veryfront 0.1.810 → 0.1.812
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/esm/deno.d.ts +3 -0
- package/esm/deno.js +5 -2
- package/esm/src/agent/conversation/durable-contracts.d.ts +204 -0
- package/esm/src/agent/conversation/durable-contracts.d.ts.map +1 -0
- package/esm/src/agent/conversation/durable-contracts.js +168 -0
- package/esm/src/agent/conversation/durable.d.ts +3 -198
- package/esm/src/agent/conversation/durable.d.ts.map +1 -1
- package/esm/src/agent/conversation/durable.js +2 -167
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +18 -6
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +1 -0
- package/esm/src/agent/types.d.ts +8 -0
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.d.ts +12 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +12 -0
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +6 -1
- package/esm/src/discovery/handlers/index.d.ts +1 -0
- package/esm/src/discovery/handlers/index.d.ts.map +1 -1
- package/esm/src/discovery/handlers/index.js +1 -0
- package/esm/src/discovery/handlers/work-handler.d.ts +7 -0
- package/esm/src/discovery/handlers/work-handler.d.ts.map +1 -0
- package/esm/src/discovery/handlers/work-handler.js +19 -0
- package/esm/src/discovery/import-rewriter.d.ts +1 -1
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +1 -0
- package/esm/src/discovery/project-discovery-config.d.ts +2 -0
- package/esm/src/discovery/project-discovery-config.d.ts.map +1 -1
- package/esm/src/discovery/project-discovery-config.js +2 -0
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +2 -0
- package/esm/src/discovery/types.d.ts +3 -0
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +2 -1
- package/esm/src/modules/manifest/route-module-manifest.d.ts.map +1 -1
- package/esm/src/modules/manifest/route-module-manifest.js +2 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +27 -9
- package/esm/src/observability/request-profiler.d.ts +1 -0
- package/esm/src/observability/request-profiler.d.ts.map +1 -1
- package/esm/src/observability/request-profiler.js +6 -0
- package/esm/src/observability/simple-metrics/index.d.ts +6 -3
- package/esm/src/observability/simple-metrics/index.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/index.js +5 -2
- package/esm/src/observability/simple-metrics/metrics-recorder.d.ts +4 -0
- package/esm/src/observability/simple-metrics/metrics-recorder.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/metrics-recorder.js +34 -0
- package/esm/src/observability/simple-metrics/metrics-state.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/metrics-state.js +24 -0
- package/esm/src/observability/simple-metrics/otel-instruments.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/otel-instruments.js +13 -0
- package/esm/src/observability/simple-metrics/types.d.ts +12 -0
- package/esm/src/observability/simple-metrics/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/shared-watcher.js +1 -1
- package/esm/src/platform/compat/http/native-response.d.ts +10 -1
- package/esm/src/platform/compat/http/native-response.d.ts.map +1 -1
- package/esm/src/platform/compat/http/native-response.js +20 -14
- package/esm/src/proxy/handler.d.ts +1 -7
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +24 -160
- package/esm/src/proxy/proxy-access-control.d.ts +41 -0
- package/esm/src/proxy/proxy-access-control.d.ts.map +1 -0
- package/esm/src/proxy/proxy-access-control.js +151 -0
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +3 -1
- package/esm/src/rendering/cache/cache-coordinator.d.ts +3 -0
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +27 -2
- package/esm/src/rendering/cache/stores/memory-store.d.ts +2 -0
- package/esm/src/rendering/cache/stores/memory-store.d.ts.map +1 -1
- package/esm/src/rendering/cache/stores/memory-store.js +2 -1
- package/esm/src/rendering/orchestrator/lifecycle.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/lifecycle.js +1 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +13 -25
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +27 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.js +28 -0
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +3 -1
- package/esm/src/rendering/shared/context-aware-cache.d.ts +3 -0
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +25 -2
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +4 -1
- package/esm/src/server/handlers/dev/dashboard/api.d.ts +3 -0
- package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.js +41 -57
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +11 -1
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +14 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/work/factory.d.ts +4 -0
- package/esm/src/work/factory.d.ts.map +1 -0
- package/esm/src/work/factory.js +51 -0
- package/esm/src/work/index.d.ts +27 -0
- package/esm/src/work/index.d.ts.map +1 -0
- package/esm/src/work/index.js +25 -0
- package/esm/src/work/prompt-augmentation.d.ts +6 -0
- package/esm/src/work/prompt-augmentation.d.ts.map +1 -0
- package/esm/src/work/prompt-augmentation.js +30 -0
- package/esm/src/work/registry.d.ts +10 -0
- package/esm/src/work/registry.d.ts.map +1 -0
- package/esm/src/work/registry.js +23 -0
- package/esm/src/work/types.d.ts +30 -0
- package/esm/src/work/types.d.ts.map +1 -0
- package/esm/src/work/types.js +1 -0
- package/package.json +5 -1
package/esm/deno.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare namespace _default {
|
|
|
31
31
|
"./workflow/claude-code": string;
|
|
32
32
|
"./workflow/claude-code/react": string;
|
|
33
33
|
"./workflow/discovery": string;
|
|
34
|
+
"./work": string;
|
|
34
35
|
"./schemas": string;
|
|
35
36
|
"./prompt": string;
|
|
36
37
|
"./resource": string;
|
|
@@ -100,6 +101,7 @@ declare namespace _default {
|
|
|
100
101
|
"veryfront/workflow/claude-code": string;
|
|
101
102
|
"veryfront/workflow/claude-code/react": string;
|
|
102
103
|
"veryfront/workflow/discovery": string;
|
|
104
|
+
"veryfront/work": string;
|
|
103
105
|
"veryfront/utils": string;
|
|
104
106
|
"veryfront/utils/box": string;
|
|
105
107
|
"veryfront/utils/case-utils": string;
|
|
@@ -203,6 +205,7 @@ declare namespace _default {
|
|
|
203
205
|
"#veryfront/workflow/claude-code": string;
|
|
204
206
|
"#veryfront/workflow/claude-code/react": string;
|
|
205
207
|
"#veryfront/workflow/discovery": string;
|
|
208
|
+
"#veryfront/work": string;
|
|
206
209
|
"#veryfront/schemas": string;
|
|
207
210
|
"#veryfront/http/responses": string;
|
|
208
211
|
"#veryfront/compat/console": string;
|
package/esm/deno.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.812",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"nodeModulesDir": "auto",
|
|
6
6
|
"minimumDependencyAge": {
|
|
@@ -86,6 +86,7 @@ export default {
|
|
|
86
86
|
"./workflow/claude-code": "./src/workflow/claude-code/index.ts",
|
|
87
87
|
"./workflow/claude-code/react": "./src/workflow/claude-code/react/index.ts",
|
|
88
88
|
"./workflow/discovery": "./src/workflow/discovery/index.ts",
|
|
89
|
+
"./work": "./src/work/index.ts",
|
|
89
90
|
"./schemas": "./src/schemas/index.ts",
|
|
90
91
|
"./prompt": "./src/prompt/index.ts",
|
|
91
92
|
"./resource": "./src/resource/index.ts",
|
|
@@ -155,6 +156,7 @@ export default {
|
|
|
155
156
|
"veryfront/workflow/claude-code": "./src/workflow/claude-code/index.ts",
|
|
156
157
|
"veryfront/workflow/claude-code/react": "./src/workflow/claude-code/react/index.ts",
|
|
157
158
|
"veryfront/workflow/discovery": "./src/workflow/discovery/index.ts",
|
|
159
|
+
"veryfront/work": "./src/work/index.ts",
|
|
158
160
|
"veryfront/utils": "./src/utils/index.ts",
|
|
159
161
|
"veryfront/utils/box": "./src/utils/box.ts",
|
|
160
162
|
"veryfront/utils/case-utils": "./src/utils/case-utils.ts",
|
|
@@ -258,6 +260,7 @@ export default {
|
|
|
258
260
|
"#veryfront/workflow/claude-code": "./src/workflow/claude-code/index.ts",
|
|
259
261
|
"#veryfront/workflow/claude-code/react": "./src/workflow/claude-code/react/index.ts",
|
|
260
262
|
"#veryfront/workflow/discovery": "./src/workflow/discovery/index.ts",
|
|
263
|
+
"#veryfront/work": "./src/work/index.ts",
|
|
261
264
|
"#veryfront/schemas": "./src/schemas/index.ts",
|
|
262
265
|
"#veryfront/http/responses": "./src/platform/compat/http/responses.ts",
|
|
263
266
|
"#veryfront/compat/console": "./src/platform/compat/console/index.ts",
|
|
@@ -368,7 +371,7 @@ export default {
|
|
|
368
371
|
"lint": "DENO_NO_PACKAGE_JSON=1 deno lint src/ cli/ react/ && deno lint --config=scripts/test.deno.json scripts/test/ scripts/build/npm-package-metadata.test.ts",
|
|
369
372
|
"fmt": "deno fmt src/ cli/ react/ && deno fmt --config=scripts/test.deno.json scripts/test/",
|
|
370
373
|
"fmt:check": "deno fmt --check src/ cli/ react/ && deno fmt --check --config=scripts/test.deno.json scripts/test/",
|
|
371
|
-
"typecheck": "deno task generate:manifests:check && deno check src/index.ts cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/transforms/index.ts src/config/index.ts src/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/modules/index.ts src/proxy/main.ts src/chat/index.ts src/markdown/index.ts src/mdx/index.ts src/fs/index.ts src/oauth/index.ts src/agent/index.ts src/agent/service/route-export.check.ts src/tool/index.ts src/workflow/index.ts src/prompt/index.ts src/resource/index.ts src/runs/index.ts src/mcp/index.ts src/provider/index.ts",
|
|
374
|
+
"typecheck": "deno task generate:manifests:check && deno check src/index.ts cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/transforms/index.ts src/config/index.ts src/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/modules/index.ts src/proxy/main.ts src/chat/index.ts src/markdown/index.ts src/mdx/index.ts src/fs/index.ts src/oauth/index.ts src/agent/index.ts src/agent/service/route-export.check.ts src/tool/index.ts src/workflow/index.ts src/work/index.ts src/prompt/index.ts src/resource/index.ts src/runs/index.ts src/mcp/index.ts src/provider/index.ts",
|
|
372
375
|
"verify": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck && deno task test && deno task test:e2e:binary",
|
|
373
376
|
"verify:quick": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck",
|
|
374
377
|
"docs": "deno run --allow-read --allow-write --allow-run --allow-env scripts/docs/generate-api-reference.ts",
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { InferSchema } from "../../extensions/schema/index.js";
|
|
2
|
+
/** Zod schema for get conversation run targets. */
|
|
3
|
+
export declare const getConversationRunTargetsSchema: () => import("../../internal-agents/schema.js").Schema<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
4
|
+
sourceTargetKind: import("../../internal-agents/schema.js").Schema<string | null>;
|
|
5
|
+
runtimeTargetKind: import("../../internal-agents/schema.js").Schema<string | null>;
|
|
6
|
+
targetBranchId: import("../../internal-agents/schema.js").Schema<string | null>;
|
|
7
|
+
}>>;
|
|
8
|
+
/** Schema for conversation run targets.
|
|
9
|
+
* @deprecated Use getConversationRunTargetsSchema()
|
|
10
|
+
*/
|
|
11
|
+
export declare const ConversationRunTargetsSchema: import("../../internal-agents/schema.js").Schema<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
12
|
+
sourceTargetKind: import("../../internal-agents/schema.js").Schema<string | null>;
|
|
13
|
+
runtimeTargetKind: import("../../internal-agents/schema.js").Schema<string | null>;
|
|
14
|
+
targetBranchId: import("../../internal-agents/schema.js").Schema<string | null>;
|
|
15
|
+
}>>;
|
|
16
|
+
/** Public API contract for conversation run targets. */
|
|
17
|
+
export type ConversationRunTargets = InferSchema<ReturnType<typeof getConversationRunTargetsSchema>>;
|
|
18
|
+
/** Resolves conversation run targets. */
|
|
19
|
+
export declare function resolveConversationRunTargets(input: {
|
|
20
|
+
projectId?: string | null;
|
|
21
|
+
branchId?: string | null;
|
|
22
|
+
}): ConversationRunTargets;
|
|
23
|
+
/** Zod schema for get conversation run status. */
|
|
24
|
+
export declare const getConversationRunStatusSchema: () => import("../../internal-agents/schema.js").Schema<string>;
|
|
25
|
+
/** Schema for conversation run status.
|
|
26
|
+
* @deprecated Use getConversationRunStatusSchema()
|
|
27
|
+
*/
|
|
28
|
+
export declare const ConversationRunStatusSchema: import("../../internal-agents/schema.js").Schema<string>;
|
|
29
|
+
/** Public API contract for conversation run projection. */
|
|
30
|
+
export interface ConversationRunProjection {
|
|
31
|
+
runId: string;
|
|
32
|
+
conversationId: string;
|
|
33
|
+
messageId: string;
|
|
34
|
+
latestEventId: number;
|
|
35
|
+
latestExternalEventSequence: number;
|
|
36
|
+
waitingToolCallId: string | null;
|
|
37
|
+
waitingToolName: string | null;
|
|
38
|
+
status: "pending" | "running" | "waiting_for_tool" | "completed" | "failed" | "cancelled";
|
|
39
|
+
}
|
|
40
|
+
/** Zod schema for get conversation run projection. */
|
|
41
|
+
export declare const getConversationRunProjectionSchema: () => import("../../internal-agents/schema.js").Schema<ConversationRunProjection>;
|
|
42
|
+
/** Schema for conversation run projection.
|
|
43
|
+
* @deprecated Use getConversationRunProjectionSchema()
|
|
44
|
+
*/
|
|
45
|
+
export declare const ConversationRunProjectionSchema: import("../../internal-agents/schema.js").Schema<ConversationRunProjection>;
|
|
46
|
+
/** Public API contract for a conversation run status is active. */
|
|
47
|
+
export type ActiveConversationRunStatus = Extract<ConversationRunProjection["status"], "pending" | "running" | "waiting_for_tool">;
|
|
48
|
+
/** Public API contract for terminal conversation run status. */
|
|
49
|
+
export type TerminalConversationRunStatus = Extract<ConversationRunProjection["status"], "completed" | "failed" | "cancelled">;
|
|
50
|
+
/** Result returned from conversation run append cursor resync. */
|
|
51
|
+
export type ConversationRunAppendCursorResyncResult = "advanced" | "non_appendable" | "unchanged";
|
|
52
|
+
/** Public API contract for conversation run append recovery outcome. */
|
|
53
|
+
export type ConversationRunAppendRecoveryOutcome = "resumed" | "stopped" | "bubbled";
|
|
54
|
+
/** Public API contract for conversation run append failure outcome. */
|
|
55
|
+
export type ConversationRunAppendFailureOutcome = "resumed" | "stopped" | "retry_scheduled";
|
|
56
|
+
/** Public API contract for conversation run append execution outcome. */
|
|
57
|
+
export type ConversationRunAppendExecutionOutcome = "resumed" | "stopped" | "retry_scheduled";
|
|
58
|
+
/** Public API contract for conversation run batch flush outcome. */
|
|
59
|
+
export type ConversationRunBatchFlushOutcome = "flushed" | "resumed" | "stopped" | "retry_scheduled";
|
|
60
|
+
/** Public API contract for conversation run queue flush outcome. */
|
|
61
|
+
export type ConversationRunQueueFlushOutcome = "flushed" | "stopped" | "retry_scheduled";
|
|
62
|
+
/** Public API contract for conversation run event queue controller. */
|
|
63
|
+
export interface ConversationRunEventQueueController {
|
|
64
|
+
enqueue(events: unknown[]): void;
|
|
65
|
+
flush(): Promise<{
|
|
66
|
+
outcome: "idle" | "flushed";
|
|
67
|
+
latestEventId: number;
|
|
68
|
+
latestExternalEventSequence: number;
|
|
69
|
+
pendingEventCount: number;
|
|
70
|
+
consecutiveFailures: number;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
outcome: "stopped";
|
|
74
|
+
latestEventId: number;
|
|
75
|
+
latestExternalEventSequence: number;
|
|
76
|
+
pendingEventCount: 0;
|
|
77
|
+
consecutiveFailures: number;
|
|
78
|
+
disabled: true;
|
|
79
|
+
disableReason?: "cursor_resyncs_exhausted" | "non_appendable" | "ignorable_append_rejection";
|
|
80
|
+
} | {
|
|
81
|
+
outcome: "retry_scheduled";
|
|
82
|
+
latestEventId: number;
|
|
83
|
+
latestExternalEventSequence: number;
|
|
84
|
+
pendingEventCount: number;
|
|
85
|
+
consecutiveFailures: number;
|
|
86
|
+
disabled: false;
|
|
87
|
+
errorMessage: string;
|
|
88
|
+
}>;
|
|
89
|
+
getSnapshot(): {
|
|
90
|
+
latestEventId: number;
|
|
91
|
+
latestExternalEventSequence: number;
|
|
92
|
+
pendingEventCount: number;
|
|
93
|
+
consecutiveFailures: number;
|
|
94
|
+
disabled: boolean;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** Zod schema for get create conversation run accepted. */
|
|
98
|
+
export declare const getCreateConversationRunAcceptedSchema: () => import("../../internal-agents/schema.js").Schema<{
|
|
99
|
+
runId: string;
|
|
100
|
+
}>;
|
|
101
|
+
/** Schema for create conversation run accepted.
|
|
102
|
+
* @deprecated Use getCreateConversationRunAcceptedSchema()
|
|
103
|
+
*/
|
|
104
|
+
export declare const CreateConversationRunAcceptedSchema: import("../../internal-agents/schema.js").Schema<{
|
|
105
|
+
runId: string;
|
|
106
|
+
}>;
|
|
107
|
+
/** Zod schema for get complete conversation run response. */
|
|
108
|
+
export declare const getCompleteConversationRunResponseSchema: () => import("../../internal-agents/schema.js").Schema<{
|
|
109
|
+
completed: boolean;
|
|
110
|
+
run: {
|
|
111
|
+
status: string;
|
|
112
|
+
} & {
|
|
113
|
+
runId?: string | undefined;
|
|
114
|
+
run_id?: string | undefined;
|
|
115
|
+
} & Record<string, unknown>;
|
|
116
|
+
} & {} & Record<string, unknown>>;
|
|
117
|
+
/** Schema for complete conversation run response.
|
|
118
|
+
* @deprecated Use getCompleteConversationRunResponseSchema()
|
|
119
|
+
*/
|
|
120
|
+
export declare const CompleteConversationRunResponseSchema: import("../../internal-agents/schema.js").Schema<{
|
|
121
|
+
completed: boolean;
|
|
122
|
+
run: {
|
|
123
|
+
status: string;
|
|
124
|
+
} & {
|
|
125
|
+
runId?: string | undefined;
|
|
126
|
+
run_id?: string | undefined;
|
|
127
|
+
} & Record<string, unknown>;
|
|
128
|
+
} & {} & Record<string, unknown>>;
|
|
129
|
+
/** Response payload for append conversation run events. */
|
|
130
|
+
export interface AppendConversationRunEventsResponse {
|
|
131
|
+
latestEventId: number;
|
|
132
|
+
latestExternalEventSequence: number;
|
|
133
|
+
appendedCount: number;
|
|
134
|
+
run: {
|
|
135
|
+
runId: string;
|
|
136
|
+
conversationId: string;
|
|
137
|
+
latestEventId: number;
|
|
138
|
+
latestExternalEventSequence: number;
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** Zod schema for get append conversation run events response. */
|
|
143
|
+
export declare const getAppendConversationRunEventsResponseSchema: () => import("../../internal-agents/schema.js").Schema<AppendConversationRunEventsResponse | import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
144
|
+
latestEventId: import("../../internal-agents/schema.js").Schema<number>;
|
|
145
|
+
latestExternalEventSequence: import("../../internal-agents/schema.js").Schema<number>;
|
|
146
|
+
appendedCount: import("../../internal-agents/schema.js").Schema<number>;
|
|
147
|
+
run: import("../../internal-agents/schema.js").Schema<{
|
|
148
|
+
runId: string;
|
|
149
|
+
conversationId: string;
|
|
150
|
+
latestEventId: number;
|
|
151
|
+
latestExternalEventSequence: number;
|
|
152
|
+
} & {} & Record<string, unknown>>;
|
|
153
|
+
}>>;
|
|
154
|
+
/** Schema for append conversation run events response.
|
|
155
|
+
* @deprecated Use getAppendConversationRunEventsResponseSchema()
|
|
156
|
+
*/
|
|
157
|
+
export declare const AppendConversationRunEventsResponseSchema: import("../../internal-agents/schema.js").Schema<AppendConversationRunEventsResponse | import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
158
|
+
latestEventId: import("../../internal-agents/schema.js").Schema<number>;
|
|
159
|
+
latestExternalEventSequence: import("../../internal-agents/schema.js").Schema<number>;
|
|
160
|
+
appendedCount: import("../../internal-agents/schema.js").Schema<number>;
|
|
161
|
+
run: import("../../internal-agents/schema.js").Schema<{
|
|
162
|
+
runId: string;
|
|
163
|
+
conversationId: string;
|
|
164
|
+
latestEventId: number;
|
|
165
|
+
latestExternalEventSequence: number;
|
|
166
|
+
} & {} & Record<string, unknown>>;
|
|
167
|
+
}>>;
|
|
168
|
+
/** Zod schema for get conversation run error. */
|
|
169
|
+
export declare const getConversationRunErrorSchema: () => import("../../internal-agents/schema.js").Schema<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
170
|
+
detail: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
171
|
+
error: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
172
|
+
}>>;
|
|
173
|
+
/** Public API contract for conversation agent run usage. */
|
|
174
|
+
export interface ConversationAgentRunUsage {
|
|
175
|
+
inputTokens: number;
|
|
176
|
+
outputTokens: number;
|
|
177
|
+
totalTokens: number;
|
|
178
|
+
}
|
|
179
|
+
/** Input payload for create conversation agent run. */
|
|
180
|
+
export interface CreateConversationAgentRunInput {
|
|
181
|
+
authToken: string;
|
|
182
|
+
apiUrl: string;
|
|
183
|
+
conversationId: string;
|
|
184
|
+
runId?: string;
|
|
185
|
+
parentRunId?: string;
|
|
186
|
+
agentId: string;
|
|
187
|
+
implementationKind?: string | null;
|
|
188
|
+
projectId?: string | null;
|
|
189
|
+
branchId?: string | null;
|
|
190
|
+
}
|
|
191
|
+
/** Input payload for finalize conversation agent run. */
|
|
192
|
+
export interface FinalizeConversationAgentRunInput {
|
|
193
|
+
authToken: string;
|
|
194
|
+
apiUrl: string;
|
|
195
|
+
conversationId: string;
|
|
196
|
+
runId: string;
|
|
197
|
+
status: "completed" | "failed" | "cancelled";
|
|
198
|
+
model: string;
|
|
199
|
+
provider: string;
|
|
200
|
+
usage?: ConversationAgentRunUsage;
|
|
201
|
+
terminalErrorCode?: string | null;
|
|
202
|
+
terminalErrorMessage?: string | null;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=durable-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-contracts.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/durable-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE,mDAAmD;AACnD,eAAO,MAAM,+BAA+B;;;;GAM3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;GAA8C,CAAC;AAExF,wDAAwD;AACxD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC9C,UAAU,CAAC,OAAO,+BAA+B,CAAC,CACnD,CAAC;AAEF,yCAAyC;AACzC,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,sBAAsB,CAoBzB;AAED,kDAAkD;AAClD,eAAO,MAAM,8BAA8B,gEAE1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,0DAA6C,CAAC;AAEtF,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B,EAAE,MAAM,CAAC;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;CAC3F;AAED,sDAAsD;AACtD,eAAO,MAAM,kCAAkC,mFAgD9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,6EAAiD,CAAC;AAE9F,mEAAmE;AACnE,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,yBAAyB,CAAC,QAAQ,CAAC,EACnC,SAAS,GAAG,SAAS,GAAG,kBAAkB,CAC3C,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,yBAAyB,CAAC,QAAQ,CAAC,EACnC,WAAW,GAAG,QAAQ,GAAG,WAAW,CACrC,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,uCAAuC,GAC/C,UAAU,GACV,gBAAgB,GAChB,WAAW,CAAC;AAEhB,wEAAwE;AACxE,MAAM,MAAM,oCAAoC,GAC5C,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd,uEAAuE;AACvE,MAAM,MAAM,mCAAmC,GAC3C,SAAS,GACT,SAAS,GACT,iBAAiB,CAAC;AAEtB,yEAAyE;AACzE,MAAM,MAAM,qCAAqC,GAC7C,SAAS,GACT,SAAS,GACT,iBAAiB,CAAC;AAEtB,oEAAoE;AACpE,MAAM,MAAM,gCAAgC,GACxC,SAAS,GACT,SAAS,GACT,SAAS,GACT,iBAAiB,CAAC;AAEtB,oEAAoE;AACpE,MAAM,MAAM,gCAAgC,GACxC,SAAS,GACT,SAAS,GACT,iBAAiB,CAAC;AAEtB,uEAAuE;AACvE,MAAM,WAAW,mCAAmC;IAClD,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjC,KAAK,IAAI,OAAO,CACZ;QACA,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,EAAE,MAAM,CAAC;QACpC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,QAAQ,EAAE,OAAO,CAAC;KACnB,GACC;QACA,OAAO,EAAE,SAAS,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,EAAE,MAAM,CAAC;QACpC,iBAAiB,EAAE,CAAC,CAAC;QACrB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,QAAQ,EAAE,IAAI,CAAC;QACf,aAAa,CAAC,EAAE,0BAA0B,GAAG,gBAAgB,GAAG,4BAA4B,CAAC;KAC9F,GACC;QACA,OAAO,EAAE,iBAAiB,CAAC;QAC3B,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,EAAE,MAAM,CAAC;QACpC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,QAAQ,EAAE,KAAK,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACtB,CACF,CAAC;IACF,WAAW,IAAI;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,EAAE,MAAM,CAAC;QACpC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED,2DAA2D;AAC3D,eAAO,MAAM,sCAAsC;WAQnB,MAAM;EAQrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mCAAmC;WAbhB,MAAM;EAerC,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,wCAAwC;;;;;;;;iCASpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;iCAEjD,CAAC;AAEF,2DAA2D;AAC3D,MAAM,WAAW,mCAAmC;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B,EAAE,MAAM,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,EAAE,MAAM,CAAC;QACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED,kEAAkE;AAClE,eAAO,MAAM,4CAA4C;;;;;;;;;;GAwCxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;GAErD,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,6BAA6B;;;GAKzC,CAAC;AAEF,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,uDAAuD;AACvD,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,yDAAyD;AACzD,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,yBAAyB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { defineSchema, lazySchema } from "../../schemas/index.js";
|
|
2
|
+
/** Zod schema for get conversation run targets. */
|
|
3
|
+
export const getConversationRunTargetsSchema = defineSchema((v) => v.object({
|
|
4
|
+
sourceTargetKind: v.enum(["project", "preview_branch"]).nullable(),
|
|
5
|
+
runtimeTargetKind: v.enum(["main_branch", "preview_branch"]).nullable(),
|
|
6
|
+
targetBranchId: v.string().uuid().nullable(),
|
|
7
|
+
}));
|
|
8
|
+
/** Schema for conversation run targets.
|
|
9
|
+
* @deprecated Use getConversationRunTargetsSchema()
|
|
10
|
+
*/
|
|
11
|
+
export const ConversationRunTargetsSchema = lazySchema(getConversationRunTargetsSchema);
|
|
12
|
+
/** Resolves conversation run targets. */
|
|
13
|
+
export function resolveConversationRunTargets(input) {
|
|
14
|
+
return getConversationRunTargetsSchema().parse(!input.projectId
|
|
15
|
+
? {
|
|
16
|
+
sourceTargetKind: null,
|
|
17
|
+
runtimeTargetKind: null,
|
|
18
|
+
targetBranchId: null,
|
|
19
|
+
}
|
|
20
|
+
: input.branchId
|
|
21
|
+
? {
|
|
22
|
+
sourceTargetKind: "preview_branch",
|
|
23
|
+
runtimeTargetKind: "preview_branch",
|
|
24
|
+
targetBranchId: input.branchId,
|
|
25
|
+
}
|
|
26
|
+
: {
|
|
27
|
+
sourceTargetKind: "project",
|
|
28
|
+
runtimeTargetKind: "main_branch",
|
|
29
|
+
targetBranchId: null,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Zod schema for get conversation run status. */
|
|
33
|
+
export const getConversationRunStatusSchema = defineSchema((v) => v.enum(["pending", "running", "waiting_for_tool", "completed", "failed", "cancelled"]));
|
|
34
|
+
/** Schema for conversation run status.
|
|
35
|
+
* @deprecated Use getConversationRunStatusSchema()
|
|
36
|
+
*/
|
|
37
|
+
export const ConversationRunStatusSchema = lazySchema(getConversationRunStatusSchema);
|
|
38
|
+
/** Zod schema for get conversation run projection. */
|
|
39
|
+
export const getConversationRunProjectionSchema = defineSchema((v) => v.object({
|
|
40
|
+
runId: v.string().min(1).optional(),
|
|
41
|
+
run_id: v.string().min(1).optional(),
|
|
42
|
+
conversationId: v.string().uuid().optional(),
|
|
43
|
+
conversation_id: v.string().uuid().optional(),
|
|
44
|
+
messageId: v.string().uuid().optional(),
|
|
45
|
+
message_id: v.string().uuid().optional(),
|
|
46
|
+
latestEventId: v.number().int().nonnegative().optional(),
|
|
47
|
+
latest_event_id: v.number().int().nonnegative().optional(),
|
|
48
|
+
latestExternalEventSequence: v.number().int().nonnegative().optional(),
|
|
49
|
+
latest_external_event_sequence: v.number().int().nonnegative().optional(),
|
|
50
|
+
waitingToolCallId: v.string().min(1).nullable().optional(),
|
|
51
|
+
waiting_tool_call_id: v.string().min(1).nullable().optional(),
|
|
52
|
+
waitingToolName: v.string().nullable().optional(),
|
|
53
|
+
waiting_tool_name: v.string().nullable().optional(),
|
|
54
|
+
status: getConversationRunStatusSchema(),
|
|
55
|
+
})
|
|
56
|
+
.passthrough()
|
|
57
|
+
.transform((data) => {
|
|
58
|
+
const d = data;
|
|
59
|
+
const runId = (d.runId ?? d.run_id);
|
|
60
|
+
const conversationId = (d.conversationId ?? d.conversation_id);
|
|
61
|
+
const messageId = (d.messageId ?? d.message_id);
|
|
62
|
+
const latestEventId = (d.latestEventId ?? d.latest_event_id) ?? 0;
|
|
63
|
+
const latestExternalEventSequence = (d.latestExternalEventSequence ??
|
|
64
|
+
d.latest_external_event_sequence);
|
|
65
|
+
if (!runId || !conversationId || !messageId) {
|
|
66
|
+
throw new Error("Missing run identifiers in durable run response");
|
|
67
|
+
}
|
|
68
|
+
if (latestExternalEventSequence === undefined) {
|
|
69
|
+
throw new Error("Missing latestExternalEventSequence in durable run response");
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
runId,
|
|
73
|
+
conversationId,
|
|
74
|
+
messageId,
|
|
75
|
+
latestEventId,
|
|
76
|
+
latestExternalEventSequence,
|
|
77
|
+
waitingToolCallId: (d.waitingToolCallId ?? d.waiting_tool_call_id) ??
|
|
78
|
+
null,
|
|
79
|
+
waitingToolName: (d.waitingToolName ?? d.waiting_tool_name) ?? null,
|
|
80
|
+
status: d.status,
|
|
81
|
+
};
|
|
82
|
+
}));
|
|
83
|
+
/** Schema for conversation run projection.
|
|
84
|
+
* @deprecated Use getConversationRunProjectionSchema()
|
|
85
|
+
*/
|
|
86
|
+
export const ConversationRunProjectionSchema = lazySchema(getConversationRunProjectionSchema);
|
|
87
|
+
/** Zod schema for get create conversation run accepted. */
|
|
88
|
+
export const getCreateConversationRunAcceptedSchema = defineSchema((v) => v.object({
|
|
89
|
+
run: v.object({
|
|
90
|
+
runId: v.string().min(1).optional(),
|
|
91
|
+
run_id: v.string().min(1).optional(),
|
|
92
|
+
}).passthrough(),
|
|
93
|
+
})
|
|
94
|
+
.passthrough()
|
|
95
|
+
.transform((data) => {
|
|
96
|
+
const d = data;
|
|
97
|
+
const runId = (d.run.runId ?? d.run.run_id);
|
|
98
|
+
if (!runId) {
|
|
99
|
+
throw new Error("Missing run id in canonical create run response");
|
|
100
|
+
}
|
|
101
|
+
return { runId };
|
|
102
|
+
}));
|
|
103
|
+
/** Schema for create conversation run accepted.
|
|
104
|
+
* @deprecated Use getCreateConversationRunAcceptedSchema()
|
|
105
|
+
*/
|
|
106
|
+
export const CreateConversationRunAcceptedSchema = lazySchema(getCreateConversationRunAcceptedSchema);
|
|
107
|
+
/** Zod schema for get complete conversation run response. */
|
|
108
|
+
export const getCompleteConversationRunResponseSchema = defineSchema((v) => v.object({
|
|
109
|
+
completed: v.boolean(),
|
|
110
|
+
run: v.object({
|
|
111
|
+
runId: v.string().min(1).optional(),
|
|
112
|
+
run_id: v.string().min(1).optional(),
|
|
113
|
+
status: v.enum(["pending", "running", "waiting", "completed", "failed", "cancelled"]),
|
|
114
|
+
}).passthrough(),
|
|
115
|
+
}).passthrough());
|
|
116
|
+
/** Schema for complete conversation run response.
|
|
117
|
+
* @deprecated Use getCompleteConversationRunResponseSchema()
|
|
118
|
+
*/
|
|
119
|
+
export const CompleteConversationRunResponseSchema = lazySchema(getCompleteConversationRunResponseSchema);
|
|
120
|
+
/** Zod schema for get append conversation run events response. */
|
|
121
|
+
export const getAppendConversationRunEventsResponseSchema = defineSchema((v) => v.union([
|
|
122
|
+
v.object({
|
|
123
|
+
latestEventId: v.number().int().nonnegative(),
|
|
124
|
+
latestExternalEventSequence: v.number().int().nonnegative(),
|
|
125
|
+
appendedCount: v.number().int().nonnegative(),
|
|
126
|
+
run: v.object({
|
|
127
|
+
runId: v.string().min(1),
|
|
128
|
+
conversationId: v.string().uuid(),
|
|
129
|
+
latestEventId: v.number().int().nonnegative(),
|
|
130
|
+
latestExternalEventSequence: v.number().int().nonnegative(),
|
|
131
|
+
}).passthrough(),
|
|
132
|
+
}),
|
|
133
|
+
v.object({
|
|
134
|
+
latest_event_id: v.number().int().nonnegative(),
|
|
135
|
+
latest_external_event_sequence: v.number().int().nonnegative(),
|
|
136
|
+
appended_count: v.number().int().nonnegative(),
|
|
137
|
+
run: v.object({
|
|
138
|
+
run_id: v.string().min(1),
|
|
139
|
+
conversation_id: v.string().uuid(),
|
|
140
|
+
latest_event_id: v.number().int().nonnegative(),
|
|
141
|
+
latest_external_event_sequence: v.number().int().nonnegative(),
|
|
142
|
+
}).passthrough(),
|
|
143
|
+
}).transform((data) => {
|
|
144
|
+
const d = data;
|
|
145
|
+
const run = d.run;
|
|
146
|
+
return {
|
|
147
|
+
latestEventId: d.latest_event_id,
|
|
148
|
+
latestExternalEventSequence: d.latest_external_event_sequence,
|
|
149
|
+
appendedCount: d.appended_count,
|
|
150
|
+
run: {
|
|
151
|
+
...run,
|
|
152
|
+
runId: run.run_id,
|
|
153
|
+
conversationId: run.conversation_id,
|
|
154
|
+
latestEventId: run.latest_event_id,
|
|
155
|
+
latestExternalEventSequence: run.latest_external_event_sequence,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}),
|
|
159
|
+
]));
|
|
160
|
+
/** Schema for append conversation run events response.
|
|
161
|
+
* @deprecated Use getAppendConversationRunEventsResponseSchema()
|
|
162
|
+
*/
|
|
163
|
+
export const AppendConversationRunEventsResponseSchema = lazySchema(getAppendConversationRunEventsResponseSchema);
|
|
164
|
+
/** Zod schema for get conversation run error. */
|
|
165
|
+
export const getConversationRunErrorSchema = defineSchema((v) => v.object({
|
|
166
|
+
detail: v.string().min(1).optional(),
|
|
167
|
+
error: v.string().min(1).optional(),
|
|
168
|
+
}));
|
|
@@ -1,201 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
sourceTargetKind: Schema<string | null>;
|
|
5
|
-
runtimeTargetKind: Schema<string | null>;
|
|
6
|
-
targetBranchId: Schema<string | null>;
|
|
7
|
-
}>>;
|
|
8
|
-
/** Schema for conversation run targets.
|
|
9
|
-
* @deprecated Use getConversationRunTargetsSchema()
|
|
10
|
-
*/
|
|
11
|
-
export declare const ConversationRunTargetsSchema: Schema<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
12
|
-
sourceTargetKind: Schema<string | null>;
|
|
13
|
-
runtimeTargetKind: Schema<string | null>;
|
|
14
|
-
targetBranchId: Schema<string | null>;
|
|
15
|
-
}>>;
|
|
16
|
-
/** Public API contract for conversation run targets. */
|
|
17
|
-
export type ConversationRunTargets = InferSchema<ReturnType<typeof getConversationRunTargetsSchema>>;
|
|
18
|
-
/** Resolves conversation run targets. */
|
|
19
|
-
export declare function resolveConversationRunTargets(input: {
|
|
20
|
-
projectId?: string | null;
|
|
21
|
-
branchId?: string | null;
|
|
22
|
-
}): ConversationRunTargets;
|
|
23
|
-
/** Zod schema for get conversation run status. */
|
|
24
|
-
export declare const getConversationRunStatusSchema: () => Schema<string>;
|
|
25
|
-
/** Schema for conversation run status.
|
|
26
|
-
* @deprecated Use getConversationRunStatusSchema()
|
|
27
|
-
*/
|
|
28
|
-
export declare const ConversationRunStatusSchema: Schema<string>;
|
|
29
|
-
/** Public API contract for conversation run projection. */
|
|
30
|
-
export interface ConversationRunProjection {
|
|
31
|
-
runId: string;
|
|
32
|
-
conversationId: string;
|
|
33
|
-
messageId: string;
|
|
34
|
-
latestEventId: number;
|
|
35
|
-
latestExternalEventSequence: number;
|
|
36
|
-
waitingToolCallId: string | null;
|
|
37
|
-
waitingToolName: string | null;
|
|
38
|
-
status: "pending" | "running" | "waiting_for_tool" | "completed" | "failed" | "cancelled";
|
|
39
|
-
}
|
|
40
|
-
/** Zod schema for get conversation run projection. */
|
|
41
|
-
export declare const getConversationRunProjectionSchema: () => Schema<ConversationRunProjection>;
|
|
42
|
-
/** Schema for conversation run projection.
|
|
43
|
-
* @deprecated Use getConversationRunProjectionSchema()
|
|
44
|
-
*/
|
|
45
|
-
export declare const ConversationRunProjectionSchema: Schema<ConversationRunProjection>;
|
|
46
|
-
/** Public API contract for a conversation run status is active. */
|
|
47
|
-
export type ActiveConversationRunStatus = Extract<ConversationRunProjection["status"], "pending" | "running" | "waiting_for_tool">;
|
|
48
|
-
/** Public API contract for terminal conversation run status. */
|
|
49
|
-
export type TerminalConversationRunStatus = Extract<ConversationRunProjection["status"], "completed" | "failed" | "cancelled">;
|
|
50
|
-
/** Result returned from conversation run append cursor resync. */
|
|
51
|
-
export type ConversationRunAppendCursorResyncResult = "advanced" | "non_appendable" | "unchanged";
|
|
52
|
-
/** Public API contract for conversation run append recovery outcome. */
|
|
53
|
-
export type ConversationRunAppendRecoveryOutcome = "resumed" | "stopped" | "bubbled";
|
|
54
|
-
/** Public API contract for conversation run append failure outcome. */
|
|
55
|
-
export type ConversationRunAppendFailureOutcome = "resumed" | "stopped" | "retry_scheduled";
|
|
56
|
-
/** Public API contract for conversation run append execution outcome. */
|
|
57
|
-
export type ConversationRunAppendExecutionOutcome = "resumed" | "stopped" | "retry_scheduled";
|
|
58
|
-
/** Public API contract for conversation run batch flush outcome. */
|
|
59
|
-
export type ConversationRunBatchFlushOutcome = "flushed" | "resumed" | "stopped" | "retry_scheduled";
|
|
60
|
-
/** Public API contract for conversation run queue flush outcome. */
|
|
61
|
-
export type ConversationRunQueueFlushOutcome = "flushed" | "stopped" | "retry_scheduled";
|
|
62
|
-
/** Public API contract for conversation run event queue controller. */
|
|
63
|
-
export interface ConversationRunEventQueueController {
|
|
64
|
-
enqueue(events: unknown[]): void;
|
|
65
|
-
flush(): Promise<{
|
|
66
|
-
outcome: "idle" | "flushed";
|
|
67
|
-
latestEventId: number;
|
|
68
|
-
latestExternalEventSequence: number;
|
|
69
|
-
pendingEventCount: number;
|
|
70
|
-
consecutiveFailures: number;
|
|
71
|
-
disabled: boolean;
|
|
72
|
-
} | {
|
|
73
|
-
outcome: "stopped";
|
|
74
|
-
latestEventId: number;
|
|
75
|
-
latestExternalEventSequence: number;
|
|
76
|
-
pendingEventCount: 0;
|
|
77
|
-
consecutiveFailures: number;
|
|
78
|
-
disabled: true;
|
|
79
|
-
disableReason?: "cursor_resyncs_exhausted" | "non_appendable" | "ignorable_append_rejection";
|
|
80
|
-
} | {
|
|
81
|
-
outcome: "retry_scheduled";
|
|
82
|
-
latestEventId: number;
|
|
83
|
-
latestExternalEventSequence: number;
|
|
84
|
-
pendingEventCount: number;
|
|
85
|
-
consecutiveFailures: number;
|
|
86
|
-
disabled: false;
|
|
87
|
-
errorMessage: string;
|
|
88
|
-
}>;
|
|
89
|
-
getSnapshot(): {
|
|
90
|
-
latestEventId: number;
|
|
91
|
-
latestExternalEventSequence: number;
|
|
92
|
-
pendingEventCount: number;
|
|
93
|
-
consecutiveFailures: number;
|
|
94
|
-
disabled: boolean;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
/** Zod schema for get create conversation run accepted. */
|
|
98
|
-
export declare const getCreateConversationRunAcceptedSchema: () => Schema<{
|
|
99
|
-
runId: string;
|
|
100
|
-
}>;
|
|
101
|
-
/** Schema for create conversation run accepted.
|
|
102
|
-
* @deprecated Use getCreateConversationRunAcceptedSchema()
|
|
103
|
-
*/
|
|
104
|
-
export declare const CreateConversationRunAcceptedSchema: Schema<{
|
|
105
|
-
runId: string;
|
|
106
|
-
}>;
|
|
107
|
-
/** Zod schema for get complete conversation run response. */
|
|
108
|
-
export declare const getCompleteConversationRunResponseSchema: () => Schema<{
|
|
109
|
-
completed: boolean;
|
|
110
|
-
run: {
|
|
111
|
-
status: string;
|
|
112
|
-
} & {
|
|
113
|
-
runId?: string | undefined;
|
|
114
|
-
run_id?: string | undefined;
|
|
115
|
-
} & Record<string, unknown>;
|
|
116
|
-
} & {} & Record<string, unknown>>;
|
|
117
|
-
/** Schema for complete conversation run response.
|
|
118
|
-
* @deprecated Use getCompleteConversationRunResponseSchema()
|
|
119
|
-
*/
|
|
120
|
-
export declare const CompleteConversationRunResponseSchema: Schema<{
|
|
121
|
-
completed: boolean;
|
|
122
|
-
run: {
|
|
123
|
-
status: string;
|
|
124
|
-
} & {
|
|
125
|
-
runId?: string | undefined;
|
|
126
|
-
run_id?: string | undefined;
|
|
127
|
-
} & Record<string, unknown>;
|
|
128
|
-
} & {} & Record<string, unknown>>;
|
|
129
|
-
/** Response payload for append conversation run events. */
|
|
130
|
-
export interface AppendConversationRunEventsResponse {
|
|
131
|
-
latestEventId: number;
|
|
132
|
-
latestExternalEventSequence: number;
|
|
133
|
-
appendedCount: number;
|
|
134
|
-
run: {
|
|
135
|
-
runId: string;
|
|
136
|
-
conversationId: string;
|
|
137
|
-
latestEventId: number;
|
|
138
|
-
latestExternalEventSequence: number;
|
|
139
|
-
[key: string]: unknown;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/** Zod schema for get append conversation run events response. */
|
|
143
|
-
export declare const getAppendConversationRunEventsResponseSchema: () => Schema<AppendConversationRunEventsResponse | import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
144
|
-
latestEventId: Schema<number>;
|
|
145
|
-
latestExternalEventSequence: Schema<number>;
|
|
146
|
-
appendedCount: Schema<number>;
|
|
147
|
-
run: Schema<{
|
|
148
|
-
runId: string;
|
|
149
|
-
conversationId: string;
|
|
150
|
-
latestEventId: number;
|
|
151
|
-
latestExternalEventSequence: number;
|
|
152
|
-
} & {} & Record<string, unknown>>;
|
|
153
|
-
}>>;
|
|
154
|
-
/** Schema for append conversation run events response.
|
|
155
|
-
* @deprecated Use getAppendConversationRunEventsResponseSchema()
|
|
156
|
-
*/
|
|
157
|
-
export declare const AppendConversationRunEventsResponseSchema: Schema<AppendConversationRunEventsResponse | import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
158
|
-
latestEventId: Schema<number>;
|
|
159
|
-
latestExternalEventSequence: Schema<number>;
|
|
160
|
-
appendedCount: Schema<number>;
|
|
161
|
-
run: Schema<{
|
|
162
|
-
runId: string;
|
|
163
|
-
conversationId: string;
|
|
164
|
-
latestEventId: number;
|
|
165
|
-
latestExternalEventSequence: number;
|
|
166
|
-
} & {} & Record<string, unknown>>;
|
|
167
|
-
}>>;
|
|
168
|
-
/** Public API contract for conversation agent run usage. */
|
|
169
|
-
export interface ConversationAgentRunUsage {
|
|
170
|
-
inputTokens: number;
|
|
171
|
-
outputTokens: number;
|
|
172
|
-
totalTokens: number;
|
|
173
|
-
}
|
|
174
|
-
/** Input payload for create conversation agent run. */
|
|
175
|
-
export interface CreateConversationAgentRunInput {
|
|
176
|
-
authToken: string;
|
|
177
|
-
apiUrl: string;
|
|
178
|
-
conversationId: string;
|
|
179
|
-
runId?: string;
|
|
180
|
-
parentRunId?: string;
|
|
181
|
-
agentId: string;
|
|
182
|
-
implementationKind?: string | null;
|
|
183
|
-
projectId?: string | null;
|
|
184
|
-
branchId?: string | null;
|
|
185
|
-
}
|
|
186
|
-
/** Input payload for finalize conversation agent run. */
|
|
187
|
-
export interface FinalizeConversationAgentRunInput {
|
|
188
|
-
authToken: string;
|
|
189
|
-
apiUrl: string;
|
|
190
|
-
conversationId: string;
|
|
191
|
-
runId: string;
|
|
192
|
-
status: "completed" | "failed" | "cancelled";
|
|
193
|
-
model: string;
|
|
194
|
-
provider: string;
|
|
195
|
-
usage?: ConversationAgentRunUsage;
|
|
196
|
-
terminalErrorCode?: string | null;
|
|
197
|
-
terminalErrorMessage?: string | null;
|
|
198
|
-
}
|
|
1
|
+
import type { ActiveConversationRunStatus, AppendConversationRunEventsResponse, ConversationRunAppendCursorResyncResult, ConversationRunAppendFailureOutcome, ConversationRunAppendRecoveryOutcome, ConversationRunEventQueueController, ConversationRunProjection, CreateConversationAgentRunInput, FinalizeConversationAgentRunInput, TerminalConversationRunStatus } from "./durable-contracts.js";
|
|
2
|
+
export { AppendConversationRunEventsResponseSchema, CompleteConversationRunResponseSchema, ConversationRunProjectionSchema, ConversationRunStatusSchema, ConversationRunTargetsSchema, CreateConversationRunAcceptedSchema, getAppendConversationRunEventsResponseSchema, getCompleteConversationRunResponseSchema, getConversationRunProjectionSchema, getConversationRunStatusSchema, getConversationRunTargetsSchema, getCreateConversationRunAcceptedSchema, resolveConversationRunTargets, } from "./durable-contracts.js";
|
|
3
|
+
export type { ActiveConversationRunStatus, AppendConversationRunEventsResponse, ConversationAgentRunUsage, ConversationRunAppendCursorResyncResult, ConversationRunAppendExecutionOutcome, ConversationRunAppendFailureOutcome, ConversationRunAppendRecoveryOutcome, ConversationRunBatchFlushOutcome, ConversationRunEventQueueController, ConversationRunProjection, ConversationRunQueueFlushOutcome, ConversationRunTargets, CreateConversationAgentRunInput, FinalizeConversationAgentRunInput, TerminalConversationRunStatus, } from "./durable-contracts.js";
|
|
199
4
|
/** Error shape for conversation run terminal state. */
|
|
200
5
|
export declare class ConversationRunTerminalStateError extends Error {
|
|
201
6
|
readonly status: TerminalConversationRunStatus;
|