@contractspec/lib.ai-agent 7.0.7 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -4
- package/dist/agent/agent-factory.d.ts +14 -3
- package/dist/agent/agent-factory.js +676 -111
- package/dist/agent/contract-spec-agent.d.ts +16 -2
- package/dist/agent/contract-spec-agent.js +672 -110
- package/dist/agent/index.js +685 -118
- package/dist/agent/json-runner.d.ts +1 -1
- package/dist/agent/json-runner.js +672 -110
- package/dist/agent/unified-agent.d.ts +2 -2
- package/dist/agent/unified-agent.js +685 -118
- package/dist/approval/index.js +6 -1
- package/dist/approval/workflow.js +5 -1
- package/dist/exporters/claude-agent-exporter.d.ts +1 -1
- package/dist/exporters/claude-agent-exporter.js +3 -51
- package/dist/exporters/index.js +8 -54
- package/dist/exporters/opencode-exporter.d.ts +1 -1
- package/dist/exporters/opencode-exporter.js +3 -51
- package/dist/exporters/types.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3805 -71
- package/dist/interop/index.js +3 -51
- package/dist/interop/spec-consumer.d.ts +1 -1
- package/dist/interop/spec-consumer.js +3 -51
- package/dist/interop/tool-consumer.d.ts +1 -1
- package/dist/interop/types.d.ts +1 -1
- package/dist/knowledge/injector.d.ts +1 -1
- package/dist/node/agent/agent-factory.js +676 -111
- package/dist/node/agent/contract-spec-agent.js +672 -110
- package/dist/node/agent/index.js +685 -118
- package/dist/node/agent/json-runner.js +672 -110
- package/dist/node/agent/unified-agent.js +685 -118
- package/dist/node/approval/index.js +6 -1
- package/dist/node/approval/workflow.js +5 -1
- package/dist/node/exporters/claude-agent-exporter.js +3 -51
- package/dist/node/exporters/index.js +8 -54
- package/dist/node/exporters/opencode-exporter.js +3 -51
- package/dist/node/index.js +3805 -71
- package/dist/node/interop/index.js +3 -51
- package/dist/node/interop/spec-consumer.js +3 -51
- package/dist/node/providers/claude-agent-sdk/adapter.js +3 -51
- package/dist/node/providers/claude-agent-sdk/index.js +3 -51
- package/dist/node/providers/index.js +8 -53
- package/dist/node/providers/opencode-sdk/adapter.js +4 -51
- package/dist/node/providers/opencode-sdk/index.js +4 -51
- package/dist/node/session/index.js +26 -1
- package/dist/node/session/store.js +26 -1
- package/dist/node/telemetry/adapter.js +2 -0
- package/dist/node/telemetry/index.js +2 -0
- package/dist/providers/claude-agent-sdk/adapter.d.ts +1 -1
- package/dist/providers/claude-agent-sdk/adapter.js +3 -51
- package/dist/providers/claude-agent-sdk/index.js +3 -51
- package/dist/providers/claude-agent-sdk/tool-bridge.d.ts +1 -8
- package/dist/providers/index.js +8 -53
- package/dist/providers/opencode-sdk/adapter.d.ts +1 -13
- package/dist/providers/opencode-sdk/adapter.js +4 -51
- package/dist/providers/opencode-sdk/agent-bridge.d.ts +1 -10
- package/dist/providers/opencode-sdk/index.js +4 -51
- package/dist/providers/opencode-sdk/tool-bridge.d.ts +1 -4
- package/dist/providers/types.d.ts +1 -8
- package/dist/session/index.js +26 -1
- package/dist/session/store.d.ts +2 -2
- package/dist/session/store.js +26 -1
- package/dist/telemetry/adapter.d.ts +1 -0
- package/dist/telemetry/adapter.js +2 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/tools/knowledge-tool.d.ts +1 -1
- package/dist/tools/mcp-server.d.ts +1 -1
- package/dist/tools/operation-tool-handler.d.ts +1 -1
- package/dist/tools/tool-adapter.d.ts +1 -1
- package/dist/types.d.ts +13 -0
- package/package.json +8 -44
- package/dist/node/spec/index.js +0 -2233
- package/dist/node/spec/registry.js +0 -2178
- package/dist/node/spec/spec.js +0 -2188
- package/dist/spec/index.d.ts +0 -2
- package/dist/spec/index.js +0 -2233
- package/dist/spec/registry.d.ts +0 -41
- package/dist/spec/registry.js +0 -2178
- package/dist/spec/spec.d.ts +0 -218
- package/dist/spec/spec.js +0 -2188
- /package/dist/{spec/spec.test.d.ts → session/store.test.d.ts} +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -47,6 +47,9 @@ export interface AgentEventPayload {
|
|
|
47
47
|
sessionId: string;
|
|
48
48
|
agentId: string;
|
|
49
49
|
tenantId?: string;
|
|
50
|
+
workflowId?: string;
|
|
51
|
+
traceId?: string;
|
|
52
|
+
checkpointId?: string;
|
|
50
53
|
stepIndex?: number;
|
|
51
54
|
toolName?: string;
|
|
52
55
|
metadata?: Record<string, unknown>;
|
|
@@ -62,6 +65,10 @@ export interface AgentCallOptions {
|
|
|
62
65
|
actorId?: string;
|
|
63
66
|
/** Session to resume; new session created when omitted */
|
|
64
67
|
sessionId?: string;
|
|
68
|
+
/** Parent workflow execution id when the agent runs inside a workflow. */
|
|
69
|
+
workflowId?: string;
|
|
70
|
+
/** External thread id used by checkpoint-capable runtimes. */
|
|
71
|
+
threadId?: string;
|
|
65
72
|
/** Arbitrary metadata forwarded to events and tool handlers */
|
|
66
73
|
metadata?: Record<string, string>;
|
|
67
74
|
/** Locale override for this call */
|
|
@@ -80,11 +87,17 @@ export interface AgentSessionState {
|
|
|
80
87
|
agentId: string;
|
|
81
88
|
tenantId?: string;
|
|
82
89
|
actorId?: string;
|
|
90
|
+
workflowId?: string;
|
|
91
|
+
threadId?: string;
|
|
92
|
+
traceId?: string;
|
|
93
|
+
checkpointId?: string;
|
|
83
94
|
/** Active locale for this session */
|
|
84
95
|
locale?: string;
|
|
85
96
|
status: AgentStatus;
|
|
86
97
|
messages: ModelMessage[];
|
|
87
98
|
steps: StepResult<ToolSet>[];
|
|
99
|
+
pendingApprovalRequestId?: string;
|
|
100
|
+
lastError?: AgentExecutionError;
|
|
88
101
|
createdAt: Date;
|
|
89
102
|
updatedAt: Date;
|
|
90
103
|
metadata?: Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.ai-agent",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "AI agent orchestration with MCP and tool support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@ai-sdk/openai": "3.0.41",
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
43
43
|
"@posthog/react": "^1.8.2",
|
|
44
|
-
"@posthog/ai": "7.12.
|
|
45
|
-
"@contractspec/lib.contracts-spec": "
|
|
46
|
-
"@contractspec/lib.ai-providers": "3.7.
|
|
47
|
-
"@contractspec/lib.knowledge": "3.7.
|
|
44
|
+
"@posthog/ai": "7.12.2",
|
|
45
|
+
"@contractspec/lib.contracts-spec": "5.0.0",
|
|
46
|
+
"@contractspec/lib.ai-providers": "3.7.9",
|
|
47
|
+
"@contractspec/lib.knowledge": "3.7.12",
|
|
48
48
|
"compare-versions": "^6.1.1",
|
|
49
49
|
"zod": "^4.3.5"
|
|
50
50
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@anthropic-ai/claude-agent-sdk": ">=0.1.0",
|
|
53
53
|
"@opencode-ai/sdk": ">=1.0.0",
|
|
54
54
|
"posthog-node": ">=4.0.0",
|
|
55
|
-
"@contractspec/lib.surface-runtime": "0.5.
|
|
55
|
+
"@contractspec/lib.surface-runtime": "0.5.12"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@anthropic-ai/claude-agent-sdk": {
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@contractspec/tool.typescript": "3.7.
|
|
75
|
+
"@contractspec/tool.typescript": "3.7.9",
|
|
76
76
|
"typescript": "^5.9.3",
|
|
77
|
-
"@contractspec/tool.bun": "3.7.
|
|
77
|
+
"@contractspec/tool.bun": "3.7.9"
|
|
78
78
|
},
|
|
79
79
|
"exports": {
|
|
80
80
|
".": {
|
|
@@ -353,24 +353,6 @@
|
|
|
353
353
|
"node": "./dist/node/session/store.js",
|
|
354
354
|
"default": "./dist/session/store.js"
|
|
355
355
|
},
|
|
356
|
-
"./spec": {
|
|
357
|
-
"types": "./dist/spec/index.d.ts",
|
|
358
|
-
"bun": "./dist/spec/index.js",
|
|
359
|
-
"node": "./dist/node/spec/index.js",
|
|
360
|
-
"default": "./dist/spec/index.js"
|
|
361
|
-
},
|
|
362
|
-
"./spec/registry": {
|
|
363
|
-
"types": "./dist/spec/registry.d.ts",
|
|
364
|
-
"bun": "./dist/spec/registry.js",
|
|
365
|
-
"node": "./dist/node/spec/registry.js",
|
|
366
|
-
"default": "./dist/spec/registry.js"
|
|
367
|
-
},
|
|
368
|
-
"./spec/spec": {
|
|
369
|
-
"types": "./dist/spec/spec.d.ts",
|
|
370
|
-
"bun": "./dist/spec/spec.js",
|
|
371
|
-
"node": "./dist/node/spec/spec.js",
|
|
372
|
-
"default": "./dist/spec/spec.js"
|
|
373
|
-
},
|
|
374
356
|
"./telemetry": {
|
|
375
357
|
"types": "./dist/telemetry/index.d.ts",
|
|
376
358
|
"bun": "./dist/telemetry/index.js",
|
|
@@ -752,24 +734,6 @@
|
|
|
752
734
|
"node": "./dist/node/session/store.js",
|
|
753
735
|
"default": "./dist/session/store.js"
|
|
754
736
|
},
|
|
755
|
-
"./spec": {
|
|
756
|
-
"types": "./dist/spec/index.d.ts",
|
|
757
|
-
"bun": "./dist/spec/index.js",
|
|
758
|
-
"node": "./dist/node/spec/index.js",
|
|
759
|
-
"default": "./dist/spec/index.js"
|
|
760
|
-
},
|
|
761
|
-
"./spec/registry": {
|
|
762
|
-
"types": "./dist/spec/registry.d.ts",
|
|
763
|
-
"bun": "./dist/spec/registry.js",
|
|
764
|
-
"node": "./dist/node/spec/registry.js",
|
|
765
|
-
"default": "./dist/spec/registry.js"
|
|
766
|
-
},
|
|
767
|
-
"./spec/spec": {
|
|
768
|
-
"types": "./dist/spec/spec.d.ts",
|
|
769
|
-
"bun": "./dist/spec/spec.js",
|
|
770
|
-
"node": "./dist/node/spec/spec.js",
|
|
771
|
-
"default": "./dist/spec/spec.js"
|
|
772
|
-
},
|
|
773
737
|
"./telemetry": {
|
|
774
738
|
"types": "./dist/telemetry/index.d.ts",
|
|
775
739
|
"bun": "./dist/telemetry/index.js",
|