opencode-plugin-flow 4.3.9 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/README.md +59 -48
- package/dist/application/errors.d.ts +5 -0
- package/dist/{runtime/api.d.ts → application/flow-service.d.ts} +89 -57
- package/dist/application/ports/session-repository.d.ts +11 -0
- package/dist/{runtime → application}/schema.d.ts +291 -371
- package/dist/cli.js +283 -2773
- package/dist/cli.js.map +7 -6
- package/dist/config-shared.d.ts +30 -16
- package/dist/config.d.ts +1 -1
- package/dist/distribution/legacy-cleanup.d.ts +25 -0
- package/dist/domain/feature-id.d.ts +3 -0
- package/dist/domain/limits.d.ts +1 -0
- package/dist/domain/orchestration-policy.d.ts +27 -0
- package/dist/domain/session.d.ts +181 -0
- package/dist/domain/transitions.d.ts +80 -0
- package/dist/guidance/catalog.d.ts +18 -0
- package/dist/guidance/ids.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2676 -1929
- package/dist/index.js.map +24 -16
- package/dist/infrastructure/fs/session-repository.d.ts +2 -0
- package/dist/infrastructure/fs/workspace-flow-service.d.ts +9 -0
- package/dist/{runtime → infrastructure/fs}/workspace.d.ts +10 -14
- package/dist/infrastructure/system/transition-environment.d.ts +2 -0
- package/dist/platform/opencode/config.d.ts +2 -0
- package/dist/{adapters → platform}/opencode/plugin.d.ts +1 -1
- package/dist/{adapters → platform}/opencode/sdk.d.ts +0 -1
- package/dist/platform/opencode/tools.d.ts +6 -0
- package/dist/prompt-baseline-fixtures.d.ts +19 -0
- package/dist/prompt-model-evaluation.d.ts +88 -0
- package/dist/prompt-quality.d.ts +73 -0
- package/dist/prompt-surfaces.d.ts +28 -0
- package/dist/version.d.ts +1 -0
- package/package.json +19 -12
- package/dist/adapters/opencode/config.d.ts +0 -3
- package/dist/adapters/opencode/tools.d.ts +0 -322
- package/dist/distribution/flow-skill-definitions.d.ts +0 -9
- package/dist/distribution/sync.d.ts +0 -69
- package/dist/runtime/time.d.ts +0 -2
- package/dist/runtime/transitions.d.ts +0 -230
- /package/dist/{runtime/json/strict-object.d.ts → infrastructure/fs/strict-json-object.d.ts} +0 -0
- /package/dist/{adapters → platform}/opencode/logging.d.ts +0 -0
package/dist/cli.js.map
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/distribution/
|
|
3
|
+
"sources": ["../src/distribution/legacy-cleanup.ts", "../src/guidance/ids.ts", "../src/version.ts", "../src/cli.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { createHash } from \"node:crypto\";\nimport { mkdir, readdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, normalize, sep } from \"node:path\";\nimport {\n\tFLOW_SKILL_DEFINITIONS,\n\ttype FlowSkillDefinition,\n} from \"./flow-skill-definitions\";\n\nconst MARKER_FILENAME = \".flow-skill-version\";\n\n// Matches the `<file>.backup.<12 hex>` names writeBackup creates, plus its\n// `.N` collision suffix, and captures the embedded content hash. writeBackup\n// names a backup after sha256(content).slice(0, 12), so the hash is a\n// self-describing checksum we can verify against the file's actual content.\nconst BACKUP_FILE_PATTERN = /\\.backup\\.([0-9a-f]{12})(?:\\.\\d+)?$/;\n\nfunction backupHashFromName(relativePath: string): string | null {\n\treturn BACKUP_FILE_PATTERN.exec(relativePath)?.[1] ?? null;\n}\n\n// A file is Flow-created backup residue only when its name matches the pattern\n// AND its content hashes to the embedded checksum. This distinguishes Flow's\n// own backups from an unrelated user file that merely happens to be named like\n// one (e.g. `db.backup.20240115abcd`), which must never be treated as\n// removable residue.\nasync function isFlowCreatedBackup(\n\tfolder: string,\n\trelativePath: string,\n): Promise<boolean> {\n\tconst namedHash = backupHashFromName(relativePath);\n\tif (!namedHash) return false;\n\tconst content = await optionalRead(resolveSkillFile(folder, relativePath));\n\tif (content === null) return false;\n\treturn sha256(content).slice(0, 12) === namedHash;\n}\n\nfunction normalizeNewlines(value: string): string {\n\treturn value.replace(/\\r\\n/g, \"\\n\");\n}\n\ntype FlowLog = (level: \"info\" | \"warn\" | \"error\", message: string) => void;\n\nexport type FlowSkillSyncAction =\n\t| \"installed\"\n\t| \"updated\"\n\t| \"updated_with_backup\"\n\t| \"marker_updated\"\n\t| \"unchanged\"\n\t| \"skipped_foreign\";\n\nexport type FlowSkillSyncResult = {\n\tname: string;\n\taction: FlowSkillSyncAction;\n\tbackupPaths?: string[];\n};\n\n// The sync actions that install or change on-disk skill content and therefore\n// require an OpenCode restart before the refreshed skills load.\nexport const CHANGED_SYNC_ACTIONS: readonly FlowSkillSyncAction[] = [\n\t\"installed\",\n\t\"updated\",\n\t\"updated_with_backup\",\n];\n\nexport function isChangedSyncAction(action: FlowSkillSyncAction): boolean {\n\treturn CHANGED_SYNC_ACTIONS.includes(action);\n}\n\nexport type FlowSkillSyncHealth = {\n\tstatus: \"ok\" | \"restart_required\" | \"action_required\" | \"error\";\n\tversion: string;\n\troot: string;\n\tcheckedAt: string;\n\texpectedSkills: string[];\n\tresults: FlowSkillSyncResult[];\n\tchangedSkills: string[];\n\tactionRequiredSkills: string[];\n\trestartRequired: boolean;\n\tsummary: string;\n\terror?: string;\n};\n\nexport type FlowSkillSetupStatus = {\n\tstatus: \"restart_required\" | \"action_required\" | \"sync_failed\";\n\tsummary: string;\n\tversion: string;\n\troot: string;\n\tchanged?: string[];\n\tactionRequired?: string[];\n\terror?: string;\n};\n\nexport type FlowSkillDoctorSkill = {\n\tname: string;\n\tpath: string;\n\tstatus: \"ok\" | \"missing\" | \"foreign\" | \"incomplete\" | \"edited\" | \"outdated\";\n\tmarkerVersion: string | null;\n\tmissingFiles: string[];\n\teditedFiles: string[];\n\toutdatedFiles: string[];\n\tbackupFiles: string[];\n};\n\nexport type FlowSkillDoctorReport = {\n\tstatus: \"ok\" | \"sync_required\" | \"action_required\";\n\tversion: string;\n\troot: string;\n\texpectedSkills: string[];\n\tskills: FlowSkillDoctorSkill[];\n\tsyncRequiredSkills: string[];\n\tactionRequiredSkills: string[];\n\tunmanagedFlowSkills: string[];\n};\n\nlet latestFlowSkillSyncHealth: FlowSkillSyncHealth | null = null;\n\nfunction homeDir(): string {\n\t// An empty or whitespace-only HOME/USERPROFILE must fall through to the OS\n\t// home dir; otherwise the skills root becomes a cwd-relative path and sync\n\t// writes into (and uninstall rm -rf's) the current directory.\n\tconst configured =\n\t\tprocess.env.HOME?.trim() || process.env.USERPROFILE?.trim();\n\treturn configured || homedir();\n}\n\nexport function resolveFlowSkillsRoot(home = homeDir()): string {\n\treturn join(home, \".config\", \"opencode\", \"skills\");\n}\n\nfunction sha256(value: string): string {\n\treturn createHash(\"sha256\").update(value).digest(\"hex\");\n}\n\nfunction markerFor(definition: FlowSkillDefinition, version: string): string {\n\treturn [\n\t\t`version=${version}`,\n\t\t...definition.files.map(\n\t\t\t(file) => `file=${file.relativePath} sha256=${sha256(file.content)}`,\n\t\t),\n\t\t\"\",\n\t].join(\"\\n\");\n}\n\nasync function optionalRead(path: string): Promise<string | null> {\n\ttry {\n\t\treturn await readFile(path, \"utf8\");\n\t} catch (error) {\n\t\tconst code = (error as NodeJS.ErrnoException).code;\n\t\t// ENOENT: nothing there. ENOTDIR: a path component is a regular file\n\t\t// (e.g. a plain `flow-notes.md` sitting in the skills root), so the\n\t\t// managed file cannot exist — both mean \"absent\", not a hard failure.\n\t\tif (code === \"ENOENT\" || code === \"ENOTDIR\") return null;\n\t\tthrow error;\n\t}\n}\n\nfunction parseMarkerFiles(content: string | null): Map<string, string> {\n\tconst files = new Map<string, string>();\n\tif (!content) return files;\n\tfor (const line of content.split(/\\r?\\n/)) {\n\t\tconst match =\n\t\t\t/^file=(.+) sha256=([a-f0-9]{64})$/.exec(line) ??\n\t\t\t/^file=(.+)=sha256:([a-f0-9]{64})$/.exec(line);\n\t\tif (match?.[1] && match[2]) files.set(match[1], match[2]);\n\t\tconst topLevelHash = /^hash=sha256:([a-f0-9]{64})$/.exec(line);\n\t\tif (topLevelHash?.[1] && !files.has(\"SKILL.md\")) {\n\t\t\tfiles.set(\"SKILL.md\", topLevelHash[1]);\n\t\t}\n\t}\n\treturn files;\n}\n\nfunction parseMarkerVersion(content: string | null): string | null {\n\tif (!content) return null;\n\tfor (const line of content.split(/\\r?\\n/)) {\n\t\tconst match = /^version=(.+)$/.exec(line);\n\t\tif (match?.[1]) return match[1];\n\t}\n\treturn null;\n}\n\nfunction resolveSkillFile(folder: string, relativePath: string): string {\n\tconst resolved = normalize(join(folder, ...relativePath.split(\"/\")));\n\tif (resolved !== folder && resolved.startsWith(`${folder}${sep}`)) {\n\t\treturn resolved;\n\t}\n\tthrow new Error(`Unsafe skill file path '${relativePath}'.`);\n}\n\nasync function writeBackup(path: string, content: string): Promise<string> {\n\tconst basePath = `${path}.backup.${sha256(content).slice(0, 12)}`;\n\tfor (let index = 0; ; index += 1) {\n\t\tconst backupPath = index === 0 ? basePath : `${basePath}.${index}`;\n\t\ttry {\n\t\t\tawait writeFile(backupPath, content, { encoding: \"utf8\", flag: \"wx\" });\n\t\t\treturn backupPath;\n\t\t} catch (error) {\n\t\t\tif ((error as NodeJS.ErrnoException).code === \"EEXIST\") continue;\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nasync function syncSkill(\n\tdefinition: FlowSkillDefinition,\n\tversion: string,\n\troot: string,\n): Promise<FlowSkillSyncResult> {\n\tconst folder = join(root, definition.name);\n\tconst markerPath = join(folder, MARKER_FILENAME);\n\tconst markerContent = await optionalRead(markerPath);\n\tconst existingMarkerHashes = parseMarkerFiles(markerContent);\n\tif (markerContent === null) {\n\t\t// No Flow marker proving Flow created this folder: if any managed path\n\t\t// already holds user content, treat the whole folder as user-owned and\n\t\t// never overwrite it. Checking only SKILL.md would silently clobber a\n\t\t// user file at a nested managed path (e.g. references/handoff-format.md)\n\t\t// with no backup.\n\t\tfor (const file of definition.files) {\n\t\t\tconst existing = await optionalRead(\n\t\t\t\tresolveSkillFile(folder, file.relativePath),\n\t\t\t);\n\t\t\tif (existing !== null) {\n\t\t\t\treturn { name: definition.name, action: \"skipped_foreign\" as const };\n\t\t\t}\n\t\t}\n\t}\n\n\tlet changed = false;\n\tconst backupPaths: string[] = [];\n\tconst currentRelativePaths = new Set(\n\t\tdefinition.files.map((file) => file.relativePath),\n\t);\n\tfor (const file of definition.files) {\n\t\tconst path = resolveSkillFile(folder, file.relativePath);\n\t\tconst existing = await optionalRead(path);\n\t\tif (existing === file.content) continue;\n\t\tchanged = true;\n\t\tconst recordedHash = existingMarkerHashes.get(file.relativePath);\n\t\tconst userEdited =\n\t\t\texisting !== null &&\n\t\t\t(recordedHash\n\t\t\t\t? sha256(existing) !== recordedHash\n\t\t\t\t: markerContent !== null);\n\t\tif (userEdited) {\n\t\t\tbackupPaths.push(await writeBackup(path, existing));\n\t\t}\n\t}\n\tfor (const [relativePath, recordedHash] of existingMarkerHashes) {\n\t\tif (currentRelativePaths.has(relativePath)) continue;\n\t\tconst path = resolveSkillFile(folder, relativePath);\n\t\tconst existing = await optionalRead(path);\n\t\tif (existing === null) continue;\n\t\tchanged = true;\n\t\tif (sha256(existing) !== recordedHash) {\n\t\t\tbackupPaths.push(await writeBackup(path, existing));\n\t\t}\n\t\tawait rm(path, { force: true });\n\t}\n\n\tif (\n\t\t!changed &&\n\t\tmarkerContent !== null &&\n\t\tnormalizeNewlines(markerContent) === markerFor(definition, version)\n\t) {\n\t\treturn { name: definition.name, action: \"unchanged\" };\n\t}\n\n\tif (!changed) {\n\t\tawait writeFile(markerPath, markerFor(definition, version), \"utf8\");\n\t\treturn { name: definition.name, action: \"marker_updated\" };\n\t}\n\n\tconst managedSkillExists = markerContent !== null;\n\tfor (const file of definition.files) {\n\t\tconst path = resolveSkillFile(folder, file.relativePath);\n\t\tawait mkdir(dirname(path), { recursive: true });\n\t\tawait writeFile(path, file.content, \"utf8\");\n\t}\n\tawait writeFile(markerPath, markerFor(definition, version), \"utf8\");\n\treturn {\n\t\tname: definition.name,\n\t\taction:\n\t\t\tbackupPaths.length > 0\n\t\t\t\t? \"updated_with_backup\"\n\t\t\t\t: managedSkillExists\n\t\t\t\t\t? \"updated\"\n\t\t\t\t\t: \"installed\",\n\t\t...(backupPaths.length > 0 ? { backupPaths } : {}),\n\t};\n}\n\nfunction expectedSkillNames(): string[] {\n\treturn FLOW_SKILL_DEFINITIONS.map((definition) => definition.name);\n}\n\nfunction createHealth(\n\tversion: string,\n\troot: string,\n\tresults: FlowSkillSyncResult[],\n): FlowSkillSyncHealth {\n\tconst changedSkills = results\n\t\t.filter((result) => isChangedSyncAction(result.action))\n\t\t.map((result) => result.name);\n\tconst actionRequiredSkills = results\n\t\t.filter((result) => result.action === \"skipped_foreign\")\n\t\t.map((result) => result.name);\n\tconst status =\n\t\tactionRequiredSkills.length > 0\n\t\t\t? \"action_required\"\n\t\t\t: changedSkills.length > 0\n\t\t\t\t? \"restart_required\"\n\t\t\t\t: \"ok\";\n\tconst summaryParts: string[] = [];\n\tif (changedSkills.length > 0) {\n\t\tsummaryParts.push(\n\t\t\t`Flow installed or updated skills during this startup (${changedSkills.join(\", \")}). Restart OpenCode before loading Flow skills.`,\n\t\t);\n\t}\n\tif (actionRequiredSkills.length > 0) {\n\t\tsummaryParts.push(\n\t\t\t`Flow found user-owned skill folders for managed skills (${actionRequiredSkills.join(\", \")}). Run ${formatFlowDoctorCommand(version)} for repair guidance.`,\n\t\t);\n\t}\n\tconst summary =\n\t\tsummaryParts.length > 0\n\t\t\t? summaryParts.join(\" \")\n\t\t\t: \"Flow skills are synced.\";\n\treturn {\n\t\tstatus,\n\t\tversion,\n\t\troot,\n\t\tcheckedAt: new Date().toISOString(),\n\t\texpectedSkills: expectedSkillNames(),\n\t\tresults,\n\t\tchangedSkills,\n\t\tactionRequiredSkills,\n\t\trestartRequired: changedSkills.length > 0,\n\t\tsummary,\n\t};\n}\n\nfunction createErrorHealth(\n\tversion: string,\n\troot: string,\n\terror: unknown,\n): FlowSkillSyncHealth {\n\tconst message = error instanceof Error ? error.message : String(error);\n\treturn {\n\t\tstatus: \"error\",\n\t\tversion,\n\t\troot,\n\t\tcheckedAt: new Date().toISOString(),\n\t\texpectedSkills: expectedSkillNames(),\n\t\tresults: [],\n\t\tchangedSkills: [],\n\t\tactionRequiredSkills: [],\n\t\trestartRequired: false,\n\t\tsummary: `Flow skill sync failed: ${message}`,\n\t\terror: message,\n\t};\n}\n\nexport function getLatestFlowSkillSyncHealth(): FlowSkillSyncHealth | null {\n\treturn latestFlowSkillSyncHealth;\n}\n\nexport function formatFlowDoctorCommand(version: string): string {\n\tconst pin = version === \"0.0.0\" ? \"latest\" : version;\n\treturn `npx -y opencode-plugin-flow@${pin} doctor`;\n}\n\nexport function getFlowSkillSetupStatus(\n\thealth = latestFlowSkillSyncHealth,\n): FlowSkillSetupStatus | null {\n\tif (!health || health.status === \"ok\") return null;\n\tconst status = health.status === \"error\" ? \"sync_failed\" : health.status;\n\treturn {\n\t\tstatus,\n\t\tsummary: health.summary,\n\t\tversion: health.version,\n\t\troot: health.root,\n\t\t...(health.changedSkills.length > 0\n\t\t\t? { changed: health.changedSkills }\n\t\t\t: {}),\n\t\t...(health.actionRequiredSkills.length > 0\n\t\t\t? { actionRequired: health.actionRequiredSkills }\n\t\t\t: {}),\n\t\t...(health.error ? { error: health.error } : {}),\n\t};\n}\n\nexport function formatFlowSkillSetupWarning(\n\thealth = latestFlowSkillSyncHealth,\n): string | null {\n\tconst setup = getFlowSkillSetupStatus(health);\n\tif (!setup) return null;\n\treturn [\n\t\t\"Flow setup warning:\",\n\t\tsetup.summary,\n\t\t`Skills root: ${setup.root}`,\n\t\t`Use \\`${formatFlowDoctorCommand(setup.version)}\\` for details.`,\n\t].join(\"\\n\");\n}\n\nexport function resolveFlowPluginVersion(): string {\n\tif (process.env.npm_package_version) return process.env.npm_package_version;\n\ttry {\n\t\tconst require = createRequire(import.meta.url);\n\t\tfor (const path of [\"../package.json\", \"../../package.json\"]) {\n\t\t\ttry {\n\t\t\t\tconst manifest = require(path) as { version?: string };\n\t\t\t\tif (manifest.version) return manifest.version;\n\t\t\t} catch {\n\t\t\t\t// Try the next layout: source tree and bundled dist differ.\n\t\t\t}\n\t\t}\n\t} catch {\n\t\t// Fall through to sentinel.\n\t}\n\treturn \"0.0.0\";\n}\n\nexport async function syncFlowSkills(version: string, home = homeDir()) {\n\tconst root = resolveFlowSkillsRoot(home);\n\treturn Promise.all(\n\t\tFLOW_SKILL_DEFINITIONS.map((definition) =>\n\t\t\tsyncSkill(definition, version, root),\n\t\t),\n\t);\n}\n\nexport async function runFlowSkillSync(\n\tversion: string,\n\tlog: FlowLog,\n\thome = homeDir(),\n): Promise<void> {\n\tconst root = resolveFlowSkillsRoot(home);\n\ttry {\n\t\tconst results = await syncFlowSkills(version, home);\n\t\tlatestFlowSkillSyncHealth = createHealth(version, root, results);\n\t\tconst changed = results.filter((result) =>\n\t\t\tisChangedSyncAction(result.action),\n\t\t);\n\t\tif (changed.length > 0) {\n\t\t\tlog(\n\t\t\t\t\"info\",\n\t\t\t\t`Flow synced skills (${changed.map((item) => `${item.name}:${item.action}`).join(\", \")}). Restart OpenCode if skills were just installed.`,\n\t\t\t);\n\t\t}\n\t\tif (latestFlowSkillSyncHealth.status === \"action_required\") {\n\t\t\tlog(\"warn\", latestFlowSkillSyncHealth.summary);\n\t\t}\n\t} catch (error) {\n\t\tlatestFlowSkillSyncHealth = createErrorHealth(version, root, error);\n\t\tlog(\"warn\", latestFlowSkillSyncHealth.summary);\n\t}\n}\n\nexport async function inspectFlowSkillInstall(\n\tversion = resolveFlowPluginVersion(),\n\thome = homeDir(),\n): Promise<FlowSkillDoctorReport> {\n\tconst root = resolveFlowSkillsRoot(home);\n\tconst expected = new Set(expectedSkillNames());\n\tconst skills = await Promise.all(\n\t\tFLOW_SKILL_DEFINITIONS.map(async (definition) => {\n\t\t\tconst folder = join(root, definition.name);\n\t\t\tconst markerContent = await optionalRead(join(folder, MARKER_FILENAME));\n\t\t\tconst markerVersion = parseMarkerVersion(markerContent);\n\t\t\tconst markerHashes = parseMarkerFiles(markerContent);\n\t\t\tconst existingSkill = await optionalRead(join(folder, \"SKILL.md\"));\n\t\t\tconst backupFiles =\n\t\t\t\tmarkerContent === null ? [] : await listFlowBackupFiles(folder);\n\t\t\tif (existingSkill === null) {\n\t\t\t\treturn {\n\t\t\t\t\tname: definition.name,\n\t\t\t\t\tpath: folder,\n\t\t\t\t\tstatus: \"missing\" as const,\n\t\t\t\t\tmarkerVersion,\n\t\t\t\t\tmissingFiles: definition.files.map((file) => file.relativePath),\n\t\t\t\t\teditedFiles: [],\n\t\t\t\t\toutdatedFiles: [],\n\t\t\t\t\tbackupFiles,\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (markerContent === null) {\n\t\t\t\treturn {\n\t\t\t\t\tname: definition.name,\n\t\t\t\t\tpath: folder,\n\t\t\t\t\tstatus: \"foreign\" as const,\n\t\t\t\t\tmarkerVersion,\n\t\t\t\t\tmissingFiles: [],\n\t\t\t\t\teditedFiles: [],\n\t\t\t\t\toutdatedFiles: [],\n\t\t\t\t\tbackupFiles,\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst missingFiles: string[] = [];\n\t\t\tconst editedFiles: string[] = [];\n\t\t\tconst outdatedFiles: string[] = [];\n\t\t\tfor (const file of definition.files) {\n\t\t\t\tconst existing = await optionalRead(\n\t\t\t\t\tresolveSkillFile(folder, file.relativePath),\n\t\t\t\t);\n\t\t\t\tif (existing === null) {\n\t\t\t\t\tmissingFiles.push(file.relativePath);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (existing === file.content) continue;\n\t\t\t\tconst recordedHash = markerHashes.get(file.relativePath);\n\t\t\t\tif (recordedHash && sha256(existing) !== recordedHash) {\n\t\t\t\t\teditedFiles.push(file.relativePath);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\toutdatedFiles.push(file.relativePath);\n\t\t\t}\n\t\t\t// Compare newline-normalized: a CRLF-converted marker (Windows editor,\n\t\t\t// autocrlf) still hashes every file correctly, so it must not be\n\t\t\t// reported as drifted/outdated purely on line endings.\n\t\t\tconst markerDrift =\n\t\t\t\tnormalizeNewlines(markerContent) !== markerFor(definition, version);\n\t\t\tconst status: FlowSkillDoctorSkill[\"status\"] =\n\t\t\t\tmissingFiles.length > 0\n\t\t\t\t\t? \"incomplete\"\n\t\t\t\t\t: editedFiles.length > 0\n\t\t\t\t\t\t? \"edited\"\n\t\t\t\t\t\t: markerDrift || outdatedFiles.length > 0\n\t\t\t\t\t\t\t? \"outdated\"\n\t\t\t\t\t\t\t: \"ok\";\n\t\t\treturn {\n\t\t\t\tname: definition.name,\n\t\t\t\tpath: folder,\n\t\t\t\tstatus,\n\t\t\t\tmarkerVersion,\n\t\t\t\tmissingFiles,\n\t\t\t\teditedFiles,\n\t\t\t\toutdatedFiles,\n\t\t\t\tbackupFiles,\n\t\t\t};\n\t\t}),\n\t);\n\n\tlet entries: string[] = [];\n\ttry {\n\t\tentries = await readdir(root);\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n\t}\n\tconst unmanagedFlowSkills = entries\n\t\t.filter(\n\t\t\t(name) =>\n\t\t\t\t(name === \"flow\" || name.startsWith(\"flow-\")) && !expected.has(name),\n\t\t)\n\t\t.map((name) => join(root, name));\n\n\tconst syncRequiredSkills = skills\n\t\t.filter((skill) =>\n\t\t\t[\"missing\", \"incomplete\", \"outdated\"].includes(skill.status),\n\t\t)\n\t\t.map((skill) => skill.name);\n\tconst actionRequiredSkills = skills\n\t\t.filter(\n\t\t\t(skill) =>\n\t\t\t\t[\"foreign\", \"edited\"].includes(skill.status) ||\n\t\t\t\tskill.backupFiles.length > 0,\n\t\t)\n\t\t.map((skill) => skill.name);\n\tconst actionRequired = actionRequiredSkills.length > 0;\n\tconst syncRequired = syncRequiredSkills.length > 0;\n\treturn {\n\t\tstatus: actionRequired\n\t\t\t? \"action_required\"\n\t\t\t: syncRequired\n\t\t\t\t? \"sync_required\"\n\t\t\t\t: \"ok\",\n\t\tversion,\n\t\troot,\n\t\texpectedSkills: [...expected],\n\t\tskills,\n\t\tsyncRequiredSkills,\n\t\tactionRequiredSkills,\n\t\tunmanagedFlowSkills,\n\t};\n}\n\nfunction appendSkillList(\n\tlines: string[],\n\tlabel: string,\n\tskills: string[],\n): void {\n\tif (skills.length === 0) return;\n\tlines.push(`- ${label}: ${skills.join(\", \")}`);\n}\n\nexport function formatFlowSkillDoctor(report: FlowSkillDoctorReport): string {\n\tconst lines = [\n\t\t\"Flow doctor\",\n\t\t`- status: ${report.status}`,\n\t\t`- plugin version: ${report.version}`,\n\t\t`- skills root: ${report.root}`,\n\t\t`- expected skills: ${report.expectedSkills.join(\", \")}`,\n\t];\n\tappendSkillList(\n\t\tlines,\n\t\t\"startup sync can install/update\",\n\t\treport.syncRequiredSkills,\n\t);\n\tappendSkillList(lines, \"needs user decision\", report.actionRequiredSkills);\n\tlines.push(\"\", \"Skills:\");\n\tfor (const skill of report.skills) {\n\t\tlines.push(\n\t\t\t`- ${skill.name}: ${skill.status} (${skill.path})${\n\t\t\t\tskill.markerVersion ? ` marker=${skill.markerVersion}` : \"\"\n\t\t\t}`,\n\t\t);\n\t\tif (skill.missingFiles.length > 0) {\n\t\t\tlines.push(` missing: ${skill.missingFiles.join(\", \")}`);\n\t\t}\n\t\tif (skill.editedFiles.length > 0) {\n\t\t\tlines.push(` edited: ${skill.editedFiles.join(\", \")}`);\n\t\t}\n\t\tif (skill.outdatedFiles.length > 0) {\n\t\t\tlines.push(` outdated: ${skill.outdatedFiles.join(\", \")}`);\n\t\t}\n\t\tif (skill.backupFiles.length > 0) {\n\t\t\tlines.push(` backups: ${skill.backupFiles.join(\", \")}`);\n\t\t}\n\t}\n\tif (report.unmanagedFlowSkills.length > 0) {\n\t\tlines.push(\"\", \"Unmanaged Flow-like skill folders:\");\n\t\tfor (const path of report.unmanagedFlowSkills) lines.push(`- ${path}`);\n\t}\n\tlines.push(\"\", \"Recommendation:\");\n\tif (report.status === \"ok\") {\n\t\tlines.push(\"- Flow skills are present and current.\");\n\t} else if (report.status === \"sync_required\") {\n\t\tlines.push(\n\t\t\t\"- Start or restart OpenCode with opencode-plugin-flow enabled so startup sync can install or update the listed skills. If Flow then reports restart_required, restart OpenCode once more so the refreshed skill registry is used.\",\n\t\t);\n\t} else {\n\t\tlines.push(\n\t\t\t\"- Resolve user-owned or edited managed skill folders, then restart OpenCode. Move a folder aside to let Flow recreate it, or keep it intentionally as a local override.\",\n\t\t);\n\t\tif (report.skills.some((skill) => skill.backupFiles.length > 0)) {\n\t\t\tlines.push(\n\t\t\t\t\"- Flow saved earlier local edits as .backup files; review each one and delete it once the saved copy is no longer needed. Sync ignores them, and uninstall removes them (naming each) along with the folder.\",\n\t\t\t);\n\t\t}\n\t}\n\tlines.push(`- Details command: ${formatFlowDoctorCommand(report.version)}`);\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n\nasync function listSkillFolderFiles(folder: string): Promise<string[]> {\n\tconst entries = await readdir(folder, {\n\t\trecursive: true,\n\t\twithFileTypes: true,\n\t});\n\treturn entries\n\t\t.filter((entry) => entry.isFile())\n\t\t.map((entry) =>\n\t\t\tjoin(entry.parentPath, entry.name)\n\t\t\t\t.slice(folder.length + 1)\n\t\t\t\t.split(sep)\n\t\t\t\t.join(\"/\"),\n\t\t);\n}\n\nasync function listFlowBackupFiles(folder: string): Promise<string[]> {\n\tlet names: string[];\n\ttry {\n\t\tnames = await listSkillFolderFiles(folder);\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return [];\n\t\tthrow error;\n\t}\n\tconst backups: string[] = [];\n\tfor (const name of names) {\n\t\tif (await isFlowCreatedBackup(folder, name)) backups.push(name);\n\t}\n\treturn backups;\n}\n\n// A managed folder is removable when every non-marker file is either a pristine\n// managed file or Flow-created `.backup` residue. Backups hold the user's own\n// earlier edits, so they are returned separately: removable, but reported so the\n// deletion is never silent.\nasync function inspectManagedFolderForUninstall(\n\tfolder: string,\n\tmarkerContent: string,\n): Promise<{ pristine: boolean; backups: string[] }> {\n\tconst hashes = parseMarkerFiles(markerContent);\n\tif (hashes.size === 0) return { pristine: false, backups: [] };\n\tconst backups: string[] = [];\n\tfor (const relativePath of await listSkillFolderFiles(folder)) {\n\t\tif (relativePath === MARKER_FILENAME) continue;\n\t\tconst recordedHash = hashes.get(relativePath);\n\t\tif (recordedHash !== undefined) {\n\t\t\tconst content = await optionalRead(\n\t\t\t\tresolveSkillFile(folder, relativePath),\n\t\t\t);\n\t\t\tif (content === null || sha256(content) !== recordedHash) {\n\t\t\t\treturn { pristine: false, backups };\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\t// Not a managed file: removable only if it is genuinely Flow-created\n\t\t// backup residue (name + content checksum). Any other unknown file is\n\t\t// the user's own and keeps the folder.\n\t\tif (await isFlowCreatedBackup(folder, relativePath)) {\n\t\t\tbackups.push(relativePath);\n\t\t\tcontinue;\n\t\t}\n\t\treturn { pristine: false, backups };\n\t}\n\treturn { pristine: true, backups };\n}\n\nexport async function uninstallFlowSkills(\n\thome = homeDir(),\n\toptions: { dryRun?: boolean } = {},\n) {\n\tconst root = resolveFlowSkillsRoot(home);\n\tconst removed: string[] = [];\n\tconst kept: string[] = [];\n\tconst removedBackups: string[] = [];\n\tlet entries: string[];\n\ttry {\n\t\tentries = await readdir(root);\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n\t\t\treturn { removed, kept, removedBackups };\n\t\t}\n\t\tthrow error;\n\t}\n\tfor (const name of entries) {\n\t\tif (name !== \"flow\" && !name.startsWith(\"flow-\")) continue;\n\t\tconst folder = join(root, name);\n\t\tconst markerContent = await optionalRead(join(folder, MARKER_FILENAME));\n\t\tif (markerContent === null) {\n\t\t\tkept.push(folder);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { pristine, backups } = await inspectManagedFolderForUninstall(\n\t\t\tfolder,\n\t\t\tmarkerContent,\n\t\t);\n\t\tif (!pristine) {\n\t\t\tkept.push(folder);\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const backup of backups) {\n\t\t\tremovedBackups.push(resolveSkillFile(folder, backup));\n\t\t}\n\t\tif (!options.dryRun) {\n\t\t\tawait rm(folder, { recursive: true, force: true });\n\t\t}\n\t\tremoved.push(folder);\n\t}\n\treturn { removed, kept, removedBackups };\n}\n",
|
|
6
|
-
"
|
|
7
|
-
"import {
|
|
5
|
+
"import { createHash } from \"node:crypto\";\nimport { constants } from \"node:fs\";\nimport {\n\ttype FileHandle,\n\tlstat,\n\tmkdir,\n\topen,\n\treaddir,\n\trename,\n} from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { isAbsolute, join, normalize, sep } from \"node:path\";\nimport { FLOW_GUIDANCE_TOPICS } from \"../guidance/ids.js\";\n\nconst LEGACY_MARKER = \".flow-skill-version\";\nconst NO_FOLLOW = constants.O_NOFOLLOW ?? 0;\nconst SUPPORTED_LEGACY_MAJOR = \"4\";\nconst SEMVER_PATTERN =\n\t/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$/;\n\ntype ParsedMarker = {\n\tversion: string;\n\tfiles: Map<string, string>;\n};\n\nexport type LegacySkillCleanupResult = {\n\tname: string;\n\tpath: string;\n\tstatus: \"absent\" | \"eligible\" | \"archived\" | \"refused\" | \"quarantined\";\n\treason?: string;\n\tarchivePath?: string;\n};\n\nexport type LegacyCleanupReport = {\n\tmode: \"dry-run\" | \"apply\";\n\troot: string;\n\tarchiveRoot: string;\n\tresults: LegacySkillCleanupResult[];\n};\n\nfunction configuredHome(): string {\n\treturn (\n\t\tprocess.env.HOME?.trim() || process.env.USERPROFILE?.trim() || homedir()\n\t);\n}\n\nexport function resolveLegacySkillsRoot(home = configuredHome()): string {\n\treturn join(home, \".config\", \"opencode\", \"skills\");\n}\n\nexport function resolveLegacyArchiveRoot(home = configuredHome()): string {\n\treturn join(home, \".config\", \"opencode\", \"flow-legacy-skills\");\n}\n\nfunction sha256(content: string): string {\n\treturn createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nfunction safeLegacyPath(folder: string, relativePath: string): string {\n\tif (\n\t\t!relativePath ||\n\t\tisAbsolute(relativePath) ||\n\t\trelativePath.includes(\"\\\\\") ||\n\t\trelativePath\n\t\t\t.split(\"/\")\n\t\t\t.some((part) => !part || part === \".\" || part === \"..\")\n\t) {\n\t\tthrow new Error(`unsafe marker path '${relativePath}'`);\n\t}\n\tconst resolved = normalize(join(folder, ...relativePath.split(\"/\")));\n\tif (!resolved.startsWith(`${folder}${sep}`)) {\n\t\tthrow new Error(`unsafe marker path '${relativePath}'`);\n\t}\n\treturn resolved;\n}\n\nasync function optionalStat(path: string) {\n\ttry {\n\t\treturn await lstat(path, { bigint: false });\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return null;\n\t\tthrow error;\n\t}\n}\n\nasync function readRegularFileWithoutFollowing(path: string): Promise<string> {\n\tlet handle: FileHandle | undefined;\n\ttry {\n\t\tconst pathMetadata = await lstat(path);\n\t\tif (pathMetadata.isSymbolicLink()) {\n\t\t\tthrow new Error(`symbolic link refused: ${path}`);\n\t\t}\n\t\tif (!pathMetadata.isFile()) throw new Error(`not a regular file: ${path}`);\n\t\thandle = await open(path, constants.O_RDONLY | NO_FOLLOW);\n\t\tconst metadata = await handle.stat();\n\t\tif (!metadata.isFile()) throw new Error(`not a regular file: ${path}`);\n\t\tif (\n\t\t\tmetadata.dev !== pathMetadata.dev ||\n\t\t\tmetadata.ino !== pathMetadata.ino\n\t\t) {\n\t\t\tthrow new Error(`file changed while cleanup was running: ${path}`);\n\t\t}\n\t\treturn await handle.readFile({ encoding: \"utf8\" });\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code === \"ELOOP\") {\n\t\t\tthrow new Error(`symbolic link refused: ${path}`);\n\t\t}\n\t\tthrow error;\n\t} finally {\n\t\tawait handle?.close();\n\t}\n}\n\nfunction parseMarker(content: string): ParsedMarker {\n\tlet version: string | undefined;\n\tconst files = new Map<string, string>();\n\tfor (const line of content.split(/\\r?\\n/)) {\n\t\tif (!line) continue;\n\t\tconst versionMatch = /^version=(.+)$/.exec(line);\n\t\tif (versionMatch?.[1]) {\n\t\t\tif (version) throw new Error(\"marker contains duplicate versions\");\n\t\t\tversion = versionMatch[1];\n\t\t\tcontinue;\n\t\t}\n\t\tconst fileMatch =\n\t\t\t/^file=(.+) sha256=([a-f0-9]{64})$/.exec(line) ??\n\t\t\t/^file=(.+)=sha256:([a-f0-9]{64})$/.exec(line);\n\t\tif (fileMatch?.[1] && fileMatch[2]) {\n\t\t\tif (files.has(fileMatch[1])) {\n\t\t\t\tthrow new Error(`marker contains duplicate file '${fileMatch[1]}'`);\n\t\t\t}\n\t\t\tfiles.set(fileMatch[1], fileMatch[2]);\n\t\t\tcontinue;\n\t\t}\n\t\tconst topLevelHash = /^hash=sha256:([a-f0-9]{64})$/.exec(line);\n\t\tif (topLevelHash?.[1] && !files.has(\"SKILL.md\")) {\n\t\t\tfiles.set(\"SKILL.md\", topLevelHash[1]);\n\t\t\tcontinue;\n\t\t}\n\t\tthrow new Error(`marker contains an invalid line: '${line}'`);\n\t}\n\tif (!version) throw new Error(\"marker has no version\");\n\tif (!files.has(\"SKILL.md\")) throw new Error(\"marker does not own SKILL.md\");\n\treturn { version, files };\n}\n\nfunction assertSupportedLegacyVersion(version: string): void {\n\tconst match = SEMVER_PATTERN.exec(version);\n\tif (!match) {\n\t\tthrow new Error(\n\t\t\t`marker version '${version}' is not a valid semantic version`,\n\t\t);\n\t}\n\tif (match[1] !== SUPPORTED_LEGACY_MAJOR) {\n\t\tthrow new Error(\n\t\t\t`marker version '${version}' is outside the supported legacy range >=4.0.0 <5.0.0`,\n\t\t);\n\t}\n}\n\nfunction expectedDirectoryEntries(\n\tmarker: ParsedMarker,\n): Map<string, Set<string>> {\n\tconst entries = new Map<string, Set<string>>([\n\t\t[\"\", new Set([LEGACY_MARKER])],\n\t]);\n\tfor (const relativePath of marker.files.keys()) {\n\t\tconst parts = relativePath.split(\"/\");\n\t\tlet parent = \"\";\n\t\tfor (let index = 0; index < parts.length; index += 1) {\n\t\t\tconst part = parts[index];\n\t\t\tif (!part) throw new Error(`unsafe marker path '${relativePath}'`);\n\t\t\tconst children = entries.get(parent) ?? new Set<string>();\n\t\t\tchildren.add(part);\n\t\t\tentries.set(parent, children);\n\t\t\tif (index < parts.length - 1) {\n\t\t\t\tparent = parent ? `${parent}/${part}` : part;\n\t\t\t\tif (!entries.has(parent)) entries.set(parent, new Set());\n\t\t\t}\n\t\t}\n\t}\n\treturn entries;\n}\n\nasync function inspectLegacyFolder(\n\tname: string,\n\tfolder: string,\n): Promise<LegacySkillCleanupResult> {\n\tconst metadata = await optionalStat(folder);\n\tif (!metadata) return { name, path: folder, status: \"absent\" };\n\tif (!metadata.isDirectory()) {\n\t\treturn {\n\t\t\tname,\n\t\t\tpath: folder,\n\t\t\tstatus: \"refused\",\n\t\t\treason: \"path is not a real directory\",\n\t\t};\n\t}\n\n\ttry {\n\t\tconst markerPath = join(folder, LEGACY_MARKER);\n\t\tconst marker = parseMarker(\n\t\t\tawait readRegularFileWithoutFollowing(markerPath),\n\t\t);\n\t\tassertSupportedLegacyVersion(marker.version);\n\t\tconst directories = expectedDirectoryEntries(marker);\n\t\tfor (const [relativeDirectory, expectedEntries] of directories) {\n\t\t\tconst directory = relativeDirectory\n\t\t\t\t? safeLegacyPath(folder, relativeDirectory)\n\t\t\t\t: folder;\n\t\t\tconst directoryMetadata = await optionalStat(directory);\n\t\t\tif (!directoryMetadata?.isDirectory()) {\n\t\t\t\tthrow new Error(`expected real directory: ${relativeDirectory || \".\"}`);\n\t\t\t}\n\t\t\tconst actualEntries = await readdir(directory);\n\t\t\tconst unexpected = actualEntries.filter(\n\t\t\t\t(entry) => !expectedEntries.has(entry),\n\t\t\t);\n\t\t\tconst missing = [...expectedEntries].filter(\n\t\t\t\t(entry) => !actualEntries.includes(entry),\n\t\t\t);\n\t\t\tif (unexpected.length > 0 || missing.length > 0) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t[\n\t\t\t\t\t\tunexpected.length > 0\n\t\t\t\t\t\t\t? `unexpected entries: ${unexpected.join(\", \")}`\n\t\t\t\t\t\t\t: \"\",\n\t\t\t\t\t\tmissing.length > 0 ? `missing entries: ${missing.join(\", \")}` : \"\",\n\t\t\t\t\t]\n\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t.join(\"; \"),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tfor (const [relativePath, expectedHash] of marker.files) {\n\t\t\tconst path = safeLegacyPath(folder, relativePath);\n\t\t\tconst content = await readRegularFileWithoutFollowing(path);\n\t\t\tif (sha256(content) !== expectedHash) {\n\t\t\t\tthrow new Error(`edited file refused: ${relativePath}`);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tname,\n\t\t\tpath: folder,\n\t\t\tstatus: \"eligible\",\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tname,\n\t\t\tpath: folder,\n\t\t\tstatus: \"refused\",\n\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t};\n\t}\n}\n\nasync function ensureRealArchiveRoot(path: string): Promise<void> {\n\tconst existing = await optionalStat(path);\n\tif (existing) {\n\t\tif (!existing.isDirectory()) {\n\t\t\tthrow new Error(`Legacy archive path is not a real directory: ${path}`);\n\t\t}\n\t\treturn;\n\t}\n\ttry {\n\t\tawait mkdir(path, { mode: 0o700 });\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code !== \"EEXIST\") throw error;\n\t\tconst raced = await optionalStat(path);\n\t\tif (!raced?.isDirectory()) {\n\t\t\tthrow new Error(`Legacy archive path is not a real directory: ${path}`);\n\t\t}\n\t}\n}\n\nexport async function cleanupLegacySkills(options?: {\n\thome?: string;\n\tapply?: boolean;\n\t/** @internal Deterministic race-testing seam; package consumers should omit it. */\n\tafterQuarantine?: (context: {\n\t\tname: string;\n\t\tpath: string;\n\t\tarchivePath: string;\n\t}) => Promise<void>;\n}): Promise<LegacyCleanupReport> {\n\tconst home = options?.home ?? configuredHome();\n\tconst root = resolveLegacySkillsRoot(home);\n\tconst archiveRoot = resolveLegacyArchiveRoot(home);\n\tconst apply = options?.apply === true;\n\tconst results: LegacySkillCleanupResult[] = [];\n\n\tlet archiveReady = false;\n\tfor (const name of FLOW_GUIDANCE_TOPICS) {\n\t\tconst path = join(root, name);\n\t\tconst inspected = await inspectLegacyFolder(name, path);\n\t\tif (!apply || inspected.status !== \"eligible\") {\n\t\t\tresults.push(inspected);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!archiveReady) {\n\t\t\tawait ensureRealArchiveRoot(archiveRoot);\n\t\t\tarchiveReady = true;\n\t\t}\n\t\tconst archivePath = join(\n\t\t\tarchiveRoot,\n\t\t\t`${name}-${new Date().toISOString().replaceAll(\":\", \"-\")}-${crypto.randomUUID()}`,\n\t\t);\n\t\ttry {\n\t\t\tawait rename(path, archivePath);\n\t\t} catch (error) {\n\t\t\tif ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n\t\t\tresults.push({\n\t\t\t\tname,\n\t\t\t\tpath,\n\t\t\t\tstatus: \"refused\",\n\t\t\t\treason: \"folder changed while cleanup was running\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tawait options?.afterQuarantine?.({ name, path, archivePath });\n\t\tconst verified = await inspectLegacyFolder(name, archivePath);\n\t\tif (verified.status !== \"eligible\") {\n\t\t\tresults.push({\n\t\t\t\tname,\n\t\t\t\tpath,\n\t\t\t\tstatus: \"quarantined\",\n\t\t\t\treason:\n\t\t\t\t\t\"folder changed while cleanup was running; preserved for manual recovery\",\n\t\t\t\tarchivePath,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tresults.push({\n\t\t\tname,\n\t\t\tpath,\n\t\t\tstatus: \"archived\",\n\t\t\tarchivePath,\n\t\t});\n\t}\n\n\treturn {\n\t\tmode: apply ? \"apply\" : \"dry-run\",\n\t\troot,\n\t\tarchiveRoot,\n\t\tresults,\n\t};\n}\n",
|
|
6
|
+
"export const FLOW_GUIDANCE_TOPICS = [\n\t\"flow\",\n\t\"flow-plan\",\n\t\"flow-run\",\n\t\"flow-test\",\n\t\"flow-review\",\n\t\"flow-deslop\",\n\t\"flow-ui-quality\",\n\t\"flow-commit\",\n] as const;\n\nexport type FlowGuidanceTopic = (typeof FLOW_GUIDANCE_TOPICS)[number];\n\nexport const FLOW_GUIDANCE_IDS = [\n\t\"flow\",\n\t\"flow/references/recovery-playbook.md\",\n\t\"flow/references/parallel-orchestration.md\",\n\t\"flow/references/parallel-decision.md\",\n\t\"flow/references/parallel-manifest.md\",\n\t\"flow/references/parallel-execution.md\",\n\t\"flow/references/parallel-synthesis.md\",\n\t\"flow/references/parallel-pass-example.md\",\n\t\"flow/references/handoff-format.md\",\n\t\"flow-plan\",\n\t\"flow-plan/references/planning-examples.md\",\n\t\"flow-plan/references/plan-quality-checklist.md\",\n\t\"flow-plan/references/parallel-discovery.md\",\n\t\"flow-run\",\n\t\"flow-run/references/validation-rubric.md\",\n\t\"flow-run/references/audit-rubric.md\",\n\t\"flow-test\",\n\t\"flow-review\",\n\t\"flow-review/references/hidden-reviewer-contract.md\",\n\t\"flow-review/references/review-rubric.md\",\n\t\"flow-deslop\",\n\t\"flow-deslop/references/smell-rubric.md\",\n\t\"flow-deslop/references/refactor-workflow.md\",\n\t\"flow-ui-quality\",\n\t\"flow-ui-quality/references/ui-rubric.md\",\n\t\"flow-ui-quality/references/visual-verification.md\",\n\t\"flow-commit\",\n] as const;\n\nexport type FlowGuidanceId = (typeof FLOW_GUIDANCE_IDS)[number];\n",
|
|
7
|
+
"import { createRequire } from \"node:module\";\n\nexport function resolveFlowPluginVersion(): string {\n\ttry {\n\t\tconst require = createRequire(import.meta.url);\n\t\tconst manifest = require(\"../package.json\") as { version?: string };\n\t\tif (manifest.version) return manifest.version;\n\t} catch {\n\t\t// Fall through to the development sentinel.\n\t}\n\treturn \"0.0.0\";\n}\n",
|
|
8
|
+
"import {\n\tcleanupLegacySkills,\n\ttype LegacyCleanupReport,\n} from \"./distribution/legacy-cleanup.js\";\nimport { resolveFlowPluginVersion } from \"./version.js\";\n\nfunction usage(): string {\n\treturn [\n\t\t\"usage: opencode-plugin-flow legacy-cleanup <--dry-run|--apply> [--json]\",\n\t\t\"\",\n\t\t\"commands:\",\n\t\t\" legacy-cleanup Inspect or archive marker-proven legacy global Flow skills\",\n\t\t\"\",\n\t\t\"options:\",\n\t\t\" --dry-run Report eligible folders without changing the filesystem\",\n\t\t\" --apply Move eligible folders to a recoverable archive outside skill discovery\",\n\t\t\" Cleanup never deletes legacy folders\",\n\t\t\" --json Write the report as JSON\",\n\t\t\" --help Show this help\",\n\t\t\" --version Print the plugin version\",\n\t].join(\"\\n\");\n}\n\nfunction writeReport(report: LegacyCleanupReport, json: boolean): void {\n\tif (json) {\n\t\tprocess.stdout.write(`${JSON.stringify(report, null, 2)}\\n`);\n\t\treturn;\n\t}\n\tprocess.stdout.write(`Flow legacy skill cleanup (${report.mode})\\n`);\n\tprocess.stdout.write(`- legacy root: ${report.root}\\n`);\n\tprocess.stdout.write(`- archive root: ${report.archiveRoot}\\n`);\n\tfor (const result of report.results) {\n\t\tprocess.stdout.write(`- ${result.name}: ${result.status}\\n`);\n\t\tif (result.reason) process.stdout.write(` reason: ${result.reason}\\n`);\n\t\tif (result.archivePath) {\n\t\t\tconst label = result.status === \"archived\" ? \"archived\" : \"preserved\";\n\t\t\tprocess.stdout.write(` ${label} at: ${result.archivePath}\\n`);\n\t\t}\n\t}\n}\n\nasync function main(argv: string[]): Promise<void> {\n\tconst [command, ...flags] = argv.slice(2);\n\tif (command === \"--help\" || command === \"-h\") {\n\t\tprocess.stdout.write(`${usage()}\\n`);\n\t\treturn;\n\t}\n\tif (command === \"--version\" || command === \"-v\") {\n\t\tprocess.stdout.write(`${resolveFlowPluginVersion()}\\n`);\n\t\treturn;\n\t}\n\tconst knownFlags = new Set([\"--dry-run\", \"--apply\", \"--json\"]);\n\tconst validFlags = flags.every((flag) => knownFlags.has(flag));\n\tconst dryRun = flags.includes(\"--dry-run\");\n\tconst apply = flags.includes(\"--apply\");\n\tif (command !== \"legacy-cleanup\" || !validFlags || dryRun === apply) {\n\t\tprocess.stderr.write(`${usage()}\\n`);\n\t\tprocess.exitCode = 2;\n\t\treturn;\n\t}\n\tconst report = await cleanupLegacySkills({ apply });\n\twriteReport(report, flags.includes(\"--json\"));\n\tif (\n\t\tapply &&\n\t\treport.results.some((result) =>\n\t\t\t[\"refused\", \"quarantined\"].includes(result.status),\n\t\t)\n\t) {\n\t\tprocess.exitCode = 1;\n\t}\n}\n\nmain(process.argv).catch((error) => {\n\tprocess.stderr.write(\n\t\t`${error instanceof Error ? error.message : String(error)}\\n`,\n\t);\n\tprocess.exitCode = 1;\n});\n"
|
|
8
9
|
],
|
|
9
|
-
"mappings": ";;;AAAA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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+
"debugId": "690F8C77CD4F802F64756E2164756E21",
|
|
11
12
|
"names": []
|
|
12
13
|
}
|
package/dist/config-shared.d.ts
CHANGED
|
@@ -13,16 +13,22 @@ export type FlowAgentConfig = {
|
|
|
13
13
|
model?: string;
|
|
14
14
|
permission?: FlowPermissionConfig;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
type FlowCommandConfigBase = {
|
|
17
17
|
description: string;
|
|
18
18
|
template: string;
|
|
19
|
-
agent?: string;
|
|
20
|
-
subtask?: boolean;
|
|
21
19
|
};
|
|
20
|
+
export type FlowManagerCommandConfig = FlowCommandConfigBase & {
|
|
21
|
+
agent?: never;
|
|
22
|
+
subtask: false;
|
|
23
|
+
};
|
|
24
|
+
export type FlowSubtaskCommandConfig = FlowCommandConfigBase & {
|
|
25
|
+
agent: string;
|
|
26
|
+
subtask: true;
|
|
27
|
+
};
|
|
28
|
+
export type FlowCommandConfig = FlowManagerCommandConfig | FlowSubtaskCommandConfig;
|
|
22
29
|
export type MutableFlowConfig = {
|
|
23
30
|
agent?: Record<string, unknown>;
|
|
24
31
|
command?: Record<string, unknown>;
|
|
25
|
-
instructions?: string[];
|
|
26
32
|
};
|
|
27
33
|
export declare const FLOW_CORE_AGENTS: {
|
|
28
34
|
"flow-reviewer": {
|
|
@@ -125,14 +131,17 @@ export declare const FLOW_CORE_AGENTS: {
|
|
|
125
131
|
export declare const FLOW_CORE_COMMANDS: {
|
|
126
132
|
"flow-auto": {
|
|
127
133
|
description: string;
|
|
134
|
+
subtask: false;
|
|
128
135
|
template: string;
|
|
129
136
|
};
|
|
130
137
|
"flow-plan": {
|
|
131
138
|
description: string;
|
|
139
|
+
subtask: false;
|
|
132
140
|
template: string;
|
|
133
141
|
};
|
|
134
142
|
"flow-run": {
|
|
135
143
|
description: string;
|
|
144
|
+
subtask: false;
|
|
136
145
|
template: string;
|
|
137
146
|
};
|
|
138
147
|
"flow-review": {
|
|
@@ -143,12 +152,17 @@ export declare const FLOW_CORE_COMMANDS: {
|
|
|
143
152
|
};
|
|
144
153
|
"flow-status": {
|
|
145
154
|
description: string;
|
|
146
|
-
|
|
155
|
+
subtask: false;
|
|
156
|
+
template: string;
|
|
147
157
|
};
|
|
148
158
|
};
|
|
149
159
|
export declare function createFlowCoreConfigEntries(): {
|
|
150
160
|
agent: {
|
|
151
161
|
[k: string]: {
|
|
162
|
+
mode: "subagent";
|
|
163
|
+
hidden: true;
|
|
164
|
+
description: string;
|
|
165
|
+
prompt: string;
|
|
152
166
|
permission: {
|
|
153
167
|
edit: string;
|
|
154
168
|
bash: string;
|
|
@@ -160,11 +174,11 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
160
174
|
flow_status: string;
|
|
161
175
|
};
|
|
162
176
|
model?: string;
|
|
177
|
+
} | {
|
|
163
178
|
mode: "subagent";
|
|
164
179
|
hidden: true;
|
|
165
180
|
description: string;
|
|
166
181
|
prompt: string;
|
|
167
|
-
} | {
|
|
168
182
|
permission: {
|
|
169
183
|
edit: string;
|
|
170
184
|
bash: string;
|
|
@@ -176,11 +190,11 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
176
190
|
flow_status: string;
|
|
177
191
|
};
|
|
178
192
|
model?: string;
|
|
193
|
+
} | {
|
|
179
194
|
mode: "subagent";
|
|
180
195
|
hidden: true;
|
|
181
196
|
description: string;
|
|
182
197
|
prompt: string;
|
|
183
|
-
} | {
|
|
184
198
|
permission: {
|
|
185
199
|
edit: string;
|
|
186
200
|
bash: string;
|
|
@@ -192,11 +206,11 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
192
206
|
flow_status: string;
|
|
193
207
|
};
|
|
194
208
|
model?: string;
|
|
209
|
+
} | {
|
|
195
210
|
mode: "subagent";
|
|
196
211
|
hidden: true;
|
|
197
212
|
description: string;
|
|
198
213
|
prompt: string;
|
|
199
|
-
} | {
|
|
200
214
|
permission: {
|
|
201
215
|
edit: string;
|
|
202
216
|
bash: string;
|
|
@@ -208,11 +222,11 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
208
222
|
flow_status: string;
|
|
209
223
|
};
|
|
210
224
|
model?: string;
|
|
225
|
+
} | {
|
|
211
226
|
mode: "subagent";
|
|
212
227
|
hidden: true;
|
|
213
228
|
description: string;
|
|
214
229
|
prompt: string;
|
|
215
|
-
} | {
|
|
216
230
|
permission: {
|
|
217
231
|
edit: string;
|
|
218
232
|
bash: string;
|
|
@@ -224,11 +238,11 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
224
238
|
flow_status: string;
|
|
225
239
|
};
|
|
226
240
|
model?: string;
|
|
241
|
+
} | {
|
|
227
242
|
mode: "subagent";
|
|
228
243
|
hidden: true;
|
|
229
244
|
description: string;
|
|
230
245
|
prompt: string;
|
|
231
|
-
} | {
|
|
232
246
|
permission: {
|
|
233
247
|
edit: string;
|
|
234
248
|
bash: string;
|
|
@@ -240,21 +254,20 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
240
254
|
flow_status: string;
|
|
241
255
|
};
|
|
242
256
|
model?: string;
|
|
243
|
-
mode: "subagent";
|
|
244
|
-
hidden: true;
|
|
245
|
-
description: string;
|
|
246
|
-
prompt: string;
|
|
247
257
|
};
|
|
248
258
|
};
|
|
249
259
|
command: {
|
|
250
260
|
[k: string]: {
|
|
251
261
|
description: string;
|
|
262
|
+
subtask: false;
|
|
252
263
|
template: string;
|
|
253
264
|
} | {
|
|
254
265
|
description: string;
|
|
266
|
+
subtask: false;
|
|
255
267
|
template: string;
|
|
256
268
|
} | {
|
|
257
269
|
description: string;
|
|
270
|
+
subtask: false;
|
|
258
271
|
template: string;
|
|
259
272
|
} | {
|
|
260
273
|
description: string;
|
|
@@ -263,11 +276,12 @@ export declare function createFlowCoreConfigEntries(): {
|
|
|
263
276
|
template: string;
|
|
264
277
|
} | {
|
|
265
278
|
description: string;
|
|
266
|
-
|
|
279
|
+
subtask: false;
|
|
280
|
+
template: string;
|
|
267
281
|
};
|
|
268
282
|
};
|
|
269
283
|
};
|
|
270
284
|
export declare function applyFlowConfig(config: MutableFlowConfig, options?: {
|
|
271
|
-
flowInstructionPath?: string;
|
|
272
285
|
onCollision?: (kind: "agent" | "command", name: string) => void;
|
|
273
286
|
}): void;
|
|
287
|
+
export {};
|
package/dist/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { applyFlowConfig, createFlowCoreConfigEntries } from "./config-shared";
|
|
1
|
+
export { applyFlowConfig, createFlowCoreConfigEntries, } from "./config-shared.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type LegacySkillCleanupResult = {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
status: "absent" | "eligible" | "archived" | "refused" | "quarantined";
|
|
5
|
+
reason?: string;
|
|
6
|
+
archivePath?: string;
|
|
7
|
+
};
|
|
8
|
+
export type LegacyCleanupReport = {
|
|
9
|
+
mode: "dry-run" | "apply";
|
|
10
|
+
root: string;
|
|
11
|
+
archiveRoot: string;
|
|
12
|
+
results: LegacySkillCleanupResult[];
|
|
13
|
+
};
|
|
14
|
+
export declare function resolveLegacySkillsRoot(home?: string): string;
|
|
15
|
+
export declare function resolveLegacyArchiveRoot(home?: string): string;
|
|
16
|
+
export declare function cleanupLegacySkills(options?: {
|
|
17
|
+
home?: string;
|
|
18
|
+
apply?: boolean;
|
|
19
|
+
/** @internal Deterministic race-testing seam; package consumers should omit it. */
|
|
20
|
+
afterQuarantine?: (context: {
|
|
21
|
+
name: string;
|
|
22
|
+
path: string;
|
|
23
|
+
archivePath: string;
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
}): Promise<LegacyCleanupReport>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MAX_ORCHESTRATION_PASSES = 50;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type OrchestrationPassEvidence = {
|
|
2
|
+
kind: string;
|
|
3
|
+
decision?: string | undefined;
|
|
4
|
+
candidateEligibility: string;
|
|
5
|
+
candidateDecision?: string | undefined;
|
|
6
|
+
decisionFactors: readonly string[];
|
|
7
|
+
modes: readonly string[];
|
|
8
|
+
workerCount: number;
|
|
9
|
+
candidateWorkerCount: number;
|
|
10
|
+
verifierWorkerCount: number;
|
|
11
|
+
};
|
|
12
|
+
export type OrchestrationPolicyIssue = {
|
|
13
|
+
path: string;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function isCandidateShapedDecision(decision: string | undefined): boolean;
|
|
17
|
+
export declare function hasCandidateExecutionEvidence(pass: {
|
|
18
|
+
kind: string;
|
|
19
|
+
modes: readonly string[];
|
|
20
|
+
candidateWorkerCount: number;
|
|
21
|
+
}): boolean;
|
|
22
|
+
export declare function hasVerifierExecutionEvidence(pass: {
|
|
23
|
+
kind: string;
|
|
24
|
+
modes: readonly string[];
|
|
25
|
+
verifierWorkerCount: number;
|
|
26
|
+
}): boolean;
|
|
27
|
+
export declare function validateOrchestrationPassPolicy(value: OrchestrationPassEvidence): OrchestrationPolicyIssue[];
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export type FeatureStatus = "pending" | "in_progress" | "completed" | "blocked";
|
|
2
|
+
export type SessionStatus = "planning" | "ready" | "running" | "blocked" | "completed";
|
|
3
|
+
export type FeatureReviewDepth = "quick" | "standard" | "detailed";
|
|
4
|
+
export type FinalReviewPolicy = "broad" | "detailed";
|
|
5
|
+
export type ValidationScope = "targeted" | "broad";
|
|
6
|
+
declare const featureIdBrand: unique symbol;
|
|
7
|
+
declare const sessionIdBrand: unique symbol;
|
|
8
|
+
export type FeatureId = string & {
|
|
9
|
+
readonly [featureIdBrand]: "FeatureId";
|
|
10
|
+
};
|
|
11
|
+
export type SessionId = string & {
|
|
12
|
+
readonly [sessionIdBrand]: "SessionId";
|
|
13
|
+
};
|
|
14
|
+
export declare function toFeatureId(value: string): FeatureId;
|
|
15
|
+
export declare function toSessionId(value: string): SessionId;
|
|
16
|
+
export type OrchestrationPassRecord = {
|
|
17
|
+
id: string;
|
|
18
|
+
kind: "discovery" | "audit" | "review" | "validation" | "verification" | "candidate" | "implementation-decision";
|
|
19
|
+
decision?: "serial" | "parallel" | "candidate-exact-path" | "candidate-worktree" | "tournament" | "skipped" | undefined;
|
|
20
|
+
decisionReason?: string | undefined;
|
|
21
|
+
candidateEligibility: "eligible" | "not_eligible" | "unknown";
|
|
22
|
+
candidateDecision?: "used" | "skipped" | "serial_required" | undefined;
|
|
23
|
+
decisionFactors: Array<"shared_state" | "overlapping_files" | "small_slice" | "needs_manager_judgment" | "independent_surface" | "validation_available">;
|
|
24
|
+
modes: Array<"evidence" | "review" | "validation" | "audit" | "verifier" | "candidate-implementation">;
|
|
25
|
+
workerCount: number;
|
|
26
|
+
candidateWorkerCount: number;
|
|
27
|
+
verifierWorkerCount: number;
|
|
28
|
+
sliceIds: string[];
|
|
29
|
+
dependsOn: string[];
|
|
30
|
+
writeScope: "none" | "manager-serial" | "exact-path" | "isolated-worktree" | "mixed";
|
|
31
|
+
handoffRefs: string[];
|
|
32
|
+
verificationStatus: "not-needed" | "pending" | "passed" | "failed" | "mixed" | "downgraded";
|
|
33
|
+
outcome: "accepted" | "modified" | "rejected" | "partial" | "not-covered" | "superseded";
|
|
34
|
+
synthesisRef?: string | undefined;
|
|
35
|
+
};
|
|
36
|
+
export type OrchestrationTelemetry = {
|
|
37
|
+
passCount: number;
|
|
38
|
+
workerCount: number;
|
|
39
|
+
candidatePassCount: number;
|
|
40
|
+
verifierPassCount: number;
|
|
41
|
+
candidateEligibleCount: number;
|
|
42
|
+
candidateUsedDecisionCount: number;
|
|
43
|
+
candidateSerialRequiredDecisionCount: number;
|
|
44
|
+
skippedCandidateDecisionCount: number;
|
|
45
|
+
latestPasses: OrchestrationPassRecord[];
|
|
46
|
+
};
|
|
47
|
+
export type ReviewFinding = {
|
|
48
|
+
summary: string;
|
|
49
|
+
severity: "blocking" | "advisory";
|
|
50
|
+
};
|
|
51
|
+
export type Review = {
|
|
52
|
+
status: "passed" | "failed";
|
|
53
|
+
summary: string;
|
|
54
|
+
blockingFindings: ReviewFinding[];
|
|
55
|
+
};
|
|
56
|
+
export type FinalReview = Review & {
|
|
57
|
+
reviewDepth: FinalReviewPolicy;
|
|
58
|
+
};
|
|
59
|
+
export type ValidationRun = {
|
|
60
|
+
command: string;
|
|
61
|
+
status: "passed" | "failed";
|
|
62
|
+
summary: string;
|
|
63
|
+
};
|
|
64
|
+
export type Artifact = {
|
|
65
|
+
path: string;
|
|
66
|
+
};
|
|
67
|
+
export type Feature = {
|
|
68
|
+
id: FeatureId;
|
|
69
|
+
title: string;
|
|
70
|
+
summary: string;
|
|
71
|
+
status: FeatureStatus;
|
|
72
|
+
reviewDepth: FeatureReviewDepth;
|
|
73
|
+
targets: string[];
|
|
74
|
+
validation: string[];
|
|
75
|
+
dependsOn: FeatureId[];
|
|
76
|
+
};
|
|
77
|
+
export type Plan = {
|
|
78
|
+
summary: string;
|
|
79
|
+
overview: string;
|
|
80
|
+
requirements: string[];
|
|
81
|
+
decisions: string[];
|
|
82
|
+
finalReviewPolicy: FinalReviewPolicy;
|
|
83
|
+
features: Feature[];
|
|
84
|
+
};
|
|
85
|
+
export type PlanInput = {
|
|
86
|
+
summary: string;
|
|
87
|
+
overview: string;
|
|
88
|
+
requirements?: string[] | undefined;
|
|
89
|
+
decisions?: string[] | undefined;
|
|
90
|
+
finalReviewPolicy?: FinalReviewPolicy | undefined;
|
|
91
|
+
features: Array<{
|
|
92
|
+
id: FeatureId;
|
|
93
|
+
title: string;
|
|
94
|
+
summary: string;
|
|
95
|
+
status?: FeatureStatus | undefined;
|
|
96
|
+
reviewDepth?: FeatureReviewDepth | undefined;
|
|
97
|
+
targets?: string[] | undefined;
|
|
98
|
+
validation?: string[] | undefined;
|
|
99
|
+
dependsOn?: FeatureId[] | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
};
|
|
102
|
+
export type CompletedWorkerOutcome = {
|
|
103
|
+
kind: "completed";
|
|
104
|
+
summary?: string | undefined;
|
|
105
|
+
resolutionHint?: string | undefined;
|
|
106
|
+
};
|
|
107
|
+
export type NeedsInputOutcome = {
|
|
108
|
+
kind: "blocked" | "needs_input" | "replan_required";
|
|
109
|
+
summary: string;
|
|
110
|
+
resolutionHint?: string | undefined;
|
|
111
|
+
};
|
|
112
|
+
export type WorkerOutcome = CompletedWorkerOutcome | NeedsInputOutcome;
|
|
113
|
+
type WorkerResultBase = {
|
|
114
|
+
featureId: FeatureId;
|
|
115
|
+
summary: string;
|
|
116
|
+
artifactsChanged: Artifact[];
|
|
117
|
+
validationRun: ValidationRun[];
|
|
118
|
+
validationScope?: ValidationScope | undefined;
|
|
119
|
+
featureReviewDepth?: FeatureReviewDepth | undefined;
|
|
120
|
+
featureReview?: Review | undefined;
|
|
121
|
+
finalReview?: FinalReview | undefined;
|
|
122
|
+
orchestrationPasses: OrchestrationPassRecord[];
|
|
123
|
+
};
|
|
124
|
+
export type WorkerResult = (WorkerResultBase & {
|
|
125
|
+
status: "ok";
|
|
126
|
+
validationScope: ValidationScope;
|
|
127
|
+
featureReviewDepth: FeatureReviewDepth;
|
|
128
|
+
featureReview: Review;
|
|
129
|
+
outcome?: CompletedWorkerOutcome | undefined;
|
|
130
|
+
}) | (WorkerResultBase & {
|
|
131
|
+
status: "needs_input";
|
|
132
|
+
outcome: NeedsInputOutcome;
|
|
133
|
+
});
|
|
134
|
+
export type ExecutionHistoryEntry = {
|
|
135
|
+
featureId: FeatureId;
|
|
136
|
+
status: "completed" | "blocked" | "needs_input";
|
|
137
|
+
summary: string;
|
|
138
|
+
recordedAt: string;
|
|
139
|
+
artifactsChanged: Artifact[];
|
|
140
|
+
validationRun: ValidationRun[];
|
|
141
|
+
validationScope?: ValidationScope | undefined;
|
|
142
|
+
featureReviewDepth?: FeatureReviewDepth | undefined;
|
|
143
|
+
featureReview?: Review | undefined;
|
|
144
|
+
finalReview?: FinalReview | undefined;
|
|
145
|
+
outcome?: WorkerOutcome | undefined;
|
|
146
|
+
orchestrationPasses: OrchestrationPassRecord[];
|
|
147
|
+
};
|
|
148
|
+
export type BudgetTelemetry = {
|
|
149
|
+
reviewCount: number;
|
|
150
|
+
failedReviewCount: number;
|
|
151
|
+
failedReviewAttemptsByFeature: Record<string, number>;
|
|
152
|
+
orchestration: OrchestrationTelemetry;
|
|
153
|
+
};
|
|
154
|
+
export type Session = {
|
|
155
|
+
version: 3;
|
|
156
|
+
id: SessionId;
|
|
157
|
+
goal: string;
|
|
158
|
+
status: SessionStatus;
|
|
159
|
+
approval: "pending" | "approved";
|
|
160
|
+
plan: Plan | null;
|
|
161
|
+
activeFeatureId: FeatureId | null;
|
|
162
|
+
history: ExecutionHistoryEntry[];
|
|
163
|
+
budget: BudgetTelemetry;
|
|
164
|
+
closure: {
|
|
165
|
+
kind: "completed" | "deferred" | "abandoned";
|
|
166
|
+
summary: string;
|
|
167
|
+
recordedAt: string;
|
|
168
|
+
} | null;
|
|
169
|
+
lastError: {
|
|
170
|
+
tool: string;
|
|
171
|
+
summary: string;
|
|
172
|
+
recovery?: string | undefined;
|
|
173
|
+
recordedAt: string;
|
|
174
|
+
} | null;
|
|
175
|
+
timestamps: {
|
|
176
|
+
createdAt: string;
|
|
177
|
+
updatedAt: string;
|
|
178
|
+
completedAt: string | null;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
export {};
|