@dawn-ai/core 0.8.7 → 0.8.8
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 +149 -1
- package/dist/capabilities/built-in/memory.d.ts.map +1 -1
- package/dist/capabilities/built-in/memory.js +38 -10
- package/dist/capabilities/permission-gate.d.ts +22 -0
- package/dist/capabilities/permission-gate.d.ts.map +1 -1
- package/dist/capabilities/permission-gate.js +59 -8
- package/dist/capabilities/types.d.ts +7 -1
- package/dist/capabilities/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -6,7 +6,155 @@
|
|
|
6
6
|
|
|
7
7
|
Filesystem-based route discovery, app config loading, state-field resolution, and typegen primitives that the Dawn CLI builds on.
|
|
8
8
|
|
|
9
|
-
This is
|
|
9
|
+
This is part of [Dawn - the TypeScript meta-framework for LangGraph](https://github.com/cacheplane/dawnai).
|
|
10
|
+
Use this package for CLI/runtime integration points; application routes usually
|
|
11
|
+
import author-facing helpers from `@dawn-ai/sdk`.
|
|
12
|
+
|
|
13
|
+
Conceptual docs: [Routes](https://dawnai.org/docs/routes),
|
|
14
|
+
[Configuration](https://dawnai.org/docs/configuration),
|
|
15
|
+
[Workspace Filesystem](https://dawnai.org/docs/workspace),
|
|
16
|
+
[Memory](https://dawnai.org/docs/memory), and
|
|
17
|
+
[API Reference](https://dawnai.org/docs/api#dawn-aicore).
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @dawn-ai/core
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import {
|
|
27
|
+
createCapabilityRegistry,
|
|
28
|
+
createWorkspaceFs,
|
|
29
|
+
discoverRoutes,
|
|
30
|
+
loadDawnConfig,
|
|
31
|
+
renderDawnTypes,
|
|
32
|
+
type DawnConfig,
|
|
33
|
+
} from "@dawn-ai/core"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Public Exports
|
|
37
|
+
|
|
38
|
+
### Capability markers
|
|
39
|
+
|
|
40
|
+
- `createAgentsMdMarker()`
|
|
41
|
+
- `createMemoryMarker()`
|
|
42
|
+
- `createMemoryMdMarker()`
|
|
43
|
+
- `createPlanningMarker()`
|
|
44
|
+
- `createSkillsMarker()`
|
|
45
|
+
- `createSubagentsMarker()`
|
|
46
|
+
- `createWorkspaceMarker()`
|
|
47
|
+
- `BUILT_IN_TOOL_NAMES`
|
|
48
|
+
|
|
49
|
+
These markers detect route/app files and contribute prompt fragments, tools, or
|
|
50
|
+
stream transformers. `createMemoryMarker()` activates only when route memory
|
|
51
|
+
context is supplied; `createWorkspaceMarker()` activates when a `workspace/`
|
|
52
|
+
directory exists or a runtime `workspaceRoot` is supplied.
|
|
53
|
+
|
|
54
|
+
### Capability registry and permission gating
|
|
55
|
+
|
|
56
|
+
- `createCapabilityRegistry(markers)` and `applyCapabilities()` collect marker
|
|
57
|
+
contributions for a route.
|
|
58
|
+
- `gateToolOp()` and `wrapToolWithApproval()` apply tool-level approval rules.
|
|
59
|
+
- Types include `CapabilityMarker`, `CapabilityMarkerContext`,
|
|
60
|
+
`CapabilityContribution`, `DawnToolDefinition`, `PromptFragment`,
|
|
61
|
+
`StreamTransformer`, `MemoryContext`, `MemoryStoreLike`, and registry result
|
|
62
|
+
types.
|
|
63
|
+
|
|
64
|
+
### Workspace filesystem
|
|
65
|
+
|
|
66
|
+
- `createWorkspaceFs(options)` builds the `WorkspaceFs` handle used as `ctx.fs`.
|
|
67
|
+
- `CreateWorkspaceFsOptions` accepts `workspaceRoot`, a `FilesystemBackend`,
|
|
68
|
+
permissions, an `AbortSignal`, and `interruptCapable`.
|
|
69
|
+
|
|
70
|
+
The helper resolves paths relative to `workspaceRoot`, canonicalizes them with
|
|
71
|
+
the backend's `realPath`, and applies the same permission gate used by
|
|
72
|
+
agent-facing workspace tools.
|
|
73
|
+
|
|
74
|
+
### Configuration and discovery
|
|
75
|
+
|
|
76
|
+
- `loadDawnConfig({ appRoot })` loads and normalizes `dawn.config.ts`.
|
|
77
|
+
- `config(value)` is the typed identity helper for config files.
|
|
78
|
+
- `discoverRoutes(options)` scans the Dawn app directory and returns a route
|
|
79
|
+
manifest.
|
|
80
|
+
- `findDawnApp(options)` locates app roots, and
|
|
81
|
+
`assertDawnRoutesDir(appRoot, routesDir?)` validates that a routes directory
|
|
82
|
+
exists, returning `Promise<void>`.
|
|
83
|
+
- `toRouteSegments()`, `isPrivateSegment()`, and `isRouteGroupSegment()` parse
|
|
84
|
+
file-system route segments.
|
|
85
|
+
- Types include `DawnConfig`, `LoadedDawnConfig`, `DiscoverRoutesOptions`,
|
|
86
|
+
`DiscoveredDawnApp`, `RouteDefinition`, `RouteManifest`, `RouteSegment`,
|
|
87
|
+
`RouteKind`, and `NormalizedRouteModule`.
|
|
88
|
+
|
|
89
|
+
### State and typegen
|
|
90
|
+
|
|
91
|
+
- `resolveStateFields()` resolves route state reducers and defaults.
|
|
92
|
+
- `extractToolSchemasForRoute()` and `extractToolTypesForRoute()` inspect route
|
|
93
|
+
tools for schemas and generated type definitions.
|
|
94
|
+
- `renderDawnTypes()`, `renderRouteTypes()`, `renderStateTypes()`, and
|
|
95
|
+
`renderToolTypes()` render the generated `dawn:routes` declaration. Some docs
|
|
96
|
+
and audits refer to this group as `renderTypeDefinitions`; there is no single
|
|
97
|
+
exported function by that name.
|
|
98
|
+
- Types include `ResolveStateFieldsOptions`, `RouteStateFields`,
|
|
99
|
+
`ExtractToolSchemasOptions`, `ExtractToolTypesOptions`,
|
|
100
|
+
`RouteToolSchemas`, `RouteToolTypes`, `ExtractedToolSchema`,
|
|
101
|
+
`ExtractedToolType`, `ResolvedStateField`, and `StateFieldReducer`.
|
|
102
|
+
|
|
103
|
+
### Tool scope
|
|
104
|
+
|
|
105
|
+
- `resolveToolScope()` and `toolOrigin()` decide whether a discovered tool is
|
|
106
|
+
visible to a route.
|
|
107
|
+
- Types include `ScopeInput` and `ToolOrigin`.
|
|
108
|
+
|
|
109
|
+
### Storage type re-export
|
|
110
|
+
|
|
111
|
+
- `ThreadsStore` is re-exported from `@dawn-ai/sqlite-storage` for config typing.
|
|
112
|
+
|
|
113
|
+
## Examples
|
|
114
|
+
|
|
115
|
+
Discover routes and render generated route types:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
import {
|
|
119
|
+
discoverRoutes,
|
|
120
|
+
extractToolTypesForRoute,
|
|
121
|
+
renderDawnTypes,
|
|
122
|
+
} from "@dawn-ai/core"
|
|
123
|
+
|
|
124
|
+
const manifest = await discoverRoutes({ appRoot: process.cwd() })
|
|
125
|
+
const toolTypes = await Promise.all(
|
|
126
|
+
manifest.routes.map(async (route) => ({
|
|
127
|
+
pathname: route.pathname,
|
|
128
|
+
tools: await extractToolTypesForRoute({
|
|
129
|
+
routeDir: route.routeDir,
|
|
130
|
+
sharedToolsDir: `${process.cwd()}/src`,
|
|
131
|
+
}),
|
|
132
|
+
})),
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
const dts = renderDawnTypes(manifest, toolTypes)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Create a gated `WorkspaceFs` handle:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
import { createWorkspaceFs } from "@dawn-ai/core"
|
|
142
|
+
import { localFilesystem } from "@dawn-ai/workspace"
|
|
143
|
+
|
|
144
|
+
const fs = createWorkspaceFs({
|
|
145
|
+
workspaceRoot: `${process.cwd()}/workspace`,
|
|
146
|
+
backend: localFilesystem(),
|
|
147
|
+
permissions: undefined,
|
|
148
|
+
signal: new AbortController().signal,
|
|
149
|
+
interruptCapable: false,
|
|
150
|
+
})
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Notes
|
|
154
|
+
|
|
155
|
+
`@dawn-ai/core` is intentionally lower level than `@dawn-ai/sdk`. Prefer the SDK
|
|
156
|
+
for route code (`agent`, `defineMemory`, `DawnToolContext`, `RuntimeContext`),
|
|
157
|
+
and use core when building CLIs, adapters, tests, or runtime integrations.
|
|
10
158
|
|
|
11
159
|
## License
|
|
12
160
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/capabilities/built-in/memory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/capabilities/built-in/memory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAA;AAanE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CA4MrD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { gateMemorySupersede } from "../permission-gate.js";
|
|
3
4
|
const DEFAULT_SEMANTIC_IDENTITY = ["subject", "predicate"];
|
|
4
5
|
// A route's defineMemory() schema arrives as `unknown` (loaded via dynamic
|
|
5
6
|
// import, validated structurally). Module-scoped (no closure deps) so it isn't
|
|
@@ -23,6 +24,7 @@ export function createMemoryMarker() {
|
|
|
23
24
|
const mem = context.memory;
|
|
24
25
|
if (!mem)
|
|
25
26
|
return {};
|
|
27
|
+
const permissions = context.permissions;
|
|
26
28
|
const indexEntries = await mem.store.search({
|
|
27
29
|
namespace: mem.namespace,
|
|
28
30
|
status: "active",
|
|
@@ -66,9 +68,12 @@ export function createMemoryMarker() {
|
|
|
66
68
|
// NOT Date.now() (determinism rule; see module docblock).
|
|
67
69
|
now: mem.now,
|
|
68
70
|
});
|
|
71
|
+
// Wrap in {result} so the langchain bridge uses the string verbatim as
|
|
72
|
+
// the ToolMessage content; a bare string hits unwrapToolResult's
|
|
73
|
+
// JSON.stringify path, quoting it and escaping the newlines below.
|
|
69
74
|
if (rows.length === 0)
|
|
70
|
-
return "(no memories found)";
|
|
71
|
-
return rows.map((r) => `${r.id}: ${r.content}`).join("\n");
|
|
75
|
+
return { result: "(no memories found)" };
|
|
76
|
+
return { result: rows.map((r) => `${r.id}: ${r.content}`).join("\n") };
|
|
72
77
|
},
|
|
73
78
|
};
|
|
74
79
|
const remember = {
|
|
@@ -78,8 +83,9 @@ export function createMemoryMarker() {
|
|
|
78
83
|
run: async (input) => {
|
|
79
84
|
const inp = (input ?? {});
|
|
80
85
|
const validated = mem.validate(inp.data);
|
|
86
|
+
// All returns below wrap in {result} — see the recall tool's note.
|
|
81
87
|
if (!validated.ok)
|
|
82
|
-
return `Rejected: ${validated.errors}
|
|
88
|
+
return { result: `Rejected: ${validated.errors}` };
|
|
83
89
|
const data = validated.value;
|
|
84
90
|
const identityKeys = mem.defined.identity ?? DEFAULT_SEMANTIC_IDENTITY;
|
|
85
91
|
// id is DATA-derived so contradicting values (same identity, different
|
|
@@ -88,7 +94,9 @@ export function createMemoryMarker() {
|
|
|
88
94
|
.update(`${mem.namespace}|${JSON.stringify(data)}`)
|
|
89
95
|
.digest("hex")
|
|
90
96
|
.slice(0, 16)}`;
|
|
91
|
-
|
|
97
|
+
// "ask" shares auto's write semantics; only its SUPERSEDE branch gates.
|
|
98
|
+
const autoLike = mem.writes === "auto" || mem.writes === "ask";
|
|
99
|
+
const status = autoLike ? "active" : "candidate";
|
|
92
100
|
const content = typeof inp.content === "string" && inp.content.length > 0
|
|
93
101
|
? inp.content
|
|
94
102
|
: JSON.stringify(data);
|
|
@@ -107,7 +115,7 @@ export function createMemoryMarker() {
|
|
|
107
115
|
createdAt: mem.now,
|
|
108
116
|
updatedAt: mem.now,
|
|
109
117
|
};
|
|
110
|
-
if (
|
|
118
|
+
if (autoLike) {
|
|
111
119
|
// Inline identity key helper — avoids importing from @dawn-ai/memory
|
|
112
120
|
const identityKey = (d) => identityKeys.map((k) => JSON.stringify(d[k] ?? null)).join(" ");
|
|
113
121
|
const existing = await mem.store.search({
|
|
@@ -125,21 +133,41 @@ export function createMemoryMarker() {
|
|
|
125
133
|
confidence,
|
|
126
134
|
tags,
|
|
127
135
|
});
|
|
128
|
-
return `Updated memory ${target.id}
|
|
136
|
+
return { result: `Updated memory ${target.id}.` };
|
|
137
|
+
}
|
|
138
|
+
// Same identity but different value — supersede. In "ask" mode this
|
|
139
|
+
// is the one write that gates: the agent is contradicting a prior
|
|
140
|
+
// belief. ADDs/idempotent UPDATEs above never reach the gate.
|
|
141
|
+
if (mem.writes === "ask") {
|
|
142
|
+
const gate = await gateMemorySupersede(permissions, {
|
|
143
|
+
namespace: mem.namespace,
|
|
144
|
+
// Human-readable display form for the prompt — deliberately NOT
|
|
145
|
+
// the `identityKey` match key above (which JSON.stringifies to
|
|
146
|
+
// stay unambiguous); do not merge the two.
|
|
147
|
+
identity: identityKeys.map((k) => String(data[k] ?? "")).join(" / "),
|
|
148
|
+
oldId: target.id,
|
|
149
|
+
oldContent: target.content,
|
|
150
|
+
newContent: content,
|
|
151
|
+
});
|
|
152
|
+
if (!gate.allowed) {
|
|
153
|
+
return {
|
|
154
|
+
result: `Kept existing memory ${target.id} ("${target.content}"); ` +
|
|
155
|
+
`your contradicting value was not stored (${gate.reason}).`,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
129
158
|
}
|
|
130
|
-
// Same identity but different value — write new active row then supersede old
|
|
131
159
|
await mem.store.put(record);
|
|
132
160
|
await mem.store.supersede(target.id, id);
|
|
133
|
-
return `Superseded ${target.id} with ${id}
|
|
161
|
+
return { result: `Superseded ${target.id} with ${id}.` };
|
|
134
162
|
}
|
|
135
163
|
// No existing record with same identity — add new active row
|
|
136
164
|
await mem.store.put(record);
|
|
137
|
-
return `Stored memory ${id}
|
|
165
|
+
return { result: `Stored memory ${id}.` };
|
|
138
166
|
}
|
|
139
167
|
// Candidate mode (and "off" never reaches here — remember tool absent):
|
|
140
168
|
// write a candidate; reconciliation happens later at CLI approval.
|
|
141
169
|
await mem.store.put(record);
|
|
142
|
-
return `Stored memory candidate ${id} (pending approval)
|
|
170
|
+
return { result: `Stored memory candidate ${id} (pending approval).` };
|
|
143
171
|
},
|
|
144
172
|
};
|
|
145
173
|
// Fingerprint the snapshot the render closure froze at load time. `id`
|
|
@@ -19,6 +19,28 @@ export declare function gateBashOp(permissions: PermissionsStore | undefined, co
|
|
|
19
19
|
export declare function gateToolOp(permissions: PermissionsStore | undefined, toolName: string, argsPreview: string, opts?: {
|
|
20
20
|
readonly interruptCapable?: boolean;
|
|
21
21
|
}): Promise<GateResult>;
|
|
22
|
+
export interface MemorySupersedeDetail {
|
|
23
|
+
readonly namespace: string;
|
|
24
|
+
readonly identity: string;
|
|
25
|
+
readonly oldId: string;
|
|
26
|
+
readonly oldContent: string;
|
|
27
|
+
readonly newContent: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Memory supersede gate (memory.writes: "ask"). Prompts ONLY when the agent
|
|
31
|
+
* contradicts an existing active memory — ADDs and idempotent UPDATEs never
|
|
32
|
+
* reach this gate. Persisted decisions live under the reserved "memory" key
|
|
33
|
+
* as workspace+route namespace prefixes; candidates are matched with a "|"
|
|
34
|
+
* terminator so sibling routes cannot prefix-collide.
|
|
35
|
+
*
|
|
36
|
+
* DELIBERATE DIVERGENCE from gateToolOp: on "unknown" with no interactive
|
|
37
|
+
* human (non-interactive mode), this gate ALLOWS the supersede — ask is a
|
|
38
|
+
* supervision affordance, not a security boundary; headless it behaves
|
|
39
|
+
* exactly as writes:"auto". Explicit deny rules are still honored headless.
|
|
40
|
+
* Only called from inside the memory capability's remember tool, which only
|
|
41
|
+
* exists on agent routes (in-graph), so interrupt() is safe here.
|
|
42
|
+
*/
|
|
43
|
+
export declare function gateMemorySupersede(permissions: PermissionsStore | undefined, detail: MemorySupersedeDetail): Promise<GateResult>;
|
|
22
44
|
/**
|
|
23
45
|
* Wrap a tool so each call passes gateToolOp first (tools.approve). A blocked
|
|
24
46
|
* call returns the denial reason AS THE TOOL RESULT — deliberately a different
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-gate.d.ts","sourceRoot":"","sources":["../../src/capabilities/permission-gate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"permission-gate.d.ts","sourceRoot":"","sources":["../../src/capabilities/permission-gate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAQ5D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAA;AAEhE,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/E,wBAAsB,UAAU,CAC9B,WAAW,EAAE,gBAAgB,GAAG,SAAS,EACzC,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7C,OAAO,CAAC,UAAU,CAAC,CAwCrB;AAED,wBAAsB,UAAU,CAC9B,WAAW,EAAE,gBAAgB,GAAG,SAAS,EACzC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,CAAC,CAqBrB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,WAAW,EAAE,gBAAgB,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7C,OAAO,CAAC,UAAU,CAAC,CA+BrB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,gBAAgB,GAAG,SAAS,EACzC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAqBrB;AAYD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,EACD,CAAC,SAAS;IACR,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;CACzE,EACD,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,CAAC,CAS3F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sep } from "node:path";
|
|
2
|
-
import { suggestedCommandPattern, suggestedPathPattern } from "@dawn-ai/permissions";
|
|
2
|
+
import { suggestedCommandPattern, suggestedMemoryPattern, suggestedPathPattern, } from "@dawn-ai/permissions";
|
|
3
3
|
import { interrupt } from "@langchain/langgraph";
|
|
4
4
|
export async function gatePathOp(permissions, operation, absPath, workspaceRoot, opts) {
|
|
5
5
|
// If permissions store is absent, allow (legacy behavior — capability used without permissions context).
|
|
@@ -105,6 +105,44 @@ export async function gateToolOp(permissions, toolName, argsPreview, opts) {
|
|
|
105
105
|
}
|
|
106
106
|
return { allowed: true };
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Memory supersede gate (memory.writes: "ask"). Prompts ONLY when the agent
|
|
110
|
+
* contradicts an existing active memory — ADDs and idempotent UPDATEs never
|
|
111
|
+
* reach this gate. Persisted decisions live under the reserved "memory" key
|
|
112
|
+
* as workspace+route namespace prefixes; candidates are matched with a "|"
|
|
113
|
+
* terminator so sibling routes cannot prefix-collide.
|
|
114
|
+
*
|
|
115
|
+
* DELIBERATE DIVERGENCE from gateToolOp: on "unknown" with no interactive
|
|
116
|
+
* human (non-interactive mode), this gate ALLOWS the supersede — ask is a
|
|
117
|
+
* supervision affordance, not a security boundary; headless it behaves
|
|
118
|
+
* exactly as writes:"auto". Explicit deny rules are still honored headless.
|
|
119
|
+
* Only called from inside the memory capability's remember tool, which only
|
|
120
|
+
* exists on agent routes (in-graph), so interrupt() is safe here.
|
|
121
|
+
*/
|
|
122
|
+
export async function gateMemorySupersede(permissions, detail) {
|
|
123
|
+
if (!permissions)
|
|
124
|
+
return { allowed: true };
|
|
125
|
+
if (permissions.mode === "bypass")
|
|
126
|
+
return { allowed: true };
|
|
127
|
+
const decision = permissions.match("memory", `${detail.namespace}|`);
|
|
128
|
+
if (decision === "allow")
|
|
129
|
+
return { allowed: true };
|
|
130
|
+
if (decision === "deny") {
|
|
131
|
+
return { allowed: false, reason: `approval denied for this route's memory overwrites` };
|
|
132
|
+
}
|
|
133
|
+
// unknown + headless → allow through (ask ≡ auto without a human).
|
|
134
|
+
if (permissions.mode === "non-interactive")
|
|
135
|
+
return { allowed: true };
|
|
136
|
+
const result = await emitPermissionInterrupt({
|
|
137
|
+
kind: "memory",
|
|
138
|
+
...detail,
|
|
139
|
+
permissions,
|
|
140
|
+
});
|
|
141
|
+
if (result === "deny") {
|
|
142
|
+
return { allowed: false, reason: `approval denied` };
|
|
143
|
+
}
|
|
144
|
+
return { allowed: true };
|
|
145
|
+
}
|
|
108
146
|
/** Best-effort display preview of a tool call's args. Never matched or persisted. */
|
|
109
147
|
function buildArgsPreview(input) {
|
|
110
148
|
try {
|
|
@@ -150,7 +188,9 @@ async function emitPermissionInterrupt(args) {
|
|
|
150
188
|
? suggestedCommandPattern(args.command)
|
|
151
189
|
: args.kind === "tool"
|
|
152
190
|
? args.toolName
|
|
153
|
-
:
|
|
191
|
+
: args.kind === "memory"
|
|
192
|
+
? suggestedMemoryPattern(args.namespace)
|
|
193
|
+
: suggestedPathPattern(args.path);
|
|
154
194
|
const payload = {
|
|
155
195
|
interruptId,
|
|
156
196
|
type: "permission-request",
|
|
@@ -159,17 +199,28 @@ async function emitPermissionInterrupt(args) {
|
|
|
159
199
|
? { command: args.command, suggestedPattern }
|
|
160
200
|
: args.kind === "tool"
|
|
161
201
|
? { toolName: args.toolName, argsPreview: args.argsPreview, suggestedPattern }
|
|
162
|
-
:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
202
|
+
: args.kind === "memory"
|
|
203
|
+
? {
|
|
204
|
+
namespace: args.namespace,
|
|
205
|
+
identity: args.identity,
|
|
206
|
+
oldId: args.oldId,
|
|
207
|
+
oldContent: args.oldContent,
|
|
208
|
+
newContent: args.newContent,
|
|
209
|
+
suggestedPattern,
|
|
210
|
+
}
|
|
211
|
+
: { operation: args.operation, path: args.path, suggestedPattern },
|
|
167
212
|
};
|
|
168
213
|
const decision = interrupt(payload);
|
|
169
214
|
if (decision === "deny")
|
|
170
215
|
return "deny";
|
|
171
216
|
if (decision === "always") {
|
|
172
|
-
const tool = args.kind === "command"
|
|
217
|
+
const tool = args.kind === "command"
|
|
218
|
+
? "bash"
|
|
219
|
+
: args.kind === "tool"
|
|
220
|
+
? "tool"
|
|
221
|
+
: args.kind === "memory"
|
|
222
|
+
? "memory"
|
|
223
|
+
: args.operation;
|
|
173
224
|
await args.permissions.addAllow(tool, suggestedPattern);
|
|
174
225
|
}
|
|
175
226
|
return "allow";
|
|
@@ -35,10 +35,16 @@ export interface MemoryStoreLike {
|
|
|
35
35
|
update(id: string, patch: Partial<MemoryRecordLike>): Promise<void>;
|
|
36
36
|
supersede(id: string, bySupersedingId: string): Promise<void>;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Memory write-governance mode. "ask" = auto's exact write semantics, except
|
|
40
|
+
* SUPERSEDEs (same identity, different value) pass a HITL gate first — a
|
|
41
|
+
* supervision affordance, not a security boundary (headless ≡ auto).
|
|
42
|
+
*/
|
|
43
|
+
export type MemoryWritesMode = "off" | "candidate" | "auto" | "ask";
|
|
38
44
|
export interface MemoryContext {
|
|
39
45
|
readonly store: MemoryStoreLike;
|
|
40
46
|
readonly namespace: string;
|
|
41
|
-
readonly writes:
|
|
47
|
+
readonly writes: MemoryWritesMode;
|
|
42
48
|
readonly defined: {
|
|
43
49
|
readonly kind: string;
|
|
44
50
|
readonly scope: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/capabilities/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAA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AAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACzF,QAAQ,CAAC,IAAI,EAAE,CACb,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uBAAuB,KAC7B,OAAO,CAAC,sBAAsB,CAAC,CAAA;CACrC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ export { createSkillsMarker } from "./capabilities/built-in/skills.js";
|
|
|
8
8
|
export { createSubagentsMarker } from "./capabilities/built-in/subagents.js";
|
|
9
9
|
export { createWorkspaceMarker } from "./capabilities/built-in/workspace.js";
|
|
10
10
|
export { BUILT_IN_TOOL_NAMES } from "./capabilities/built-in-tool-names.js";
|
|
11
|
-
export {
|
|
11
|
+
export type { MemorySupersedeDetail } from "./capabilities/permission-gate.js";
|
|
12
|
+
export { gateMemorySupersede, gateToolOp, wrapToolWithApproval, } from "./capabilities/permission-gate.js";
|
|
12
13
|
export type { AppliedContribution, ApplyResult, CapabilityError, CapabilityRegistry, } from "./capabilities/registry.js";
|
|
13
14
|
export { applyCapabilities, createCapabilityRegistry, } from "./capabilities/registry.js";
|
|
14
|
-
export type { CapabilityContribution, CapabilityMarker, CapabilityMarkerContext, DawnToolDefinition, MemoryContext, MemoryRecordLike, MemoryStoreLike, PromptFragment, StreamTransformer, StreamTransformerInput, StreamTransformerOutput, } from "./capabilities/types.js";
|
|
15
|
+
export type { CapabilityContribution, CapabilityMarker, CapabilityMarkerContext, DawnToolDefinition, MemoryContext, MemoryRecordLike, MemoryStoreLike, MemoryWritesMode, PromptFragment, StreamTransformer, StreamTransformerInput, StreamTransformerOutput, } from "./capabilities/types.js";
|
|
15
16
|
export type { CreateWorkspaceFsOptions } from "./capabilities/workspace-fs.js";
|
|
16
17
|
export { createWorkspaceFs } from "./capabilities/workspace-fs.js";
|
|
17
18
|
export { loadDawnConfig } from "./config.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAC3E,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAC3E,YA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AAY,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAC1E,OAAO,EACL,eAAe,EACf,gBAAgB,GACjB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,GAClB,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { createSkillsMarker } from "./capabilities/built-in/skills.js";
|
|
|
6
6
|
export { createSubagentsMarker } from "./capabilities/built-in/subagents.js";
|
|
7
7
|
export { createWorkspaceMarker } from "./capabilities/built-in/workspace.js";
|
|
8
8
|
export { BUILT_IN_TOOL_NAMES } from "./capabilities/built-in-tool-names.js";
|
|
9
|
-
export { gateToolOp, wrapToolWithApproval } from "./capabilities/permission-gate.js";
|
|
9
|
+
export { gateMemorySupersede, gateToolOp, wrapToolWithApproval, } from "./capabilities/permission-gate.js";
|
|
10
10
|
export { applyCapabilities, createCapabilityRegistry, } from "./capabilities/registry.js";
|
|
11
11
|
export { createWorkspaceFs } from "./capabilities/workspace-fs.js";
|
|
12
12
|
export { loadDawnConfig } from "./config.js";
|