gestalt-mobile 0.62.1 → 0.62.3
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 +16 -2
- package/dist/server/server/composition.contracts.js +265 -3
- package/dist/server/server/composition.js +98 -0
- package/dist/server/server/features/agent-activity/registry.js +6 -2
- package/dist/server/server/features/autopilot/application/policy.js +3 -2
- package/dist/server/server/features/autopilot/application/service.js +14 -2
- package/dist/server/server/features/autopilot/application/takeover-supervision.js +206 -0
- package/dist/server/server/features/autopilot/domain/autopilot-session.js +5 -5
- package/dist/server/server/features/autopilot/domain/supervised-lifecycle.js +5 -1
- package/dist/server/server/features/sessions/application/writer-acquisition.js +7 -0
- package/dist/server/server/platform/codex/codex-capabilities.js +1 -1
- package/dist/server/server/platform/codex/session-runtime.js +132 -0
- package/dist/server/server/platform/persistence/migrate.js +2 -0
- package/dist/server/server/platform/persistence/sqlite-supervision-takeover-store.js +122 -0
- package/dist/server/server/platform/retrieval/codex-xerj.js +13 -4
- package/dist/server/server/platform/retrieval/xerj-index-diagnostic.js +41 -0
- package/dist/server/server/platform/retrieval/xerj-indexer.js +34 -4
- package/dist/server/shared/contracts/org-plan-takeover.js +32 -0
- package/gestalt-supervision-capabilities.json +1 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import { homedir } from 'node:os';
|
|
|
11
11
|
import { checkXerjIndexConfig, saveXerjIndexConfig, xerjContentArguments, xerjIndexConfig, } from './xerj-index-config.js';
|
|
12
12
|
import { xerjDeadline } from './managed-xerj.js';
|
|
13
13
|
import { ReadinessEvidence } from './readiness-evidence.js';
|
|
14
|
+
import { saveXerjIndexDiagnostic, xerjIndexDiagnostic } from './xerj-index-diagnostic.js';
|
|
14
15
|
// Native gitignore syntax, editable by the host operator. Hidden directories and
|
|
15
16
|
// symlinks are already skipped by XERJ. Never replace an existing root policy.
|
|
16
17
|
export const xerjDefaultIgnores = `# Gestalt source discovery. Edit these native XERJ rules to change scope.
|
|
@@ -65,6 +66,9 @@ export class XerjIndexer {
|
|
|
65
66
|
closed = false;
|
|
66
67
|
saveConfiguration;
|
|
67
68
|
configurationSaved;
|
|
69
|
+
diagnosticDirectory;
|
|
70
|
+
pendingDiagnostic;
|
|
71
|
+
diagnosticSaved;
|
|
68
72
|
constructor(root, mode, capability, environment = process.env, report = console.warn) {
|
|
69
73
|
this.capability = capability;
|
|
70
74
|
this.environment = environment;
|
|
@@ -119,6 +123,7 @@ export class XerjIndexer {
|
|
|
119
123
|
}
|
|
120
124
|
const directory = join(this.environment.CODEX_HOME ?? join(homedir(), '.codex-gestalt'), 'xerj-data', 'autoindex', namespace);
|
|
121
125
|
const config = xerjIndexConfig(root, namespace, ready.endpoint);
|
|
126
|
+
this.diagnosticDirectory = directory;
|
|
122
127
|
const compatibility = await checkXerjIndexConfig(directory, config);
|
|
123
128
|
if (this.closed)
|
|
124
129
|
return;
|
|
@@ -239,22 +244,47 @@ export class XerjIndexer {
|
|
|
239
244
|
});
|
|
240
245
|
}
|
|
241
246
|
else if (event.event === 'warning') {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
247
|
+
const diagnostic = xerjIndexDiagnostic(event.message);
|
|
248
|
+
this.value = { ...this.value, diagnostic };
|
|
249
|
+
this.pendingDiagnostic = diagnostic;
|
|
250
|
+
this.diagnosticSaved ??= this.saveDiagnostics();
|
|
251
|
+
const reference = ` Diagnostic: ${diagnostic.id} (${diagnostic.code}).`;
|
|
252
|
+
if (diagnostic.code === 'ambiguous-assignment') {
|
|
253
|
+
this.fail('XERJ incremental dataset assignment failed; the index is stale. See the XERJ recovery guide for this upstream limitation.' +
|
|
254
|
+
reference);
|
|
245
255
|
return;
|
|
246
256
|
}
|
|
247
|
-
this.fail('XERJ reported an indexing warning. Inspect the index with gestalt xerj autoindex status; source changes trigger another pass.'
|
|
257
|
+
this.fail('XERJ reported an indexing warning. Inspect the index with gestalt xerj autoindex status; source changes trigger another pass.' +
|
|
258
|
+
reference);
|
|
248
259
|
}
|
|
249
260
|
}
|
|
250
261
|
catch {
|
|
251
262
|
/* Native diagnostics are not public status or application logs. */
|
|
252
263
|
}
|
|
253
264
|
}
|
|
265
|
+
async saveDiagnostics() {
|
|
266
|
+
try {
|
|
267
|
+
// Coalesce bursts to the latest warning instead of queuing unbounded writes.
|
|
268
|
+
while (this.pendingDiagnostic && this.diagnosticDirectory) {
|
|
269
|
+
const diagnostic = this.pendingDiagnostic;
|
|
270
|
+
this.pendingDiagnostic = undefined;
|
|
271
|
+
try {
|
|
272
|
+
await saveXerjIndexDiagnostic(this.diagnosticDirectory, diagnostic);
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
this.report('XERJ could not save its redacted indexing diagnostic.');
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
finally {
|
|
280
|
+
this.diagnosticSaved = undefined;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
254
283
|
async close() {
|
|
255
284
|
this.closed = true;
|
|
256
285
|
await this.task;
|
|
257
286
|
await this.configurationSaved;
|
|
287
|
+
await this.diagnosticSaved;
|
|
258
288
|
const child = this.child;
|
|
259
289
|
if (child && child.exitCode === null && child.signalCode === null) {
|
|
260
290
|
await new Promise((resolve) => {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2026 Dyne.org foundation
|
|
3
|
+
* Designed by Denis Roio <jaromil@dyne.org>
|
|
4
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
|
+
*/
|
|
6
|
+
export const gestaltOrgPlanTakeoverDynamicTool = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
name: 'gestalt_org_plan_takeover',
|
|
9
|
+
description: 'Take over the current unfinished Org Plan in this new supervisor session when the user explicitly instructed you to take over or continue it here. That instruction supplies authorization; do not ask for another approval or declare a permission blocker. Mobile fences previous supervisors, confirms their writers stopped, preserves checkpoint history, and returns the exact replacement executor identity for this root. Retries return the same pending identity, never a new generation: if that task name already exists in this root, resume it instead of spawning it again. Do not follow up or interrupt an executor belonging to another root. Does not waive review, model-policy, or pending-interaction gates. On failure, report the returned specific recovery code; never launch a competing writer.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
additionalProperties: false,
|
|
13
|
+
required: ['version', 'reason'],
|
|
14
|
+
properties: {
|
|
15
|
+
version: { const: 1 },
|
|
16
|
+
reason: { const: 'userDirectedTakeover' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export function isOrgPlanTakeoverCall(input) {
|
|
21
|
+
if (input.method !== 'item/tool/call' || !record(input.params))
|
|
22
|
+
return false;
|
|
23
|
+
const args = input.params.arguments;
|
|
24
|
+
return (input.params.tool === gestaltOrgPlanTakeoverDynamicTool.name &&
|
|
25
|
+
record(args) &&
|
|
26
|
+
Object.keys(args).length === 2 &&
|
|
27
|
+
args.version === 1 &&
|
|
28
|
+
args.reason === 'userDirectedTakeover');
|
|
29
|
+
}
|
|
30
|
+
function record(value) {
|
|
31
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
32
|
+
}
|