@providerprotocol/agents 0.0.2 → 0.0.4
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/LICENSE +21 -0
- package/dist/checkpoint/index.d.ts +43 -0
- package/dist/checkpoint/index.js +73 -0
- package/dist/checkpoint/index.js.map +1 -0
- package/{src/execution/loop.ts → dist/chunk-4ESYN66B.js} +54 -162
- package/dist/chunk-4ESYN66B.js.map +1 -0
- package/dist/chunk-EKRXMSDX.js +8 -0
- package/dist/chunk-EKRXMSDX.js.map +1 -0
- package/dist/chunk-T47B3VAF.js +427 -0
- package/dist/chunk-T47B3VAF.js.map +1 -0
- package/dist/execution/index.d.ts +105 -0
- package/dist/execution/index.js +679 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/index-qsPwbY86.d.ts +65 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +218 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/index.d.ts +23 -0
- package/dist/middleware/index.js +82 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/thread-tree/index.d.ts +115 -0
- package/dist/thread-tree/index.js +4 -0
- package/dist/thread-tree/index.js.map +1 -0
- package/dist/types-2Vsthzyu.d.ts +163 -0
- package/dist/types-BiyEVOnf.d.ts +65 -0
- package/dist/types-D1egxttz.d.ts +270 -0
- package/dist/types-DChRdQoX.d.ts +98 -0
- package/package.json +41 -9
- package/.claude/settings.local.json +0 -29
- package/AGENTS.md +0 -681
- package/CLAUDE.md +0 -681
- package/bun.lock +0 -472
- package/eslint.config.js +0 -75
- package/index.ts +0 -1
- package/llms.md +0 -796
- package/specs/UAP-1.0.md +0 -2355
- package/src/agent/index.ts +0 -384
- package/src/agent/types.ts +0 -91
- package/src/checkpoint/file.ts +0 -126
- package/src/checkpoint/index.ts +0 -40
- package/src/checkpoint/types.ts +0 -95
- package/src/execution/index.ts +0 -37
- package/src/execution/plan.ts +0 -497
- package/src/execution/react.ts +0 -340
- package/src/execution/tool-ordering.ts +0 -186
- package/src/execution/types.ts +0 -315
- package/src/index.ts +0 -80
- package/src/middleware/index.ts +0 -7
- package/src/middleware/logging.ts +0 -123
- package/src/middleware/types.ts +0 -69
- package/src/state/index.ts +0 -301
- package/src/state/types.ts +0 -173
- package/src/thread-tree/index.ts +0 -249
- package/src/thread-tree/types.ts +0 -29
- package/src/utils/uuid.ts +0 -7
- package/tests/live/agent-anthropic.test.ts +0 -288
- package/tests/live/agent-strategy-hooks.test.ts +0 -268
- package/tests/live/checkpoint.test.ts +0 -243
- package/tests/live/execution-strategies.test.ts +0 -255
- package/tests/live/plan-strategy.test.ts +0 -160
- package/tests/live/subagent-events.live.test.ts +0 -249
- package/tests/live/thread-tree.test.ts +0 -186
- package/tests/unit/agent.test.ts +0 -703
- package/tests/unit/checkpoint.test.ts +0 -232
- package/tests/unit/execution/equivalence.test.ts +0 -402
- package/tests/unit/execution/loop.test.ts +0 -437
- package/tests/unit/execution/plan.test.ts +0 -590
- package/tests/unit/execution/react.test.ts +0 -604
- package/tests/unit/execution/subagent-events.test.ts +0 -235
- package/tests/unit/execution/tool-ordering.test.ts +0 -310
- package/tests/unit/middleware/logging.test.ts +0 -276
- package/tests/unit/state.test.ts +0 -573
- package/tests/unit/thread-tree.test.ts +0 -249
- package/tsconfig.json +0 -29
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { a as AgentStateJSON } from './types-2Vsthzyu.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checkpoint Types
|
|
5
|
+
*
|
|
6
|
+
* Type definitions for step-level persistence and session resume.
|
|
7
|
+
*
|
|
8
|
+
* @see UAP-1.0 Spec Section 12.4
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Checkpoint store interface.
|
|
13
|
+
*
|
|
14
|
+
* Implementations handle persistence of agent state at step boundaries
|
|
15
|
+
* for crash recovery and session resume.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const store = fileCheckpoints({ dir: './checkpoints' });
|
|
20
|
+
*
|
|
21
|
+
* // Save checkpoint
|
|
22
|
+
* await store.save('session-123', state.toJSON());
|
|
23
|
+
*
|
|
24
|
+
* // Load checkpoint
|
|
25
|
+
* const saved = await store.load('session-123');
|
|
26
|
+
* if (saved) {
|
|
27
|
+
* const restored = AgentState.fromJSON(saved);
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
interface CheckpointStore {
|
|
32
|
+
/**
|
|
33
|
+
* Save a checkpoint at the current state.
|
|
34
|
+
*
|
|
35
|
+
* @param sessionId - Session identifier
|
|
36
|
+
* @param state - Serialized agent state
|
|
37
|
+
*/
|
|
38
|
+
save(sessionId: string, state: AgentStateJSON): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Load the most recent checkpoint for a session.
|
|
41
|
+
*
|
|
42
|
+
* @param sessionId - Session identifier
|
|
43
|
+
* @returns Serialized state or null if not found
|
|
44
|
+
*/
|
|
45
|
+
load(sessionId: string): Promise<AgentStateJSON | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Load metadata for a session without loading full state.
|
|
48
|
+
*
|
|
49
|
+
* @param sessionId - Session identifier
|
|
50
|
+
* @returns Checkpoint metadata or null if not found
|
|
51
|
+
*/
|
|
52
|
+
loadMetadata(sessionId: string): Promise<CheckpointMetadata | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Delete all checkpoints for a session.
|
|
55
|
+
*
|
|
56
|
+
* @param sessionId - Session identifier
|
|
57
|
+
*/
|
|
58
|
+
delete(sessionId: string): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* List all session IDs with checkpoints.
|
|
61
|
+
*
|
|
62
|
+
* @returns Array of session IDs
|
|
63
|
+
*/
|
|
64
|
+
list(): Promise<string[]>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Options for file-based checkpoint store.
|
|
68
|
+
*/
|
|
69
|
+
interface FileCheckpointOptions {
|
|
70
|
+
/** Directory for checkpoint files. Default: ".checkpoints" */
|
|
71
|
+
dir?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Checkpoint metadata stored alongside state.
|
|
75
|
+
*/
|
|
76
|
+
interface CheckpointMetadata {
|
|
77
|
+
/** Session identifier */
|
|
78
|
+
sessionId: string;
|
|
79
|
+
/** Unique checkpoint ID */
|
|
80
|
+
checkpointId: string;
|
|
81
|
+
/** ISO 8601 timestamp */
|
|
82
|
+
timestamp: string;
|
|
83
|
+
/** Step number at checkpoint */
|
|
84
|
+
step: number;
|
|
85
|
+
/** Agent instance ID */
|
|
86
|
+
agentId: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Full checkpoint data including state and metadata.
|
|
90
|
+
*/
|
|
91
|
+
interface CheckpointData {
|
|
92
|
+
/** Checkpoint metadata */
|
|
93
|
+
metadata: CheckpointMetadata;
|
|
94
|
+
/** Serialized agent state */
|
|
95
|
+
state: AgentStateJSON;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type { CheckpointStore as C, FileCheckpointOptions as F, CheckpointMetadata as a, CheckpointData as b };
|
package/package.json
CHANGED
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@providerprotocol/agents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Unified Agent Protocol (UAP) 1.0 implementation for @providerprotocol/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Provider Protocol"
|
|
8
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/providerprotocol/agents"
|
|
13
|
+
},
|
|
9
14
|
"publishConfig": {
|
|
10
15
|
"access": "public"
|
|
11
16
|
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"module": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
12
25
|
"exports": {
|
|
13
|
-
".":
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./execution": {
|
|
31
|
+
"types": "./dist/execution/index.d.ts",
|
|
32
|
+
"import": "./dist/execution/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./middleware": {
|
|
35
|
+
"types": "./dist/middleware/index.d.ts",
|
|
36
|
+
"import": "./dist/middleware/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./thread-tree": {
|
|
39
|
+
"types": "./dist/thread-tree/index.d.ts",
|
|
40
|
+
"import": "./dist/thread-tree/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./checkpoint": {
|
|
43
|
+
"types": "./dist/checkpoint/index.d.ts",
|
|
44
|
+
"import": "./dist/checkpoint/index.js"
|
|
45
|
+
}
|
|
17
46
|
},
|
|
18
47
|
"scripts": {
|
|
48
|
+
"build": "tsup",
|
|
49
|
+
"prepublishOnly": "bun run build",
|
|
19
50
|
"test": "bun test",
|
|
20
51
|
"test:unit": "bun test tests/unit",
|
|
21
52
|
"test:live": "bun test tests/live",
|
|
@@ -23,15 +54,16 @@
|
|
|
23
54
|
"typecheck": "tsc --noEmit"
|
|
24
55
|
},
|
|
25
56
|
"peerDependencies": {
|
|
26
|
-
"@providerprotocol/ai": ">=0.0.11"
|
|
27
|
-
"typescript": "^5.9.3"
|
|
57
|
+
"@providerprotocol/ai": ">=0.0.11"
|
|
28
58
|
},
|
|
29
59
|
"devDependencies": {
|
|
30
|
-
"@providerprotocol/ai": "^0.0.
|
|
60
|
+
"@providerprotocol/ai": "^0.0.12",
|
|
31
61
|
"@types/bun": "^1.3.5",
|
|
32
62
|
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
33
63
|
"@typescript-eslint/parser": "^8.52.0",
|
|
34
64
|
"eslint": "^9.39.2",
|
|
35
|
-
"eslint-plugin-import": "^2.32.0"
|
|
65
|
+
"eslint-plugin-import": "^2.32.0",
|
|
66
|
+
"tsup": "^8.5.1",
|
|
67
|
+
"typescript": "^5.9.3"
|
|
36
68
|
}
|
|
37
69
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(tree:*)",
|
|
5
|
-
"Bash(bun test:*)",
|
|
6
|
-
"Bash(bun run typecheck:*)",
|
|
7
|
-
"Bash(bun run lint)",
|
|
8
|
-
"Bash(ls:*)",
|
|
9
|
-
"Bash(cat:*)",
|
|
10
|
-
"Bash(find:*)",
|
|
11
|
-
"Bash(bun test:live:*)",
|
|
12
|
-
"WebSearch",
|
|
13
|
-
"WebFetch(domain:arxiv.org)",
|
|
14
|
-
"WebFetch(domain:www.microsoft.com)",
|
|
15
|
-
"WebFetch(domain:docs.anthropic.com)",
|
|
16
|
-
"WebFetch(domain:blog.jetbrains.com)",
|
|
17
|
-
"Bash(grep:*)",
|
|
18
|
-
"Bash(bun install:*)",
|
|
19
|
-
"Bash(bun update:*)",
|
|
20
|
-
"Bash(timeout 2 bun:*)",
|
|
21
|
-
"WebFetch(domain:www.npmjs.com)",
|
|
22
|
-
"WebFetch(domain:github.com)",
|
|
23
|
-
"WebFetch(domain:raw.githubusercontent.com)",
|
|
24
|
-
"Bash(bun add:*)",
|
|
25
|
-
"Bash(timeout 3 bun run:*)",
|
|
26
|
-
"Bash(bun -e:*)"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|