@narumitw/pi-sync 0.57.2 → 0.57.4
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/README.md +5 -1
- package/dist/chunks/{agent-plan-K3CRYVXV.ts → agent-plan-3L7CRFDM.ts} +28 -11
- package/dist/chunks/agent-plan-3L7CRFDM.ts.map +7 -0
- package/dist/chunks/agent-refusal-retry-AH7TXOQT.ts +69 -0
- package/dist/chunks/agent-refusal-retry-AH7TXOQT.ts.map +7 -0
- package/dist/chunks/{agent-runner-E2JU2VZ6.ts → agent-runner-WMSCKSCB.ts} +7 -5
- package/dist/chunks/agent-runner-WMSCKSCB.ts.map +7 -0
- package/dist/chunks/{agent-store-A3F6IYWZ.ts → agent-store-55CZOCPX.ts} +25 -3
- package/dist/chunks/agent-store-55CZOCPX.ts.map +7 -0
- package/dist/chunks/{chunk-QGK445K7.ts → chunk-3ST7RSYN.ts} +1 -1
- package/dist/chunks/chunk-3ST7RSYN.ts.map +7 -0
- package/dist/chunks/{chunk-OWBAZA6J.ts → chunk-DT6TOCIG.ts} +2 -2
- package/dist/chunks/{chunk-JJTARUSO.ts → chunk-JCH3VXIO.ts} +3 -2
- package/dist/chunks/{chunk-JJTARUSO.ts.map → chunk-JCH3VXIO.ts.map} +2 -2
- package/dist/chunks/{chunk-OEWQVWLC.ts → chunk-ORGBI36T.ts} +4 -4
- package/dist/chunks/{chunk-EUMINX7L.ts → chunk-P7DD5PWZ.ts} +2 -2
- package/dist/chunks/{chunk-VJN7KU4J.ts → chunk-PG7NMFP2.ts} +83 -18
- package/dist/chunks/chunk-PG7NMFP2.ts.map +7 -0
- package/dist/chunks/{chunk-T3NC77TU.ts → chunk-R75IHAOJ.ts} +45 -18
- package/dist/chunks/chunk-R75IHAOJ.ts.map +7 -0
- package/dist/chunks/{chunk-4TQWFLOQ.ts → chunk-U3XRI2HF.ts} +28 -197
- package/dist/chunks/chunk-U3XRI2HF.ts.map +7 -0
- package/dist/chunks/chunk-WD6FJHCK.ts +140 -0
- package/dist/chunks/chunk-WD6FJHCK.ts.map +7 -0
- package/dist/chunks/{conflict-review-ZCGWFKEK.ts → conflict-review-T7GSOKNG.ts} +9 -8
- package/dist/chunks/{conflict-review-ZCGWFKEK.ts.map → conflict-review-T7GSOKNG.ts.map} +1 -1
- package/dist/chunks/{continuous-record-LFRVXQBD.ts → continuous-record-SQJ47CXN.ts} +3 -3
- package/dist/chunks/{continuous-sync-LAIMSW7D.ts → continuous-sync-U4HIKPQK.ts} +9 -9
- package/dist/chunks/{continuous-sync-LAIMSW7D.ts.map → continuous-sync-U4HIKPQK.ts.map} +2 -2
- package/dist/chunks/{git-backend-KYDZ673X.ts → git-backend-NYKSG5X6.ts} +4 -4
- package/dist/chunks/{manager-result-dispatcher-AGBBVDDS.ts → manager-result-dispatcher-HOCM2GDA.ts} +4 -4
- package/dist/chunks/{manager-ui-PSA2L6CE.ts → manager-ui-FXXO6TW4.ts} +54 -17
- package/dist/chunks/manager-ui-FXXO6TW4.ts.map +7 -0
- package/dist/chunks/{remote-selection-ui-5725JDNC.ts → remote-selection-ui-YFPGYGNE.ts} +3 -3
- package/dist/chunks/{s3-backend-Y7WSCLJI.ts → s3-backend-F7PR5FB3.ts} +4 -4
- package/dist/chunks/{setup-wizard-SOYOJQKP.ts → setup-wizard-OVHZYXNW.ts} +2 -2
- package/dist/chunks/{sync-inspection-XFJOAMJD.ts → sync-inspection-5MY2HI4P.ts} +3 -3
- package/dist/chunks/{sync-operations-W5HFFMTP.ts → sync-operations-GNPS6BLY.ts} +29 -17
- package/dist/chunks/sync-operations-GNPS6BLY.ts.map +7 -0
- package/dist/chunks/{webdav-backend-6K26F6LT.ts → webdav-backend-TGFUH3SF.ts} +4 -4
- package/dist/index.ts +28 -23
- package/dist/index.ts.map +2 -2
- package/docs/agent-continuous-hardening.md +79 -0
- package/docs/agent-mode-verification.md +2 -0
- package/docs/agent-quality-verification.md +41 -0
- package/docs/continuous-sync-verification.md +2 -0
- package/package.json +2 -2
- package/skills/configure-pi-sync/references/configuration.md +21 -5
- package/src/commands/command-execution.ts +7 -2
- package/src/commands/command-handler.ts +3 -1
- package/src/commands/command-types.ts +3 -1
- package/src/sync/agent-plan.ts +26 -9
- package/src/sync/agent-refusal-retry.ts +54 -0
- package/src/sync/agent-request.ts +3 -1
- package/src/sync/agent-runner.ts +8 -6
- package/src/sync/agent-store.ts +32 -1
- package/src/sync/agent-sync.ts +63 -13
- package/src/sync/continuous-lease.ts +2 -7
- package/src/sync/continuous-record.ts +95 -13
- package/src/sync/continuous-storage.ts +12 -3
- package/src/sync/continuous-sync.ts +2 -1
- package/src/sync/merged-sync.ts +37 -9
- package/src/sync/sync-mutations.ts +11 -0
- package/src/ui/cancellable-operation.ts +2 -0
- package/src/ui/manager-state.ts +1 -0
- package/src/ui/manager-ui.ts +59 -14
- package/src/ui/secret-input.ts +29 -211
- package/dist/chunks/agent-plan-K3CRYVXV.ts.map +0 -7
- package/dist/chunks/agent-runner-E2JU2VZ6.ts.map +0 -7
- package/dist/chunks/agent-store-A3F6IYWZ.ts.map +0 -7
- package/dist/chunks/chunk-4TQWFLOQ.ts.map +0 -7
- package/dist/chunks/chunk-QGK445K7.ts.map +0 -7
- package/dist/chunks/chunk-QOC47PBC.ts +0 -97
- package/dist/chunks/chunk-QOC47PBC.ts.map +0 -7
- package/dist/chunks/chunk-T3NC77TU.ts.map +0 -7
- package/dist/chunks/chunk-VJN7KU4J.ts.map +0 -7
- package/dist/chunks/manager-ui-PSA2L6CE.ts.map +0 -7
- package/dist/chunks/sync-operations-W5HFFMTP.ts.map +0 -7
- /package/dist/chunks/{chunk-OWBAZA6J.ts.map → chunk-DT6TOCIG.ts.map} +0 -0
- /package/dist/chunks/{chunk-OEWQVWLC.ts.map → chunk-ORGBI36T.ts.map} +0 -0
- /package/dist/chunks/{chunk-EUMINX7L.ts.map → chunk-P7DD5PWZ.ts.map} +0 -0
- /package/dist/chunks/{continuous-record-LFRVXQBD.ts.map → continuous-record-SQJ47CXN.ts.map} +0 -0
- /package/dist/chunks/{git-backend-KYDZ673X.ts.map → git-backend-NYKSG5X6.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-AGBBVDDS.ts.map → manager-result-dispatcher-HOCM2GDA.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-5725JDNC.ts.map → remote-selection-ui-YFPGYGNE.ts.map} +0 -0
- /package/dist/chunks/{s3-backend-Y7WSCLJI.ts.map → s3-backend-F7PR5FB3.ts.map} +0 -0
- /package/dist/chunks/{setup-wizard-SOYOJQKP.ts.map → setup-wizard-OVHZYXNW.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-XFJOAMJD.ts.map → sync-inspection-5MY2HI4P.ts.map} +0 -0
- /package/dist/chunks/{webdav-backend-6K26F6LT.ts.map → webdav-backend-TGFUH3SF.ts.map} +0 -0
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sync/conflict-review.ts", "../../src/sync/conflict-preview.ts"],
|
|
4
4
|
"sourcesContent": ["import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { createSyncBackend, type SyncBackendFactory } from \"../backends/backend-factory.js\";\nimport type { CommandOptions } from \"../commands/command-types.js\";\nimport { loadConfig, syncCheckConfigFingerprint } from \"../settings/config.js\";\nimport { readStateForConfig, syncStateFingerprint } from \"../state/sync-state-store.js\";\nimport { confirmMergeReview } from \"../ui/merge-review.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport { conflictArtifactFingerprint, readConflictArtifact } from \"./conflict-artifacts.js\";\nimport { conflictPreview } from \"./conflict-preview.js\";\nimport { mergeSync } from \"./merged-sync.js\";\nimport { captureMutationOwner } from \"./sync-local.js\";\nexport async function showConflicts(\n ctx: ExtensionContext,\n options: CommandOptions,\n factory: SyncBackendFactory = createSyncBackend,\n) {\n const validate = captureMutationOwner(ctx, options.signal);\n const config = await loadConfig(options.setup);\n validate();\n const state = await readStateForConfig(config);\n validate();\n if (!state.unresolved?.length) {\n ctx.ui.notify(\"No recorded unresolved conflict groups.\", \"info\");\n return;\n }\n if (!ctx.hasUI) {\n ctx.ui.notify(\n `${state.unresolved.length} conflict groups remain unresolved. Review with TUI/RPC; no transfer performed.`,\n \"warning\",\n );\n return;\n }\n const backend = await factory(config);\n validate();\n const labels = state.unresolved.map(\n (group, index) =>\n `${index + 1}: ${group.paths.length} paths \u00B7 ${group.paths\n .slice(0, 3)\n .map((value) => truncateToWidth(safeTerminalText(value), 80))\n .join(\", \")}${group.paths.length > 3 ? \", \u2026\" : \"\"}`,\n );\n const choice = await ctx.ui.select(\"Review unresolved dependency group\", [...labels, \"Keep all unresolved\"], {\n signal: options.signal,\n });\n validate();\n const index = labels.indexOf(choice ?? \"\");\n if (index < 0) return;\n const reference = state.unresolved[index];\n if (!reference) return;\n const artifact = await readConflictArtifact(config, backend.identity, reference.artifact);\n validate();\n const groupIndex = artifact.groups.findIndex(\n (group) => JSON.stringify(group.paths) === JSON.stringify(reference.paths),\n );\n if (groupIndex < 0) throw new Error(\"Conflict reference is stale; refresh sync.\");\n const body = conflictPreview(artifact, reference.paths, backend.destination);\n if (\n !(await confirmMergeReview(\n ctx,\n \"Review private conflict versions\",\n body,\n options.signal,\n () => {\n try {\n validate();\n return true;\n } catch {\n return false;\n }\n },\n \"Continue to resolution choices\",\n ))\n )\n return;\n validate();\n const decision = await ctx.ui.select(\n \"Resolve the entire reviewed group\",\n [\"Keep unresolved\", \"Use local group\", \"Use remote group\"],\n { signal: options.signal },\n );\n validate();\n if (decision !== \"Use local group\" && decision !== \"Use remote group\") return;\n if (syncCheckConfigFingerprint(config) !== syncCheckConfigFingerprint(await loadConfig(options.setup)))\n throw new Error(\"Settings changed during conflict review.\");\n validate();\n await mergeSync(ctx, { ...options, yes: false, auto: false }, factory, {\n token: reference.artifact,\n group: groupIndex,\n source: decision === \"Use local group\" ? \"local\" : \"remote\",\n stateIdentity: syncStateFingerprint(state),\n artifactIdentity: conflictArtifactFingerprint(artifact),\n });\n validate();\n}\n", "import type { SnapshotFile } from \"../snapshot/snapshot-types.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport type { ConflictArtifact } from \"./conflict-artifacts.js\";\n\nexport const CONFLICT_DISPLAY_BYTES = 2 * 1024 * 1024;\nconst tooLarge = () =>\n new Error(\n \"Conflict review exceeds the 2 MiB display bound; inspect private evidence and use a reviewed explicit direction.\",\n );\n\n/** Index once and refuse a version before decoding if it cannot fit the remaining display budget. */\nexport function conflictPreview(artifact: ConflictArtifact, paths: readonly string[], destination: string) {\n const index = (files: SnapshotFile[]) => new Map(files.map((file) => [file.path, file]));\n const ancestors = index(artifact.ancestors ?? []);\n const local = index(artifact.local.files);\n const remote = index(artifact.remote.files);\n const parts: string[] = [];\n let size = 0;\n const remaining = () => CONFLICT_DISPLAY_BYTES - size - (parts.length ? 1 : 0);\n const append = (value: string, prefix = \"\") => {\n if (Buffer.byteLength(value) + Buffer.byteLength(prefix) > remaining()) throw tooLarge();\n // Sanitize at the display boundary, retaining line endings and raw evidence unchanged.\n parts.push(prefix + value.split(\"\\n\").map(safeTerminalText).join(\"\\n\"));\n size += Buffer.byteLength(prefix) + Buffer.byteLength(value) + (parts.length > 1 ? 1 : 0);\n };\n const version = (files: Map<string, SnapshotFile>, filePath: string) => {\n const file = files.get(filePath);\n if (!file) return append(\"(absent)\");\n append(file.sha256, \"sha256: \");\n if (Buffer.byteLength(file.contentBase64, \"base64\") > remaining()) throw tooLarge();\n const bytes = Buffer.from(file.contentBase64, \"base64\");\n let value: string;\n try {\n value = new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true }).decode(bytes);\n } catch {\n return append(file.contentBase64, \"base64: \");\n }\n append(value);\n };\n append(safeTerminalText(destination), \"Storage: \");\n append(\n \"Private conflict versions. Historical artifact is not authority for changed bytes/head. No automatic activation.\",\n );\n for (const filePath of paths) {\n append(safeTerminalText(filePath), \"Path: \");\n append(\"Base:\");\n const hash = artifact.state.lastFileHashes[filePath];\n if (hash && !ancestors.has(filePath)) append(`(verified ancestor unavailable; sha256: ${hash})`);\n else version(ancestors, filePath);\n append(\"Local:\");\n version(local, filePath);\n append(\"Remote:\");\n version(remote, filePath);\n }\n return parts.join(\"\\n\");\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,uBAAuB;;;ACGzB,IAAM,yBAAyB,IAAI,OAAO;AACjD,IAAM,WAAW,MACf,IAAI;AAAA,EACF;AACF;AAGK,SAAS,gBAAgB,UAA4B,OAA0B,aAAqB;AACzG,QAAM,QAAQ,CAAC,UAA0B,IAAI,IAAI,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;AACvF,QAAM,YAAY,MAAM,SAAS,aAAa,CAAC,CAAC;AAChD,QAAM,QAAQ,MAAM,SAAS,MAAM,KAAK;AACxC,QAAM,SAAS,MAAM,SAAS,OAAO,KAAK;AAC1C,QAAM,QAAkB,CAAC;AACzB,MAAI,OAAO;AACX,QAAM,YAAY,MAAM,yBAAyB,QAAQ,MAAM,SAAS,IAAI;AAC5E,QAAM,SAAS,CAAC,OAAe,SAAS,OAAO;AAC7C,QAAI,OAAO,WAAW,KAAK,IAAI,OAAO,WAAW,MAAM,IAAI,UAAU,EAAG,OAAM,SAAS;AAEvF,UAAM,KAAK,SAAS,MAAM,MAAM,IAAI,EAAE,IAAI,gBAAgB,EAAE,KAAK,IAAI,CAAC;AACtE,YAAQ,OAAO,WAAW,MAAM,IAAI,OAAO,WAAW,KAAK,KAAK,MAAM,SAAS,IAAI,IAAI;AAAA,EACzF;AACA,QAAM,UAAU,CAAC,OAAkC,aAAqB;AACtE,UAAM,OAAO,MAAM,IAAI,QAAQ;AAC/B,QAAI,CAAC,KAAM,QAAO,OAAO,UAAU;AAC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AAA,EAC3B;AACA,WAAS;AACT,MAAI,aAAa,qBAAqB,aAAa,mBAAoB;AACvE,MAAI,2BAA2B,MAAM,MAAM,2BAA2B,MAAM,WAAW,QAAQ,KAAK,CAAC;AACnG,UAAM,IAAI,MAAM,0CAA0C;AAC5D,WAAS;AACT,QAAM,UAAU,KAAK,EAAE,GAAG,SAAS,KAAK,OAAO,MAAM,MAAM,GAAG,SAAS;AAAA,IACrE,OAAO,UAAU;AAAA,IACjB,OAAO;AAAA,IACP,QAAQ,aAAa,oBAAoB,UAAU;AAAA,IACnD,eAAe,qBAAqB,KAAK;AAAA,IACzC,kBAAkB,4BAA4B,QAAQ;AAAA,EACxD,CAAC;AACD,WAAS;AACX;",
|
|
6
6
|
"names": ["index"]
|
|
7
7
|
}
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
reserveContinuousRequest,
|
|
9
9
|
updateContinuousRecord,
|
|
10
10
|
validateContinuousRecord
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PG7NMFP2.ts";
|
|
12
12
|
import "./chunk-AAEEHR7H.ts";
|
|
13
|
-
import "./chunk-PWMWOJP4.ts";
|
|
14
13
|
import "./chunk-DT7M4VQS.ts";
|
|
15
14
|
import "./chunk-YDVQYUHE.ts";
|
|
15
|
+
import "./chunk-PWMWOJP4.ts";
|
|
16
16
|
import "./chunk-UPNVIUBN.ts";
|
|
17
17
|
import "./chunk-SWRVXVFD.ts";
|
|
18
18
|
import "./chunk-2JZFHNLM.ts";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
updateContinuousRecord,
|
|
28
28
|
validateContinuousRecord
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=continuous-record-
|
|
30
|
+
//# sourceMappingURL=continuous-record-SQJ47CXN.ts.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
readContinuousRecord,
|
|
9
9
|
reserveContinuousRequest,
|
|
10
10
|
updateContinuousRecord
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PG7NMFP2.ts";
|
|
12
12
|
import {
|
|
13
13
|
readMergeJournal
|
|
14
14
|
} from "./chunk-GNH73BJ5.ts";
|
|
@@ -17,15 +17,15 @@ import {
|
|
|
17
17
|
} from "./chunk-BDB4IDM3.ts";
|
|
18
18
|
import {
|
|
19
19
|
withAgentSyncLock
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import
|
|
22
|
-
captureMutationOwner
|
|
23
|
-
} from "./chunk-UOHR7LRO.ts";
|
|
20
|
+
} from "./chunk-WD6FJHCK.ts";
|
|
21
|
+
import "./chunk-3ST7RSYN.ts";
|
|
24
22
|
import {
|
|
25
23
|
setSyncStatus
|
|
26
24
|
} from "./chunk-K3RIEL6J.ts";
|
|
25
|
+
import {
|
|
26
|
+
captureMutationOwner
|
|
27
|
+
} from "./chunk-UOHR7LRO.ts";
|
|
27
28
|
import "./chunk-UBV24CG4.ts";
|
|
28
|
-
import "./chunk-QGK445K7.ts";
|
|
29
29
|
import {
|
|
30
30
|
loadConfigForCheck,
|
|
31
31
|
syncCheckConfigFingerprint
|
|
@@ -34,12 +34,12 @@ import "./chunk-A6HU4ERM.ts";
|
|
|
34
34
|
import {
|
|
35
35
|
withLock
|
|
36
36
|
} from "./chunk-AAEEHR7H.ts";
|
|
37
|
-
import "./chunk-PWMWOJP4.ts";
|
|
38
37
|
import {
|
|
39
38
|
ContinuousError,
|
|
40
39
|
continuousFailure
|
|
41
40
|
} from "./chunk-DT7M4VQS.ts";
|
|
42
41
|
import "./chunk-YDVQYUHE.ts";
|
|
42
|
+
import "./chunk-PWMWOJP4.ts";
|
|
43
43
|
import {
|
|
44
44
|
snapshotOptionsForContext
|
|
45
45
|
} from "./chunk-QOFMXPM5.ts";
|
|
@@ -482,7 +482,7 @@ function createContinuousSync(loaders, clock = systemClock) {
|
|
|
482
482
|
signal,
|
|
483
483
|
background: {
|
|
484
484
|
validate,
|
|
485
|
-
reserve: (key) => reserveContinuousRequest(binding, lease, key, () => clock.now())
|
|
485
|
+
reserve: (key, requestSignal) => reserveContinuousRequest(binding, lease, key, () => clock.now(), requestSignal)
|
|
486
486
|
}
|
|
487
487
|
},
|
|
488
488
|
(options) => operations.syncBoth(ctx, options)
|
|
@@ -542,4 +542,4 @@ export {
|
|
|
542
542
|
continuousEnabled,
|
|
543
543
|
createContinuousSync
|
|
544
544
|
};
|
|
545
|
-
//# sourceMappingURL=continuous-sync-
|
|
545
|
+
//# sourceMappingURL=continuous-sync-U4HIKPQK.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sync/continuous-watch.ts", "../../src/sync/continuous-sync.ts"],
|
|
4
|
-
"sourcesContent": ["import { type FSWatcher, watch } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getAgentDir } from \"@earendil-works/pi-coding-agent\";\nimport { isDeniedPath } from \"../paths.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\n\n/** Hints only. The scheduler's periodic snapshot scan remains required. */\nexport async function watchContinuous(\n config: AnySyncConfig,\n changed: (settings: boolean) => void,\n): Promise<() => void> {\n const root = getAgentDir();\n const watchers: FSWatcher[] = [];\n const selected = config.include.map((item) => path.resolve(root, item));\n const relevant = (target: string) =>\n selected.some(\n (item) => target === item || target.startsWith(`${item}${path.sep}`) || item.startsWith(`${target}${path.sep}`),\n );\n const add = (directory: string, recursive: boolean) => {\n try {\n const watcher = watch(directory, { recursive, persistent: false }, (_event, file) => {\n // Unknown names can be our own private writes. Periodic scans cover them.\n if (!file) return;\n const target = path.resolve(directory, String(file));\n if (target === path.join(root, \"pi-sync.json\")) changed(true);\n else if (isDeniedPath(path.relative(root, target))) return;\n else if (relevant(target)) changed(false);\n });\n watcher.on(\"error\", () => watcher.close());\n watchers.push(watcher);\n } catch {\n /* Periodic scans cover unavailable or unsupported watchers. */\n }\n };\n add(root, false);\n const directories = new Set<string>();\n try {\n for (const target of selected) {\n try {\n const stat = await fs.lstat(target);\n if (stat.isSymbolicLink()) continue;\n const directory = stat.isDirectory() ? target : path.dirname(target);\n if (directory === root || directories.has(directory)) continue;\n directories.add(directory);\n add(directory, stat.isDirectory());\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") continue;\n // Missing targets are found by the parent hint or the next periodic scan.\n }\n }\n return () => {\n for (const watcher of watchers) watcher.close();\n };\n } catch (error) {\n for (const watcher of watchers) watcher.close();\n throw error;\n }\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { loadConfigForCheck, syncCheckConfigFingerprint } from \"../settings/config.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\nimport { snapshotOptionsForContext } from \"../snapshot/session-paths.js\";\nimport { withLock } from \"../state/lock.js\";\nimport { withStateDirectoryAccess } from \"../state/state-directory.js\";\nimport { readStateForConfig } from \"../state/sync-state-store.js\";\nimport { setSyncStatus } from \"../ui/sync-status.js\";\nimport { withAgentSyncLock } from \"./agent-sync.js\";\nimport { ContinuousError, continuousFailure } from \"./continuous-errors.js\";\nimport { acquireContinuousLease, type ContinuousLease } from \"./continuous-lease.js\";\nimport {\n normalizeContinuousClock,\n readContinuousRecord,\n reserveContinuousRequest,\n updateContinuousRecord,\n} from \"./continuous-record.js\";\nimport { continuousBinding, hashContinuous } from \"./continuous-storage.js\";\nimport { watchContinuous } from \"./continuous-watch.js\";\nimport { readMergeJournal } from \"./merge-journal.js\";\nimport type { SyncLoaders } from \"./sync-loaders.js\";\nimport { captureMutationOwner } from \"./sync-local.js\";\nimport { fileHashMap } from \"./sync-state.js\";\n\nexport function continuousEnabled(config: Pick<AnySyncConfig, \"continuous\" | \"agentMode\">) {\n return Boolean(config.continuous && config.agentMode);\n}\nexport interface ContinuousClock {\n now(): number;\n random(): number;\n schedule(ms: number, run: () => void, kind?: \"wait\" | \"authorization\"): () => void;\n}\nconst systemClock: ContinuousClock = {\n now: () => Date.now(),\n random: () => Math.random(),\n schedule: (ms, run) => {\n const timer = setTimeout(run, ms);\n timer.unref?.();\n return () => clearTimeout(timer);\n },\n};\nconst LOCAL_CHECK_MS = 5_000;\nconst POLL_MS = 60_000;\nconst DEBOUNCE_MS = 1_000;\n\n/** Created on first enabled session. No module/factory-owned timers or watchers. */\nexport function createContinuousSync(loaders: SyncLoaders, clock: ContinuousClock = systemClock) {\n const repairNotices = new WeakSet<ExtensionContext[\"sessionManager\"]>();\n let task:\n | { owner: ExtensionContext[\"sessionManager\"]; controller: AbortController; promise: Promise<void>; clear(): void }\n | undefined;\n return {\n start(ctx: ExtensionContext, sessionSignal: AbortSignal, explicitRetry = false) {\n if (!ctx.hasUI || (ctx.mode !== \"tui\" && ctx.mode !== \"rpc\") || sessionSignal.aborted || task) return;\n const controller = new AbortController();\n const signal = AbortSignal.any([sessionSignal, controller.signal]);\n const validateContext = captureMutationOwner(ctx);\n const current = {\n owner: ctx.sessionManager,\n controller,\n promise: Promise.resolve(),\n clear: () => {\n try {\n validateContext();\n setSyncStatus(ctx, undefined);\n } catch {\n /* replaced session */\n }\n },\n };\n task = current;\n current.promise = (async () => {\n let explicit = explicitRetry;\n while (!signal.aborted) {\n try {\n await run(ctx, signal, explicit);\n return;\n } catch {\n if (signal.aborted) return;\n try {\n validateContext();\n setSyncStatus(ctx, \"sync blocked: private state or settings need repair\");\n if (!repairNotices.has(ctx.sessionManager)) {\n repairNotices.add(ctx.sessionManager);\n ctx.ui.notify(\n \"Continuous sync blocked: private state or settings need repair. Use /sync. Evidence was retained.\",\n \"warning\",\n );\n }\n } catch {\n return;\n }\n }\n explicit = false;\n // Only local prerequisites are retried here. No remote/model request can\n // pass a malformed settings/state read. A repair can resume monitoring.\n await wait(clock, LOCAL_CHECK_MS, signal);\n }\n })()\n .catch(() => {\n /* Cancellation/UI disposal must not leak a detached rejection. */\n })\n .finally(() => {\n if (task === current) task = undefined;\n });\n },\n async stop(owner?: ExtensionContext[\"sessionManager\"]) {\n const current = task;\n if (!current || (owner && current.owner !== owner)) return;\n current.controller.abort(new DOMException(\"Continuous sync interrupted\", \"AbortError\"));\n current.clear();\n await current.promise;\n },\n };\n\n async function run(ctx: ExtensionContext, signal: AbortSignal, explicitRetry: boolean) {\n const validateOwner = captureMutationOwner(ctx, signal);\n try {\n while (!signal.aborted) {\n validateOwner();\n const config = await loadConfigForCheck();\n validateOwner();\n if (!continuousEnabled(config)) return;\n try {\n if (ctx.isIdle()) {\n let lease: ContinuousLease | undefined;\n let binding = \"\";\n try {\n await withStateDirectoryAccess(async () => {\n validateOwner();\n binding = await continuousBinding(config);\n validateOwner();\n lease = await acquireContinuousLease(binding);\n validateOwner();\n });\n if (lease) {\n await monitor(ctx, config, binding, lease, signal, explicitRetry);\n explicitRetry = false;\n } else setSyncStatus(ctx, \"sync waiting: another local owner\");\n } finally {\n await lease?.release();\n }\n }\n } catch (error) {\n if (signal.aborted) return;\n const failure = continuousFailure(error);\n if (!failure.retry && !(error instanceof Error && error.name === \"AbortError\")) throw error;\n setSyncStatus(ctx, `sync retry scheduled: ${failure.kind}`);\n }\n validateOwner();\n if (!continuousEnabled(await loadConfigForCheck())) return;\n validateOwner();\n await wait(clock, LOCAL_CHECK_MS, signal);\n }\n } finally {\n // Shutdown/replacement owns clearing the old UI; do not call it from a stale continuation.\n if (!signal.aborted) {\n try {\n validateOwner();\n setSyncStatus(ctx, undefined);\n } catch {\n /* stale context */\n }\n }\n }\n }\n\n async function monitor(\n ctx: ExtensionContext,\n initial: AnySyncConfig,\n binding: string,\n lease: ContinuousLease,\n parent: AbortSignal,\n explicitRetry: boolean,\n ) {\n const signal = AbortSignal.any([parent, lease.signal]);\n const validateOwner = captureMutationOwner(ctx, signal);\n let config = initial;\n let closeWatch = () => {};\n let wake = () => {};\n let dirtyAt: number | undefined;\n let cycle: AbortController | undefined;\n const changed = (settings: boolean) => {\n dirtyAt = clock.now();\n if (settings) cycle?.abort(new DOMException(\"Continuous settings changed\", \"AbortError\"));\n wake();\n };\n const validate = () => {\n validateOwner();\n lease.assert();\n if (!ctx.isIdle()) throw new DOMException(\"Owning session became busy\", \"AbortError\");\n };\n const stopWatch = () => {\n closeWatch();\n wake();\n };\n signal.addEventListener(\"abort\", stopWatch, { once: true });\n let pollDue = 0;\n try {\n closeWatch = await watchContinuous(config, changed);\n validate();\n while (!signal.aborted && ctx.isIdle()) {\n validate();\n const latest = await loadConfigForCheck();\n validate();\n if (!continuousEnabled(latest) || (await continuousBinding(latest)) !== binding) return;\n validate();\n if (syncCheckConfigFingerprint(latest) !== syncCheckConfigFingerprint(config)) {\n closeWatch();\n config = latest;\n closeWatch = await watchContinuous(config, changed);\n validate();\n pollDue = 0;\n }\n const record = await readContinuousRecord(binding);\n validate();\n const now = clock.now();\n const oldClock = JSON.stringify([record.next, record.calls]);\n normalizeContinuousClock(record, now);\n if (oldClock !== JSON.stringify([record.next, record.calls])) {\n await updateContinuousRecord(binding, lease, (current) => normalizeContinuousClock(current, now));\n validate();\n }\n const configuration = hashContinuous([{ ...config, showStatus: undefined, debug: undefined }, ctx.model]);\n const controlChanged = record.configuration !== configuration;\n if (controlChanged || explicitRetry) {\n record.next = 0;\n pollDue = 0;\n }\n const hintDue = dirtyAt === undefined ? Number.POSITIVE_INFINITY : dirtyAt + DEBOUNCE_MS;\n const due = Math.max(record.error === \"budget\" ? 0 : record.next, Math.min(pollDue, hintDue));\n if (now >= due) {\n const force = explicitRetry || controlChanged;\n explicitRetry = false;\n const expectedModel = hashContinuous(ctx.model);\n const expectedConfig = syncCheckConfigFingerprint(config);\n dirtyAt = undefined;\n cycle = new AbortController();\n const cancelDeadline = clock.schedule(30_000, () =>\n cycle?.abort(new DOMException(\"Continuous cycle timed out\", \"TimeoutError\")),\n );\n const guard = new AbortController();\n const guardSignal = AbortSignal.any([signal, cycle.signal, guard.signal]);\n const activeCycle = cycle;\n // Transfer entrypoints supply each fresh settings read. Never let a new\n // transfer adopt authorization that changed after this cycle's inspection.\n const validateCycle = (latest?: AnySyncConfig) => {\n validate();\n if (\n (latest && syncCheckConfigFingerprint(latest) !== expectedConfig) ||\n hashContinuous(ctx.model) !== expectedModel\n )\n activeCycle.abort(new DOMException(\"Continuous authorization changed\", \"AbortError\"));\n activeCycle.signal.throwIfAborted();\n };\n const guardTask = (async () => {\n while (!guardSignal.aborted) {\n await wait(clock, LOCAL_CHECK_MS, guardSignal, undefined, \"authorization\");\n if (guardSignal.aborted) return;\n try {\n validate();\n const latest = await loadConfigForCheck();\n if (guardSignal.aborted) return;\n validateCycle(latest);\n } catch {\n activeCycle.abort(new DOMException(\"Continuous authorization unavailable\", \"AbortError\"));\n }\n }\n })().catch(() => {});\n try {\n await performCycle(\n ctx,\n config,\n binding,\n lease,\n AbortSignal.any([signal, cycle.signal]),\n validateCycle,\n configuration,\n force,\n );\n } catch (error) {\n if (signal.aborted || !ctx.isIdle()) return;\n // A settings hint interrupts the old authorization; load it afresh, not as a failed transfer.\n if (cycle.signal.aborted && cycle.signal.reason?.name !== \"TimeoutError\") {\n pollDue = 0;\n continue;\n }\n const failure = continuousFailure(error);\n let announce = false;\n await updateContinuousRecord(binding, lease, (current) => {\n const now = clock.now();\n normalizeContinuousClock(current, now);\n const notice = hashContinuous([failure.kind, current.evidence, configuration]);\n announce = current.notice !== notice;\n if (!failure.retry) current.notice = notice;\n current.configuration = configuration;\n current.pending = true;\n current.error = failure.kind;\n current.phase = failure.retry ? \"retry\" : \"blocked\";\n current.failures = Math.min(30, current.failures + 1);\n const base = Math.min(300_000, 5_000 * 2 ** Math.min(6, current.failures - 1));\n const delay = Math.min(300_000, base + Math.floor(clock.random() * base * 0.2));\n current.next = now + Math.max(delay, failure.delay ?? 0);\n });\n validate();\n if (announce && !failure.retry)\n ctx.ui.notify(\n `Continuous sync blocked (${failure.kind}). Review /sync or repair the setup. Evidence was retained.`,\n \"warning\",\n );\n } finally {\n cancelDeadline();\n guard.abort();\n await guardTask;\n cycle = undefined;\n }\n pollDue = clock.now() + POLL_MS + Math.floor(clock.random() * 6_000);\n closeWatch();\n closeWatch = () => {};\n closeWatch = await watchContinuous(config, changed);\n validate();\n }\n validate();\n const state = await readContinuousRecord(binding);\n validate();\n setSyncStatus(\n ctx,\n state.phase === \"blocked\"\n ? `sync blocked: ${state.error}`\n : state.phase === \"retry\"\n ? `sync retry scheduled: ${state.error}`\n : \"sync waiting for changes\",\n );\n if (state.phase === \"retry\") pollDue = Math.min(pollDue, state.next);\n const next = Math.max(\n state.error === \"budget\" ? 0 : state.next,\n Math.min(pollDue, dirtyAt === undefined ? Number.POSITIVE_INFINITY : dirtyAt + DEBOUNCE_MS),\n );\n await wait(clock, Math.max(1, Math.min(LOCAL_CHECK_MS, next - clock.now())), signal, (callback) => {\n wake = callback;\n });\n }\n } finally {\n signal.removeEventListener(\"abort\", stopWatch);\n closeWatch();\n cycle?.abort();\n }\n }\n\n async function performCycle(\n ctx: ExtensionContext,\n config: AnySyncConfig,\n binding: string,\n lease: ContinuousLease,\n signal: AbortSignal,\n validateOwner: (config?: AnySyncConfig) => void,\n configuration: string,\n force: boolean,\n ) {\n const validate = (latest?: AnySyncConfig) => {\n signal.throwIfAborted();\n validateOwner(latest);\n };\n validate();\n const current = await readContinuousRecord(binding);\n validate();\n // A newly pending journal may prove an uncertain commit. It is never authority to republish.\n const pending = await guardedLock(\"continuous-journal\", () => readMergeJournal(config));\n validate();\n if (\n !force &&\n !pending &&\n current.phase === \"blocked\" &&\n [\"authentication\", \"storage\", \"unknown\"].includes(current.error ?? \"\")\n )\n return;\n setSyncStatus(ctx, \"sync checking\");\n const inspectionModule = await loaders.inspection();\n validate();\n const observed = await guardedLock(\"continuous-check\", async () => {\n validate();\n const inspection = await inspectionModule.inspectSync(config, snapshotOptionsForContext(ctx, config), signal);\n validate();\n let localIdentity = inspection.localIdentity;\n if (!localIdentity) {\n const snapshotModule = await loaders.snapshot();\n validate();\n const local = await snapshotModule.createSnapshot(config.snapshotIdentity, {\n ...snapshotOptionsForContext(ctx, config),\n signal,\n });\n validate();\n localIdentity = hashContinuous(fileHashMap(local));\n }\n const journal = await readMergeJournal(config);\n validate();\n return { inspection, journal, localIdentity };\n });\n validate();\n const evidence = hashContinuous([\n configuration,\n observed.localIdentity,\n observed.inspection.head?.revision,\n observed.inspection.stateIdentity,\n ]);\n const recovery = observed.journal ? hashContinuous([evidence, observed.journal]) : undefined;\n const blocked =\n !force &&\n current.evidence === evidence &&\n ((current.phase === \"blocked\" && (!recovery || recovery === current.recovery)) ||\n (current.error === \"budget\" && current.next > clock.now() && !observed.journal));\n await updateContinuousRecord(binding, lease, (record) => {\n if (record.configuration !== configuration) {\n record.failures = 0;\n record.next = 0;\n }\n record.configuration = configuration;\n record.checked = clock.now();\n record.evidence = evidence;\n if (!blocked) {\n if (record.phase !== \"blocked\") record.phase = \"syncing\";\n record.pending = true;\n if (recovery) record.recovery = recovery;\n }\n });\n validate();\n if (blocked) return;\n if (\n !observed.journal &&\n (observed.inspection.firstSync ||\n !observed.inspection.head ||\n observed.inspection.selectionState?.kind !== \"same\")\n )\n throw new ContinuousError(\"unsafe\", \"Continuous sync needs an accepted baseline and matching remote selection.\");\n let transferred = false;\n if (observed.journal || observed.inspection.localChanged || observed.inspection.remoteChanged) {\n const operations = await loaders.operations();\n validate();\n setSyncStatus(ctx, \"sync syncing\");\n const result = await withStateDirectoryAccess(() =>\n withAgentSyncLock(\n ctx,\n {\n args: [],\n yes: true,\n force: false,\n stale: false,\n silent: true,\n reload: false,\n auto: true,\n signal,\n background: {\n validate,\n reserve: (key) => reserveContinuousRequest(binding, lease, key, () => clock.now()),\n },\n },\n (options) => operations.syncBoth(ctx, options),\n ),\n );\n validate();\n transferred = result === \"applied\";\n }\n const state = await guardedLock(\"continuous-result\", () => readStateForConfig(config));\n validate();\n const unresolved = state.unresolved;\n let announcePartial = false;\n await updateContinuousRecord(binding, lease, (record) => {\n record.phase = unresolved?.length ? \"blocked\" : \"waiting\";\n record.pending = Boolean(unresolved?.length);\n record.failures = 0;\n record.next = 0;\n if (unresolved?.length) {\n record.error = \"unsafe\";\n const notice = hashContinuous([\"partial\", unresolved, configuration]);\n announcePartial = record.notice !== notice;\n record.notice = notice;\n } else {\n delete record.error;\n delete record.notice;\n }\n if (transferred) record.transferred = clock.now();\n });\n validate();\n if (announcePartial)\n ctx.ui.notify(\n \"Continuous sync retained unresolved groups. Review /sync conflicts; independent partial progress was preserved.\",\n \"warning\",\n );\n }\n}\n\nfunction guardedLock<T>(command: string, run: () => Promise<T>) {\n return withStateDirectoryAccess(() => withLock(command, run));\n}\n\nfunction wait(\n clock: ContinuousClock,\n ms: number,\n signal: AbortSignal,\n expose?: (wake: () => void) => void,\n kind: \"wait\" | \"authorization\" = \"wait\",\n) {\n signal.throwIfAborted();\n return new Promise<void>((resolve) => {\n const done = () => {\n cancel();\n signal.removeEventListener(\"abort\", done);\n expose?.(() => {});\n resolve();\n };\n const cancel = clock.schedule(ms, done, kind);\n signal.addEventListener(\"abort\", done, { once: true });\n expose?.(done);\n if (signal.aborted) done();\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAyB,aAAa;AACtC,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAK5B,eAAsB,gBACpB,QACA,SACqB;AACrB,QAAM,OAAO,YAAY;AACzB,QAAM,WAAwB,CAAC;AAC/B,QAAM,WAAW,OAAO,QAAQ,IAAI,CAAC,SAAS,KAAK,QAAQ,MAAM,IAAI,CAAC;AACtE,QAAM,WAAW,CAAC,WAChB,SAAS;AAAA,IACP,CAAC,SAAS,WAAW,QAAQ,OAAO,WAAW,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,KAAK,KAAK,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,EAAE;AAAA,EAChH;AACF,QAAM,MAAM,CAAC,WAAmB,cAAuB;AACrD,QAAI;AACF,YAAM,UAAU,MAAM,WAAW,EAAE,WAAW,YAAY,MAA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,iBAAiB,SAAS,MAAM,EAAE,MAAM,KAAK,CAAC;AACrD,aAAS,IAAI;AACb,QAAI,OAAO,QAAS,MAAK;AAAA,EAC3B,CAAC;AACH;",
|
|
4
|
+
"sourcesContent": ["import { type FSWatcher, watch } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getAgentDir } from \"@earendil-works/pi-coding-agent\";\nimport { isDeniedPath } from \"../paths.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\n\n/** Hints only. The scheduler's periodic snapshot scan remains required. */\nexport async function watchContinuous(\n config: AnySyncConfig,\n changed: (settings: boolean) => void,\n): Promise<() => void> {\n const root = getAgentDir();\n const watchers: FSWatcher[] = [];\n const selected = config.include.map((item) => path.resolve(root, item));\n const relevant = (target: string) =>\n selected.some(\n (item) => target === item || target.startsWith(`${item}${path.sep}`) || item.startsWith(`${target}${path.sep}`),\n );\n const add = (directory: string, recursive: boolean) => {\n try {\n const watcher = watch(directory, { recursive, persistent: false }, (_event, file) => {\n // Unknown names can be our own private writes. Periodic scans cover them.\n if (!file) return;\n const target = path.resolve(directory, String(file));\n if (target === path.join(root, \"pi-sync.json\")) changed(true);\n else if (isDeniedPath(path.relative(root, target))) return;\n else if (relevant(target)) changed(false);\n });\n watcher.on(\"error\", () => watcher.close());\n watchers.push(watcher);\n } catch {\n /* Periodic scans cover unavailable or unsupported watchers. */\n }\n };\n add(root, false);\n const directories = new Set<string>();\n try {\n for (const target of selected) {\n try {\n const stat = await fs.lstat(target);\n if (stat.isSymbolicLink()) continue;\n const directory = stat.isDirectory() ? target : path.dirname(target);\n if (directory === root || directories.has(directory)) continue;\n directories.add(directory);\n add(directory, stat.isDirectory());\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") continue;\n // Missing targets are found by the parent hint or the next periodic scan.\n }\n }\n return () => {\n for (const watcher of watchers) watcher.close();\n };\n } catch (error) {\n for (const watcher of watchers) watcher.close();\n throw error;\n }\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { loadConfigForCheck, syncCheckConfigFingerprint } from \"../settings/config.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\nimport { snapshotOptionsForContext } from \"../snapshot/session-paths.js\";\nimport { withLock } from \"../state/lock.js\";\nimport { withStateDirectoryAccess } from \"../state/state-directory.js\";\nimport { readStateForConfig } from \"../state/sync-state-store.js\";\nimport { setSyncStatus } from \"../ui/sync-status.js\";\nimport { withAgentSyncLock } from \"./agent-sync.js\";\nimport { ContinuousError, continuousFailure } from \"./continuous-errors.js\";\nimport { acquireContinuousLease, type ContinuousLease } from \"./continuous-lease.js\";\nimport {\n normalizeContinuousClock,\n readContinuousRecord,\n reserveContinuousRequest,\n updateContinuousRecord,\n} from \"./continuous-record.js\";\nimport { continuousBinding, hashContinuous } from \"./continuous-storage.js\";\nimport { watchContinuous } from \"./continuous-watch.js\";\nimport { readMergeJournal } from \"./merge-journal.js\";\nimport type { SyncLoaders } from \"./sync-loaders.js\";\nimport { captureMutationOwner } from \"./sync-local.js\";\nimport { fileHashMap } from \"./sync-state.js\";\n\nexport function continuousEnabled(config: Pick<AnySyncConfig, \"continuous\" | \"agentMode\">) {\n return Boolean(config.continuous && config.agentMode);\n}\nexport interface ContinuousClock {\n now(): number;\n random(): number;\n schedule(ms: number, run: () => void, kind?: \"wait\" | \"authorization\"): () => void;\n}\nconst systemClock: ContinuousClock = {\n now: () => Date.now(),\n random: () => Math.random(),\n schedule: (ms, run) => {\n const timer = setTimeout(run, ms);\n timer.unref?.();\n return () => clearTimeout(timer);\n },\n};\nconst LOCAL_CHECK_MS = 5_000;\nconst POLL_MS = 60_000;\nconst DEBOUNCE_MS = 1_000;\n\n/** Created on first enabled session. No module/factory-owned timers or watchers. */\nexport function createContinuousSync(loaders: SyncLoaders, clock: ContinuousClock = systemClock) {\n const repairNotices = new WeakSet<ExtensionContext[\"sessionManager\"]>();\n let task:\n | { owner: ExtensionContext[\"sessionManager\"]; controller: AbortController; promise: Promise<void>; clear(): void }\n | undefined;\n return {\n start(ctx: ExtensionContext, sessionSignal: AbortSignal, explicitRetry = false) {\n if (!ctx.hasUI || (ctx.mode !== \"tui\" && ctx.mode !== \"rpc\") || sessionSignal.aborted || task) return;\n const controller = new AbortController();\n const signal = AbortSignal.any([sessionSignal, controller.signal]);\n const validateContext = captureMutationOwner(ctx);\n const current = {\n owner: ctx.sessionManager,\n controller,\n promise: Promise.resolve(),\n clear: () => {\n try {\n validateContext();\n setSyncStatus(ctx, undefined);\n } catch {\n /* replaced session */\n }\n },\n };\n task = current;\n current.promise = (async () => {\n let explicit = explicitRetry;\n while (!signal.aborted) {\n try {\n await run(ctx, signal, explicit);\n return;\n } catch {\n if (signal.aborted) return;\n try {\n validateContext();\n setSyncStatus(ctx, \"sync blocked: private state or settings need repair\");\n if (!repairNotices.has(ctx.sessionManager)) {\n repairNotices.add(ctx.sessionManager);\n ctx.ui.notify(\n \"Continuous sync blocked: private state or settings need repair. Use /sync. Evidence was retained.\",\n \"warning\",\n );\n }\n } catch {\n return;\n }\n }\n explicit = false;\n // Only local prerequisites are retried here. No remote/model request can\n // pass a malformed settings/state read. A repair can resume monitoring.\n await wait(clock, LOCAL_CHECK_MS, signal);\n }\n })()\n .catch(() => {\n /* Cancellation/UI disposal must not leak a detached rejection. */\n })\n .finally(() => {\n if (task === current) task = undefined;\n });\n },\n async stop(owner?: ExtensionContext[\"sessionManager\"]) {\n const current = task;\n if (!current || (owner && current.owner !== owner)) return;\n current.controller.abort(new DOMException(\"Continuous sync interrupted\", \"AbortError\"));\n current.clear();\n await current.promise;\n },\n };\n\n async function run(ctx: ExtensionContext, signal: AbortSignal, explicitRetry: boolean) {\n const validateOwner = captureMutationOwner(ctx, signal);\n try {\n while (!signal.aborted) {\n validateOwner();\n const config = await loadConfigForCheck();\n validateOwner();\n if (!continuousEnabled(config)) return;\n try {\n if (ctx.isIdle()) {\n let lease: ContinuousLease | undefined;\n let binding = \"\";\n try {\n await withStateDirectoryAccess(async () => {\n validateOwner();\n binding = await continuousBinding(config);\n validateOwner();\n lease = await acquireContinuousLease(binding);\n validateOwner();\n });\n if (lease) {\n await monitor(ctx, config, binding, lease, signal, explicitRetry);\n explicitRetry = false;\n } else setSyncStatus(ctx, \"sync waiting: another local owner\");\n } finally {\n await lease?.release();\n }\n }\n } catch (error) {\n if (signal.aborted) return;\n const failure = continuousFailure(error);\n if (!failure.retry && !(error instanceof Error && error.name === \"AbortError\")) throw error;\n setSyncStatus(ctx, `sync retry scheduled: ${failure.kind}`);\n }\n validateOwner();\n if (!continuousEnabled(await loadConfigForCheck())) return;\n validateOwner();\n await wait(clock, LOCAL_CHECK_MS, signal);\n }\n } finally {\n // Shutdown/replacement owns clearing the old UI; do not call it from a stale continuation.\n if (!signal.aborted) {\n try {\n validateOwner();\n setSyncStatus(ctx, undefined);\n } catch {\n /* stale context */\n }\n }\n }\n }\n\n async function monitor(\n ctx: ExtensionContext,\n initial: AnySyncConfig,\n binding: string,\n lease: ContinuousLease,\n parent: AbortSignal,\n explicitRetry: boolean,\n ) {\n const signal = AbortSignal.any([parent, lease.signal]);\n const validateOwner = captureMutationOwner(ctx, signal);\n let config = initial;\n let closeWatch = () => {};\n let wake = () => {};\n let dirtyAt: number | undefined;\n let cycle: AbortController | undefined;\n const changed = (settings: boolean) => {\n dirtyAt = clock.now();\n if (settings) cycle?.abort(new DOMException(\"Continuous settings changed\", \"AbortError\"));\n wake();\n };\n const validate = () => {\n validateOwner();\n lease.assert();\n if (!ctx.isIdle()) throw new DOMException(\"Owning session became busy\", \"AbortError\");\n };\n const stopWatch = () => {\n closeWatch();\n wake();\n };\n signal.addEventListener(\"abort\", stopWatch, { once: true });\n let pollDue = 0;\n try {\n closeWatch = await watchContinuous(config, changed);\n validate();\n while (!signal.aborted && ctx.isIdle()) {\n validate();\n const latest = await loadConfigForCheck();\n validate();\n if (!continuousEnabled(latest) || (await continuousBinding(latest)) !== binding) return;\n validate();\n if (syncCheckConfigFingerprint(latest) !== syncCheckConfigFingerprint(config)) {\n closeWatch();\n config = latest;\n closeWatch = await watchContinuous(config, changed);\n validate();\n pollDue = 0;\n }\n const record = await readContinuousRecord(binding);\n validate();\n const now = clock.now();\n const oldClock = JSON.stringify([record.next, record.calls]);\n normalizeContinuousClock(record, now);\n if (oldClock !== JSON.stringify([record.next, record.calls])) {\n await updateContinuousRecord(binding, lease, (current) => normalizeContinuousClock(current, now));\n validate();\n }\n const configuration = hashContinuous([{ ...config, showStatus: undefined, debug: undefined }, ctx.model]);\n const controlChanged = record.configuration !== configuration;\n if (controlChanged || explicitRetry) {\n record.next = 0;\n pollDue = 0;\n }\n const hintDue = dirtyAt === undefined ? Number.POSITIVE_INFINITY : dirtyAt + DEBOUNCE_MS;\n const due = Math.max(record.error === \"budget\" ? 0 : record.next, Math.min(pollDue, hintDue));\n if (now >= due) {\n const force = explicitRetry || controlChanged;\n explicitRetry = false;\n const expectedModel = hashContinuous(ctx.model);\n const expectedConfig = syncCheckConfigFingerprint(config);\n dirtyAt = undefined;\n cycle = new AbortController();\n const cancelDeadline = clock.schedule(30_000, () =>\n cycle?.abort(new DOMException(\"Continuous cycle timed out\", \"TimeoutError\")),\n );\n const guard = new AbortController();\n const guardSignal = AbortSignal.any([signal, cycle.signal, guard.signal]);\n const activeCycle = cycle;\n // Transfer entrypoints supply each fresh settings read. Never let a new\n // transfer adopt authorization that changed after this cycle's inspection.\n const validateCycle = (latest?: AnySyncConfig) => {\n validate();\n if (\n (latest && syncCheckConfigFingerprint(latest) !== expectedConfig) ||\n hashContinuous(ctx.model) !== expectedModel\n )\n activeCycle.abort(new DOMException(\"Continuous authorization changed\", \"AbortError\"));\n activeCycle.signal.throwIfAborted();\n };\n const guardTask = (async () => {\n while (!guardSignal.aborted) {\n await wait(clock, LOCAL_CHECK_MS, guardSignal, undefined, \"authorization\");\n if (guardSignal.aborted) return;\n try {\n validate();\n const latest = await loadConfigForCheck();\n if (guardSignal.aborted) return;\n validateCycle(latest);\n } catch {\n activeCycle.abort(new DOMException(\"Continuous authorization unavailable\", \"AbortError\"));\n }\n }\n })().catch(() => {});\n try {\n await performCycle(\n ctx,\n config,\n binding,\n lease,\n AbortSignal.any([signal, cycle.signal]),\n validateCycle,\n configuration,\n force,\n );\n } catch (error) {\n if (signal.aborted || !ctx.isIdle()) return;\n // A settings hint interrupts the old authorization; load it afresh, not as a failed transfer.\n if (cycle.signal.aborted && cycle.signal.reason?.name !== \"TimeoutError\") {\n pollDue = 0;\n continue;\n }\n const failure = continuousFailure(error);\n let announce = false;\n await updateContinuousRecord(binding, lease, (current) => {\n const now = clock.now();\n normalizeContinuousClock(current, now);\n const notice = hashContinuous([failure.kind, current.evidence, configuration]);\n announce = current.notice !== notice;\n if (!failure.retry) current.notice = notice;\n current.configuration = configuration;\n current.pending = true;\n current.error = failure.kind;\n current.phase = failure.retry ? \"retry\" : \"blocked\";\n current.failures = Math.min(30, current.failures + 1);\n const base = Math.min(300_000, 5_000 * 2 ** Math.min(6, current.failures - 1));\n const delay = Math.min(300_000, base + Math.floor(clock.random() * base * 0.2));\n current.next = now + Math.max(delay, failure.delay ?? 0);\n });\n validate();\n if (announce && !failure.retry)\n ctx.ui.notify(\n `Continuous sync blocked (${failure.kind}). Review /sync or repair the setup. Evidence was retained.`,\n \"warning\",\n );\n } finally {\n cancelDeadline();\n guard.abort();\n await guardTask;\n cycle = undefined;\n }\n pollDue = clock.now() + POLL_MS + Math.floor(clock.random() * 6_000);\n closeWatch();\n closeWatch = () => {};\n closeWatch = await watchContinuous(config, changed);\n validate();\n }\n validate();\n const state = await readContinuousRecord(binding);\n validate();\n setSyncStatus(\n ctx,\n state.phase === \"blocked\"\n ? `sync blocked: ${state.error}`\n : state.phase === \"retry\"\n ? `sync retry scheduled: ${state.error}`\n : \"sync waiting for changes\",\n );\n if (state.phase === \"retry\") pollDue = Math.min(pollDue, state.next);\n const next = Math.max(\n state.error === \"budget\" ? 0 : state.next,\n Math.min(pollDue, dirtyAt === undefined ? Number.POSITIVE_INFINITY : dirtyAt + DEBOUNCE_MS),\n );\n await wait(clock, Math.max(1, Math.min(LOCAL_CHECK_MS, next - clock.now())), signal, (callback) => {\n wake = callback;\n });\n }\n } finally {\n signal.removeEventListener(\"abort\", stopWatch);\n closeWatch();\n cycle?.abort();\n }\n }\n\n async function performCycle(\n ctx: ExtensionContext,\n config: AnySyncConfig,\n binding: string,\n lease: ContinuousLease,\n signal: AbortSignal,\n validateOwner: (config?: AnySyncConfig) => void,\n configuration: string,\n force: boolean,\n ) {\n const validate = (latest?: AnySyncConfig) => {\n signal.throwIfAborted();\n validateOwner(latest);\n };\n validate();\n const current = await readContinuousRecord(binding);\n validate();\n // A newly pending journal may prove an uncertain commit. It is never authority to republish.\n const pending = await guardedLock(\"continuous-journal\", () => readMergeJournal(config));\n validate();\n if (\n !force &&\n !pending &&\n current.phase === \"blocked\" &&\n [\"authentication\", \"storage\", \"unknown\"].includes(current.error ?? \"\")\n )\n return;\n setSyncStatus(ctx, \"sync checking\");\n const inspectionModule = await loaders.inspection();\n validate();\n const observed = await guardedLock(\"continuous-check\", async () => {\n validate();\n const inspection = await inspectionModule.inspectSync(config, snapshotOptionsForContext(ctx, config), signal);\n validate();\n let localIdentity = inspection.localIdentity;\n if (!localIdentity) {\n const snapshotModule = await loaders.snapshot();\n validate();\n const local = await snapshotModule.createSnapshot(config.snapshotIdentity, {\n ...snapshotOptionsForContext(ctx, config),\n signal,\n });\n validate();\n localIdentity = hashContinuous(fileHashMap(local));\n }\n const journal = await readMergeJournal(config);\n validate();\n return { inspection, journal, localIdentity };\n });\n validate();\n const evidence = hashContinuous([\n configuration,\n observed.localIdentity,\n observed.inspection.head?.revision,\n observed.inspection.stateIdentity,\n ]);\n const recovery = observed.journal ? hashContinuous([evidence, observed.journal]) : undefined;\n const blocked =\n !force &&\n current.evidence === evidence &&\n ((current.phase === \"blocked\" && (!recovery || recovery === current.recovery)) ||\n (current.error === \"budget\" && current.next > clock.now() && !observed.journal));\n await updateContinuousRecord(binding, lease, (record) => {\n if (record.configuration !== configuration) {\n record.failures = 0;\n record.next = 0;\n }\n record.configuration = configuration;\n record.checked = clock.now();\n record.evidence = evidence;\n if (!blocked) {\n if (record.phase !== \"blocked\") record.phase = \"syncing\";\n record.pending = true;\n if (recovery) record.recovery = recovery;\n }\n });\n validate();\n if (blocked) return;\n if (\n !observed.journal &&\n (observed.inspection.firstSync ||\n !observed.inspection.head ||\n observed.inspection.selectionState?.kind !== \"same\")\n )\n throw new ContinuousError(\"unsafe\", \"Continuous sync needs an accepted baseline and matching remote selection.\");\n let transferred = false;\n if (observed.journal || observed.inspection.localChanged || observed.inspection.remoteChanged) {\n const operations = await loaders.operations();\n validate();\n setSyncStatus(ctx, \"sync syncing\");\n const result = await withStateDirectoryAccess(() =>\n withAgentSyncLock(\n ctx,\n {\n args: [],\n yes: true,\n force: false,\n stale: false,\n silent: true,\n reload: false,\n auto: true,\n signal,\n background: {\n validate,\n reserve: (key, requestSignal) =>\n reserveContinuousRequest(binding, lease, key, () => clock.now(), requestSignal),\n },\n },\n (options) => operations.syncBoth(ctx, options),\n ),\n );\n validate();\n transferred = result === \"applied\";\n }\n const state = await guardedLock(\"continuous-result\", () => readStateForConfig(config));\n validate();\n const unresolved = state.unresolved;\n let announcePartial = false;\n await updateContinuousRecord(binding, lease, (record) => {\n record.phase = unresolved?.length ? \"blocked\" : \"waiting\";\n record.pending = Boolean(unresolved?.length);\n record.failures = 0;\n record.next = 0;\n if (unresolved?.length) {\n record.error = \"unsafe\";\n const notice = hashContinuous([\"partial\", unresolved, configuration]);\n announcePartial = record.notice !== notice;\n record.notice = notice;\n } else {\n delete record.error;\n delete record.notice;\n }\n if (transferred) record.transferred = clock.now();\n });\n validate();\n if (announcePartial)\n ctx.ui.notify(\n \"Continuous sync retained unresolved groups. Review /sync conflicts; independent partial progress was preserved.\",\n \"warning\",\n );\n }\n}\n\nfunction guardedLock<T>(command: string, run: () => Promise<T>) {\n return withStateDirectoryAccess(() => withLock(command, run));\n}\n\nfunction wait(\n clock: ContinuousClock,\n ms: number,\n signal: AbortSignal,\n expose?: (wake: () => void) => void,\n kind: \"wait\" | \"authorization\" = \"wait\",\n) {\n signal.throwIfAborted();\n return new Promise<void>((resolve) => {\n const done = () => {\n cancel();\n signal.removeEventListener(\"abort\", done);\n expose?.(() => {});\n resolve();\n };\n const cancel = clock.schedule(ms, done, kind);\n signal.addEventListener(\"abort\", done, { once: true });\n expose?.(done);\n if (signal.aborted) done();\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAyB,aAAa;AACtC,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAK5B,eAAsB,gBACpB,QACA,SACqB;AACrB,QAAM,OAAO,YAAY;AACzB,QAAM,WAAwB,CAAC;AAC/B,QAAM,WAAW,OAAO,QAAQ,IAAI,CAAC,SAAS,KAAK,QAAQ,MAAM,IAAI,CAAC;AACtE,QAAM,WAAW,CAAC,WAChB,SAAS;AAAA,IACP,CAAC,SAAS,WAAW,QAAQ,OAAO,WAAW,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,KAAK,KAAK,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,EAAE;AAAA,EAChH;AACF,QAAM,MAAM,CAAC,WAAmB,cAAuB;AACrD,QAAI;AACF,YAAM,UAAU,MAAM,WAAW,EAAE,WAAW,YAAY,MAAM,GAAG,CAAC,QAAQ,SAAS;AAEnF,YAAI,CAAC,KAAM;AACX,cAAM,SAAS,KAAK,QAAQ,WAAW,OAAO,IAAI,CAAC;AACnD,YAAI,WAAW,KAAK,KAAK,MAAM,cAAc,EAAG,SAAQ,IAAI;AAAA,iBACnD,aAAa,KAAK,SAAS,MAAM,MAAM,CAAC,EAAG;AAAA,iBAC3C,SAAS,MAAM,EAAG,SAAQ,KAAK;AAAA,MAC1C,CAAC;AACD,cAAQ,GAAG,SAAS,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ACT,UAAM,aAAa,MAAM;AACzB,QAAI,kBAAkB;AACtB,UAAM,uBAAuB,SAAS,OAAO,CAAC,WAAW;AACvD,aAAO,QAAQ,YAAY,SAAS,YAAY;AAChD,aAAO,UAAU,QAAQ,YAAY,MAAM;AAC3C,aAAO,WAAW;AAClB,aAAO,OAAO;AACd,UAAI,YAAY,QAAQ;AACtB,eAAO,QAAQ;AACf,cAAM,SAAS,eAAe,CAAC,WAAW,YAAY,aAAa,CAAC;AACpE,0BAAkB,OAAO,WAAW;AACpC,eAAO,SAAS;AAAA,MAClB,OAAO;AACL,eAAO,OAAO;AACd,eAAO,OAAO;AAAA,MAChB;AACA,UAAI,YAAa,QAAO,cAAc,MAAM,IAAI;AAAA,IAClD,CAAC;AACD,aAAS;AACT,QAAI;AACF,UAAI,GAAG;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,EACJ;AACF;AAEA,SAAS,YAAe,SAAiB,KAAuB;AAC9D,SAAO,yBAAyB,MAAM,SAAS,SAAS,GAAG,CAAC;AAC9D;AAEA,SAAS,KACP,OACA,IACA,QACA,QACA,OAAiC,QACjC;AACA,SAAO,eAAe;AACtB,SAAO,IAAI,QAAc,CAAC,YAAY;AACpC,UAAM,OAAO,MAAM;AACjB,aAAO;AACP,aAAO,oBAAoB,SAAS,IAAI;AACxC,eAAS,MAAM;AAAA,MAAC,CAAC;AACjB,cAAQ;AAAA,IACV;AACA,UAAM,SAAS,MAAM,SAAS,IAAI,MAAM,IAAI;AAC5C,WAAO,iBAAiB,SAAS,MAAM,EAAE,MAAM,KAAK,CAAC;AACrD,aAAS,IAAI;AACb,QAAI,OAAO,QAAS,MAAK;AAAA,EAC3B,CAAC;AACH;",
|
|
6
6
|
"names": ["latest", "now"]
|
|
7
7
|
}
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
validatePortableSnapshot,
|
|
10
10
|
validateSnapshotFieldPolicy
|
|
11
11
|
} from "./chunk-A6HU4ERM.ts";
|
|
12
|
-
import {
|
|
13
|
-
throwIfAborted
|
|
14
|
-
} from "./chunk-PWMWOJP4.ts";
|
|
15
12
|
import {
|
|
16
13
|
SyncBackendConflictError,
|
|
17
14
|
SyncBackendPublicationOutcomeUnknownError
|
|
18
15
|
} from "./chunk-YDVQYUHE.ts";
|
|
16
|
+
import {
|
|
17
|
+
throwIfAborted
|
|
18
|
+
} from "./chunk-PWMWOJP4.ts";
|
|
19
19
|
import {
|
|
20
20
|
portableSnapshotSelection,
|
|
21
21
|
snapshotSelectionInclude
|
|
@@ -1071,4 +1071,4 @@ export {
|
|
|
1071
1071
|
gitBackendIdentity,
|
|
1072
1072
|
isSupportedGitVersion
|
|
1073
1073
|
};
|
|
1074
|
-
//# sourceMappingURL=git-backend-
|
|
1074
|
+
//# sourceMappingURL=git-backend-NYKSG5X6.ts.map
|
package/dist/chunks/{manager-result-dispatcher-AGBBVDDS.ts → manager-result-dispatcher-HOCM2GDA.ts}
RENAMED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
dispatchManagerResult
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-P7DD5PWZ.ts";
|
|
6
|
+
import "./chunk-JCH3VXIO.ts";
|
|
7
7
|
import "./chunk-YK52VDXG.ts";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-ORGBI36T.ts";
|
|
9
9
|
import "./chunk-B4QZBDBT.ts";
|
|
10
10
|
import "./chunk-K3RIEL6J.ts";
|
|
11
11
|
import "./chunk-AMJRUXFT.ts";
|
|
@@ -21,4 +21,4 @@ import "./chunk-HUZ5CR4W.ts";
|
|
|
21
21
|
export {
|
|
22
22
|
dispatchManagerResult
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=manager-result-dispatcher-
|
|
24
|
+
//# sourceMappingURL=manager-result-dispatcher-HOCM2GDA.ts.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
-
import {
|
|
4
|
-
confirmMergeReview
|
|
5
|
-
} from "./chunk-5XZOC7FD.ts";
|
|
6
3
|
import {
|
|
7
4
|
applyS3CredentialUpdate,
|
|
8
5
|
chooseS3CredentialUpdate,
|
|
@@ -22,14 +19,15 @@ import {
|
|
|
22
19
|
showEditS3Target,
|
|
23
20
|
showEditWebDavStorageProfile,
|
|
24
21
|
showEditWebDavTarget
|
|
25
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-U3XRI2HF.ts";
|
|
26
23
|
import {
|
|
27
24
|
dispatchManagerResult
|
|
28
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-P7DD5PWZ.ts";
|
|
29
26
|
import {
|
|
30
27
|
runCancellableOperation
|
|
31
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JCH3VXIO.ts";
|
|
32
29
|
import "./chunk-YK52VDXG.ts";
|
|
30
|
+
import "./chunk-ORGBI36T.ts";
|
|
33
31
|
import {
|
|
34
32
|
SETUP_SWITCH_ACTION_OPTIONS,
|
|
35
33
|
saveOnSwitch,
|
|
@@ -37,7 +35,9 @@ import {
|
|
|
37
35
|
setupSwitchActionLabel,
|
|
38
36
|
useSyncSetup
|
|
39
37
|
} from "./chunk-GP5DU62N.ts";
|
|
40
|
-
import
|
|
38
|
+
import {
|
|
39
|
+
confirmMergeReview
|
|
40
|
+
} from "./chunk-5XZOC7FD.ts";
|
|
41
41
|
import {
|
|
42
42
|
addStorageConnection,
|
|
43
43
|
removeStorageConnection,
|
|
@@ -50,9 +50,6 @@ import {
|
|
|
50
50
|
observationSummary,
|
|
51
51
|
syncAttentionMatchesConfig
|
|
52
52
|
} from "./chunk-GSNPASKB.ts";
|
|
53
|
-
import {
|
|
54
|
-
captureMutationOwner
|
|
55
|
-
} from "./chunk-UOHR7LRO.ts";
|
|
56
53
|
import {
|
|
57
54
|
automaticSyncSummary
|
|
58
55
|
} from "./chunk-ECYCNZOE.ts";
|
|
@@ -64,6 +61,9 @@ import {
|
|
|
64
61
|
STARTUP_TRANSFER_DESCRIPTION,
|
|
65
62
|
startupTransferSummary
|
|
66
63
|
} from "./chunk-NLWS55B6.ts";
|
|
64
|
+
import {
|
|
65
|
+
captureMutationOwner
|
|
66
|
+
} from "./chunk-UOHR7LRO.ts";
|
|
67
67
|
import {
|
|
68
68
|
safeTerminalText
|
|
69
69
|
} from "./chunk-AMJRUXFT.ts";
|
|
@@ -184,7 +184,7 @@ function blockedSyncMenuItem(label, manager) {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
async function showManagerAttention(ctx, attention, runRoute, signal, onSelectionResolved) {
|
|
187
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
187
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-YFPGYGNE.ts");
|
|
188
188
|
if (signal?.aborted) return "close";
|
|
189
189
|
const review = await showRemoteSelectionReview(ctx, attention.decision.setupName, signal, void 0, {
|
|
190
190
|
decision: attention.decision,
|
|
@@ -529,6 +529,7 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
|
|
|
529
529
|
const lastAppliedSnapshot = changesBlocked ? "Unavailable while operations are locked" : syncState?.lastAppliedSnapshot ? `${truncateToWidth(safeTerminalText(syncState.lastAppliedSnapshot), 20, "\u2026")} (application time unavailable; full ID in History)` : syncState ? "Never synced" : "Unavailable";
|
|
530
530
|
const canSwitch = await countValidSyncSetups(configuredTargets, signal) > 1;
|
|
531
531
|
const mainActions = [...MAIN_MENU_ACTIONS];
|
|
532
|
+
if (config.agentMode && !noSyncedContent) mainActions.splice(1, 0, "Retry refused model result\u2026");
|
|
532
533
|
if (canSwitch) mainActions.push("Switch sync setup");
|
|
533
534
|
if (syncState?.unresolved?.length) mainActions.unshift("Review unresolved conflicts");
|
|
534
535
|
const ordinaryTitle = [
|
|
@@ -553,7 +554,7 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
|
|
|
553
554
|
`Automatic sync: ${automaticSyncSummary(config.automatic)}`,
|
|
554
555
|
`Startup transfer: ${startupTransferSummary(config)}`,
|
|
555
556
|
`Agent mode: ${config.agentMode ? "On (experimental; autonomous merged sync)" : "Off"}`,
|
|
556
|
-
...config.continuous ? await (await import("./continuous-record-
|
|
557
|
+
...config.continuous ? await (await import("./continuous-record-SQJ47CXN.ts")).continuousStatusLines(config) : [],
|
|
557
558
|
`Last applied: ${lastAppliedSnapshot}`,
|
|
558
559
|
...noSyncedContent ? ["", "No included content is selected. Choose included content in Settings before syncing."] : [],
|
|
559
560
|
"",
|
|
@@ -1796,7 +1797,7 @@ async function showSyncSettings(ctx, runRoute, signal) {
|
|
|
1796
1797
|
},
|
|
1797
1798
|
"remote-include": async ({ signal: actionSignal }) => {
|
|
1798
1799
|
const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
1799
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
1800
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-YFPGYGNE.ts");
|
|
1800
1801
|
if (reviewSignal.aborted) return { kind: "rejected" };
|
|
1801
1802
|
const review = await showRemoteSelectionReview(ctx, setupName, reviewSignal, void 0, {
|
|
1802
1803
|
origin: "settings",
|
|
@@ -1891,7 +1892,7 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
|
|
|
1891
1892
|
if (!attention) {
|
|
1892
1893
|
const observation = options.getObservation?.();
|
|
1893
1894
|
if (!observation) return { kind: "stay" };
|
|
1894
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
1895
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-YFPGYGNE.ts");
|
|
1895
1896
|
if (sessionSignal?.aborted) return { kind: "close" };
|
|
1896
1897
|
const config = await loadConfig();
|
|
1897
1898
|
if (sessionSignal?.aborted) return { kind: "close" };
|
|
@@ -1939,6 +1940,26 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
|
|
|
1939
1940
|
const disposition = await dispatchManagerResult(ctx, result, "sync", runRoute, sessionSignal);
|
|
1940
1941
|
return disposition.kind === "close" ? { kind: "close" } : { kind: "stay" };
|
|
1941
1942
|
},
|
|
1943
|
+
"retry-refusal": async ({ signal: actionSignal }) => {
|
|
1944
|
+
const signal = sessionSignal ? AbortSignal.any([sessionSignal, actionSignal]) : actionSignal;
|
|
1945
|
+
const validate = captureMutationOwner(ctx, signal);
|
|
1946
|
+
validate();
|
|
1947
|
+
const retryRoute = (route, operationSignal, onCommit, target, onDialog) => runRoute(route, operationSignal, onCommit, target, onDialog, true);
|
|
1948
|
+
const result = await runCancellableOperation(ctx, "Checking cached refusal\u2026", "sync", retryRoute, {
|
|
1949
|
+
commitAware: true,
|
|
1950
|
+
cancelAcrossDialogs: true,
|
|
1951
|
+
signal,
|
|
1952
|
+
cancelledMessage: "Model retry cancelled. Submitted requests and committed writes cannot be undone."
|
|
1953
|
+
});
|
|
1954
|
+
if (signal.aborted) return { kind: "close" };
|
|
1955
|
+
validate();
|
|
1956
|
+
if (result.kind === "decision-required" || result.kind === "remote-selection-required")
|
|
1957
|
+
ctx.ui.notify(
|
|
1958
|
+
"Model retry needs an established source and matching synced content. Use Sync now to review changed selection or recovery before retrying.",
|
|
1959
|
+
"warning"
|
|
1960
|
+
);
|
|
1961
|
+
return { kind: result.kind === "closed" ? "close" : "stay" };
|
|
1962
|
+
},
|
|
1942
1963
|
switch: async () => {
|
|
1943
1964
|
const result = await showSetupSwitcher(ctx, runRoute, void 0, sessionSignal);
|
|
1944
1965
|
return result === "pull-attempted" || result === "closed" ? { kind: "close" } : { kind: "stay" };
|
|
@@ -2044,7 +2065,22 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
|
|
|
2044
2065
|
}
|
|
2045
2066
|
}
|
|
2046
2067
|
});
|
|
2047
|
-
|
|
2068
|
+
const menuContext = {
|
|
2069
|
+
...ctx,
|
|
2070
|
+
ui: {
|
|
2071
|
+
...ctx.ui,
|
|
2072
|
+
custom: (factory, customOptions) => ctx.ui.custom((...args) => {
|
|
2073
|
+
const bound = (component2) => {
|
|
2074
|
+
const render = component2.render.bind(component2);
|
|
2075
|
+
component2.render = (width) => width <= 0 ? [] : render(width);
|
|
2076
|
+
return component2;
|
|
2077
|
+
};
|
|
2078
|
+
const component = factory(...args);
|
|
2079
|
+
return component instanceof Promise ? component.then(bound) : bound(component);
|
|
2080
|
+
}, customOptions)
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2083
|
+
await runMenu5(menuContext, menu, {
|
|
2048
2084
|
getState: async () => {
|
|
2049
2085
|
const pendingAttention = options.getAttention?.();
|
|
2050
2086
|
const observation = options.getObservation?.();
|
|
@@ -2065,6 +2101,7 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
|
|
|
2065
2101
|
function syncMainMenuItem(label) {
|
|
2066
2102
|
const actions = {
|
|
2067
2103
|
"Sync now": "sync",
|
|
2104
|
+
"Retry refused model result\u2026": "retry-refusal",
|
|
2068
2105
|
"Pull from remote\u2026": "pull",
|
|
2069
2106
|
"Push to remote\u2026": "push",
|
|
2070
2107
|
"View differences": "diff",
|
|
@@ -2088,10 +2125,10 @@ function syncMainMenuItem(label) {
|
|
|
2088
2125
|
id: action,
|
|
2089
2126
|
label,
|
|
2090
2127
|
action,
|
|
2091
|
-
description: action === "doctor" ? "Manage: review backend checks before running." : action === "settings" || action === "history" || action === "switch" ? "Manage" : action === "sync" ? "Transfer: choose a safe direction or review conflicts." : action === "pull" ? "Transfer: remote \u2192 local; review writes and removals." : action === "push" ? "Transfer: local \u2192 remote active snapshot; review publication." : action === "status" || action === "diff" ? "Inspect: read current local and remote state without transferring files." : void 0
|
|
2128
|
+
description: action === "retry-refusal" ? "Transfer: confirm one fresh model request for a current cached refusal; may incur costs." : action === "doctor" ? "Manage: review backend checks before running." : action === "settings" || action === "history" || action === "switch" ? "Manage" : action === "sync" ? "Transfer: choose a safe direction or review conflicts." : action === "pull" ? "Transfer: remote \u2192 local; review writes and removals." : action === "push" ? "Transfer: local \u2192 remote active snapshot; review publication." : action === "status" || action === "diff" ? "Inspect: read current local and remote state without transferring files." : void 0
|
|
2092
2129
|
};
|
|
2093
2130
|
}
|
|
2094
2131
|
export {
|
|
2095
2132
|
showSyncManager
|
|
2096
2133
|
};
|
|
2097
|
-
//# sourceMappingURL=manager-ui-
|
|
2134
|
+
//# sourceMappingURL=manager-ui-FXXO6TW4.ts.map
|