@abelxiaoxing/cadence 2.0.33 → 2.0.34
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/docs/conversation-mode.md +8 -4
- package/docs/history.md +7 -3
- package/docs/service-management.md +23 -9
- package/package.json +2 -1
- package/src/cadence-mode.ts +70 -35
- package/src/conversation-identity.ts +7 -0
- package/src/native-build.ts +1 -1
- package/src/sdk-worker.mjs +33 -1
- package/src/service/contracts/models.ts +50 -0
- package/src/service/contracts/workbench.ts +142 -58
- package/src/service/contracts/workflow.ts +16 -1
- package/src/service-cli.mjs +19 -5
- package/src/service-client.ts +55 -9
- package/src/service-host.mjs +23070 -22508
- package/src/session-entries.mjs +3 -0
- package/src/worker-public.mjs +2 -0
- package/src/workspace.ts +16 -0
- package/web/dist/assets/cadence.js +16 -16
- package/web/dist/manifest.json +5 -5
package/src/session-entries.mjs
CHANGED
|
@@ -5,3 +5,6 @@
|
|
|
5
5
|
export const CADENCE_MODE_ENTRY = "cadence-conversation-mode/1";
|
|
6
6
|
/** Marks a session the browser created; Pi ignores it in the model context. */
|
|
7
7
|
export const WEBUI_SESSION_ENTRY = "cadence-webui/1";
|
|
8
|
+
|
|
9
|
+
/** Browser command/user identity and finalized message boundary, not model context. */
|
|
10
|
+
export const BROWSER_COMMAND_ENTRY = "cadence-browser-command/1";
|
package/src/worker-public.mjs
CHANGED
|
@@ -93,6 +93,7 @@ export const ERROR_CODES = [
|
|
|
93
93
|
"expired-grant",
|
|
94
94
|
"consumed-grant",
|
|
95
95
|
"unsupported-context",
|
|
96
|
+
"retired-conversation",
|
|
96
97
|
"quarantine",
|
|
97
98
|
"capacity",
|
|
98
99
|
"unavailable",
|
|
@@ -138,6 +139,7 @@ export function errorStatus(code) {
|
|
|
138
139
|
case "expired-grant":
|
|
139
140
|
return 410;
|
|
140
141
|
case "unsupported-context":
|
|
142
|
+
case "retired-conversation":
|
|
141
143
|
return 422;
|
|
142
144
|
case "quarantine":
|
|
143
145
|
return 423;
|
package/src/workspace.ts
CHANGED
|
@@ -212,6 +212,22 @@ export function resolveWorkspace(cwd: string): { root: string; cwd: string } {
|
|
|
212
212
|
throw new Error("Git workspace lookup refused");
|
|
213
213
|
return { root: actual, cwd: actual };
|
|
214
214
|
}
|
|
215
|
+
/** Lexical membership only: retained contexts can outlive their directory. */
|
|
216
|
+
export function withinWorkspace(root: string, cwd: string): boolean {
|
|
217
|
+
const path = relative(root, cwd);
|
|
218
|
+
return !isAbsolute(path) && path !== ".." && !path.startsWith(`..${sep}`);
|
|
219
|
+
}
|
|
220
|
+
/** The owner is the checkout, not a saved conversation/default directory. A
|
|
221
|
+
* provably removed default may remain metadata while other directories work.
|
|
222
|
+
* Unreadable or foreign defaults are not classified as absent. */
|
|
223
|
+
export function ownerDefaultInCheckout(root: string, cwd: string): boolean {
|
|
224
|
+
try {
|
|
225
|
+
return resolveWorkspace(cwd).root === root;
|
|
226
|
+
} catch (error) {
|
|
227
|
+
if (!absent(error)) throw error;
|
|
228
|
+
return withinWorkspace(root, canonicalAmbientRoot(cwd));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
215
231
|
export function defaultStateHome(): string {
|
|
216
232
|
const candidate =
|
|
217
233
|
process.platform === "win32"
|