4 plans across 3 waves: Wave 0 TDD stubs, Wave 1 data layer (parallel: OneDrive/GCS/B2 + SFTP/SftpAuthToggle), Wave 2 RemoteConfigStep wiring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11 KiB
11 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 06-new-backends | 01 | execute | 1 |
|
|
true |
|
|
Purpose: Three simple backends (no custom toggle UI) that follow the pure registry + FieldRenderer pattern. Implementing them first keeps SFTP (Plan 02) isolated. Output: registry.ts, index.ts, rclone-conf.ts updated; registry and rclone-conf tests go green for these three backends.
<execution_context> @C:/Users/SebastienQUEROL/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/SebastienQUEROL/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/06-new-backends/06-RESEARCH.md @.planning/phases/06-new-backends/06-00-SUMMARY.mdFrom src/schemas/registry.ts (current):
export type BackendType = 'azureblob' | 's3' | 's3-compatible';
export interface FieldDef {
key: string;
label: string;
inputType: 'text' | 'password' | 'select' | 'toggle';
required: boolean;
placeholder?: string;
helpText?: string;
options?: { value: string; label: string }[];
}
export const BACKEND_REGISTRY: Record<BackendType, {
displayName: string;
description: string;
fields: FieldDef[];
}> = { azureblob: {...}, s3: {...}, 's3-compatible': {...} };
From src/schemas/index.ts (current):
function buildZodSchema(backendType: BackendType): z.ZodObject<Record<string, z.ZodTypeAny>>
export const BACKEND_SCHEMAS = {
azureblob: buildZodSchema('azureblob'),
s3: buildZodSchema('s3'),
's3-compatible': buildZodSchema('s3-compatible'),
} as const;
From src/generators/rclone-conf.ts (current):
const RCLONE_TYPE_MAP: Record<string, string> = {
azureblob: 'azureblob',
s3: 's3',
's3-compatible': 's3',
};
1. Replace BackendType line with:
`export type BackendType = 'azureblob' | 's3' | 's3-compatible' | 'onedrive' | 'sftp' | 'gcs' | 'b2';`
2. Add three new entries to BACKEND_REGISTRY after the 's3-compatible' entry:
```typescript
onedrive: {
displayName: 'OneDrive',
description: 'Microsoft OneDrive (paste pre-obtained rclone token)',
fields: [
{
key: 'token',
label: 'OAuth Token (JSON)',
inputType: 'password',
required: true,
placeholder: '{"access_token":"...","token_type":"Bearer","refresh_token":"...","expiry":"..."}',
helpText: 'Paste the JSON token from: rclone authorize "onedrive"',
},
{
key: 'drive_id',
label: 'Drive ID',
inputType: 'text',
required: true,
placeholder: 'b!...',
helpText: 'The drive ID from your OneDrive. Found in the rclone authorize output.',
},
{
key: 'drive_type',
label: 'Drive Type',
inputType: 'select',
required: true,
options: [
{ value: 'personal', label: 'Personal' },
{ value: 'business', label: 'Business' },
{ value: 'documentLibrary', label: 'SharePoint Document Library' },
],
helpText: 'Personal for consumer OneDrive, Business for Microsoft 365',
},
],
},
gcs: {
displayName: 'Google Cloud Storage',
description: 'Google Cloud Storage',
fields: [
{
key: 'project_number',
label: 'Project Number',
inputType: 'text',
required: true,
placeholder: '123456789',
helpText: 'Your GCP project number (not project ID)',
},
{
key: 'service_account_credentials',
label: 'Service Account JSON',
inputType: 'password',
required: true,
placeholder: '{"type":"service_account","project_id":"..."}',
helpText: 'Paste the full content of your service account JSON key file',
},
],
},
b2: {
displayName: 'Backblaze B2',
description: 'Backblaze B2 Cloud Storage',
fields: [
{
key: 'account',
label: 'Application Key ID',
inputType: 'text',
required: true,
placeholder: 'your-application-key-id',
helpText: 'The applicationKeyId — not the master account ID',
},
{
key: 'key',
label: 'Application Key',
inputType: 'password',
required: true,
helpText: 'The application key (secret value from the B2 dashboard)',
},
],
},
```
Note: BACKEND_REGISTRY type is `Record<BackendType, ...>` which requires ALL BackendType values. After this task, TypeScript will error because 'sftp' is in the union but not yet in the BACKEND_REGISTRY object. Plan 02 adds the sftp entry. If running `npx tsc --noEmit` between plans, expect this error temporarily. The Vitest tests will still run.
**src/generators/rclone-conf.ts:** Extend RCLONE_TYPE_MAP:
```typescript
const RCLONE_TYPE_MAP: Record<string, string> = {
azureblob: 'azureblob',
s3: 's3',
's3-compatible': 's3',
onedrive: 'onedrive',
gcs: 'google cloud storage', // NOTE: spaces in rclone type value — do NOT shorten
b2: 'b2',
};
```
Do NOT add sftp yet — Plan 02 adds it.
After editing, run full suite to confirm existing tests still pass and new backend tests pass.
npx tsc --noEmit — expect one error: BACKEND_REGISTRY missing 'sftp' key (fixed by Plan 02). All other TypeScript must be clean.
<success_criteria>
- BackendType union has all 7 types
- onedrive, gcs, b2 registry entries with correct rclone key names
- BACKEND_SCHEMAS covers onedrive, gcs, b2
- gcs maps to 'google cloud storage' in RCLONE_TYPE_MAP
- rclone-conf tests pass for onedrive, gcs, b2
- Zero TypeScript errors outside the known sftp-missing-key error </success_criteria>