clinkx 1.0.0 → 1.1.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 +95 -0
- package/README.md +184 -112
- package/clinkx-workflows/dist/chairman-knobs.d.ts +24 -0
- package/clinkx-workflows/dist/chairman-knobs.js +27 -0
- package/clinkx-workflows/dist/chairman-knobs.js.map +1 -0
- package/clinkx-workflows/dist/clink-client.d.ts +10 -0
- package/clinkx-workflows/dist/clink-client.js +39 -1
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +29 -1
- package/clinkx-workflows/dist/config.js +35 -2
- package/clinkx-workflows/dist/config.js.map +1 -1
- package/clinkx-workflows/dist/context-preflight.d.ts +5 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -1
- package/clinkx-workflows/dist/council-execution-policy.d.ts +68 -0
- package/clinkx-workflows/dist/council-execution-policy.js +110 -0
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +9 -8
- package/clinkx-workflows/dist/council-expander.js +18 -9
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +5557 -4
- package/clinkx-workflows/dist/dashboard/activity-contract.js +55 -3
- package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +9 -5
- package/clinkx-workflows/dist/dashboard/activity-reader.js +15 -2
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +4 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +133 -25
- package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.d.ts +3865 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js +69 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +36 -2
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +142 -19
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +20027 -480
- package/clinkx-workflows/dist/dashboard/contracts.js +133 -6
- package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/index.d.ts +4 -0
- package/clinkx-workflows/dist/dashboard/index.js +4 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/invocation-contract.d.ts +786 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js +201 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +14 -1
- package/clinkx-workflows/dist/dashboard/lazy-content.js +53 -2
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.d.ts +90 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js +31 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.d.ts +12 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js +286 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +147 -4
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js +11 -11
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js +4 -56
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +2 -1
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +6 -5
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.d.ts +194 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js +89 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js +102 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js +4 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +3 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +52 -8
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +14 -1
- package/clinkx-workflows/dist/dashboard/server-factory.js +73 -21
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +223 -56
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +26 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-journal.js +10 -3
- package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +9 -1
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +793 -59
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -1
- package/clinkx-workflows/dist/dashboard-ui/assets/index-JPHQVtn9.js +106 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-DOMHk-j6.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
- package/clinkx-workflows/dist/delegate-finalizer-policy.d.ts +26 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js +72 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js.map +1 -0
- package/clinkx-workflows/dist/delegate-signature.d.ts +14 -0
- package/clinkx-workflows/dist/delegate-signature.js +14 -0
- package/clinkx-workflows/dist/delegate-signature.js.map +1 -0
- package/clinkx-workflows/dist/delegate-validate.d.ts +32 -2
- package/clinkx-workflows/dist/delegate-validate.js +51 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -1
- package/clinkx-workflows/dist/engine.d.ts +113 -3
- package/clinkx-workflows/dist/engine.js +476 -80
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +22 -2
- package/clinkx-workflows/dist/errors.js +30 -2
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fidelity.d.ts +47 -1
- package/clinkx-workflows/dist/fidelity.js +54 -1
- package/clinkx-workflows/dist/fidelity.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +24 -6
- package/clinkx-workflows/dist/fingerprint.js +32 -9
- package/clinkx-workflows/dist/fingerprint.js.map +1 -1
- package/clinkx-workflows/dist/index.js +53 -1
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/logger.d.ts +1 -1
- package/clinkx-workflows/dist/logger.js +17 -3
- package/clinkx-workflows/dist/logger.js.map +1 -1
- package/clinkx-workflows/dist/monotonic-clock.d.ts +19 -0
- package/clinkx-workflows/dist/monotonic-clock.js +22 -0
- package/clinkx-workflows/dist/monotonic-clock.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/contract.d.ts +52 -52
- package/clinkx-workflows/dist/plan-review/publication.d.ts +4 -4
- package/clinkx-workflows/dist/plan-review/run-state.d.ts +16 -16
- package/clinkx-workflows/dist/roster-contract.d.ts +889 -0
- package/clinkx-workflows/dist/roster-contract.js +180 -0
- package/clinkx-workflows/dist/roster-contract.js.map +1 -0
- package/clinkx-workflows/dist/rosters.d.ts +14 -0
- package/clinkx-workflows/dist/rosters.js +169 -0
- package/clinkx-workflows/dist/rosters.js.map +1 -0
- package/clinkx-workflows/dist/run-health.d.ts +7 -0
- package/clinkx-workflows/dist/run-health.js +25 -0
- package/clinkx-workflows/dist/run-health.js.map +1 -0
- package/clinkx-workflows/dist/schema.d.ts +64 -0
- package/clinkx-workflows/dist/schema.js +24 -0
- package/clinkx-workflows/dist/schema.js.map +1 -1
- package/clinkx-workflows/dist/server.js +2 -0
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +15 -2
- package/clinkx-workflows/dist/shutdown.js +60 -16
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +23 -0
- package/clinkx-workflows/dist/state.d.ts +5 -0
- package/clinkx-workflows/dist/state.js +128 -21
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/stdio-watchdog.d.ts +52 -0
- package/clinkx-workflows/dist/stdio-watchdog.js +212 -0
- package/clinkx-workflows/dist/stdio-watchdog.js.map +1 -0
- package/clinkx-workflows/dist/types.d.ts +6 -0
- package/clinkx-workflows/dist/validators/council.d.ts +50 -50
- package/clinkx-workflows/dist/validators/plan-review.d.ts +3 -3
- package/clinkx-workflows/dist/workflow-tools.d.ts +70 -0
- package/clinkx-workflows/dist/workflow-tools.js +760 -168
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/templates/council/answer-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/answer-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +3 -0
- package/clinkx-workflows/templates/council/chairman.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/debug-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/debug-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/debug-debugger.txt +3 -0
- package/clinkx-workflows/templates/council/discover-analyst.txt +3 -0
- package/clinkx-workflows/templates/council/discover-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/discover-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/member.txt +3 -0
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/reviewer.txt +3 -0
- package/clinkx-workflows/workflows/council-answer.yaml +3 -0
- package/clinkx-workflows/workflows/council-code-review.yaml +3 -0
- package/clinkx-workflows/workflows/council-debug.yaml +3 -0
- package/clinkx-workflows/workflows/council-default.yaml +7 -0
- package/clinkx-workflows/workflows/council-discover.yaml +3 -0
- package/clinkx-workflows/workflows/council-plan-review.yaml +3 -0
- package/conf/adapters/agy.json +9 -2
- package/conf/adapters/claude.json +7 -0
- package/conf/adapters/codex.json +7 -0
- package/conf/adapters/glm.json +19 -3
- package/conf/adapters/grok.json +9 -2
- package/conf/adapters/hapi/agy.json +9 -2
- package/conf/adapters/hapi/claude.json +7 -0
- package/conf/adapters/hapi/codex.json +7 -0
- package/conf/adapters/hapi/glm.json +20 -4
- package/conf/rosters/default-council.json +21 -0
- package/dist/activity-journal.d.ts +17 -3
- package/dist/activity-journal.js +404 -79
- package/dist/activity-journal.js.map +1 -1
- package/dist/codex/agent-tools.js +36 -0
- package/dist/codex/agent-tools.js.map +1 -1
- package/dist/codex/app-server-client.d.ts +3 -0
- package/dist/codex/app-server-client.js +11 -0
- package/dist/codex/app-server-client.js.map +1 -1
- package/dist/codex/app-server-registry.d.ts +18 -0
- package/dist/codex/app-server-registry.js +88 -2
- package/dist/codex/app-server-registry.js.map +1 -1
- package/dist/codex/client-types.d.ts +7 -1
- package/dist/codex/protocol.d.ts +4 -4
- package/dist/config.d.ts +220 -23
- package/dist/config.js +104 -1
- package/dist/config.js.map +1 -1
- package/dist/context-builder/bundle.d.ts +13 -0
- package/dist/context-builder/bundle.js +46 -0
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/delegate-finalizer-effective.d.ts +33 -0
- package/dist/context-builder/delegate-finalizer-effective.js +82 -0
- package/dist/context-builder/delegate-finalizer-effective.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +18 -0
- package/dist/context-builder/delegate-packet.js +73 -9
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-reconstruction.d.ts +29 -0
- package/dist/context-builder/delegate-reconstruction.js +110 -41
- package/dist/context-builder/delegate-reconstruction.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +31 -0
- package/dist/context-builder/delegate-validation.js +87 -10
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +9 -0
- package/dist/context-builder/delegate.js +210 -59
- package/dist/context-builder/delegate.js.map +1 -1
- package/dist/context-builder/diagnostics.d.ts +1 -1
- package/dist/context-builder/diagnostics.js.map +1 -1
- package/dist/context-builder/discovery-progress.d.ts +25 -0
- package/dist/context-builder/discovery-progress.js +64 -0
- package/dist/context-builder/discovery-progress.js.map +1 -0
- package/dist/context-builder/discovery-watchdog.d.ts +15 -0
- package/dist/context-builder/discovery-watchdog.js +39 -0
- package/dist/context-builder/discovery-watchdog.js.map +1 -0
- package/dist/context-builder/discovery.d.ts +7 -0
- package/dist/context-builder/discovery.js +119 -7
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/external-gaps.d.ts +73 -0
- package/dist/context-builder/external-gaps.js +248 -0
- package/dist/context-builder/external-gaps.js.map +1 -0
- package/dist/context-builder/globs.d.ts +1 -0
- package/dist/context-builder/globs.js +15 -0
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +42 -1
- package/dist/context-builder/handler.js +690 -62
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/invocation-sidecar.d.ts +41 -0
- package/dist/context-builder/invocation-sidecar.js +189 -0
- package/dist/context-builder/invocation-sidecar.js.map +1 -0
- package/dist/context-builder/lifecycle-contract.d.ts +51 -51
- package/dist/context-builder/mutation-lock.d.ts +32 -0
- package/dist/context-builder/mutation-lock.js +321 -0
- package/dist/context-builder/mutation-lock.js.map +1 -0
- package/dist/context-builder/review-coverage.d.ts +32 -0
- package/dist/context-builder/review-coverage.js +130 -23
- package/dist/context-builder/review-coverage.js.map +1 -1
- package/dist/context-builder/schema.d.ts +76 -1
- package/dist/context-builder/schema.js +21 -1
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +31 -0
- package/dist/context-builder/secrets.js +871 -84
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/status.d.ts +1 -1
- package/dist/context-builder/status.js +1 -0
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +29 -5
- package/dist/context-builder/storage.js +311 -236
- package/dist/context-builder/storage.js.map +1 -1
- package/dist/context-builder/versions.d.ts +19 -4
- package/dist/context-builder/versions.js +19 -4
- package/dist/context-builder/versions.js.map +1 -1
- package/dist/context-builder/workflow-runner.d.ts +6 -0
- package/dist/context-builder/workflow-runner.js +363 -173
- package/dist/context-builder/workflow-runner.js.map +1 -1
- package/dist/dashboard-adapter-catalog.js +7 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -1
- package/dist/dashboard-cli.d.ts +2 -0
- package/dist/dashboard-cli.js +40 -2
- package/dist/dashboard-cli.js.map +1 -1
- package/dist/dashboard-companion/client.d.ts +1 -0
- package/dist/dashboard-companion/client.js +22 -3
- package/dist/dashboard-companion/client.js.map +1 -1
- package/dist/dashboard-companion/protocol.js +4 -1
- package/dist/dashboard-companion/protocol.js.map +1 -1
- package/dist/dashboard-gateway/index.d.ts +1 -0
- package/dist/dashboard-gateway/index.js +33 -2
- package/dist/dashboard-gateway/index.js.map +1 -1
- package/dist/handler.js +5 -1
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +145 -7
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +18 -3
- package/dist/logger.js.map +1 -1
- package/dist/parsers/agy-stream-json.d.ts +14 -0
- package/dist/parsers/agy-stream-json.js +172 -0
- package/dist/parsers/agy-stream-json.js.map +1 -0
- package/dist/parsers/extract.js +5 -1
- package/dist/parsers/extract.js.map +1 -1
- package/dist/parsers/observed-invocation.d.ts +20 -0
- package/dist/parsers/observed-invocation.js +42 -0
- package/dist/parsers/observed-invocation.js.map +1 -0
- package/dist/pipeline.d.ts +13 -0
- package/dist/pipeline.js +60 -10
- package/dist/pipeline.js.map +1 -1
- package/dist/progress-report/lock.d.ts +74 -0
- package/dist/progress-report/lock.js +343 -0
- package/dist/progress-report/lock.js.map +1 -0
- package/dist/progress-report/schema.d.ts +808 -0
- package/dist/progress-report/schema.js +119 -0
- package/dist/progress-report/schema.js.map +1 -0
- package/dist/progress-report/store.d.ts +66 -0
- package/dist/progress-report/store.js +766 -0
- package/dist/progress-report/store.js.map +1 -0
- package/dist/progress-report/tools.d.ts +20 -0
- package/dist/progress-report/tools.js +141 -0
- package/dist/progress-report/tools.js.map +1 -0
- package/dist/prompt-mode.d.ts +1 -1
- package/dist/prompt-mode.js +7 -2
- package/dist/prompt-mode.js.map +1 -1
- package/dist/runner.d.ts +7 -0
- package/dist/runner.js +10 -3
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +50 -0
- package/dist/safety.js +182 -1
- package/dist/safety.js.map +1 -1
- package/dist/schema.d.ts +8 -0
- package/dist/schema.js +20 -0
- package/dist/schema.js.map +1 -1
- package/dist/server.d.ts +6 -1
- package/dist/server.js +94 -8
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +1 -1
- package/dist/session-log-stream.js +280 -33
- package/dist/session-log-stream.js.map +1 -1
- package/dist/stdio-activity.d.ts +28 -0
- package/dist/stdio-activity.js +72 -0
- package/dist/stdio-activity.js.map +1 -0
- package/docs/configuration.md +426 -0
- package/docs/security.md +293 -0
- package/package.json +5 -5
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DOkMXTfB.js +0 -25
- package/clinkx-workflows/dist/dashboard-ui/assets/style-ChJsn0KD.css +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { AgentStatusSchema, BlockerEntrySchema, BoundedIdSchema, BoundedMessageSchema, BoundedTitleSchema, FileChangeEntrySchema, LogKindSchema, NonnegativeSafeIntegerSchema, ProgressReportSessionIdSchema, ProjectFolderPathSchema, SessionStatusSchema, TaskSectionSchema, } from "../../clinkx-workflows/dist/dashboard/progress-report-contract.js";
|
|
4
|
+
/**
|
|
5
|
+
* Tool-input schemas for the native progress-report tools.
|
|
6
|
+
*
|
|
7
|
+
* This is deliberately NOT `src/schema.ts` — that file is the frozen v1
|
|
8
|
+
* `clink` input contract. Per-tool schema modules are the established shape
|
|
9
|
+
* (`src/context-builder/schema.ts`). Every document-shaped field here reuses the
|
|
10
|
+
* dashboard's own producer contract, so the writer cannot drift from the reader.
|
|
11
|
+
*
|
|
12
|
+
* Server-owned fields are absent by construction: `session.id`, `started_at`,
|
|
13
|
+
* every `updated_at` / `t` / `last_run`, and `schema_version` are stamped by the
|
|
14
|
+
* store, never accepted from a caller.
|
|
15
|
+
*/
|
|
16
|
+
const RequestIdSchema = z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(128)
|
|
20
|
+
.describe("Idempotency key for this call. Replaying the same request_id with identical content returns the original receipt and writes nothing; reusing it with different content is rejected. Use a fresh key (a UUID) per intended write. On progress_report_start the session id is DERIVED from this key, so it must be unique per report, and the returned receipt describes the original call — check replayed:true and call progress_report_get if you need the report's current revision.");
|
|
21
|
+
// Agents are upserted by name; updated_at is stamped server-side.
|
|
22
|
+
const AgentInputSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
name: BoundedIdSchema,
|
|
25
|
+
role: BoundedIdSchema,
|
|
26
|
+
status: AgentStatusSchema,
|
|
27
|
+
activity: BoundedMessageSchema,
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
const LogAppendSchema = z
|
|
31
|
+
.object({ agent: BoundedIdSchema, kind: LogKindSchema, msg: BoundedMessageSchema })
|
|
32
|
+
.strict();
|
|
33
|
+
const DecisionAppendSchema = z
|
|
34
|
+
.object({ by: BoundedIdSchema, msg: BoundedMessageSchema })
|
|
35
|
+
.strict();
|
|
36
|
+
const TestsSetSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
passed: NonnegativeSafeIntegerSchema,
|
|
39
|
+
failed: NonnegativeSafeIntegerSchema,
|
|
40
|
+
skipped: NonnegativeSafeIntegerSchema,
|
|
41
|
+
failing: z.array(BoundedMessageSchema).max(100),
|
|
42
|
+
})
|
|
43
|
+
.strict();
|
|
44
|
+
export const ProgressReportStartInputSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
request_id: RequestIdSchema,
|
|
47
|
+
project_folder: ProjectFolderPathSchema.describe("Absolute path of the workspace this session is working in. progress_report_list matches candidates by it."),
|
|
48
|
+
title: BoundedTitleSchema,
|
|
49
|
+
goal: BoundedTitleSchema,
|
|
50
|
+
opened_by: BoundedIdSchema.describe("Agent name credited with the opening log entry. Use a lowercase slug that matches an agents[].name."),
|
|
51
|
+
agents: z.array(AgentInputSchema).max(50).optional(),
|
|
52
|
+
tasks: z.array(TaskSectionSchema).max(200).optional(),
|
|
53
|
+
})
|
|
54
|
+
.strict();
|
|
55
|
+
export const ProgressReportChangesSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
session: z
|
|
58
|
+
.object({
|
|
59
|
+
title: BoundedTitleSchema.optional(),
|
|
60
|
+
goal: BoundedTitleSchema.optional(),
|
|
61
|
+
status: SessionStatusSchema.optional(),
|
|
62
|
+
})
|
|
63
|
+
.strict()
|
|
64
|
+
.optional(),
|
|
65
|
+
agents_upsert: z.array(AgentInputSchema).max(50).optional(),
|
|
66
|
+
tasks_upsert: z.array(TaskSectionSchema).max(200).optional(),
|
|
67
|
+
log_append: z.array(LogAppendSchema).max(50).optional(),
|
|
68
|
+
files_upsert: z.array(FileChangeEntrySchema).max(500).optional(),
|
|
69
|
+
tests_set: TestsSetSchema.optional(),
|
|
70
|
+
blockers_set: z.array(BlockerEntrySchema).max(50).optional(),
|
|
71
|
+
decisions_append: z.array(DecisionAppendSchema).max(20).optional(),
|
|
72
|
+
})
|
|
73
|
+
.strict()
|
|
74
|
+
// NOTE: `.refine` produces a ZodEffects, which zodToJsonSchema DROPS. The
|
|
75
|
+
// advertised JSON Schema therefore still admits `changes: {}`; enforcement is
|
|
76
|
+
// server-side only, in the safeParse that every tool call goes through. Do not
|
|
77
|
+
// assume a client's schema validation has already rejected an empty patch.
|
|
78
|
+
.refine((value) => Object.values(value).some((v) => v !== undefined), {
|
|
79
|
+
message: "changes must carry at least one of session, agents_upsert, tasks_upsert, log_append, files_upsert, tests_set, blockers_set, decisions_append",
|
|
80
|
+
});
|
|
81
|
+
export const ProgressReportUpdateInputSchema = z
|
|
82
|
+
.object({
|
|
83
|
+
report_id: ProgressReportSessionIdSchema.describe("The session id returned by progress_report_start or progress_report_list."),
|
|
84
|
+
request_id: RequestIdSchema,
|
|
85
|
+
expected_revision: z
|
|
86
|
+
.number()
|
|
87
|
+
.int()
|
|
88
|
+
.min(1)
|
|
89
|
+
.describe("The revision this update is based on, from the last receipt or progress_report_get. A mismatch is rejected as revision_conflict rather than silently overwriting a concurrent write."),
|
|
90
|
+
changes: ProgressReportChangesSchema,
|
|
91
|
+
reopen: z
|
|
92
|
+
.boolean()
|
|
93
|
+
.optional()
|
|
94
|
+
.describe("Required to write to a report already closed as done or failed. Setting session.status to running also reopens it."),
|
|
95
|
+
})
|
|
96
|
+
.strict();
|
|
97
|
+
export const ProgressReportGetInputSchema = z
|
|
98
|
+
.object({ report_id: ProgressReportSessionIdSchema })
|
|
99
|
+
.strict();
|
|
100
|
+
export const ProgressReportListInputSchema = z
|
|
101
|
+
.object({
|
|
102
|
+
project_folder: ProjectFolderPathSchema.optional().describe("Restrict to reports opened for this workspace. Omit to list every report."),
|
|
103
|
+
limit: z.number().int().min(1).max(50).default(5),
|
|
104
|
+
})
|
|
105
|
+
.strict();
|
|
106
|
+
const JSON_SCHEMA_OPTIONS = { $refStrategy: "none" };
|
|
107
|
+
export function progressReportStartJsonSchema() {
|
|
108
|
+
return zodToJsonSchema(ProgressReportStartInputSchema, JSON_SCHEMA_OPTIONS);
|
|
109
|
+
}
|
|
110
|
+
export function progressReportUpdateJsonSchema() {
|
|
111
|
+
return zodToJsonSchema(ProgressReportUpdateInputSchema, JSON_SCHEMA_OPTIONS);
|
|
112
|
+
}
|
|
113
|
+
export function progressReportGetJsonSchema() {
|
|
114
|
+
return zodToJsonSchema(ProgressReportGetInputSchema, JSON_SCHEMA_OPTIONS);
|
|
115
|
+
}
|
|
116
|
+
export function progressReportListJsonSchema() {
|
|
117
|
+
return zodToJsonSchema(ProgressReportListInputSchema, JSON_SCHEMA_OPTIONS);
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/progress-report/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mEAAmE,CAAC;AAE3E;;;;;;;;;;;GAWG;AAEH,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,EAAE;KACR,GAAG,CAAC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,+BAA+B,EAAE,mBAAmB,CAA4B,CAAC;AAC1G,CAAC;AACD,MAAM,UAAU,2BAA2B;IACzC,OAAO,eAAe,CAAC,4BAA4B,EAAE,mBAAmB,CAA4B,CAAC;AACvG,CAAC;AACD,MAAM,UAAU,4BAA4B;IAC1C,OAAO,eAAe,CAAC,6BAA6B,EAAE,mBAAmB,CAA4B,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ProgressReportDocument } from "../../clinkx-workflows/dist/dashboard/progress-report-contract.js";
|
|
2
|
+
import type { ProgressReportChanges, ProgressReportStartInput } from "./schema.js";
|
|
3
|
+
export declare const REPORTS_SUBDIR = "progress-reports";
|
|
4
|
+
export declare const REPORT_FILENAME = "report-data.json";
|
|
5
|
+
export declare const CONTROL_FILENAME = ".control.json";
|
|
6
|
+
/** Mirrors the dashboard reader's own per-file cap (progress-report-reader.ts). */
|
|
7
|
+
export declare const MAX_REPORT_FILE_BYTES: number;
|
|
8
|
+
/** Bound directory enumeration the same way the reader does. */
|
|
9
|
+
export declare const SCAN_CAP = 10000;
|
|
10
|
+
/**
|
|
11
|
+
* How many directories are actually READ per listing. Enumeration is stat-only;
|
|
12
|
+
* only the newest this many are opened, exactly as the dashboard reader does.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MAX_LIST_CANDIDATES = 200;
|
|
15
|
+
/** Aggregate read budget for one listing, matching the reader's own budget. */
|
|
16
|
+
export declare const MAX_LIST_SCAN_BYTES: number;
|
|
17
|
+
/** How many bounded request_id receipts to retain per session. */
|
|
18
|
+
export declare const RECEIPT_RETENTION = 32;
|
|
19
|
+
export interface ProgressReportReceipt {
|
|
20
|
+
readonly session_id: string;
|
|
21
|
+
readonly revision: number;
|
|
22
|
+
readonly path: string;
|
|
23
|
+
readonly status: string;
|
|
24
|
+
readonly updated_at: string;
|
|
25
|
+
readonly replayed: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function reportsRoot(env?: NodeJS.ProcessEnv): string;
|
|
28
|
+
export declare function startReport(input: ProgressReportStartInput, env?: NodeJS.ProcessEnv): Promise<ProgressReportReceipt>;
|
|
29
|
+
export declare function updateReport(args: {
|
|
30
|
+
readonly report_id: string;
|
|
31
|
+
readonly request_id: string;
|
|
32
|
+
readonly expected_revision: number;
|
|
33
|
+
readonly changes: ProgressReportChanges;
|
|
34
|
+
readonly reopen?: boolean | undefined;
|
|
35
|
+
}, env?: NodeJS.ProcessEnv): Promise<ProgressReportReceipt>;
|
|
36
|
+
export declare function getReport(reportId: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
37
|
+
document: ProgressReportDocument;
|
|
38
|
+
revision: number;
|
|
39
|
+
path: string;
|
|
40
|
+
}>;
|
|
41
|
+
export interface ProgressReportCandidate {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly path: string;
|
|
44
|
+
readonly title: string;
|
|
45
|
+
readonly goal: string;
|
|
46
|
+
readonly status: string;
|
|
47
|
+
readonly revision: number;
|
|
48
|
+
readonly updated_at: string;
|
|
49
|
+
readonly agents: readonly string[];
|
|
50
|
+
readonly tasks: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
export interface ProgressReportListing {
|
|
53
|
+
readonly candidates: readonly ProgressReportCandidate[];
|
|
54
|
+
/** True when the listing could not consider every report on disk. */
|
|
55
|
+
readonly truncated: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function listReports(options: {
|
|
58
|
+
readonly project_folder?: string;
|
|
59
|
+
readonly limit: number;
|
|
60
|
+
}, env?: NodeJS.ProcessEnv): Promise<ProgressReportListing>;
|
|
61
|
+
/**
|
|
62
|
+
* Apply one bounded patch. Every server-owned field (timestamps, ids) is
|
|
63
|
+
* stamped here rather than trusted from the caller, so a caller cannot publish
|
|
64
|
+
* a guessed clock or rewrite an identity.
|
|
65
|
+
*/
|
|
66
|
+
export declare function applyChanges(current: ProgressReportDocument, changes: ProgressReportChanges, reopen: boolean): ProgressReportDocument;
|