agentxchain 2.145.0 → 2.147.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/dashboard/app.js +3 -0
- package/dashboard/components/notifications.js +127 -0
- package/dashboard/index.html +1 -0
- package/package.json +1 -1
- package/scripts/publish-npm.sh +16 -0
- package/scripts/release-downstream-truth.sh +16 -8
- package/scripts/sync-homebrew.sh +14 -1
- package/scripts/verify-post-publish.sh +55 -4
- package/src/commands/init.js +66 -31
- package/src/commands/reissue-turn.js +16 -0
- package/src/commands/reject-turn.js +14 -1
- package/src/commands/restart.js +33 -3
- package/src/commands/resume.js +78 -66
- package/src/commands/run.js +67 -10
- package/src/commands/schedule.js +34 -7
- package/src/commands/status.js +38 -5
- package/src/commands/step.js +117 -34
- package/src/lib/adapters/api-proxy-adapter.js +8 -0
- package/src/lib/adapters/local-cli-adapter.js +131 -13
- package/src/lib/adapters/manual-adapter.js +9 -10
- package/src/lib/adapters/mcp-adapter.js +3 -5
- package/src/lib/adapters/remote-agent-adapter.js +3 -5
- package/src/lib/config.js +4 -1
- package/src/lib/continuous-run.js +71 -6
- package/src/lib/dashboard/actions.js +9 -3
- package/src/lib/dashboard/bridge-server.js +11 -0
- package/src/lib/dashboard/notifications-reader.js +91 -0
- package/src/lib/dashboard/state-reader.js +16 -4
- package/src/lib/dispatch-bundle.js +1 -1
- package/src/lib/dispatch-progress.js +5 -3
- package/src/lib/governed-state.js +355 -13
- package/src/lib/intake.js +10 -1
- package/src/lib/normalized-config.js +51 -1
- package/src/lib/recent-event-summary.js +12 -0
- package/src/lib/run-events.js +4 -0
- package/src/lib/run-loop.js +67 -2
- package/src/lib/runner-interface.js +1 -0
- package/src/lib/schema.js +7 -0
- package/src/lib/schemas/agentxchain-config.schema.json +15 -1
- package/src/lib/staged-result-proof.js +43 -0
- package/src/lib/stale-turn-watchdog.js +308 -34
- package/src/lib/turn-result-shape.js +38 -0
- package/src/lib/turn-result-validator.js +4 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight staged turn-result shape guard.
|
|
3
|
+
*
|
|
4
|
+
* This is intentionally weaker than full acceptance validation. It exists for
|
|
5
|
+
* adapter pre-stage checks so obviously incomplete payloads (`{}`,
|
|
6
|
+
* `{"turn_id":"t1"}`, etc.) are rejected before they can be written into the
|
|
7
|
+
* governed staging path and mistaken for meaningful execution output.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
function isNonEmptyString(value) {
|
|
11
|
+
return typeof value === 'string' && value.trim() !== '';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns true when `value` has the minimum governed turn-result envelope:
|
|
16
|
+
* - `schema_version`
|
|
17
|
+
* - at least one identity field (`run_id` or `turn_id`)
|
|
18
|
+
* - at least one lifecycle field (`status`, `role`, or `runtime_id`)
|
|
19
|
+
*
|
|
20
|
+
* Full schema validation still happens later via `validateStagedTurnResult`.
|
|
21
|
+
*
|
|
22
|
+
* @param {unknown} value
|
|
23
|
+
* @returns {boolean}
|
|
24
|
+
*/
|
|
25
|
+
export function hasMinimumTurnResultShape(value) {
|
|
26
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const candidate = /** @type {Record<string, unknown>} */ (value);
|
|
31
|
+
const hasSchemaVersion = isNonEmptyString(candidate.schema_version);
|
|
32
|
+
const hasIdentity = isNonEmptyString(candidate.run_id) || isNonEmptyString(candidate.turn_id);
|
|
33
|
+
const hasLifecycle = isNonEmptyString(candidate.status)
|
|
34
|
+
|| isNonEmptyString(candidate.role)
|
|
35
|
+
|| isNonEmptyString(candidate.runtime_id);
|
|
36
|
+
|
|
37
|
+
return hasSchemaVersion && hasIdentity && hasLifecycle;
|
|
38
|
+
}
|
|
@@ -75,7 +75,10 @@ export function validateStagedTurnResult(root, state, config, opts = {}) {
|
|
|
75
75
|
const normContext = {};
|
|
76
76
|
if (state) {
|
|
77
77
|
normContext.phase = state.phase;
|
|
78
|
-
//
|
|
78
|
+
// Prefer active_turns (the persisted schema field); fall back to the
|
|
79
|
+
// current_turn compatibility alias for callers that pass a state shape
|
|
80
|
+
// built outside loadProjectState() (e.g. raw fixtures). Both surfaces are
|
|
81
|
+
// live per DEC-CURRENT-TURN-COMPAT-ALIAS-001 — current_turn is not legacy.
|
|
79
82
|
const activeTurn = getActiveTurn(state) || state.current_turn;
|
|
80
83
|
if (activeTurn) {
|
|
81
84
|
const roleKey = activeTurn.assigned_role || activeTurn.role;
|