@piagent/platform 1.3.1 → 1.4.1
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 +132 -0
- package/README.md +10 -4
- package/README.vi.md +27 -0
- package/architecture/layers.json +96 -1
- package/docs/README.md +1 -0
- package/docs/architecture.md +1 -0
- package/docs/authority-manifest.md +1 -0
- package/docs/auto-delegation-policy.md +1 -0
- package/docs/capability-packs.md +1 -0
- package/docs/command-reference-vietnamese.md +5 -4
- package/docs/context-engine.md +1 -0
- package/docs/context-window-policy.md +1 -0
- package/docs/distribution-standard.md +8 -7
- package/docs/en/architecture.md +13 -0
- package/docs/herdr-workflow.md +1 -0
- package/docs/languages.json +20 -4
- package/docs/mcp-and-tools.md +125 -9
- package/docs/memory-policy.md +1 -0
- package/docs/model-options.md +1 -0
- package/docs/oauth-providers.md +1 -0
- package/docs/operator-manual-vietnamese.md +15 -12
- package/docs/package-architecture-notes.md +1 -0
- package/docs/project-adapters.md +1 -0
- package/docs/project-onboarding.md +1 -0
- package/docs/publishing-for-teams.md +37 -0
- package/docs/quality-benchmark.md +1 -0
- package/docs/quickstart-vietnamese.md +3 -2
- package/docs/release-install-policy.md +22 -8
- package/docs/runtime-harness-standard.md +2 -1
- package/docs/runtime-policy-design.md +1 -0
- package/docs/runtime-quality-baseline.md +1 -0
- package/docs/security-redaction-benchmark.md +1 -0
- package/docs/security-threat-model.md +2 -1
- package/docs/subagent-orchestration-capabilities.md +1 -0
- package/docs/subagents-and-multiagent.md +1 -0
- package/docs/task-implementation-contract.md +12 -4
- package/docs/task-lifecycle-vietnamese.md +1 -0
- package/docs/team-onboarding.md +3 -2
- package/docs/third-party-neutrality.md +26 -0
- package/docs/usage-observability.md +71 -0
- package/docs/vercel-docs-site.md +1 -0
- package/docs/vi/architecture.md +13 -0
- package/docs/workflow-recipes.md +1 -0
- package/docs-site/architecture.html +5 -1
- package/docs-site/benchmark.html +5 -1
- package/docs-site/commands.html +5 -1
- package/docs-site/content/en/index.html +49 -0
- package/docs-site/content/en/runtime.html +13 -0
- package/docs-site/content/index.html +49 -0
- package/docs-site/content/runtime.html +28 -0
- package/docs-site/context-engine.html +5 -1
- package/docs-site/en/architecture.html +5 -1
- package/docs-site/en/benchmark.html +5 -1
- package/docs-site/en/commands.html +5 -1
- package/docs-site/en/context-engine.html +5 -1
- package/docs-site/en/index.html +54 -1
- package/docs-site/en/mcp-approval.html +5 -1
- package/docs-site/en/mcp-auth.html +5 -1
- package/docs-site/en/mcp-servers.html +5 -1
- package/docs-site/en/mcp.html +5 -1
- package/docs-site/en/permissions.html +5 -1
- package/docs-site/en/profiles.html +5 -1
- package/docs-site/en/quickstart.html +5 -1
- package/docs-site/en/runtime.html +18 -1
- package/docs-site/en/scope.html +5 -1
- package/docs-site/en/security.html +5 -1
- package/docs-site/en/team.html +5 -1
- package/docs-site/en/whats-new.html +5 -1
- package/docs-site/en/workflows.html +5 -1
- package/docs-site/index.html +54 -1
- package/docs-site/mcp-approval.html +5 -1
- package/docs-site/mcp-auth.html +5 -1
- package/docs-site/mcp-servers.html +5 -1
- package/docs-site/mcp.html +5 -1
- package/docs-site/permissions.html +5 -1
- package/docs-site/profiles.html +5 -1
- package/docs-site/quickstart.html +5 -1
- package/docs-site/runtime.html +33 -1
- package/docs-site/scope.html +5 -1
- package/docs-site/security.html +5 -1
- package/docs-site/team.html +5 -1
- package/docs-site/whats-new.html +5 -1
- package/docs-site/workflows.html +5 -1
- package/evals/fixtures/mutation-provenance-record.invalid.json +17 -0
- package/evals/fixtures/mutation-provenance-record.valid.json +27 -0
- package/evals/fixtures/piagent-webui/approval-v1.invalid.json +54 -0
- package/evals/fixtures/piagent-webui/approval-v1.valid.json +58 -0
- package/evals/fixtures/piagent-webui/attachment-v1.invalid.json +25 -0
- package/evals/fixtures/piagent-webui/attachment-v1.valid.json +25 -0
- package/evals/fixtures/piagent-webui/capabilities-v1.invalid.json +51 -0
- package/evals/fixtures/piagent-webui/capabilities-v1.valid.json +122 -0
- package/evals/fixtures/piagent-webui/commit-summary-v1.invalid.json +10 -0
- package/evals/fixtures/piagent-webui/commit-summary-v1.valid.json +25 -0
- package/evals/fixtures/piagent-webui/control-command-v1.invalid.json +37 -0
- package/evals/fixtures/piagent-webui/control-command-v1.valid.json +35 -0
- package/evals/fixtures/piagent-webui/diff-v1.invalid.json +13 -0
- package/evals/fixtures/piagent-webui/diff-v1.valid.json +141 -0
- package/evals/fixtures/piagent-webui/gateway-capabilities-v1.invalid.json +35 -0
- package/evals/fixtures/piagent-webui/gateway-capabilities-v1.valid.json +35 -0
- package/evals/fixtures/piagent-webui/gateway-protocol-v1.invalid.json +14 -0
- package/evals/fixtures/piagent-webui/gateway-protocol-v1.valid.json +14 -0
- package/evals/fixtures/piagent-webui/handoff-history-v1.invalid.json +16 -0
- package/evals/fixtures/piagent-webui/handoff-history-v1.valid.json +16 -0
- package/evals/fixtures/piagent-webui/model-catalog-v1.invalid.json +31 -0
- package/evals/fixtures/piagent-webui/model-catalog-v1.valid.json +43 -0
- package/evals/fixtures/piagent-webui/queue-v1.invalid.json +29 -0
- package/evals/fixtures/piagent-webui/queue-v1.valid.json +44 -0
- package/evals/fixtures/piagent-webui/recovery-history-v1.invalid.json +17 -0
- package/evals/fixtures/piagent-webui/recovery-history-v1.valid.json +20 -0
- package/evals/fixtures/piagent-webui/release-monitor-v1.invalid.json +12 -0
- package/evals/fixtures/piagent-webui/release-monitor-v1.valid.json +29 -0
- package/evals/fixtures/piagent-webui/review-state-v1.invalid.json +25 -0
- package/evals/fixtures/piagent-webui/review-state-v1.valid.json +38 -0
- package/evals/fixtures/piagent-webui/runtime-event-v2.invalid.json +49 -0
- package/evals/fixtures/piagent-webui/runtime-event-v2.valid.json +49 -0
- package/evals/fixtures/piagent-webui/session-catalog-v1.invalid.json +17 -0
- package/evals/fixtures/piagent-webui/session-catalog-v1.valid.json +58 -0
- package/evals/fixtures/piagent-webui/session-command-v1.invalid.json +19 -0
- package/evals/fixtures/piagent-webui/session-command-v1.valid.json +19 -0
- package/evals/fixtures/piagent-webui/snapshot-v1.invalid.json +5 -0
- package/evals/fixtures/piagent-webui/snapshot-v1.valid.json +191 -0
- package/evals/fixtures/piagent-webui/source-change-v1.invalid.json +57 -0
- package/evals/fixtures/piagent-webui/source-change-v1.valid.json +98 -0
- package/evals/fixtures/piagent-webui/source-mutation-v1.invalid.json +19 -0
- package/evals/fixtures/piagent-webui/source-mutation-v1.valid.json +38 -0
- package/evals/fixtures/piagent-webui/source-revert-v1.invalid.json +20 -0
- package/evals/fixtures/piagent-webui/source-revert-v1.valid.json +62 -0
- package/evals/fixtures/piagent-webui/subagent-tree-v1.invalid.json +26 -0
- package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +39 -0
- package/evals/fixtures/piagent-webui/task-index-v1.invalid.json +15 -0
- package/evals/fixtures/piagent-webui/task-index-v1.valid.json +15 -0
- package/evals/fixtures/piagent-webui/task-timeline-v1.invalid.json +14 -0
- package/evals/fixtures/piagent-webui/task-timeline-v1.valid.json +16 -0
- package/evals/fixtures/piagent-webui/transcript-v1.invalid.json +35 -0
- package/evals/fixtures/piagent-webui/transcript-v1.valid.json +55 -0
- package/evals/fixtures/task-baseline-manifest.invalid.json +16 -0
- package/evals/fixtures/task-baseline-manifest.valid.json +41 -0
- package/evals/fixtures/verifier-file-snapshot.invalid.json +21 -0
- package/evals/fixtures/verifier-file-snapshot.valid.json +21 -0
- package/package.json +43 -4
- package/packages/piagent-core/README.md +3 -2
- package/packages/piagent-core/benchmark/benchmark-candidate.d.ts +1 -0
- package/packages/piagent-core/benchmark/benchmark-forensics.d.ts +1 -0
- package/packages/piagent-core/benchmark/benchmark-ledger.d.ts +4 -0
- package/packages/piagent-core/benchmark/benchmark-record-validation.d.ts +1 -0
- package/packages/piagent-core/benchmark/benchmark-runtime.d.ts +1 -0
- package/packages/piagent-core/capabilities/capability-core.js +2 -2
- package/packages/piagent-core/capabilities/capability-verification-cache.js +17 -7
- package/packages/piagent-core/capabilities/runtime-integrity.js +190 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +80 -272
- package/packages/piagent-core/extensions/redaction-core.d.ts +2 -0
- package/packages/piagent-core/extensions/runtime-evidence.js +12 -1
- package/packages/piagent-core/extensions/shell-reach.ts +250 -0
- package/packages/piagent-core/extensions/task-journal.js +30 -1
- package/packages/piagent-core/extensions/task-state.js +33 -36
- package/packages/piagent-core/mcp/mcp-command-actions.js +1 -1
- package/packages/piagent-core/mcp/mcp-server-catalog.js +139 -9
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -2
- package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +12 -2
- package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +20 -19
- package/packages/piagent-core/runtime/hooks/tool-result-metadata.ts +13 -0
- package/packages/piagent-core/runtime/input/chat-images.ts +2 -2
- package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +94 -0
- package/packages/piagent-core/runtime/inspection/approval-broker.ts +318 -0
- package/packages/piagent-core/runtime/inspection/commit-summary-projection.ts +59 -0
- package/packages/piagent-core/runtime/inspection/context-telemetry-inspection.ts +37 -0
- package/packages/piagent-core/runtime/inspection/criteria-links.ts +295 -0
- package/packages/piagent-core/runtime/inspection/diff-projection.ts +499 -0
- package/packages/piagent-core/runtime/inspection/git-filter-safety.ts +38 -0
- package/packages/piagent-core/runtime/inspection/git-numstat-adapter.ts +71 -0
- package/packages/piagent-core/runtime/inspection/git-status-adapter.ts +493 -0
- package/packages/piagent-core/runtime/inspection/git-tree-adapter.ts +108 -0
- package/packages/piagent-core/runtime/inspection/mcp-control.ts +10 -0
- package/packages/piagent-core/runtime/inspection/mutation-provenance-contract.ts +131 -0
- package/packages/piagent-core/runtime/inspection/mutation-provenance-recorder.ts +48 -0
- package/packages/piagent-core/runtime/inspection/mutation-provenance-store.ts +161 -0
- package/packages/piagent-core/runtime/inspection/project-runtime-inspection.ts +36 -0
- package/packages/piagent-core/runtime/inspection/review-state-contract.ts +108 -0
- package/packages/piagent-core/runtime/inspection/review-state-projection.ts +93 -0
- package/packages/piagent-core/runtime/inspection/review-state-store.ts +112 -0
- package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +262 -0
- package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +103 -0
- package/packages/piagent-core/runtime/inspection/source-change-projection.ts +471 -0
- package/packages/piagent-core/runtime/inspection/source-evidence-contract.ts +139 -0
- package/packages/piagent-core/runtime/inspection/source-evidence-store.ts +315 -0
- package/packages/piagent-core/runtime/inspection/source-handoff-store.ts +70 -0
- package/packages/piagent-core/runtime/inspection/source-inspection-plan.ts +34 -0
- package/packages/piagent-core/runtime/inspection/source-mutation-projection.ts +164 -0
- package/packages/piagent-core/runtime/inspection/source-mutation-store.ts +168 -0
- package/packages/piagent-core/runtime/inspection/source-open-target.ts +38 -0
- package/packages/piagent-core/runtime/inspection/source-revert-projection.ts +147 -0
- package/packages/piagent-core/runtime/inspection/task-baseline-start-capture.ts +22 -0
- package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +160 -0
- package/packages/piagent-core/runtime/inspection/task-control-journal.ts +131 -0
- package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +95 -0
- package/packages/piagent-core/runtime/inspection/task-provenance-projection.ts +60 -0
- package/packages/piagent-core/runtime/inspection/task-recovery-timeline.ts +88 -0
- package/packages/piagent-core/runtime/inspection/task-run-index.ts +87 -0
- package/packages/piagent-core/runtime/inspection/task-source-projection.ts +401 -0
- package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +101 -0
- package/packages/piagent-core/runtime/inspection/text-diff.ts +60 -0
- package/packages/piagent-core/runtime/inspection/verifier-snapshot-contract.ts +114 -0
- package/packages/piagent-core/runtime/inspection/verifier-snapshot-store.ts +189 -0
- package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +320 -0
- package/packages/piagent-core/runtime/inspection/workspace-file-reader.ts +132 -0
- package/packages/piagent-core/runtime/inspection/workspace-source-projection.ts +96 -0
- package/packages/piagent-core/runtime/inspection/zero-turn-conformance.ts +175 -0
- package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +93 -6
- package/packages/piagent-core/runtime/policy/block-remedy.ts +139 -0
- package/packages/piagent-core/runtime/policy/source-index-transaction.ts +173 -0
- package/packages/piagent-core/runtime/policy/source-mutation-guard-binding.ts +42 -0
- package/packages/piagent-core/runtime/policy/source-mutation-guard.ts +184 -0
- package/packages/piagent-core/runtime/policy/source-worktree-transaction.ts +105 -0
- package/packages/piagent-core/runtime/product/activity-inspector-footer.ts +5 -3
- package/packages/piagent-core/runtime/product/activity-inspector.ts +85 -343
- package/packages/piagent-core/runtime/recovery/resume-state.ts +38 -1
- package/packages/piagent-core/runtime/registration/activity-inspector-command.ts +68 -14
- package/packages/piagent-core/runtime/registration/task-start-tool.ts +22 -27
- package/packages/piagent-core/runtime/session/model-authorship-state.ts +31 -3
- package/packages/piagent-core/runtime/session/runtime-state.ts +11 -1
- package/packages/piagent-core/runtime/session/token-economics.js +34 -0
- package/packages/piagent-core/runtime/tools/phase-tool-runtime.ts +2 -1
- package/packages/piagent-core/runtime/workflows/task-intake.ts +5 -0
- package/packages/piagent-core/security/sensitive-data.js +7 -0
- package/packages/piagent-webui/dist/client/assets/index-DwKCWbwd.css +1 -0
- package/packages/piagent-webui/dist/client/assets/index-bu7XpD9Q.js +172 -0
- package/packages/piagent-webui/dist/client/index.html +16 -0
- package/packages/piagent-webui/extension/attachment-store.ts +323 -0
- package/packages/piagent-webui/extension/held-message-queue.ts +311 -0
- package/packages/piagent-webui/extension/lifecycle-controller.ts +423 -0
- package/packages/piagent-webui/extension/lifecycle-event-adapter.ts +23 -0
- package/packages/piagent-webui/extension/piagent-webui.ts +470 -0
- package/packages/piagent-webui/extension/review-controller.ts +160 -0
- package/packages/piagent-webui/extension/same-session-bridge.ts +500 -0
- package/packages/piagent-webui/extension/session-options-controller.ts +281 -0
- package/packages/piagent-webui/extension/session-stream-adapter.ts +249 -0
- package/packages/piagent-webui/extension/source-mutation-controller.ts +215 -0
- package/packages/piagent-webui/extension/source-open-controller.ts +136 -0
- package/packages/piagent-webui/extension/source-revert-controller.ts +189 -0
- package/packages/piagent-webui/extension/terminal-session-adapter.ts +73 -0
- package/packages/piagent-webui/extension/vscode-handoff.ts +51 -0
- package/packages/piagent-webui/gateway/control-socket.ts +92 -0
- package/packages/piagent-webui/gateway/extension-authority.ts +47 -0
- package/packages/piagent-webui/gateway/gateway-events.ts +60 -0
- package/packages/piagent-webui/gateway/gateway-protocol-service.ts +64 -0
- package/packages/piagent-webui/gateway/gateway-service.ts +215 -0
- package/packages/piagent-webui/gateway/gateway-session-stream.ts +110 -0
- package/packages/piagent-webui/gateway/mcp-auth-broker.ts +158 -0
- package/packages/piagent-webui/gateway/native-project-picker.ts +29 -0
- package/packages/piagent-webui/gateway/pi-host.ts +41 -0
- package/packages/piagent-webui/gateway/profile-state.ts +1 -0
- package/packages/piagent-webui/gateway/project-registry.ts +108 -0
- package/packages/piagent-webui/gateway/provider-auth-broker.ts +172 -0
- package/packages/piagent-webui/gateway/session-catalog.ts +128 -0
- package/packages/piagent-webui/gateway/session-command-controller.ts +237 -0
- package/packages/piagent-webui/gateway/session-command-store.ts +224 -0
- package/packages/piagent-webui/gateway/session-inspection-registry.ts +239 -0
- package/packages/piagent-webui/gateway/session-lease-store.ts +1 -0
- package/packages/piagent-webui/gateway/session-metadata-store.ts +152 -0
- package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +489 -0
- package/packages/piagent-webui/ownership/gateway-runtime-context.ts +8 -0
- package/packages/piagent-webui/ownership/profile-state.ts +117 -0
- package/packages/piagent-webui/ownership/session-lease-store.ts +329 -0
- package/packages/piagent-webui/ownership/session-refs.ts +8 -0
- package/packages/piagent-webui/package.json +33 -0
- package/packages/piagent-webui/server/README.md +4 -0
- package/packages/piagent-webui/server/benchmark-release-monitor.ts +230 -0
- package/packages/piagent-webui/server/core-inspection-provider.ts +403 -0
- package/packages/piagent-webui/server/gateway-websocket.ts +143 -0
- package/packages/piagent-webui/server/http-security.ts +27 -0
- package/packages/piagent-webui/server/ipc-read-model-client.ts +89 -0
- package/packages/piagent-webui/server/loopback-server.ts +368 -0
- package/packages/piagent-webui/server/read-model-provider.ts +37 -0
- package/packages/piagent-webui/server/read-only-router.ts +105 -0
- package/packages/piagent-webui/server/session-auth.ts +88 -0
- package/packages/piagent-webui/server/sidecar-main.ts +86 -0
- package/packages/piagent-webui/server/sse-hub.ts +76 -0
- package/packages/piagent-webui/server/static-bundle.ts +40 -0
- package/packages/piagent-webui/server/transcript-projection.ts +125 -0
- package/schemas/mutation-provenance-record.schema.json +100 -0
- package/schemas/piagent-webui/approval-v1.schema.json +654 -0
- package/schemas/piagent-webui/attachment-v1.schema.json +267 -0
- package/schemas/piagent-webui/capabilities-v1.schema.json +729 -0
- package/schemas/piagent-webui/catalog-v1.json +240 -0
- package/schemas/piagent-webui/commit-summary-v1.schema.json +63 -0
- package/schemas/piagent-webui/common-v1.schema.json +479 -0
- package/schemas/piagent-webui/control-command-v1.schema.json +1780 -0
- package/schemas/piagent-webui/diff-v1.schema.json +826 -0
- package/schemas/piagent-webui/gateway-capabilities-v1.schema.json +136 -0
- package/schemas/piagent-webui/gateway-protocol-v1.schema.json +456 -0
- package/schemas/piagent-webui/handoff-history-v1.schema.json +92 -0
- package/schemas/piagent-webui/model-catalog-v1.schema.json +95 -0
- package/schemas/piagent-webui/queue-v1.schema.json +99 -0
- package/schemas/piagent-webui/recovery-history-v1.schema.json +144 -0
- package/schemas/piagent-webui/release-monitor-v1.schema.json +173 -0
- package/schemas/piagent-webui/review-state-v1.schema.json +206 -0
- package/schemas/piagent-webui/runtime-event-v2.schema.json +5206 -0
- package/schemas/piagent-webui/session-catalog-v1.schema.json +222 -0
- package/schemas/piagent-webui/session-command-v1.schema.json +390 -0
- package/schemas/piagent-webui/snapshot-v1.schema.json +2622 -0
- package/schemas/piagent-webui/source-change-v1.schema.json +763 -0
- package/schemas/piagent-webui/source-mutation-v1.schema.json +96 -0
- package/schemas/piagent-webui/source-revert-v1.schema.json +130 -0
- package/schemas/piagent-webui/subagent-tree-v1.schema.json +88 -0
- package/schemas/piagent-webui/task-index-v1.schema.json +74 -0
- package/schemas/piagent-webui/task-timeline-v1.schema.json +49 -0
- package/schemas/piagent-webui/transcript-v1.schema.json +243 -0
- package/schemas/task-baseline-manifest.schema.json +122 -0
- package/schemas/verifier-file-snapshot.schema.json +81 -0
- package/scripts/build-docs-site.mjs +21 -1
- package/scripts/check-architecture.mjs +1 -0
- package/scripts/check-doc-languages.mjs +19 -2
- package/scripts/check-third-party-neutrality.mjs +43 -0
- package/scripts/explain-command.mjs +240 -0
- package/scripts/install-global.sh +105 -4
- package/scripts/mcp-manage.mjs +17 -4
- package/scripts/pi-session-stats.sh +10 -2
- package/scripts/piagent-cli.mjs +30 -3
- package/scripts/piagent-dashboard.mjs +261 -0
- package/scripts/piagent-webui-launcher.mjs +121 -0
- package/scripts/setup.sh +69 -33
- package/scripts/traffic-snapshot.mjs +214 -0
- package/scripts/typescript-loader.mjs +42 -1
- package/scripts/uninstall-global.sh +53 -2
- package/scripts/update-global.mjs +33 -1
- package/scripts/verify-local.sh +257 -0
- package/scripts/verify-release-identity.mjs +4 -1
- package/scripts/verify-translation-pairing.mjs +121 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/gateway-capabilities-v1.schema.json",
|
|
4
|
+
"title": "Piagent Gateway capability handshake v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "version", "generatedAt", "gatewayInstanceRef", "protocol", "mode", "capabilities", "reasonCode"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"version": { "const": "piagent-gateway-capabilities-v1" },
|
|
11
|
+
"generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
12
|
+
"gatewayInstanceRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
13
|
+
"protocol": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["minimum", "maximum", "selected", "compatibility"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"minimum": { "const": 1 },
|
|
19
|
+
"maximum": { "const": 1 },
|
|
20
|
+
"selected": { "type": ["integer", "null"], "minimum": 1, "maximum": 1 },
|
|
21
|
+
"compatibility": { "enum": ["ready", "incompatible", "resync-required"] }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"mode": { "enum": ["full", "read-only", "unavailable"] },
|
|
25
|
+
"capabilities": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["catalog", "events", "terminalAdapter", "sessionRuntime", "sessionActions"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"catalog": { "$ref": "#/$defs/capability" },
|
|
31
|
+
"events": { "$ref": "#/$defs/capability" },
|
|
32
|
+
"terminalAdapter": { "$ref": "#/$defs/capability" },
|
|
33
|
+
"sessionRuntime": { "$ref": "#/$defs/capability" },
|
|
34
|
+
"sessionActions": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": ["create", "send", "abort", "setModel", "setThinking", "setPermission", "rename", "pin", "archive", "unarchive", "fork", "acquire", "release"],
|
|
38
|
+
"properties": {
|
|
39
|
+
"create": { "$ref": "#/$defs/capability" },
|
|
40
|
+
"send": { "$ref": "#/$defs/capability" },
|
|
41
|
+
"abort": { "$ref": "#/$defs/capability" },
|
|
42
|
+
"setModel": { "$ref": "#/$defs/capability" },
|
|
43
|
+
"setThinking": { "$ref": "#/$defs/capability" },
|
|
44
|
+
"setPermission": { "$ref": "#/$defs/capability" },
|
|
45
|
+
"rename": { "$ref": "#/$defs/capability" },
|
|
46
|
+
"pin": { "$ref": "#/$defs/capability" },
|
|
47
|
+
"archive": { "$ref": "#/$defs/capability" },
|
|
48
|
+
"unarchive": { "$ref": "#/$defs/capability" },
|
|
49
|
+
"fork": { "$ref": "#/$defs/capability" },
|
|
50
|
+
"acquire": { "$ref": "#/$defs/capability" },
|
|
51
|
+
"release": { "$ref": "#/$defs/capability" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
|
|
57
|
+
},
|
|
58
|
+
"allOf": [
|
|
59
|
+
{
|
|
60
|
+
"if": { "properties": { "protocol": { "type": "object", "properties": { "compatibility": { "const": "ready" } }, "required": ["compatibility"] } }, "required": ["protocol"] },
|
|
61
|
+
"then": { "properties": { "protocol": { "type": "object", "properties": { "selected": { "const": 1 } }, "required": ["selected"] }, "reasonCode": { "type": "null" } } }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"if": { "properties": { "protocol": { "type": "object", "properties": { "compatibility": { "enum": ["incompatible", "resync-required"] } }, "required": ["compatibility"] } }, "required": ["protocol"] },
|
|
65
|
+
"then": {
|
|
66
|
+
"properties": {
|
|
67
|
+
"mode": { "enum": ["read-only", "unavailable"] },
|
|
68
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
69
|
+
"capabilities": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"sessionRuntime": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
73
|
+
"sessionActions": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"properties": {
|
|
76
|
+
"create": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
77
|
+
"send": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
78
|
+
"abort": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
79
|
+
"setModel": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
80
|
+
"setThinking": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
81
|
+
"setPermission": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
82
|
+
"rename": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
83
|
+
"pin": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
84
|
+
"archive": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
85
|
+
"unarchive": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
86
|
+
"fork": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
87
|
+
"acquire": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
88
|
+
"release": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] }
|
|
89
|
+
},
|
|
90
|
+
"required": ["create", "send", "abort", "setModel", "setThinking", "setPermission", "rename", "pin", "archive", "unarchive", "fork", "acquire", "release"]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": ["sessionRuntime", "sessionActions"]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"if": { "properties": { "mode": { "const": "unavailable" } }, "required": ["mode"] },
|
|
100
|
+
"then": {
|
|
101
|
+
"properties": {
|
|
102
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
103
|
+
"capabilities": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"properties": {
|
|
106
|
+
"catalog": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
107
|
+
"events": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
108
|
+
"terminalAdapter": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] },
|
|
109
|
+
"sessionRuntime": { "type": "object", "properties": { "status": { "const": "unavailable" } }, "required": ["status"] }
|
|
110
|
+
},
|
|
111
|
+
"required": ["catalog", "events", "terminalAdapter", "sessionRuntime"]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"$defs": {
|
|
118
|
+
"capability": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": ["status", "version", "reasonCode"],
|
|
122
|
+
"properties": {
|
|
123
|
+
"status": { "enum": ["available", "unavailable"] },
|
|
124
|
+
"version": { "type": ["integer", "null"], "minimum": 1, "maximum": 1000 },
|
|
125
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
|
|
126
|
+
},
|
|
127
|
+
"allOf": [
|
|
128
|
+
{
|
|
129
|
+
"if": { "properties": { "status": { "const": "available" } }, "required": ["status"] },
|
|
130
|
+
"then": { "properties": { "version": { "type": "integer" }, "reasonCode": { "type": "null" } } },
|
|
131
|
+
"else": { "properties": { "version": { "type": "null" }, "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" } } }
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/gateway-protocol-v1.schema.json",
|
|
4
|
+
"title": "Piagent Gateway protocol envelope v1",
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{ "$ref": "#/$defs/connect" },
|
|
7
|
+
{ "$ref": "#/$defs/hello" },
|
|
8
|
+
{ "$ref": "#/$defs/request" },
|
|
9
|
+
{ "$ref": "#/$defs/successResponse" },
|
|
10
|
+
{ "$ref": "#/$defs/errorResponse" },
|
|
11
|
+
{ "$ref": "#/$defs/event" }
|
|
12
|
+
],
|
|
13
|
+
"$defs": {
|
|
14
|
+
"requestId": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 16,
|
|
17
|
+
"maxLength": 96,
|
|
18
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
19
|
+
},
|
|
20
|
+
"stateVersion": {
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"minimum": 0,
|
|
23
|
+
"maximum": 9007199254740991
|
|
24
|
+
},
|
|
25
|
+
"method": {
|
|
26
|
+
"enum": ["gateway.health", "sessions.list", "sessions.get", "sessions.command"]
|
|
27
|
+
},
|
|
28
|
+
"connect": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"required": ["schemaVersion", "version", "messageType", "clientRef", "minimumProtocol", "maximumProtocol", "lastEventSequence", "catalogRevision"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"schemaVersion": { "const": 1 },
|
|
34
|
+
"version": { "const": "piagent-gateway-protocol-v1" },
|
|
35
|
+
"messageType": { "const": "connect" },
|
|
36
|
+
"clientRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
37
|
+
"minimumProtocol": { "const": 1 },
|
|
38
|
+
"maximumProtocol": { "const": 1 },
|
|
39
|
+
"lastEventSequence": {
|
|
40
|
+
"anyOf": [
|
|
41
|
+
{ "$ref": "#/$defs/stateVersion" },
|
|
42
|
+
{ "type": "null" }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"catalogRevision": { "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken" }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"hello": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["schemaVersion", "version", "messageType", "capabilities"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"schemaVersion": { "const": 1 },
|
|
54
|
+
"version": { "const": "piagent-gateway-protocol-v1" },
|
|
55
|
+
"messageType": { "const": "hello" },
|
|
56
|
+
"capabilities": { "$ref": "gateway-capabilities-v1.schema.json" }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"requestBase": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["schemaVersion", "version", "messageType", "requestId", "method", "params"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"schemaVersion": { "const": 1 },
|
|
65
|
+
"version": { "const": "piagent-gateway-protocol-v1" },
|
|
66
|
+
"messageType": { "const": "request" },
|
|
67
|
+
"requestId": { "$ref": "#/$defs/requestId" },
|
|
68
|
+
"method": { "$ref": "#/$defs/method" },
|
|
69
|
+
"params": { "type": "object" }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"healthRequest": {
|
|
73
|
+
"allOf": [
|
|
74
|
+
{ "$ref": "#/$defs/requestBase" },
|
|
75
|
+
{
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"method": { "const": "gateway.health" },
|
|
79
|
+
"params": { "type": "object", "additionalProperties": false, "maxProperties": 0 }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"listRequest": {
|
|
85
|
+
"allOf": [
|
|
86
|
+
{ "$ref": "#/$defs/requestBase" },
|
|
87
|
+
{
|
|
88
|
+
"type": "object",
|
|
89
|
+
"properties": {
|
|
90
|
+
"method": { "const": "sessions.list" },
|
|
91
|
+
"params": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"required": ["cursor", "limit", "filter", "query", "projectRef"],
|
|
95
|
+
"properties": {
|
|
96
|
+
"cursor": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
|
|
97
|
+
"limit": { "type": "integer", "minimum": 1, "maximum": 200 },
|
|
98
|
+
"filter": { "enum": ["active", "archived", "all"] },
|
|
99
|
+
"query": {
|
|
100
|
+
"type": ["string", "null"],
|
|
101
|
+
"minLength": 1,
|
|
102
|
+
"maxLength": 200,
|
|
103
|
+
"pattern": "^[^\\u0000-\\u001F\\u007F]+$"
|
|
104
|
+
},
|
|
105
|
+
"projectRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" }
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"getRequest": {
|
|
113
|
+
"allOf": [
|
|
114
|
+
{ "$ref": "#/$defs/requestBase" },
|
|
115
|
+
{
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"method": { "const": "sessions.get" },
|
|
119
|
+
"params": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": false,
|
|
122
|
+
"required": ["sessionRef"],
|
|
123
|
+
"properties": {
|
|
124
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"commandRequest": {
|
|
132
|
+
"allOf": [
|
|
133
|
+
{ "$ref": "#/$defs/requestBase" },
|
|
134
|
+
{
|
|
135
|
+
"type": "object",
|
|
136
|
+
"properties": {
|
|
137
|
+
"method": { "const": "sessions.command" },
|
|
138
|
+
"params": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"additionalProperties": false,
|
|
141
|
+
"required": ["command"],
|
|
142
|
+
"properties": {
|
|
143
|
+
"command": { "$ref": "session-command-v1.schema.json#/$defs/command" }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"request": {
|
|
151
|
+
"oneOf": [
|
|
152
|
+
{ "$ref": "#/$defs/healthRequest" },
|
|
153
|
+
{ "$ref": "#/$defs/listRequest" },
|
|
154
|
+
{ "$ref": "#/$defs/getRequest" },
|
|
155
|
+
{ "$ref": "#/$defs/commandRequest" }
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"responseBase": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"required": ["schemaVersion", "version", "messageType", "requestId", "method", "ok", "stateVersion", "result", "error"],
|
|
162
|
+
"properties": {
|
|
163
|
+
"schemaVersion": { "const": 1 },
|
|
164
|
+
"version": { "const": "piagent-gateway-protocol-v1" },
|
|
165
|
+
"messageType": { "const": "response" },
|
|
166
|
+
"requestId": { "$ref": "#/$defs/requestId" },
|
|
167
|
+
"method": { "$ref": "#/$defs/method" },
|
|
168
|
+
"ok": { "type": "boolean" },
|
|
169
|
+
"stateVersion": { "$ref": "#/$defs/stateVersion" },
|
|
170
|
+
"result": {},
|
|
171
|
+
"error": {}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"healthResponse": {
|
|
175
|
+
"allOf": [
|
|
176
|
+
{ "$ref": "#/$defs/responseBase" },
|
|
177
|
+
{
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"method": { "const": "gateway.health" },
|
|
181
|
+
"ok": { "const": true },
|
|
182
|
+
"result": { "$ref": "gateway-capabilities-v1.schema.json" },
|
|
183
|
+
"error": { "type": "null" }
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"listResponse": {
|
|
189
|
+
"allOf": [
|
|
190
|
+
{ "$ref": "#/$defs/responseBase" },
|
|
191
|
+
{
|
|
192
|
+
"type": "object",
|
|
193
|
+
"properties": {
|
|
194
|
+
"method": { "const": "sessions.list" },
|
|
195
|
+
"ok": { "const": true },
|
|
196
|
+
"result": { "$ref": "session-catalog-v1.schema.json#/$defs/catalog" },
|
|
197
|
+
"error": { "type": "null" }
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
"getResponse": {
|
|
203
|
+
"allOf": [
|
|
204
|
+
{ "$ref": "#/$defs/responseBase" },
|
|
205
|
+
{
|
|
206
|
+
"type": "object",
|
|
207
|
+
"properties": {
|
|
208
|
+
"method": { "const": "sessions.get" },
|
|
209
|
+
"ok": { "const": true },
|
|
210
|
+
"result": { "$ref": "session-catalog-v1.schema.json#/$defs/sessionDetail" },
|
|
211
|
+
"error": { "type": "null" }
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"commandResponse": {
|
|
217
|
+
"allOf": [
|
|
218
|
+
{ "$ref": "#/$defs/responseBase" },
|
|
219
|
+
{
|
|
220
|
+
"type": "object",
|
|
221
|
+
"properties": {
|
|
222
|
+
"method": { "const": "sessions.command" },
|
|
223
|
+
"ok": { "const": true },
|
|
224
|
+
"result": { "$ref": "session-command-v1.schema.json#/$defs/receipt" },
|
|
225
|
+
"error": { "type": "null" }
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"successResponse": {
|
|
231
|
+
"oneOf": [
|
|
232
|
+
{ "$ref": "#/$defs/healthResponse" },
|
|
233
|
+
{ "$ref": "#/$defs/listResponse" },
|
|
234
|
+
{ "$ref": "#/$defs/getResponse" },
|
|
235
|
+
{ "$ref": "#/$defs/commandResponse" }
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"protocolError": {
|
|
239
|
+
"type": "object",
|
|
240
|
+
"additionalProperties": false,
|
|
241
|
+
"required": ["code", "message", "retryable"],
|
|
242
|
+
"properties": {
|
|
243
|
+
"code": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
244
|
+
"message": { "$ref": "common-v1.schema.json#/$defs/nonEmptyDisplayText" },
|
|
245
|
+
"retryable": { "type": "boolean" }
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"errorResponse": {
|
|
249
|
+
"allOf": [
|
|
250
|
+
{ "$ref": "#/$defs/responseBase" },
|
|
251
|
+
{
|
|
252
|
+
"type": "object",
|
|
253
|
+
"properties": {
|
|
254
|
+
"ok": { "const": false },
|
|
255
|
+
"result": { "type": "null" },
|
|
256
|
+
"error": { "$ref": "#/$defs/protocolError" }
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"eventBase": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"required": ["schemaVersion", "version", "messageType", "sequence", "stateVersion", "generatedAt", "kind", "payload"],
|
|
265
|
+
"properties": {
|
|
266
|
+
"schemaVersion": { "const": 1 },
|
|
267
|
+
"version": { "const": "piagent-gateway-protocol-v1" },
|
|
268
|
+
"messageType": { "const": "event" },
|
|
269
|
+
"sequence": { "$ref": "#/$defs/stateVersion" },
|
|
270
|
+
"stateVersion": { "$ref": "#/$defs/stateVersion" },
|
|
271
|
+
"generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
|
|
272
|
+
"kind": { "enum": ["catalog.changed", "session.changed", "runtime.changed", "resync.required", "message.delta", "message.completed", "tool.started", "tool.completed"] },
|
|
273
|
+
"payload": { "type": "object" }
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"catalogChangedEvent": {
|
|
277
|
+
"allOf": [
|
|
278
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
279
|
+
{
|
|
280
|
+
"type": "object",
|
|
281
|
+
"properties": {
|
|
282
|
+
"kind": { "const": "catalog.changed" },
|
|
283
|
+
"payload": {
|
|
284
|
+
"type": "object",
|
|
285
|
+
"additionalProperties": false,
|
|
286
|
+
"required": ["catalogRevision"],
|
|
287
|
+
"properties": { "catalogRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" } }
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
"sessionChangedEvent": {
|
|
294
|
+
"allOf": [
|
|
295
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
296
|
+
{
|
|
297
|
+
"type": "object",
|
|
298
|
+
"properties": {
|
|
299
|
+
"kind": { "const": "session.changed" },
|
|
300
|
+
"payload": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"additionalProperties": false,
|
|
303
|
+
"required": ["catalogRevision", "session"],
|
|
304
|
+
"properties": {
|
|
305
|
+
"catalogRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
306
|
+
"session": { "$ref": "session-catalog-v1.schema.json#/$defs/sessionRow" }
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
"runtimeChangedEvent": {
|
|
314
|
+
"allOf": [
|
|
315
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
316
|
+
{
|
|
317
|
+
"type": "object",
|
|
318
|
+
"properties": {
|
|
319
|
+
"kind": { "const": "runtime.changed" },
|
|
320
|
+
"payload": {
|
|
321
|
+
"type": "object",
|
|
322
|
+
"additionalProperties": false,
|
|
323
|
+
"required": ["sessionRef", "sessionRevision", "liveState", "operationRef", "reasonCode"],
|
|
324
|
+
"properties": {
|
|
325
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
326
|
+
"sessionRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
327
|
+
"liveState": { "enum": ["offline", "idle", "running", "paused", "waiting-approval", "uncertain"] },
|
|
328
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
|
|
329
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
|
|
330
|
+
},
|
|
331
|
+
"allOf": [
|
|
332
|
+
{
|
|
333
|
+
"if": { "properties": { "liveState": { "enum": ["running", "paused", "waiting-approval"] } }, "required": ["liveState"] },
|
|
334
|
+
"then": { "properties": { "operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" } } }
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"if": { "properties": { "liveState": { "const": "uncertain" } }, "required": ["liveState"] },
|
|
338
|
+
"then": { "properties": { "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" } } },
|
|
339
|
+
"else": { "properties": { "reasonCode": { "type": "null" } } }
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
"resyncRequiredEvent": {
|
|
348
|
+
"allOf": [
|
|
349
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
350
|
+
{
|
|
351
|
+
"type": "object",
|
|
352
|
+
"properties": {
|
|
353
|
+
"kind": { "const": "resync.required" },
|
|
354
|
+
"payload": {
|
|
355
|
+
"type": "object",
|
|
356
|
+
"additionalProperties": false,
|
|
357
|
+
"required": ["reasonCode", "earliestSequence", "currentSequence"],
|
|
358
|
+
"properties": {
|
|
359
|
+
"reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
|
|
360
|
+
"earliestSequence": { "$ref": "#/$defs/stateVersion" },
|
|
361
|
+
"currentSequence": { "$ref": "#/$defs/stateVersion" }
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
"messageDeltaEvent": {
|
|
369
|
+
"allOf": [
|
|
370
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
371
|
+
{
|
|
372
|
+
"type": "object",
|
|
373
|
+
"properties": {
|
|
374
|
+
"kind": { "const": "message.delta" },
|
|
375
|
+
"payload": {
|
|
376
|
+
"type": "object",
|
|
377
|
+
"additionalProperties": false,
|
|
378
|
+
"required": ["sessionRef", "operationRef", "messageRef", "messageSequence", "delta"],
|
|
379
|
+
"properties": {
|
|
380
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
381
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
382
|
+
"messageRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
383
|
+
"messageSequence": { "$ref": "#/$defs/stateVersion" },
|
|
384
|
+
"delta": { "type": "string", "maxLength": 16384, "pattern": "^[^\\u0000]*$" }
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
},
|
|
391
|
+
"messageCompletedEvent": {
|
|
392
|
+
"allOf": [
|
|
393
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
394
|
+
{
|
|
395
|
+
"type": "object",
|
|
396
|
+
"properties": {
|
|
397
|
+
"kind": { "const": "message.completed" },
|
|
398
|
+
"payload": {
|
|
399
|
+
"type": "object",
|
|
400
|
+
"additionalProperties": false,
|
|
401
|
+
"required": ["sessionRef", "operationRef", "messageRef", "sessionRevision", "truncated"],
|
|
402
|
+
"properties": {
|
|
403
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
404
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
405
|
+
"messageRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
406
|
+
"sessionRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
|
|
407
|
+
"truncated": { "type": "boolean" }
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"toolEvent": {
|
|
415
|
+
"allOf": [
|
|
416
|
+
{ "$ref": "#/$defs/eventBase" },
|
|
417
|
+
{
|
|
418
|
+
"type": "object",
|
|
419
|
+
"properties": {
|
|
420
|
+
"kind": { "enum": ["tool.started", "tool.completed"] },
|
|
421
|
+
"payload": {
|
|
422
|
+
"type": "object",
|
|
423
|
+
"additionalProperties": false,
|
|
424
|
+
"required": ["sessionRef", "operationRef", "toolCallRef", "toolLabel", "isError"],
|
|
425
|
+
"properties": {
|
|
426
|
+
"sessionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
427
|
+
"operationRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
428
|
+
"toolCallRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
|
|
429
|
+
"toolLabel": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[^\\u0000-\\u001F\\u007F]+$" },
|
|
430
|
+
"isError": { "type": ["boolean", "null"] }
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
"allOf": [
|
|
435
|
+
{
|
|
436
|
+
"if": { "properties": { "kind": { "const": "tool.started" } }, "required": ["kind"] },
|
|
437
|
+
"then": { "properties": { "payload": { "type": "object", "properties": { "isError": { "type": "null" } } } } },
|
|
438
|
+
"else": { "properties": { "payload": { "type": "object", "properties": { "isError": { "type": "boolean" } } } } }
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
"event": {
|
|
445
|
+
"oneOf": [
|
|
446
|
+
{ "$ref": "#/$defs/catalogChangedEvent" },
|
|
447
|
+
{ "$ref": "#/$defs/sessionChangedEvent" },
|
|
448
|
+
{ "$ref": "#/$defs/runtimeChangedEvent" },
|
|
449
|
+
{ "$ref": "#/$defs/resyncRequiredEvent" },
|
|
450
|
+
{ "$ref": "#/$defs/messageDeltaEvent" },
|
|
451
|
+
{ "$ref": "#/$defs/messageCompletedEvent" },
|
|
452
|
+
{ "$ref": "#/$defs/toolEvent" }
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|