@lumenflow/packs-sidekick 3.6.6
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 +661 -0
- package/README.md +194 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest-schema.d.ts +48 -0
- package/dist/manifest-schema.d.ts.map +1 -0
- package/dist/manifest-schema.js +177 -0
- package/dist/manifest-schema.js.map +1 -0
- package/dist/manifest.d.ts +26 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +297 -0
- package/dist/manifest.js.map +1 -0
- package/dist/pack-registration.d.ts +14 -0
- package/dist/pack-registration.d.ts.map +1 -0
- package/dist/pack-registration.js +79 -0
- package/dist/pack-registration.js.map +1 -0
- package/dist/tool-impl/channel-tools.d.ts +3 -0
- package/dist/tool-impl/channel-tools.d.ts.map +1 -0
- package/dist/tool-impl/channel-tools.js +169 -0
- package/dist/tool-impl/channel-tools.js.map +1 -0
- package/dist/tool-impl/index.d.ts +2 -0
- package/dist/tool-impl/index.d.ts.map +1 -0
- package/dist/tool-impl/index.js +4 -0
- package/dist/tool-impl/index.js.map +1 -0
- package/dist/tool-impl/memory-tools.d.ts +3 -0
- package/dist/tool-impl/memory-tools.d.ts.map +1 -0
- package/dist/tool-impl/memory-tools.js +137 -0
- package/dist/tool-impl/memory-tools.js.map +1 -0
- package/dist/tool-impl/routine-tools.d.ts +3 -0
- package/dist/tool-impl/routine-tools.d.ts.map +1 -0
- package/dist/tool-impl/routine-tools.js +145 -0
- package/dist/tool-impl/routine-tools.js.map +1 -0
- package/dist/tool-impl/shared.d.ts +34 -0
- package/dist/tool-impl/shared.d.ts.map +1 -0
- package/dist/tool-impl/shared.js +89 -0
- package/dist/tool-impl/shared.js.map +1 -0
- package/dist/tool-impl/storage.d.ts +87 -0
- package/dist/tool-impl/storage.d.ts.map +1 -0
- package/dist/tool-impl/storage.js +191 -0
- package/dist/tool-impl/storage.js.map +1 -0
- package/dist/tool-impl/system-tools.d.ts +3 -0
- package/dist/tool-impl/system-tools.d.ts.map +1 -0
- package/dist/tool-impl/system-tools.js +116 -0
- package/dist/tool-impl/system-tools.js.map +1 -0
- package/dist/tool-impl/task-tools.d.ts +3 -0
- package/dist/tool-impl/task-tools.d.ts.map +1 -0
- package/dist/tool-impl/task-tools.js +215 -0
- package/dist/tool-impl/task-tools.js.map +1 -0
- package/dist/tools/channel-tools.d.ts +4 -0
- package/dist/tools/channel-tools.d.ts.map +1 -0
- package/dist/tools/channel-tools.js +41 -0
- package/dist/tools/channel-tools.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +9 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/memory-tools.d.ts +4 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +41 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/routine-tools.d.ts +4 -0
- package/dist/tools/routine-tools.d.ts.map +1 -0
- package/dist/tools/routine-tools.js +41 -0
- package/dist/tools/routine-tools.js.map +1 -0
- package/dist/tools/system-tools.d.ts +4 -0
- package/dist/tools/system-tools.d.ts.map +1 -0
- package/dist/tools/system-tools.js +36 -0
- package/dist/tools/system-tools.js.map +1 -0
- package/dist/tools/task-tools.d.ts +5 -0
- package/dist/tools/task-tools.d.ts.map +1 -0
- package/dist/tools/task-tools.js +48 -0
- package/dist/tools/task-tools.js.map +1 -0
- package/dist/tools/types.d.ts +40 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +24 -0
- package/dist/tools/types.js.map +1 -0
- package/manifest.yaml +406 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Sidekick Pack
|
|
2
|
+
|
|
3
|
+
Personal productivity pack for the LumenFlow kernel. Provides task management,
|
|
4
|
+
workspace memory, communication channels, routines, and system administration
|
|
5
|
+
tools -- all scoped to a local `.sidekick/` directory.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
**Version**: 0.1.0 (pre-release)
|
|
10
|
+
**License**: AGPL-3.0-only
|
|
11
|
+
|
|
12
|
+
## Tool Groups
|
|
13
|
+
|
|
14
|
+
| Group | Tools | Description |
|
|
15
|
+
| ------- | ------------------------------------------------------------ | ------------------------------------------- |
|
|
16
|
+
| Task | `task:create`, `task:list`, `task:complete`, `task:schedule` | Create, query, complete, and schedule tasks |
|
|
17
|
+
| Memory | `memory:store`, `memory:recall`, `memory:forget` | Persist and retrieve workspace knowledge |
|
|
18
|
+
| Channel | `channel:configure`, `channel:send`, `channel:receive` | Named message channels |
|
|
19
|
+
| Routine | `routine:create`, `routine:list`, `routine:run` | Multi-step tool sequences (plan-only) |
|
|
20
|
+
| System | `sidekick:init`, `sidekick:status`, `sidekick:export` | Bootstrap, health check, data export |
|
|
21
|
+
|
|
22
|
+
**Total**: 16 tools
|
|
23
|
+
|
|
24
|
+
## Key Design Decisions
|
|
25
|
+
|
|
26
|
+
- **`.sidekick/` is workspace-local storage.** All data lives under the project
|
|
27
|
+
root in a `.sidekick/` directory managed by the `StoragePort` abstraction.
|
|
28
|
+
- **`routine:run` returns a plan only.** It resolves the routine definition and
|
|
29
|
+
returns the ordered list of steps with their inputs. It does not execute them.
|
|
30
|
+
- **`sidekick:export` is read-only.** It returns all stored data as a JSON
|
|
31
|
+
structure. It does not write files to disk.
|
|
32
|
+
- **Every write tool supports `dry_run`.** When `dry_run: true`, the tool
|
|
33
|
+
validates input and returns what it would do, without persisting changes.
|
|
34
|
+
- **Pack manifest is the contract.** There is no separate contract package. The
|
|
35
|
+
`manifest.yaml` file defines tool names, schemas, scopes, and policies.
|
|
36
|
+
|
|
37
|
+
## Manual Smoke Flow
|
|
38
|
+
|
|
39
|
+
Use this sequence to verify the pack end-to-end after installation or upgrade.
|
|
40
|
+
|
|
41
|
+
### Prerequisites
|
|
42
|
+
|
|
43
|
+
- LumenFlow kernel runtime with the sidekick pack registered
|
|
44
|
+
- HTTP surface running (for HTTP dispatch tests)
|
|
45
|
+
|
|
46
|
+
### Step 1: Initialize
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Via kernel tool dispatch (or HTTP POST /tools/sidekick:init)
|
|
50
|
+
tool: sidekick:init
|
|
51
|
+
input: {}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Expected: `{ "success": true, "data": { "initialized": true, "root_dir": ".sidekick" } }`
|
|
55
|
+
|
|
56
|
+
### Step 2: Create a Task
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
tool: task:create
|
|
60
|
+
input: { "title": "Review docs", "priority": "P1", "tags": ["docs"] }
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Expected: `{ "success": true, "data": { "id": "<uuid>", "title": "Review docs", ... } }`
|
|
64
|
+
|
|
65
|
+
### Step 3: List Tasks
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
tool: task:list
|
|
69
|
+
input: { "status": "pending" }
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Expected: Array containing the task from Step 2.
|
|
73
|
+
|
|
74
|
+
### Step 4: Store a Memory
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
tool: memory:store
|
|
78
|
+
input: { "type": "note", "content": "Sidekick pack validated", "tags": ["smoke-test"] }
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Expected: `{ "success": true, "data": { "id": "<uuid>", ... } }`
|
|
82
|
+
|
|
83
|
+
### Step 5: Recall Memory
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
tool: memory:recall
|
|
87
|
+
input: { "query": "validated", "type": "note" }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Expected: Array containing the memory from Step 4.
|
|
91
|
+
|
|
92
|
+
### Step 6: Create a Routine
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
tool: routine:create
|
|
96
|
+
input: {
|
|
97
|
+
"name": "daily-review",
|
|
98
|
+
"steps": [
|
|
99
|
+
{ "tool": "task:list", "input": { "status": "pending" } },
|
|
100
|
+
{ "tool": "sidekick:status", "input": {} }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Expected: `{ "success": true, "data": { "id": "<uuid>", "name": "daily-review", ... } }`
|
|
106
|
+
|
|
107
|
+
### Step 7: Run Routine (plan-only)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
tool: routine:run
|
|
111
|
+
input: { "id": "<routine-id-from-step-6>" }
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Expected: A plan object listing the two steps with their resolved inputs. No
|
|
115
|
+
side-effects -- the steps are NOT executed.
|
|
116
|
+
|
|
117
|
+
### Step 8: Check Status
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
tool: sidekick:status
|
|
121
|
+
input: {}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Expected: Summary showing `task_count >= 1`, `memory_entries >= 1`,
|
|
125
|
+
`routines >= 1`.
|
|
126
|
+
|
|
127
|
+
### Step 9: Export
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
tool: sidekick:export
|
|
131
|
+
input: { "include_audit": true }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Expected: Full JSON dump of all stores including audit trail from prior steps.
|
|
135
|
+
|
|
136
|
+
### Step 10: Complete the Task
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
tool: task:complete
|
|
140
|
+
input: { "id": "<task-id-from-step-2>", "note": "Smoke test passed" }
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Expected: `{ "success": true, "data": { "status": "done", ... } }`
|
|
144
|
+
|
|
145
|
+
### Step 11: Verify via HTTP Surface
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
curl -X POST http://localhost:<port>/tools/sidekick:status \
|
|
149
|
+
-H "Content-Type: application/json" \
|
|
150
|
+
-d '{ "context": { "task_id": "smoke-test", "workspace_id": "test" } }'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Expected: HTTP 200 with the same status payload as Step 8.
|
|
154
|
+
|
|
155
|
+
### Dry Run Verification
|
|
156
|
+
|
|
157
|
+
Repeat Step 2 with `"dry_run": true` added to the input. Verify that the
|
|
158
|
+
response includes `"dry_run": true` and that `task:list` does not return the
|
|
159
|
+
dry-run task.
|
|
160
|
+
|
|
161
|
+
## Validation
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Schema and integrity validation
|
|
165
|
+
pnpm pack:validate --id sidekick
|
|
166
|
+
|
|
167
|
+
# Unit tests (119 tests across 3 suites)
|
|
168
|
+
npx vitest run packages/@lumenflow/packs/sidekick/__tests__/
|
|
169
|
+
|
|
170
|
+
# HTTP surface tests (13 tests)
|
|
171
|
+
npx vitest run packages/@lumenflow/surfaces/http/__tests__/tool-api.test.ts
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Storage Architecture
|
|
175
|
+
|
|
176
|
+
The pack uses a `StoragePort` abstraction with a filesystem adapter
|
|
177
|
+
(`FsStoragePort`). Each store (tasks, memories, channels, messages, routines)
|
|
178
|
+
is a JSON array file under `.sidekick/`. An append-only `audit.jsonl` file
|
|
179
|
+
records every tool invocation.
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
.sidekick/
|
|
183
|
+
tasks.json
|
|
184
|
+
memories.json
|
|
185
|
+
channels.json
|
|
186
|
+
messages.json
|
|
187
|
+
routines.json
|
|
188
|
+
audit.jsonl
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Contributing
|
|
192
|
+
|
|
193
|
+
This pack follows the LumenFlow development workflow. See the root `CLAUDE.md`
|
|
194
|
+
and `LUMENFLOW.md` for contribution guidelines.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SIDEKICK_PACK_ID: "sidekick";
|
|
2
|
+
export declare const SIDEKICK_PACK_VERSION: "0.1.0";
|
|
3
|
+
export declare const SIDEKICK_DOMAIN: "sidekick";
|
|
4
|
+
export declare const SIDEKICK_POLICY_ID_PREFIX: "sidekick.policy";
|
|
5
|
+
export declare const SIDEKICK_MANIFEST_FILE_NAME: "manifest.yaml";
|
|
6
|
+
export declare const SHA256_ALGORITHM: "sha256";
|
|
7
|
+
export declare const UTF8_ENCODING: "utf8";
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,EAAG,UAAmB,CAAC;AACpD,eAAO,MAAM,qBAAqB,EAAG,OAAgB,CAAC;AACtD,eAAO,MAAM,eAAe,YAAmB,CAAC;AAChD,eAAO,MAAM,yBAAyB,mBAAwC,CAAC;AAC/E,eAAO,MAAM,2BAA2B,EAAG,eAAwB,CAAC;AACpE,eAAO,MAAM,gBAAgB,EAAG,QAAiB,CAAC;AAClD,eAAO,MAAM,aAAa,EAAG,MAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
export const SIDEKICK_PACK_ID = 'sidekick';
|
|
4
|
+
export const SIDEKICK_PACK_VERSION = '0.1.0';
|
|
5
|
+
export const SIDEKICK_DOMAIN = SIDEKICK_PACK_ID;
|
|
6
|
+
export const SIDEKICK_POLICY_ID_PREFIX = `${SIDEKICK_PACK_ID}.policy`;
|
|
7
|
+
export const SIDEKICK_MANIFEST_FILE_NAME = 'manifest.yaml';
|
|
8
|
+
export const SHA256_ALGORITHM = 'sha256';
|
|
9
|
+
export const UTF8_ENCODING = 'utf8';
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,yCAAyC;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAmB,CAAC;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAgB,CAAC;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAChD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,gBAAgB,SAAkB,CAAC;AAC/E,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAwB,CAAC;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAe,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
export * from './constants.js';
|
|
4
|
+
export * from './manifest.js';
|
|
5
|
+
export * from './manifest-schema.js';
|
|
6
|
+
export * from './pack-registration.js';
|
|
7
|
+
export * from './tools/types.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,yCAAyC;AAEzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type PathScope, type ToolPermission } from './tools/types.js';
|
|
2
|
+
interface Parser<T> {
|
|
3
|
+
parse(input: unknown): T;
|
|
4
|
+
}
|
|
5
|
+
export declare const MANIFEST_POLICY_TRIGGERS: {
|
|
6
|
+
readonly ON_TOOL_REQUEST: "on_tool_request";
|
|
7
|
+
readonly ON_CLAIM: "on_claim";
|
|
8
|
+
readonly ON_COMPLETION: "on_completion";
|
|
9
|
+
readonly ON_EVIDENCE_ADDED: "on_evidence_added";
|
|
10
|
+
};
|
|
11
|
+
export type ManifestPolicyTrigger = (typeof MANIFEST_POLICY_TRIGGERS)[keyof typeof MANIFEST_POLICY_TRIGGERS];
|
|
12
|
+
export declare const MANIFEST_POLICY_DECISIONS: {
|
|
13
|
+
readonly ALLOW: "allow";
|
|
14
|
+
readonly DENY: "deny";
|
|
15
|
+
};
|
|
16
|
+
export type ManifestPolicyDecision = (typeof MANIFEST_POLICY_DECISIONS)[keyof typeof MANIFEST_POLICY_DECISIONS];
|
|
17
|
+
export interface SidekickManifestTool {
|
|
18
|
+
name: string;
|
|
19
|
+
entry: string;
|
|
20
|
+
permission: ToolPermission;
|
|
21
|
+
required_scopes: PathScope[];
|
|
22
|
+
input_schema?: Record<string, unknown>;
|
|
23
|
+
output_schema?: Record<string, unknown>;
|
|
24
|
+
internal_only?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SidekickManifestPolicy {
|
|
27
|
+
id: string;
|
|
28
|
+
trigger: ManifestPolicyTrigger;
|
|
29
|
+
decision: ManifestPolicyDecision;
|
|
30
|
+
reason?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SidekickPackManifest {
|
|
33
|
+
id: string;
|
|
34
|
+
version: string;
|
|
35
|
+
config_key?: string;
|
|
36
|
+
config_schema?: string;
|
|
37
|
+
task_types: string[];
|
|
38
|
+
tools: SidekickManifestTool[];
|
|
39
|
+
policies: SidekickManifestPolicy[];
|
|
40
|
+
evidence_types: string[];
|
|
41
|
+
state_aliases: Record<string, string>;
|
|
42
|
+
lane_templates: Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export declare const SidekickManifestSchema: Parser<SidekickPackManifest>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=manifest-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-schema.d.ts","sourceRoot":"","sources":["../manifest-schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,MAAM,CAAC,CAAC;IAChB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC;CAC1B;AAED,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,yBAAyB;;;CAG5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,cAAc,CAAC;IAC3B,eAAe,EAAE,SAAS,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,cAAc,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACvC;AAwJD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,oBAAoB,CAgD/D,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
import { TOOL_PERMISSIONS, TOOL_SCOPE_ACCESS, TOOL_SCOPE_TYPES, } from './tools/types.js';
|
|
4
|
+
export const MANIFEST_POLICY_TRIGGERS = {
|
|
5
|
+
ON_TOOL_REQUEST: 'on_tool_request',
|
|
6
|
+
ON_CLAIM: 'on_claim',
|
|
7
|
+
ON_COMPLETION: 'on_completion',
|
|
8
|
+
ON_EVIDENCE_ADDED: 'on_evidence_added',
|
|
9
|
+
};
|
|
10
|
+
export const MANIFEST_POLICY_DECISIONS = {
|
|
11
|
+
ALLOW: 'allow',
|
|
12
|
+
DENY: 'deny',
|
|
13
|
+
};
|
|
14
|
+
function asRecord(input, label) {
|
|
15
|
+
if (!input || typeof input !== 'object' || Array.isArray(input)) {
|
|
16
|
+
throw new Error(`${label} must be an object.`);
|
|
17
|
+
}
|
|
18
|
+
return input;
|
|
19
|
+
}
|
|
20
|
+
function parseNonEmptyString(value, label) {
|
|
21
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
22
|
+
throw new Error(`${label} must be a non-empty string.`);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
function parseStringArray(value, label) {
|
|
27
|
+
if (!Array.isArray(value)) {
|
|
28
|
+
throw new Error(`${label} must be an array.`);
|
|
29
|
+
}
|
|
30
|
+
return value.map((entry, index) => parseNonEmptyString(entry, `${label}[${index}]`));
|
|
31
|
+
}
|
|
32
|
+
function parseJsonSchemaObject(value, label) {
|
|
33
|
+
return asRecord(value, label);
|
|
34
|
+
}
|
|
35
|
+
function isSemver(value) {
|
|
36
|
+
let core = value;
|
|
37
|
+
const prereleaseIndex = core.indexOf('-');
|
|
38
|
+
if (prereleaseIndex >= 0) {
|
|
39
|
+
core = core.slice(0, prereleaseIndex);
|
|
40
|
+
}
|
|
41
|
+
const metadataIndex = core.indexOf('+');
|
|
42
|
+
if (metadataIndex >= 0) {
|
|
43
|
+
core = core.slice(0, metadataIndex);
|
|
44
|
+
}
|
|
45
|
+
const parts = core.split('.');
|
|
46
|
+
if (parts.length !== 3) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return parts.every((part) => part.length > 0 && [...part].every((char) => char >= '0' && char <= '9'));
|
|
50
|
+
}
|
|
51
|
+
const ALLOWED_POLICY_TRIGGERS = new Set(Object.values(MANIFEST_POLICY_TRIGGERS));
|
|
52
|
+
const ALLOWED_POLICY_DECISIONS = new Set(Object.values(MANIFEST_POLICY_DECISIONS));
|
|
53
|
+
const ALLOWED_TOOL_PERMISSIONS = new Set(Object.values(TOOL_PERMISSIONS));
|
|
54
|
+
function parsePathScope(input, label) {
|
|
55
|
+
const scope = asRecord(input, label);
|
|
56
|
+
const type = parseNonEmptyString(scope.type, `${label}.type`);
|
|
57
|
+
const pattern = parseNonEmptyString(scope.pattern, `${label}.pattern`);
|
|
58
|
+
const access = parseNonEmptyString(scope.access, `${label}.access`);
|
|
59
|
+
if (type !== TOOL_SCOPE_TYPES.PATH) {
|
|
60
|
+
throw new Error(`${label}.type must be "${TOOL_SCOPE_TYPES.PATH}".`);
|
|
61
|
+
}
|
|
62
|
+
if (access !== TOOL_SCOPE_ACCESS.READ && access !== TOOL_SCOPE_ACCESS.WRITE) {
|
|
63
|
+
throw new Error(`${label}.access must be "${TOOL_SCOPE_ACCESS.READ}" or "${TOOL_SCOPE_ACCESS.WRITE}".`);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
type: TOOL_SCOPE_TYPES.PATH,
|
|
67
|
+
pattern,
|
|
68
|
+
access,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function parseRequiredScopes(value, label) {
|
|
72
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
73
|
+
throw new Error(`${label} must be a non-empty array.`);
|
|
74
|
+
}
|
|
75
|
+
return value.map((entry, index) => parsePathScope(entry, `${label}[${index}]`));
|
|
76
|
+
}
|
|
77
|
+
function parsePolicy(input, index) {
|
|
78
|
+
const policy = asRecord(input, `policies[${index}]`);
|
|
79
|
+
const trigger = parseNonEmptyString(policy.trigger, `policies[${index}].trigger`);
|
|
80
|
+
const decision = parseNonEmptyString(policy.decision, `policies[${index}].decision`);
|
|
81
|
+
if (!ALLOWED_POLICY_TRIGGERS.has(trigger)) {
|
|
82
|
+
throw new Error(`policies[${index}].trigger is invalid.`);
|
|
83
|
+
}
|
|
84
|
+
if (!ALLOWED_POLICY_DECISIONS.has(decision)) {
|
|
85
|
+
throw new Error(`policies[${index}].decision is invalid.`);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
id: parseNonEmptyString(policy.id, `policies[${index}].id`),
|
|
89
|
+
trigger: trigger,
|
|
90
|
+
decision: decision,
|
|
91
|
+
reason: policy.reason === undefined
|
|
92
|
+
? undefined
|
|
93
|
+
: parseNonEmptyString(policy.reason, `policies[${index}].reason`),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function parseTool(input, index) {
|
|
97
|
+
const tool = asRecord(input, `tools[${index}]`);
|
|
98
|
+
const permission = tool.permission === undefined
|
|
99
|
+
? TOOL_PERMISSIONS.READ
|
|
100
|
+
: parseNonEmptyString(tool.permission, `tools[${index}].permission`);
|
|
101
|
+
if (!ALLOWED_TOOL_PERMISSIONS.has(permission)) {
|
|
102
|
+
throw new Error(`tools[${index}].permission is invalid.`);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
name: parseNonEmptyString(tool.name, `tools[${index}].name`),
|
|
106
|
+
entry: parseNonEmptyString(tool.entry, `tools[${index}].entry`),
|
|
107
|
+
permission: permission,
|
|
108
|
+
required_scopes: parseRequiredScopes(tool.required_scopes, `tools[${index}].required_scopes`),
|
|
109
|
+
input_schema: tool.input_schema === undefined
|
|
110
|
+
? undefined
|
|
111
|
+
: parseJsonSchemaObject(tool.input_schema, `tools[${index}].input_schema`),
|
|
112
|
+
output_schema: tool.output_schema === undefined
|
|
113
|
+
? undefined
|
|
114
|
+
: parseJsonSchemaObject(tool.output_schema, `tools[${index}].output_schema`),
|
|
115
|
+
internal_only: tool.internal_only === undefined
|
|
116
|
+
? undefined
|
|
117
|
+
: (() => {
|
|
118
|
+
if (typeof tool.internal_only !== 'boolean') {
|
|
119
|
+
throw new Error(`tools[${index}].internal_only must be boolean.`);
|
|
120
|
+
}
|
|
121
|
+
return tool.internal_only;
|
|
122
|
+
})(),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function parseStateAliases(input) {
|
|
126
|
+
const aliases = asRecord(input ?? {}, 'state_aliases');
|
|
127
|
+
const parsed = {};
|
|
128
|
+
for (const [key, value] of Object.entries(aliases)) {
|
|
129
|
+
parsed[parseNonEmptyString(key, 'state_aliases key')] = parseNonEmptyString(value, `state_aliases.${key}`);
|
|
130
|
+
}
|
|
131
|
+
return parsed;
|
|
132
|
+
}
|
|
133
|
+
export const SidekickManifestSchema = {
|
|
134
|
+
parse(input) {
|
|
135
|
+
const manifest = asRecord(input, 'manifest');
|
|
136
|
+
const version = parseNonEmptyString(manifest.version, 'version');
|
|
137
|
+
if (!isSemver(version)) {
|
|
138
|
+
throw new Error('version must be semver.');
|
|
139
|
+
}
|
|
140
|
+
const taskTypes = parseStringArray(manifest.task_types, 'task_types');
|
|
141
|
+
if (taskTypes.length === 0) {
|
|
142
|
+
throw new Error('task_types must include at least one item.');
|
|
143
|
+
}
|
|
144
|
+
const toolsValue = manifest.tools ?? [];
|
|
145
|
+
if (!Array.isArray(toolsValue)) {
|
|
146
|
+
throw new Error('tools must be an array.');
|
|
147
|
+
}
|
|
148
|
+
const policiesValue = manifest.policies ?? [];
|
|
149
|
+
if (!Array.isArray(policiesValue)) {
|
|
150
|
+
throw new Error('policies must be an array.');
|
|
151
|
+
}
|
|
152
|
+
const laneTemplatesValue = manifest.lane_templates ?? [];
|
|
153
|
+
if (!Array.isArray(laneTemplatesValue)) {
|
|
154
|
+
throw new Error('lane_templates must be an array.');
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
id: parseNonEmptyString(manifest.id, 'id'),
|
|
158
|
+
version,
|
|
159
|
+
config_key: manifest.config_key === undefined
|
|
160
|
+
? undefined
|
|
161
|
+
: parseNonEmptyString(manifest.config_key, 'config_key'),
|
|
162
|
+
config_schema: manifest.config_schema === undefined
|
|
163
|
+
? undefined
|
|
164
|
+
: parseNonEmptyString(manifest.config_schema, 'config_schema'),
|
|
165
|
+
task_types: taskTypes,
|
|
166
|
+
tools: toolsValue.map((tool, index) => parseTool(tool, index)),
|
|
167
|
+
policies: policiesValue.map((policy, index) => parsePolicy(policy, index)),
|
|
168
|
+
evidence_types: parseStringArray(manifest.evidence_types ?? [], 'evidence_types'),
|
|
169
|
+
state_aliases: parseStateAliases(manifest.state_aliases),
|
|
170
|
+
lane_templates: laneTemplatesValue.map((laneTemplate, index) => {
|
|
171
|
+
const entry = asRecord(laneTemplate, `lane_templates[${index}]`);
|
|
172
|
+
return { id: parseNonEmptyString(entry.id, `lane_templates[${index}].id`) };
|
|
173
|
+
}),
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=manifest-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-schema.js","sourceRoot":"","sources":["../manifest-schema.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,yCAAyC;AAEzC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GAGjB,MAAM,kBAAkB,CAAC;AAM1B,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,eAAe,EAAE,iBAAiB;IAClC,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,eAAe;IAC9B,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC;AAKX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC;AAmCX,SAAS,QAAQ,CAAC,KAAc,EAAE,KAAa;IAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qBAAqB,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,KAAa;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,8BAA8B,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CA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EAAE,EAAE,gBAAgB,CAAC;YACjF,aAAa,EAAE,iBAAiB,CAAC,QAAQ,CAAC,aAAa,CAAC;YACxD,cAAc,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;gBAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,EAAE,kBAAkB,KAAK,GAAG,CAAC,CAAC;gBACjE,OAAO,EAAE,EAAE,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAAE,kBAAkB,KAAK,MAAM,CAAC,EAAE,CAAC;YAC9E,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SidekickManifestTool, type SidekickPackManifest } from './manifest-schema.js';
|
|
2
|
+
declare const TOOL_PERMISSIONS_MAP: {
|
|
3
|
+
readonly 'task:create': "write";
|
|
4
|
+
readonly 'task:list': "read";
|
|
5
|
+
readonly 'task:complete': "write";
|
|
6
|
+
readonly 'task:schedule': "write";
|
|
7
|
+
readonly 'memory:store': "write";
|
|
8
|
+
readonly 'memory:recall': "read";
|
|
9
|
+
readonly 'memory:forget': "write";
|
|
10
|
+
readonly 'channel:configure': "write";
|
|
11
|
+
readonly 'channel:send': "write";
|
|
12
|
+
readonly 'channel:receive': "read";
|
|
13
|
+
readonly 'routine:create': "write";
|
|
14
|
+
readonly 'routine:list': "read";
|
|
15
|
+
readonly 'routine:run': "read";
|
|
16
|
+
readonly 'sidekick:init': "write";
|
|
17
|
+
readonly 'sidekick:status': "read";
|
|
18
|
+
readonly 'sidekick:export': "read";
|
|
19
|
+
};
|
|
20
|
+
type SidekickToolName = keyof typeof TOOL_PERMISSIONS_MAP;
|
|
21
|
+
export declare const SIDEKICK_TOOL_NAMES: SidekickToolName[];
|
|
22
|
+
export declare const SIDEKICK_MANIFEST: SidekickPackManifest;
|
|
23
|
+
export declare function getSidekickManifestToolByName(name: string): SidekickManifestTool | undefined;
|
|
24
|
+
export declare function getSidekickToolCount(): number;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../manifest.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AA6B9B,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;CAsByB,CAAC;AAEpD,KAAK,gBAAgB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AA8O1D,eAAO,MAAM,mBAAmB,EAAwC,gBAAgB,EAAE,CAAC;AAqB3F,eAAO,MAAM,iBAAiB,EAAE,oBAE/B,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE5F;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|