@warpgogol/forge 10.1.1 → 10.1.2
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/CHANGELOG.md +17 -0
- package/bin/cli.js +0 -0
- package/dist/src/sdk/context.d.ts +1 -0
- package/dist/src/sdk/context.d.ts.map +1 -1
- package/dist/src/sdk/context.js +87 -3
- package/dist/src/sdk/context.js.map +1 -1
- package/dist/src/sdk/types.d.ts +20 -0
- package/dist/src/sdk/types.d.ts.map +1 -1
- package/dist/src/sdk/types.js.map +1 -1
- package/package.json +497 -169
- package/src/sdk/context.ts +83 -3
- package/src/sdk/types.ts +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
For the full commit history, see the [GitHub releases page](https://github.com/syrokomskyi/forge/releases).
|
|
8
8
|
|
|
9
|
+
## [10.1.2] — 2026-11-25
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Symlink ports in the plugin SDK** — `workspace.readlink`/`symlink`/`unlink` behind the filesystem grant (readlink: read; symlink/unlink: readwrite). Deploy-style atomic swaps are link re-points and `readFile` follows links invisibly, so extraction of link-based subsystems was impossible without them (RFC-1645 WP-8 wave-2 prep).
|
|
14
|
+
- Regression coverage: project-local plugin `.ts` source loading (zero-build contract) — positive through the SDK loader, negative (production strip-only refusal of non-erasable syntax) through a real node subprocess because vitest transpiles in-process and masks the constraint.
|
|
15
|
+
|
|
16
|
+
- **Env port implemented** — the manifest's `envKeys` dimension (declared in v1 schema, unenforced until now) now backs `ctx.env.get`/`declared`: undeclared keys refuse with CapabilityViolation, so secrets-adjacent access is transparent and auditable at the manifest surface (RFC-1645 WP-8 wave-2 prep — deploy signing-key reads extract through this, never a blanket process.env passthrough).
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **Security — git capability bypass closed**: the mutation check inspected `args[0]` only, so `git -c user=x commit …` slipped past enforcement. The subcommand is now parsed past value-taking global flags, dual-use commands (`tag`/`branch`/`config`) are conservative-denied (ref listing belongs to `for-each-ref` plumbing), mutator coverage extended (`add`/`stash`/`worktree`/`reflog`/`fetch`/`pull`/…), and `-C`/`--git-dir`/`--work-tree` scope redirection is refused outright for reads and writes.
|
|
21
|
+
|
|
22
|
+
### Security notes
|
|
23
|
+
|
|
24
|
+
- `scoped()` is a textual check: a symlink whose target leaves the workspace escapes on follow. `filesystem: readwrite` is a trusted-within-workspace grant by design (it can already overwrite `forge.yaml` and hooks) — plugins needing strict containment must not receive it. This is now documented at the enforcement site.
|
|
25
|
+
|
|
9
26
|
## [10.1.1] — 2026-11-25
|
|
10
27
|
|
|
11
28
|
### Added
|
package/bin/cli.js
CHANGED
|
File without changes
|
|
@@ -8,6 +8,7 @@ export interface ContextHostServices {
|
|
|
8
8
|
registerNode?: PluginContext["contracts"]["registerNode"];
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
+
export declare function gitSubcommand(args: string[]): string | undefined;
|
|
11
12
|
/** Build a capability-enforcing PluginContext for one activated plugin. */
|
|
12
13
|
export declare function createPluginContext(manifest: PluginManifest, host: ContextHostServices): PluginContext;
|
|
13
14
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/sdk/context.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAI1F,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE;QACN,eAAe,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;QACvD,YAAY,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;KAC3D,CAAC;CACH;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/sdk/context.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAI1F,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE;QACN,eAAe,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;QACvD,YAAY,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;KAC3D,CAAC;CACH;AAWD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAehE;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,GAAG,aAAa,CA4JtG"}
|
package/dist/src/sdk/context.js
CHANGED
|
@@ -9,12 +9,35 @@ spawn, no git mutation. This is auditability, not a sandbox.
|
|
|
9
9
|
<non-goals><item>No static circumvention scan — that lives in the contract node.</item></non-goals>
|
|
10
10
|
<CHANGE_SUMMARY><item>RFC-1648 (WP-5): initial capability-enforcing context.</item></CHANGE_SUMMARY>
|
|
11
11
|
*/
|
|
12
|
-
import { access, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
12
|
+
import { access, mkdir, readFile, readdir, readlink, rename, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
13
13
|
import { execFile } from "node:child_process";
|
|
14
14
|
import { dirname, resolve as pathResolve } from "node:path";
|
|
15
15
|
import { promisify } from "node:util";
|
|
16
16
|
import { CapabilityViolation } from "./types.js";
|
|
17
17
|
const execFileAsync = promisify(execFile);
|
|
18
|
+
/* Dual-use commands (tag/branch/config) are conservative-denied: listing refs
|
|
19
|
+
belongs to for-each-ref plumbing, config reads to file parsing. A security
|
|
20
|
+
boundary refuses false negatives at the cost of false-positive friction. */
|
|
21
|
+
const MUTATING_GIT_OPS = new Set(["commit", "push", "update-ref", "checkout", "reset", "rebase", "merge", "cherry-pick", "apply", "commit-tree", "tag", "branch", "am", "stash", "rm", "mv", "clean", "gc", "fetch", "pull", "clone", "init", "add", "notes", "replace", "filter-branch", "update-index", "write-tree", "symbolic-ref", "worktree", "reflog", "config"]);
|
|
22
|
+
/* Git global flags consuming a separate value token — the subcommand is the first
|
|
23
|
+
positional after these are skipped. `--flag=value` forms self-skip. */
|
|
24
|
+
const GIT_VALUE_FLAGS = new Set(["-C", "-c", "--git-dir", "--work-tree", "--namespace", "--config-env", "--exec-path"]);
|
|
25
|
+
export function gitSubcommand(args) {
|
|
26
|
+
let i = 0;
|
|
27
|
+
while (i < args.length) {
|
|
28
|
+
const a = args[i];
|
|
29
|
+
if (GIT_VALUE_FLAGS.has(a)) {
|
|
30
|
+
i += 2;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (a.startsWith("-")) {
|
|
34
|
+
i += 1;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
return a;
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
18
41
|
/** Build a capability-enforcing PluginContext for one activated plugin. */
|
|
19
42
|
export function createPluginContext(manifest, host) {
|
|
20
43
|
const caps = manifest.capabilities ?? {};
|
|
@@ -60,6 +83,47 @@ export function createPluginContext(manifest, host) {
|
|
|
60
83
|
deny("filesystem", "list with filesystem:none");
|
|
61
84
|
return readdir(scoped(dir));
|
|
62
85
|
},
|
|
86
|
+
async readlink(path) {
|
|
87
|
+
if (fsGrant === "none")
|
|
88
|
+
deny("filesystem", "readlink with filesystem:none");
|
|
89
|
+
return readlink(scoped(path));
|
|
90
|
+
},
|
|
91
|
+
async symlink(target, linkPath) {
|
|
92
|
+
if (fsGrant !== "readwrite")
|
|
93
|
+
deny("filesystem", `symlink with filesystem:${fsGrant}`);
|
|
94
|
+
// The link PATH is sandboxed; the link TARGET is not re-validated — scoped()
|
|
95
|
+
// is a textual check, so a link pointing outside the root escapes on follow.
|
|
96
|
+
// readwrite is a trusted-within-workspace grant (it can already overwrite
|
|
97
|
+
// forge.yaml and hooks); symlink creation is consistent with that trust level.
|
|
98
|
+
// Plugins needing strict containment must not receive readwrite.
|
|
99
|
+
await symlink(target, scoped(linkPath));
|
|
100
|
+
},
|
|
101
|
+
async unlink(path) {
|
|
102
|
+
if (fsGrant !== "readwrite")
|
|
103
|
+
deny("filesystem", `unlink with filesystem:${fsGrant}`);
|
|
104
|
+
await unlink(scoped(path));
|
|
105
|
+
},
|
|
106
|
+
async readFileBytes(path) {
|
|
107
|
+
if (fsGrant === "none")
|
|
108
|
+
deny("filesystem", "readFileBytes with filesystem:none");
|
|
109
|
+
return new Uint8Array(await readFile(scoped(path)));
|
|
110
|
+
},
|
|
111
|
+
async rename(from, to) {
|
|
112
|
+
if (fsGrant !== "readwrite")
|
|
113
|
+
deny("filesystem", `rename with filesystem:${fsGrant}`);
|
|
114
|
+
await rename(scoped(from), scoped(to));
|
|
115
|
+
},
|
|
116
|
+
async rm(path, opts) {
|
|
117
|
+
if (fsGrant !== "readwrite")
|
|
118
|
+
deny("filesystem", `rm with filesystem:${fsGrant}`);
|
|
119
|
+
await rm(scoped(path), { recursive: opts?.recursive ?? false, force: true });
|
|
120
|
+
},
|
|
121
|
+
async stat(path) {
|
|
122
|
+
if (fsGrant === "none")
|
|
123
|
+
deny("filesystem", "stat with filesystem:none");
|
|
124
|
+
const st = await stat(scoped(path));
|
|
125
|
+
return { size: st.size, mtimeMs: st.mtimeMs, isDirectory: st.isDirectory() };
|
|
126
|
+
},
|
|
63
127
|
},
|
|
64
128
|
evidence: {
|
|
65
129
|
consult: host.hooks?.evidenceConsult ?? (async () => ({ hit: false })),
|
|
@@ -80,8 +144,17 @@ export function createPluginContext(manifest, host) {
|
|
|
80
144
|
},
|
|
81
145
|
git: {
|
|
82
146
|
async exec(args) {
|
|
83
|
-
|
|
84
|
-
|
|
147
|
+
// Redirection flags escape the workspace scope for reads AND writes — refused outright.
|
|
148
|
+
for (const a of args) {
|
|
149
|
+
if (a === "-C" || a === "--git-dir" || a === "--work-tree" || a.startsWith("--git-dir=") || a.startsWith("--work-tree=")) {
|
|
150
|
+
deny("filesystem", `git scope redirection refused: ${a}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (!caps.gitMutation) {
|
|
154
|
+
const subcommand = gitSubcommand(args);
|
|
155
|
+
if (subcommand && MUTATING_GIT_OPS.has(subcommand)) {
|
|
156
|
+
deny("gitMutation", `mutating git op refused: git ${subcommand}`);
|
|
157
|
+
}
|
|
85
158
|
}
|
|
86
159
|
const { stdout } = await execFileAsync("git", args, { cwd: host.workspaceRoot });
|
|
87
160
|
return stdout;
|
|
@@ -114,6 +187,17 @@ export function createPluginContext(manifest, host) {
|
|
|
114
187
|
return { status: res.status, body: await res.text() };
|
|
115
188
|
},
|
|
116
189
|
},
|
|
190
|
+
env: {
|
|
191
|
+
get(key) {
|
|
192
|
+
if (!(caps.envKeys ?? []).includes(key)) {
|
|
193
|
+
deny("env", `env key not declared in manifest envKeys: ${key}`);
|
|
194
|
+
}
|
|
195
|
+
return process.env[key];
|
|
196
|
+
},
|
|
197
|
+
declared(key) {
|
|
198
|
+
return (caps.envKeys ?? []).includes(key);
|
|
199
|
+
},
|
|
200
|
+
},
|
|
117
201
|
log: {
|
|
118
202
|
info: (msg) => console.log(`[${pid}] ${msg}`),
|
|
119
203
|
warn: (msg) => console.warn(`[${pid}] ${msg}`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/sdk/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/sdk/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5H,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAA2C,MAAM,YAAY,CAAC;AAE1F,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAY1C;;8EAE8E;AAC9E,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,QAA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AC;YAC1B,CAAC;YACD,QAAQ,CAAC,GAAG;gBACV,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC5C,CAAC;SACF;QACD,GAAG,EAAE;YACH,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;YAC7C,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;YAC9C,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;SACjD;QACD,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,KAAK,CAAC;YAChE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa;SAC/B;KACF,CAAC;AACJ,CAAC"}
|
package/dist/src/sdk/types.d.ts
CHANGED
|
@@ -65,6 +65,19 @@ export interface WorkspaceIOPort {
|
|
|
65
65
|
writeFile(path: string, content: string): Promise<void>;
|
|
66
66
|
exists(path: string): Promise<boolean>;
|
|
67
67
|
list(dir: string, pattern?: string): Promise<string[]>;
|
|
68
|
+
readlink(path: string): Promise<string>;
|
|
69
|
+
symlink(target: string, linkPath: string): Promise<void>;
|
|
70
|
+
unlink(path: string): Promise<void>;
|
|
71
|
+
readFileBytes(path: string): Promise<Uint8Array>;
|
|
72
|
+
rename(from: string, to: string): Promise<void>;
|
|
73
|
+
rm(path: string, opts?: {
|
|
74
|
+
recursive?: boolean;
|
|
75
|
+
}): Promise<void>;
|
|
76
|
+
stat(path: string): Promise<{
|
|
77
|
+
size: number;
|
|
78
|
+
mtimeMs: number;
|
|
79
|
+
isDirectory: boolean;
|
|
80
|
+
}>;
|
|
68
81
|
}
|
|
69
82
|
export interface EvidenceAccessPort {
|
|
70
83
|
consult(nodeId: string, inputDigest: string): Promise<{
|
|
@@ -126,6 +139,13 @@ export interface PluginContext {
|
|
|
126
139
|
network: NetworkPort;
|
|
127
140
|
log: LoggerPort;
|
|
128
141
|
paths: PathResolverPort;
|
|
142
|
+
env: EnvPort;
|
|
143
|
+
}
|
|
144
|
+
export interface EnvPort {
|
|
145
|
+
/** Declared key → value or undefined; undeclared key → CapabilityViolation. */
|
|
146
|
+
get(key: string): string | undefined;
|
|
147
|
+
/** Whether the key is declared in the manifest — no leakage of presence vs value. */
|
|
148
|
+
declared(key: string): boolean;
|
|
129
149
|
}
|
|
130
150
|
/** Typed incompatibility error — fail-closed, no degraded modes. */
|
|
131
151
|
export declare class PluginLoadError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sdk/types.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,0BAA0B,CAAC;IACnC,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE;QACZ,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;QAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,SAAS,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,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AAC,QAAQ,EAAE,MAAM,CAAC;gBACd,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAMjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AA4CF,MAAM,CAAC,MAAM,eAAe,GAA6B,CAAC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AA4CF,MAAM,CAAC,MAAM,eAAe,GAA6B,CAAC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;AAkG7H,oEAAoE;AACpE,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,CAAsH;IAC1H,QAAQ,CAAU;IAC3B,YACE,IAAyH,EACzH,OAAe,EACf,QAAiB;QAEjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,UAAU,CAAS;IACnB,QAAQ,CAAS;IAC1B,YAAY,UAAkB,EAAE,QAAgB,EAAE,MAAc;QAC9D,KAAK,CAAC,iCAAiC,QAAQ,YAAY,UAAU,YAAY,MAAM,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warpgogol/forge",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"description": "Repository-native governance for AI-assisted software development
|
|
7
|
+
"description": "Repository-native governance for AI-assisted software development \u2014 project contracts, RFCs, ADRs, agent skills and deterministic validation.",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"ai",
|
|
10
10
|
"agent",
|
|
@@ -22,307 +22,331 @@
|
|
|
22
22
|
"type": "git",
|
|
23
23
|
"url": "git+https://github.com/syrokomskyi/forge.git"
|
|
24
24
|
},
|
|
25
|
-
"main": "./
|
|
26
|
-
"types": "./
|
|
25
|
+
"main": "./src/index.ts",
|
|
26
|
+
"types": "./src/index.ts",
|
|
27
27
|
"bin": {
|
|
28
|
-
"forge": "
|
|
28
|
+
"forge": "bin/cli.js"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
|
-
"types": "./
|
|
33
|
-
"default": "./
|
|
32
|
+
"types": "./src/index.ts",
|
|
33
|
+
"default": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"./types": {
|
|
36
|
-
"types": "./
|
|
37
|
-
"default": "./
|
|
36
|
+
"types": "./src/types.ts",
|
|
37
|
+
"default": "./src/types.ts"
|
|
38
38
|
},
|
|
39
39
|
"./utils": {
|
|
40
|
-
"types": "./
|
|
41
|
-
"default": "./
|
|
40
|
+
"types": "./src/utils/index.ts",
|
|
41
|
+
"default": "./src/utils/index.ts"
|
|
42
42
|
},
|
|
43
43
|
"./config": {
|
|
44
|
-
"types": "./
|
|
45
|
-
"default": "./
|
|
44
|
+
"types": "./src/config/forge-config.ts",
|
|
45
|
+
"default": "./src/config/forge-config.ts"
|
|
46
|
+
},
|
|
47
|
+
"./registry": {
|
|
48
|
+
"types": "./src/registry.ts",
|
|
49
|
+
"default": "./src/registry.ts"
|
|
46
50
|
},
|
|
47
51
|
"./reachability": {
|
|
48
|
-
"types": "./
|
|
49
|
-
"default": "./
|
|
52
|
+
"types": "./src/reachability/command-mentions.ts",
|
|
53
|
+
"default": "./src/reachability/command-mentions.ts"
|
|
54
|
+
},
|
|
55
|
+
"./spec": {
|
|
56
|
+
"types": "./src/spec/resolve-spec-source.ts",
|
|
57
|
+
"default": "./src/spec/resolve-spec-source.ts"
|
|
58
|
+
},
|
|
59
|
+
"./compass": {
|
|
60
|
+
"types": "./src/compass/index.ts",
|
|
61
|
+
"default": "./src/compass/index.ts"
|
|
50
62
|
},
|
|
51
63
|
"./os/core": {
|
|
52
|
-
"types": "./
|
|
53
|
-
"default": "./
|
|
64
|
+
"types": "./os/core/core.module.ts",
|
|
65
|
+
"default": "./os/core/core.module.ts"
|
|
54
66
|
},
|
|
55
67
|
"./os/core/lock-holder": {
|
|
56
|
-
"types": "./
|
|
57
|
-
"default": "./
|
|
68
|
+
"types": "./os/core/lock-holder.ts",
|
|
69
|
+
"default": "./os/core/lock-holder.ts"
|
|
58
70
|
},
|
|
59
71
|
"./os/compass": {
|
|
60
|
-
"types": "./
|
|
61
|
-
"default": "./
|
|
72
|
+
"types": "./os/compass/index.ts",
|
|
73
|
+
"default": "./os/compass/index.ts"
|
|
62
74
|
},
|
|
63
75
|
"./os/naming": {
|
|
64
|
-
"types": "./
|
|
65
|
-
"default": "./
|
|
76
|
+
"types": "./os/naming/index.ts",
|
|
77
|
+
"default": "./os/naming/index.ts"
|
|
66
78
|
},
|
|
67
79
|
"./os/naming-module": {
|
|
68
|
-
"types": "./
|
|
69
|
-
"default": "./
|
|
80
|
+
"types": "./os/naming/naming.module.ts",
|
|
81
|
+
"default": "./os/naming/naming.module.ts"
|
|
70
82
|
},
|
|
71
83
|
"./os/rfc": {
|
|
72
|
-
"types": "./
|
|
73
|
-
"default": "./
|
|
84
|
+
"types": "./os/rfc/index.ts",
|
|
85
|
+
"default": "./os/rfc/index.ts"
|
|
74
86
|
},
|
|
75
87
|
"./os/rfc-module": {
|
|
76
|
-
"types": "./
|
|
77
|
-
"default": "./
|
|
88
|
+
"types": "./os/rfc/rfc.module.ts",
|
|
89
|
+
"default": "./os/rfc/rfc.module.ts"
|
|
78
90
|
},
|
|
79
91
|
"./os/workflow": {
|
|
80
|
-
"types": "./
|
|
81
|
-
"default": "./
|
|
92
|
+
"types": "./os/workflow/index.ts",
|
|
93
|
+
"default": "./os/workflow/index.ts"
|
|
82
94
|
},
|
|
83
95
|
"./os/workflow-module": {
|
|
84
|
-
"types": "./
|
|
85
|
-
"default": "./
|
|
96
|
+
"types": "./os/workflow/workflow.module.ts",
|
|
97
|
+
"default": "./os/workflow/workflow.module.ts"
|
|
86
98
|
},
|
|
87
99
|
"./os/spec-module": {
|
|
88
|
-
"types": "./
|
|
89
|
-
"default": "./
|
|
100
|
+
"types": "./os/spec/spec.module.ts",
|
|
101
|
+
"default": "./os/spec/spec.module.ts"
|
|
90
102
|
},
|
|
91
103
|
"./os/adr": {
|
|
92
|
-
"types": "./
|
|
93
|
-
"default": "./
|
|
104
|
+
"types": "./os/adr/index.ts",
|
|
105
|
+
"default": "./os/adr/index.ts"
|
|
94
106
|
},
|
|
95
107
|
"./os/adr-module": {
|
|
96
|
-
"types": "./
|
|
97
|
-
"default": "./
|
|
108
|
+
"types": "./os/adr/adr.module.ts",
|
|
109
|
+
"default": "./os/adr/adr.module.ts"
|
|
98
110
|
},
|
|
99
111
|
"./os/plan": {
|
|
100
|
-
"types": "./
|
|
101
|
-
"default": "./
|
|
112
|
+
"types": "./os/plan/index.ts",
|
|
113
|
+
"default": "./os/plan/index.ts"
|
|
102
114
|
},
|
|
103
115
|
"./os/plan-module": {
|
|
104
|
-
"types": "./
|
|
105
|
-
"default": "./
|
|
116
|
+
"types": "./os/plan/plan.module.ts",
|
|
117
|
+
"default": "./os/plan/plan.module.ts"
|
|
106
118
|
},
|
|
107
119
|
"./os/audit": {
|
|
108
|
-
"types": "./
|
|
109
|
-
"default": "./
|
|
120
|
+
"types": "./os/audit/index.ts",
|
|
121
|
+
"default": "./os/audit/index.ts"
|
|
110
122
|
},
|
|
111
123
|
"./os/audit-module": {
|
|
112
|
-
"types": "./
|
|
113
|
-
"default": "./
|
|
124
|
+
"types": "./os/audit/audit.module.ts",
|
|
125
|
+
"default": "./os/audit/audit.module.ts"
|
|
114
126
|
},
|
|
115
127
|
"./os/session": {
|
|
116
|
-
"types": "./
|
|
117
|
-
"default": "./
|
|
128
|
+
"types": "./os/session/index.ts",
|
|
129
|
+
"default": "./os/session/index.ts"
|
|
118
130
|
},
|
|
119
131
|
"./os/session-module": {
|
|
120
|
-
"types": "./
|
|
121
|
-
"default": "./
|
|
132
|
+
"types": "./os/session/session.module.ts",
|
|
133
|
+
"default": "./os/session/session.module.ts"
|
|
122
134
|
},
|
|
123
135
|
"./os/exploration": {
|
|
124
|
-
"types": "./
|
|
125
|
-
"default": "./
|
|
136
|
+
"types": "./os/exploration/index.ts",
|
|
137
|
+
"default": "./os/exploration/index.ts"
|
|
126
138
|
},
|
|
127
139
|
"./os/exploration-module": {
|
|
128
|
-
"types": "./
|
|
129
|
-
"default": "./
|
|
140
|
+
"types": "./os/exploration/exploration.module.ts",
|
|
141
|
+
"default": "./os/exploration/exploration.module.ts"
|
|
130
142
|
},
|
|
131
143
|
"./os/notes": {
|
|
132
|
-
"types": "./
|
|
133
|
-
"default": "./
|
|
144
|
+
"types": "./os/notes/index.ts",
|
|
145
|
+
"default": "./os/notes/index.ts"
|
|
134
146
|
},
|
|
135
147
|
"./os/notes-module": {
|
|
136
|
-
"types": "./
|
|
137
|
-
"default": "./
|
|
148
|
+
"types": "./os/notes/notes.module.ts",
|
|
149
|
+
"default": "./os/notes/notes.module.ts"
|
|
138
150
|
},
|
|
139
151
|
"./os/program": {
|
|
140
|
-
"types": "./
|
|
141
|
-
"default": "./
|
|
152
|
+
"types": "./os/program/program.module.ts",
|
|
153
|
+
"default": "./os/program/program.module.ts"
|
|
142
154
|
},
|
|
143
155
|
"./os/plugin": {
|
|
144
|
-
"types": "./
|
|
145
|
-
"default": "./
|
|
156
|
+
"types": "./os/plugin/plugin.module.ts",
|
|
157
|
+
"default": "./os/plugin/plugin.module.ts"
|
|
146
158
|
},
|
|
147
159
|
"./os/queue": {
|
|
148
|
-
"types": "./
|
|
149
|
-
"default": "./
|
|
160
|
+
"types": "./os/queue/index.ts",
|
|
161
|
+
"default": "./os/queue/index.ts"
|
|
150
162
|
},
|
|
151
163
|
"./os/gate-run": {
|
|
152
|
-
"types": "./
|
|
153
|
-
"default": "./
|
|
164
|
+
"types": "./os/gate-run/index.ts",
|
|
165
|
+
"default": "./os/gate-run/index.ts"
|
|
154
166
|
},
|
|
155
167
|
"./os/queue-module": {
|
|
156
|
-
"types": "./
|
|
157
|
-
"default": "./
|
|
168
|
+
"types": "./os/queue/queue.module.ts",
|
|
169
|
+
"default": "./os/queue/queue.module.ts"
|
|
158
170
|
},
|
|
159
171
|
"./os/gate-run-module": {
|
|
160
|
-
"types": "./
|
|
161
|
-
"default": "./
|
|
172
|
+
"types": "./os/gate-run/gate-run.module.ts",
|
|
173
|
+
"default": "./os/gate-run/gate-run.module.ts"
|
|
162
174
|
},
|
|
163
|
-
"./
|
|
164
|
-
"types": "./
|
|
165
|
-
"default": "./
|
|
175
|
+
"./authority": {
|
|
176
|
+
"types": "./src/authority/index.ts",
|
|
177
|
+
"default": "./src/authority/index.ts"
|
|
166
178
|
},
|
|
167
|
-
"./
|
|
168
|
-
"types": "./
|
|
169
|
-
"default": "./
|
|
179
|
+
"./os/authority": {
|
|
180
|
+
"types": "./os/authority/index.ts",
|
|
181
|
+
"default": "./os/authority/index.ts"
|
|
182
|
+
},
|
|
183
|
+
"./os/authority-module": {
|
|
184
|
+
"types": "./os/authority/authority.module.ts",
|
|
185
|
+
"default": "./os/authority/authority.module.ts"
|
|
186
|
+
},
|
|
187
|
+
"./conformance": {
|
|
188
|
+
"types": "./src/conformance/index.ts",
|
|
189
|
+
"default": "./src/conformance/index.ts"
|
|
170
190
|
},
|
|
171
191
|
"./formal": {
|
|
172
|
-
"types": "./
|
|
173
|
-
"default": "./
|
|
192
|
+
"types": "./src/formal/index.ts",
|
|
193
|
+
"default": "./src/formal/index.ts"
|
|
174
194
|
},
|
|
175
195
|
"./os/conformance": {
|
|
176
|
-
"types": "./
|
|
177
|
-
"default": "./
|
|
196
|
+
"types": "./os/conformance/index.ts",
|
|
197
|
+
"default": "./os/conformance/index.ts"
|
|
178
198
|
},
|
|
179
199
|
"./os/conformance-module": {
|
|
180
|
-
"types": "./
|
|
181
|
-
"default": "./
|
|
200
|
+
"types": "./os/conformance/conformance.module.ts",
|
|
201
|
+
"default": "./os/conformance/conformance.module.ts"
|
|
182
202
|
},
|
|
183
203
|
"./os/flow": {
|
|
184
|
-
"types": "./
|
|
185
|
-
"default": "./
|
|
204
|
+
"types": "./os/flow/index.ts",
|
|
205
|
+
"default": "./os/flow/index.ts"
|
|
206
|
+
},
|
|
207
|
+
"./os/flow/test-helpers": {
|
|
208
|
+
"types": "./os/flow/tests/helpers.ts",
|
|
209
|
+
"default": "./os/flow/tests/helpers.ts"
|
|
186
210
|
},
|
|
187
211
|
"./os/flow-module": {
|
|
188
|
-
"types": "./
|
|
189
|
-
"default": "./
|
|
212
|
+
"types": "./os/flow/flow.module.ts",
|
|
213
|
+
"default": "./os/flow/flow.module.ts"
|
|
190
214
|
},
|
|
191
215
|
"./os/formal": {
|
|
192
|
-
"types": "./
|
|
193
|
-
"default": "./
|
|
216
|
+
"types": "./os/formal/index.ts",
|
|
217
|
+
"default": "./os/formal/index.ts"
|
|
194
218
|
},
|
|
195
219
|
"./os/formal-module": {
|
|
196
|
-
"types": "./
|
|
197
|
-
"default": "./
|
|
220
|
+
"types": "./os/formal/formal.module.ts",
|
|
221
|
+
"default": "./os/formal/formal.module.ts"
|
|
198
222
|
},
|
|
199
223
|
"./os/friction": {
|
|
200
|
-
"types": "./
|
|
201
|
-
"default": "./
|
|
224
|
+
"types": "./os/friction/index.ts",
|
|
225
|
+
"default": "./os/friction/index.ts"
|
|
202
226
|
},
|
|
203
227
|
"./os/friction-module": {
|
|
204
|
-
"types": "./
|
|
205
|
-
"default": "./
|
|
228
|
+
"types": "./os/friction/friction.module.ts",
|
|
229
|
+
"default": "./os/friction/friction.module.ts"
|
|
206
230
|
},
|
|
207
231
|
"./os/correctness": {
|
|
208
|
-
"types": "./
|
|
209
|
-
"default": "./
|
|
232
|
+
"types": "./os/correctness/index.ts",
|
|
233
|
+
"default": "./os/correctness/index.ts"
|
|
210
234
|
},
|
|
211
235
|
"./correctness": {
|
|
212
|
-
"types": "./
|
|
213
|
-
"default": "./
|
|
236
|
+
"types": "./src/correctness/index.ts",
|
|
237
|
+
"default": "./src/correctness/index.ts"
|
|
214
238
|
},
|
|
215
239
|
"./os/correctness-module": {
|
|
216
|
-
"types": "./
|
|
217
|
-
"default": "./
|
|
240
|
+
"types": "./os/correctness/correctness.module.ts",
|
|
241
|
+
"default": "./os/correctness/correctness.module.ts"
|
|
218
242
|
},
|
|
219
243
|
"./os/yaml": {
|
|
220
|
-
"types": "./
|
|
221
|
-
"default": "./
|
|
244
|
+
"types": "./os/yaml/index.ts",
|
|
245
|
+
"default": "./os/yaml/index.ts"
|
|
222
246
|
},
|
|
223
247
|
"./os/yaml-module": {
|
|
224
|
-
"types": "./
|
|
225
|
-
"default": "./
|
|
248
|
+
"types": "./os/yaml/yaml.module.ts",
|
|
249
|
+
"default": "./os/yaml/yaml.module.ts"
|
|
226
250
|
},
|
|
227
251
|
"./os/resolver-module": {
|
|
228
|
-
"types": "./
|
|
229
|
-
"default": "./
|
|
252
|
+
"types": "./os/resolver/resolver.module.ts",
|
|
253
|
+
"default": "./os/resolver/resolver.module.ts"
|
|
230
254
|
},
|
|
231
255
|
"./os/instructions-module": {
|
|
232
|
-
"types": "./
|
|
233
|
-
"default": "./
|
|
256
|
+
"types": "./os/instructions/instructions.module.ts",
|
|
257
|
+
"default": "./os/instructions/instructions.module.ts"
|
|
234
258
|
},
|
|
235
259
|
"./os/agent-module": {
|
|
236
|
-
"types": "./
|
|
237
|
-
"default": "./
|
|
260
|
+
"types": "./os/agent/agent.module.ts",
|
|
261
|
+
"default": "./os/agent/agent.module.ts"
|
|
238
262
|
},
|
|
239
263
|
"./os/agent": {
|
|
240
|
-
"types": "./
|
|
241
|
-
"default": "./
|
|
264
|
+
"types": "./os/agent/index.ts",
|
|
265
|
+
"default": "./os/agent/index.ts"
|
|
242
266
|
},
|
|
243
267
|
"./os/knowledge-module": {
|
|
244
|
-
"types": "./
|
|
245
|
-
"default": "./
|
|
268
|
+
"types": "./os/knowledge/knowledge.module.ts",
|
|
269
|
+
"default": "./os/knowledge/knowledge.module.ts"
|
|
246
270
|
},
|
|
247
271
|
"./os/knowledge": {
|
|
248
|
-
"types": "./
|
|
249
|
-
"default": "./
|
|
272
|
+
"types": "./os/knowledge/index.ts",
|
|
273
|
+
"default": "./os/knowledge/index.ts"
|
|
250
274
|
},
|
|
251
275
|
"./os/gate-module": {
|
|
252
|
-
"types": "./
|
|
253
|
-
"default": "./
|
|
276
|
+
"types": "./os/gate/gate.module.ts",
|
|
277
|
+
"default": "./os/gate/gate.module.ts"
|
|
254
278
|
},
|
|
255
279
|
"./os/gate": {
|
|
256
|
-
"types": "./
|
|
257
|
-
"default": "./
|
|
280
|
+
"types": "./os/gate/index.ts",
|
|
281
|
+
"default": "./os/gate/index.ts"
|
|
258
282
|
},
|
|
259
283
|
"./os/agent-tools-module": {
|
|
260
|
-
"types": "./
|
|
261
|
-
"default": "./
|
|
284
|
+
"types": "./os/agent-tools/agent-tools.module.ts",
|
|
285
|
+
"default": "./os/agent-tools/agent-tools.module.ts"
|
|
262
286
|
},
|
|
263
287
|
"./os/agent-tools": {
|
|
264
|
-
"types": "./
|
|
265
|
-
"default": "./
|
|
288
|
+
"types": "./os/agent-tools/index.ts",
|
|
289
|
+
"default": "./os/agent-tools/index.ts"
|
|
266
290
|
},
|
|
267
291
|
"./os/checks-module": {
|
|
268
|
-
"types": "./
|
|
269
|
-
"default": "./
|
|
292
|
+
"types": "./os/checks/checks.module.ts",
|
|
293
|
+
"default": "./os/checks/checks.module.ts"
|
|
270
294
|
},
|
|
271
295
|
"./os/checks": {
|
|
272
|
-
"types": "./
|
|
273
|
-
"default": "./
|
|
274
|
-
},
|
|
275
|
-
"./os/context-module": {
|
|
276
|
-
"types": "./dist/os/context/context.module.d.ts",
|
|
277
|
-
"default": "./dist/os/context/context.module.js"
|
|
296
|
+
"types": "./os/checks/index.ts",
|
|
297
|
+
"default": "./os/checks/index.ts"
|
|
278
298
|
},
|
|
279
299
|
"./os/codebase": {
|
|
280
|
-
"types": "./
|
|
281
|
-
"default": "./
|
|
300
|
+
"types": "./os/codebase/index.ts",
|
|
301
|
+
"default": "./os/codebase/index.ts"
|
|
282
302
|
},
|
|
283
303
|
"./os/codebase-module": {
|
|
284
|
-
"types": "./
|
|
285
|
-
"default": "./
|
|
304
|
+
"types": "./os/codebase/codebase.module.ts",
|
|
305
|
+
"default": "./os/codebase/codebase.module.ts"
|
|
306
|
+
},
|
|
307
|
+
"./os/context-module": {
|
|
308
|
+
"types": "./os/context/context.module.ts",
|
|
309
|
+
"default": "./os/context/context.module.ts"
|
|
286
310
|
},
|
|
287
311
|
"./os/context": {
|
|
288
|
-
"types": "./
|
|
289
|
-
"default": "./
|
|
312
|
+
"types": "./os/context/index.ts",
|
|
313
|
+
"default": "./os/context/index.ts"
|
|
290
314
|
},
|
|
291
315
|
"./os/trajectory-module": {
|
|
292
|
-
"types": "./
|
|
293
|
-
"default": "./
|
|
316
|
+
"types": "./os/trajectory/trajectory.module.ts",
|
|
317
|
+
"default": "./os/trajectory/trajectory.module.ts"
|
|
294
318
|
},
|
|
295
319
|
"./os/trajectory": {
|
|
296
|
-
"types": "./
|
|
297
|
-
"default": "./
|
|
320
|
+
"types": "./os/trajectory/index.ts",
|
|
321
|
+
"default": "./os/trajectory/index.ts"
|
|
298
322
|
},
|
|
299
323
|
"./os/system": {
|
|
300
|
-
"types": "./
|
|
301
|
-
"default": "./
|
|
324
|
+
"types": "./os/system/index.ts",
|
|
325
|
+
"default": "./os/system/index.ts"
|
|
302
326
|
},
|
|
303
327
|
"./os/system-module": {
|
|
304
|
-
"types": "./
|
|
305
|
-
"default": "./
|
|
328
|
+
"types": "./os/system/system.module.ts",
|
|
329
|
+
"default": "./os/system/system.module.ts"
|
|
306
330
|
},
|
|
307
331
|
"./os/adversarial-module": {
|
|
308
|
-
"types": "./
|
|
309
|
-
"default": "./
|
|
332
|
+
"types": "./os/adversarial/adversarial.module.ts",
|
|
333
|
+
"default": "./os/adversarial/adversarial.module.ts"
|
|
310
334
|
},
|
|
311
335
|
"./sdk": {
|
|
312
|
-
"types": "./
|
|
313
|
-
"default": "./
|
|
336
|
+
"types": "./src/sdk/types.ts",
|
|
337
|
+
"default": "./src/sdk/types.ts"
|
|
314
338
|
},
|
|
315
339
|
"./sdk/context": {
|
|
316
|
-
"types": "./
|
|
317
|
-
"default": "./
|
|
340
|
+
"types": "./src/sdk/context.ts",
|
|
341
|
+
"default": "./src/sdk/context.ts"
|
|
318
342
|
},
|
|
319
343
|
"./sdk/loader": {
|
|
320
|
-
"types": "./
|
|
321
|
-
"default": "./
|
|
344
|
+
"types": "./src/sdk/loader.ts",
|
|
345
|
+
"default": "./src/sdk/loader.ts"
|
|
322
346
|
},
|
|
323
347
|
"./integration": {
|
|
324
|
-
"types": "./
|
|
325
|
-
"default": "./
|
|
348
|
+
"types": "./src/integration/enqueue.ts",
|
|
349
|
+
"default": "./src/integration/enqueue.ts"
|
|
326
350
|
}
|
|
327
351
|
},
|
|
328
352
|
"files": [
|
|
@@ -342,6 +366,17 @@
|
|
|
342
366
|
"SECURITY.md",
|
|
343
367
|
"CHANGELOG.md"
|
|
344
368
|
],
|
|
369
|
+
"scripts": {
|
|
370
|
+
"build": "pnpm exec tsc -p tsconfig.build.json",
|
|
371
|
+
"build:check": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
372
|
+
"lint": "pnpm exec eslint \"src/**/*.ts\" \"os/**/*.ts\"",
|
|
373
|
+
"typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
374
|
+
"test": "vitest run --passWithNoTests",
|
|
375
|
+
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
376
|
+
"test:watch": "vitest",
|
|
377
|
+
"test:tarball:node24": "node test-fixtures/node24-consumer/smoke.mjs",
|
|
378
|
+
"prepublishOnly": "pnpm run test:tarball:node24"
|
|
379
|
+
},
|
|
345
380
|
"dependencies": {
|
|
346
381
|
"@aws-sdk/client-s3": "^3.1131.0",
|
|
347
382
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
@@ -366,16 +401,309 @@
|
|
|
366
401
|
"node": ">=24"
|
|
367
402
|
},
|
|
368
403
|
"publishConfig": {
|
|
369
|
-
"access": "public"
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
"
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
"
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
404
|
+
"access": "public",
|
|
405
|
+
"main": "./dist/src/index.js",
|
|
406
|
+
"types": "./dist/src/index.d.ts",
|
|
407
|
+
"bin": {
|
|
408
|
+
"forge": "./dist/bin/cli.js"
|
|
409
|
+
},
|
|
410
|
+
"exports": {
|
|
411
|
+
".": {
|
|
412
|
+
"types": "./dist/src/index.d.ts",
|
|
413
|
+
"default": "./dist/src/index.js"
|
|
414
|
+
},
|
|
415
|
+
"./types": {
|
|
416
|
+
"types": "./dist/src/types.d.ts",
|
|
417
|
+
"default": "./dist/src/types.js"
|
|
418
|
+
},
|
|
419
|
+
"./utils": {
|
|
420
|
+
"types": "./dist/src/utils/index.d.ts",
|
|
421
|
+
"default": "./dist/src/utils/index.js"
|
|
422
|
+
},
|
|
423
|
+
"./config": {
|
|
424
|
+
"types": "./dist/src/config/forge-config.d.ts",
|
|
425
|
+
"default": "./dist/src/config/forge-config.js"
|
|
426
|
+
},
|
|
427
|
+
"./reachability": {
|
|
428
|
+
"types": "./dist/src/reachability/command-mentions.d.ts",
|
|
429
|
+
"default": "./dist/src/reachability/command-mentions.js"
|
|
430
|
+
},
|
|
431
|
+
"./os/core": {
|
|
432
|
+
"types": "./dist/os/core/core.module.d.ts",
|
|
433
|
+
"default": "./dist/os/core/core.module.js"
|
|
434
|
+
},
|
|
435
|
+
"./os/core/lock-holder": {
|
|
436
|
+
"types": "./dist/os/core/lock-holder.d.ts",
|
|
437
|
+
"default": "./dist/os/core/lock-holder.js"
|
|
438
|
+
},
|
|
439
|
+
"./os/compass": {
|
|
440
|
+
"types": "./dist/os/compass/index.d.ts",
|
|
441
|
+
"default": "./dist/os/compass/index.js"
|
|
442
|
+
},
|
|
443
|
+
"./os/naming": {
|
|
444
|
+
"types": "./dist/os/naming/index.d.ts",
|
|
445
|
+
"default": "./dist/os/naming/index.js"
|
|
446
|
+
},
|
|
447
|
+
"./os/naming-module": {
|
|
448
|
+
"types": "./dist/os/naming/naming.module.d.ts",
|
|
449
|
+
"default": "./dist/os/naming/naming.module.js"
|
|
450
|
+
},
|
|
451
|
+
"./os/rfc": {
|
|
452
|
+
"types": "./dist/os/rfc/index.d.ts",
|
|
453
|
+
"default": "./dist/os/rfc/index.js"
|
|
454
|
+
},
|
|
455
|
+
"./os/rfc-module": {
|
|
456
|
+
"types": "./dist/os/rfc/rfc.module.d.ts",
|
|
457
|
+
"default": "./dist/os/rfc/rfc.module.js"
|
|
458
|
+
},
|
|
459
|
+
"./os/workflow": {
|
|
460
|
+
"types": "./dist/os/workflow/index.d.ts",
|
|
461
|
+
"default": "./dist/os/workflow/index.js"
|
|
462
|
+
},
|
|
463
|
+
"./os/workflow-module": {
|
|
464
|
+
"types": "./dist/os/workflow/workflow.module.d.ts",
|
|
465
|
+
"default": "./dist/os/workflow/workflow.module.js"
|
|
466
|
+
},
|
|
467
|
+
"./os/spec-module": {
|
|
468
|
+
"types": "./dist/os/spec/spec.module.d.ts",
|
|
469
|
+
"default": "./dist/os/spec/spec.module.js"
|
|
470
|
+
},
|
|
471
|
+
"./os/adr": {
|
|
472
|
+
"types": "./dist/os/adr/index.d.ts",
|
|
473
|
+
"default": "./dist/os/adr/index.js"
|
|
474
|
+
},
|
|
475
|
+
"./os/adr-module": {
|
|
476
|
+
"types": "./dist/os/adr/adr.module.d.ts",
|
|
477
|
+
"default": "./dist/os/adr/adr.module.js"
|
|
478
|
+
},
|
|
479
|
+
"./os/plan": {
|
|
480
|
+
"types": "./dist/os/plan/index.d.ts",
|
|
481
|
+
"default": "./dist/os/plan/index.js"
|
|
482
|
+
},
|
|
483
|
+
"./os/plan-module": {
|
|
484
|
+
"types": "./dist/os/plan/plan.module.d.ts",
|
|
485
|
+
"default": "./dist/os/plan/plan.module.js"
|
|
486
|
+
},
|
|
487
|
+
"./os/audit": {
|
|
488
|
+
"types": "./dist/os/audit/index.d.ts",
|
|
489
|
+
"default": "./dist/os/audit/index.js"
|
|
490
|
+
},
|
|
491
|
+
"./os/audit-module": {
|
|
492
|
+
"types": "./dist/os/audit/audit.module.d.ts",
|
|
493
|
+
"default": "./dist/os/audit/audit.module.js"
|
|
494
|
+
},
|
|
495
|
+
"./os/session": {
|
|
496
|
+
"types": "./dist/os/session/index.d.ts",
|
|
497
|
+
"default": "./dist/os/session/index.js"
|
|
498
|
+
},
|
|
499
|
+
"./os/session-module": {
|
|
500
|
+
"types": "./dist/os/session/session.module.d.ts",
|
|
501
|
+
"default": "./dist/os/session/session.module.js"
|
|
502
|
+
},
|
|
503
|
+
"./os/exploration": {
|
|
504
|
+
"types": "./dist/os/exploration/index.d.ts",
|
|
505
|
+
"default": "./dist/os/exploration/index.js"
|
|
506
|
+
},
|
|
507
|
+
"./os/exploration-module": {
|
|
508
|
+
"types": "./dist/os/exploration/exploration.module.d.ts",
|
|
509
|
+
"default": "./dist/os/exploration/exploration.module.js"
|
|
510
|
+
},
|
|
511
|
+
"./os/notes": {
|
|
512
|
+
"types": "./dist/os/notes/index.d.ts",
|
|
513
|
+
"default": "./dist/os/notes/index.js"
|
|
514
|
+
},
|
|
515
|
+
"./os/notes-module": {
|
|
516
|
+
"types": "./dist/os/notes/notes.module.d.ts",
|
|
517
|
+
"default": "./dist/os/notes/notes.module.js"
|
|
518
|
+
},
|
|
519
|
+
"./os/program": {
|
|
520
|
+
"types": "./dist/os/program/program.module.d.ts",
|
|
521
|
+
"default": "./dist/os/program/program.module.js"
|
|
522
|
+
},
|
|
523
|
+
"./os/plugin": {
|
|
524
|
+
"types": "./dist/os/plugin/plugin.module.d.ts",
|
|
525
|
+
"default": "./dist/os/plugin/plugin.module.js"
|
|
526
|
+
},
|
|
527
|
+
"./os/queue": {
|
|
528
|
+
"types": "./dist/os/queue/index.d.ts",
|
|
529
|
+
"default": "./dist/os/queue/index.js"
|
|
530
|
+
},
|
|
531
|
+
"./os/gate-run": {
|
|
532
|
+
"types": "./dist/os/gate-run/index.d.ts",
|
|
533
|
+
"default": "./dist/os/gate-run/index.js"
|
|
534
|
+
},
|
|
535
|
+
"./os/queue-module": {
|
|
536
|
+
"types": "./dist/os/queue/queue.module.d.ts",
|
|
537
|
+
"default": "./dist/os/queue/queue.module.js"
|
|
538
|
+
},
|
|
539
|
+
"./os/gate-run-module": {
|
|
540
|
+
"types": "./dist/os/gate-run/gate-run.module.d.ts",
|
|
541
|
+
"default": "./dist/os/gate-run/gate-run.module.js"
|
|
542
|
+
},
|
|
543
|
+
"./conformance": {
|
|
544
|
+
"types": "./dist/src/conformance/index.d.ts",
|
|
545
|
+
"default": "./dist/src/conformance/index.js"
|
|
546
|
+
},
|
|
547
|
+
"./spec": {
|
|
548
|
+
"types": "./dist/src/spec/resolve-spec-source.d.ts",
|
|
549
|
+
"default": "./dist/src/spec/resolve-spec-source.js"
|
|
550
|
+
},
|
|
551
|
+
"./formal": {
|
|
552
|
+
"types": "./dist/src/formal/index.d.ts",
|
|
553
|
+
"default": "./dist/src/formal/index.js"
|
|
554
|
+
},
|
|
555
|
+
"./os/conformance": {
|
|
556
|
+
"types": "./dist/os/conformance/index.d.ts",
|
|
557
|
+
"default": "./dist/os/conformance/index.js"
|
|
558
|
+
},
|
|
559
|
+
"./os/conformance-module": {
|
|
560
|
+
"types": "./dist/os/conformance/conformance.module.d.ts",
|
|
561
|
+
"default": "./dist/os/conformance/conformance.module.js"
|
|
562
|
+
},
|
|
563
|
+
"./os/flow": {
|
|
564
|
+
"types": "./dist/os/flow/index.d.ts",
|
|
565
|
+
"default": "./dist/os/flow/index.js"
|
|
566
|
+
},
|
|
567
|
+
"./os/flow-module": {
|
|
568
|
+
"types": "./dist/os/flow/flow.module.d.ts",
|
|
569
|
+
"default": "./dist/os/flow/flow.module.js"
|
|
570
|
+
},
|
|
571
|
+
"./os/formal": {
|
|
572
|
+
"types": "./dist/os/formal/index.d.ts",
|
|
573
|
+
"default": "./dist/os/formal/index.js"
|
|
574
|
+
},
|
|
575
|
+
"./os/formal-module": {
|
|
576
|
+
"types": "./dist/os/formal/formal.module.d.ts",
|
|
577
|
+
"default": "./dist/os/formal/formal.module.js"
|
|
578
|
+
},
|
|
579
|
+
"./os/friction": {
|
|
580
|
+
"types": "./dist/os/friction/index.d.ts",
|
|
581
|
+
"default": "./dist/os/friction/index.js"
|
|
582
|
+
},
|
|
583
|
+
"./os/friction-module": {
|
|
584
|
+
"types": "./dist/os/friction/friction.module.d.ts",
|
|
585
|
+
"default": "./dist/os/friction/friction.module.js"
|
|
586
|
+
},
|
|
587
|
+
"./os/correctness": {
|
|
588
|
+
"types": "./dist/os/correctness/index.d.ts",
|
|
589
|
+
"default": "./dist/os/correctness/index.js"
|
|
590
|
+
},
|
|
591
|
+
"./correctness": {
|
|
592
|
+
"types": "./dist/src/correctness/index.d.ts",
|
|
593
|
+
"default": "./dist/src/correctness/index.js"
|
|
594
|
+
},
|
|
595
|
+
"./os/correctness-module": {
|
|
596
|
+
"types": "./dist/os/correctness/correctness.module.d.ts",
|
|
597
|
+
"default": "./dist/os/correctness/correctness.module.js"
|
|
598
|
+
},
|
|
599
|
+
"./os/yaml": {
|
|
600
|
+
"types": "./dist/os/yaml/index.d.ts",
|
|
601
|
+
"default": "./dist/os/yaml/index.js"
|
|
602
|
+
},
|
|
603
|
+
"./os/yaml-module": {
|
|
604
|
+
"types": "./dist/os/yaml/yaml.module.d.ts",
|
|
605
|
+
"default": "./dist/os/yaml/yaml.module.js"
|
|
606
|
+
},
|
|
607
|
+
"./os/resolver-module": {
|
|
608
|
+
"types": "./dist/os/resolver/resolver.module.d.ts",
|
|
609
|
+
"default": "./dist/os/resolver/resolver.module.js"
|
|
610
|
+
},
|
|
611
|
+
"./os/instructions-module": {
|
|
612
|
+
"types": "./dist/os/instructions/instructions.module.d.ts",
|
|
613
|
+
"default": "./dist/os/instructions/instructions.module.js"
|
|
614
|
+
},
|
|
615
|
+
"./os/agent-module": {
|
|
616
|
+
"types": "./dist/os/agent/agent.module.d.ts",
|
|
617
|
+
"default": "./dist/os/agent/agent.module.js"
|
|
618
|
+
},
|
|
619
|
+
"./os/agent": {
|
|
620
|
+
"types": "./dist/os/agent/index.d.ts",
|
|
621
|
+
"default": "./dist/os/agent/index.js"
|
|
622
|
+
},
|
|
623
|
+
"./os/knowledge-module": {
|
|
624
|
+
"types": "./dist/os/knowledge/knowledge.module.d.ts",
|
|
625
|
+
"default": "./dist/os/knowledge/knowledge.module.js"
|
|
626
|
+
},
|
|
627
|
+
"./os/knowledge": {
|
|
628
|
+
"types": "./dist/os/knowledge/index.d.ts",
|
|
629
|
+
"default": "./dist/os/knowledge/index.js"
|
|
630
|
+
},
|
|
631
|
+
"./os/gate-module": {
|
|
632
|
+
"types": "./dist/os/gate/gate.module.d.ts",
|
|
633
|
+
"default": "./dist/os/gate/gate.module.js"
|
|
634
|
+
},
|
|
635
|
+
"./os/gate": {
|
|
636
|
+
"types": "./dist/os/gate/index.d.ts",
|
|
637
|
+
"default": "./dist/os/gate/index.js"
|
|
638
|
+
},
|
|
639
|
+
"./os/agent-tools-module": {
|
|
640
|
+
"types": "./dist/os/agent-tools/agent-tools.module.d.ts",
|
|
641
|
+
"default": "./dist/os/agent-tools/agent-tools.module.js"
|
|
642
|
+
},
|
|
643
|
+
"./os/agent-tools": {
|
|
644
|
+
"types": "./dist/os/agent-tools/index.d.ts",
|
|
645
|
+
"default": "./dist/os/agent-tools/index.js"
|
|
646
|
+
},
|
|
647
|
+
"./os/checks-module": {
|
|
648
|
+
"types": "./dist/os/checks/checks.module.d.ts",
|
|
649
|
+
"default": "./dist/os/checks/checks.module.js"
|
|
650
|
+
},
|
|
651
|
+
"./os/checks": {
|
|
652
|
+
"types": "./dist/os/checks/index.d.ts",
|
|
653
|
+
"default": "./dist/os/checks/index.js"
|
|
654
|
+
},
|
|
655
|
+
"./os/context-module": {
|
|
656
|
+
"types": "./dist/os/context/context.module.d.ts",
|
|
657
|
+
"default": "./dist/os/context/context.module.js"
|
|
658
|
+
},
|
|
659
|
+
"./os/codebase": {
|
|
660
|
+
"types": "./dist/os/codebase/index.d.ts",
|
|
661
|
+
"default": "./dist/os/codebase/index.js"
|
|
662
|
+
},
|
|
663
|
+
"./os/codebase-module": {
|
|
664
|
+
"types": "./dist/os/codebase/codebase.module.d.ts",
|
|
665
|
+
"default": "./dist/os/codebase/codebase.module.js"
|
|
666
|
+
},
|
|
667
|
+
"./os/context": {
|
|
668
|
+
"types": "./dist/os/context/index.d.ts",
|
|
669
|
+
"default": "./dist/os/context/index.js"
|
|
670
|
+
},
|
|
671
|
+
"./os/trajectory-module": {
|
|
672
|
+
"types": "./dist/os/trajectory/trajectory.module.d.ts",
|
|
673
|
+
"default": "./dist/os/trajectory/trajectory.module.js"
|
|
674
|
+
},
|
|
675
|
+
"./os/trajectory": {
|
|
676
|
+
"types": "./dist/os/trajectory/index.d.ts",
|
|
677
|
+
"default": "./dist/os/trajectory/index.js"
|
|
678
|
+
},
|
|
679
|
+
"./os/system": {
|
|
680
|
+
"types": "./dist/os/system/index.d.ts",
|
|
681
|
+
"default": "./dist/os/system/index.js"
|
|
682
|
+
},
|
|
683
|
+
"./os/system-module": {
|
|
684
|
+
"types": "./dist/os/system/system.module.d.ts",
|
|
685
|
+
"default": "./dist/os/system/system.module.js"
|
|
686
|
+
},
|
|
687
|
+
"./os/adversarial-module": {
|
|
688
|
+
"types": "./dist/os/adversarial/adversarial.module.d.ts",
|
|
689
|
+
"default": "./dist/os/adversarial/adversarial.module.js"
|
|
690
|
+
},
|
|
691
|
+
"./sdk": {
|
|
692
|
+
"types": "./dist/src/sdk/types.d.ts",
|
|
693
|
+
"default": "./dist/src/sdk/types.js"
|
|
694
|
+
},
|
|
695
|
+
"./sdk/context": {
|
|
696
|
+
"types": "./dist/sdk/context.d.ts",
|
|
697
|
+
"default": "./dist/sdk/context.js"
|
|
698
|
+
},
|
|
699
|
+
"./sdk/loader": {
|
|
700
|
+
"types": "./dist/sdk/loader.d.ts",
|
|
701
|
+
"default": "./dist/sdk/loader.js"
|
|
702
|
+
},
|
|
703
|
+
"./integration": {
|
|
704
|
+
"types": "./dist/integration/enqueue.d.ts",
|
|
705
|
+
"default": "./dist/integration/enqueue.js"
|
|
706
|
+
}
|
|
707
|
+
}
|
|
380
708
|
}
|
|
381
|
-
}
|
|
709
|
+
}
|
package/src/sdk/context.ts
CHANGED
|
@@ -10,7 +10,7 @@ spawn, no git mutation. This is auditability, not a sandbox.
|
|
|
10
10
|
<CHANGE_SUMMARY><item>RFC-1648 (WP-5): initial capability-enforcing context.</item></CHANGE_SUMMARY>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { access, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
13
|
+
import { access, mkdir, readFile, readdir, readlink, rename, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
14
14
|
import { execFile } from "node:child_process";
|
|
15
15
|
import { dirname, resolve as pathResolve } from "node:path";
|
|
16
16
|
import { promisify } from "node:util";
|
|
@@ -29,6 +29,32 @@ export interface ContextHostServices {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/* Dual-use commands (tag/branch/config) are conservative-denied: listing refs
|
|
33
|
+
belongs to for-each-ref plumbing, config reads to file parsing. A security
|
|
34
|
+
boundary refuses false negatives at the cost of false-positive friction. */
|
|
35
|
+
const MUTATING_GIT_OPS = new Set(["commit", "push", "update-ref", "checkout", "reset", "rebase", "merge", "cherry-pick", "apply", "commit-tree", "tag", "branch", "am", "stash", "rm", "mv", "clean", "gc", "fetch", "pull", "clone", "init", "add", "notes", "replace", "filter-branch", "update-index", "write-tree", "symbolic-ref", "worktree", "reflog", "config"]);
|
|
36
|
+
|
|
37
|
+
/* Git global flags consuming a separate value token — the subcommand is the first
|
|
38
|
+
positional after these are skipped. `--flag=value` forms self-skip. */
|
|
39
|
+
const GIT_VALUE_FLAGS = new Set(["-C", "-c", "--git-dir", "--work-tree", "--namespace", "--config-env", "--exec-path"]);
|
|
40
|
+
|
|
41
|
+
export function gitSubcommand(args: string[]): string | undefined {
|
|
42
|
+
let i = 0;
|
|
43
|
+
while (i < args.length) {
|
|
44
|
+
const a = args[i];
|
|
45
|
+
if (GIT_VALUE_FLAGS.has(a)) {
|
|
46
|
+
i += 2;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (a.startsWith("-")) {
|
|
50
|
+
i += 1;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
return a;
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
32
58
|
/** Build a capability-enforcing PluginContext for one activated plugin. */
|
|
33
59
|
export function createPluginContext(manifest: PluginManifest, host: ContextHostServices): PluginContext {
|
|
34
60
|
const caps = manifest.capabilities ?? {};
|
|
@@ -72,6 +98,40 @@ export function createPluginContext(manifest: PluginManifest, host: ContextHostS
|
|
|
72
98
|
if (fsGrant === "none") deny("filesystem", "list with filesystem:none");
|
|
73
99
|
return readdir(scoped(dir));
|
|
74
100
|
},
|
|
101
|
+
async readlink(path) {
|
|
102
|
+
if (fsGrant === "none") deny("filesystem", "readlink with filesystem:none");
|
|
103
|
+
return readlink(scoped(path));
|
|
104
|
+
},
|
|
105
|
+
async symlink(target, linkPath) {
|
|
106
|
+
if (fsGrant !== "readwrite") deny("filesystem", `symlink with filesystem:${fsGrant}`);
|
|
107
|
+
// The link PATH is sandboxed; the link TARGET is not re-validated — scoped()
|
|
108
|
+
// is a textual check, so a link pointing outside the root escapes on follow.
|
|
109
|
+
// readwrite is a trusted-within-workspace grant (it can already overwrite
|
|
110
|
+
// forge.yaml and hooks); symlink creation is consistent with that trust level.
|
|
111
|
+
// Plugins needing strict containment must not receive readwrite.
|
|
112
|
+
await symlink(target, scoped(linkPath));
|
|
113
|
+
},
|
|
114
|
+
async unlink(path) {
|
|
115
|
+
if (fsGrant !== "readwrite") deny("filesystem", `unlink with filesystem:${fsGrant}`);
|
|
116
|
+
await unlink(scoped(path));
|
|
117
|
+
},
|
|
118
|
+
async readFileBytes(path) {
|
|
119
|
+
if (fsGrant === "none") deny("filesystem", "readFileBytes with filesystem:none");
|
|
120
|
+
return new Uint8Array(await readFile(scoped(path)));
|
|
121
|
+
},
|
|
122
|
+
async rename(from, to) {
|
|
123
|
+
if (fsGrant !== "readwrite") deny("filesystem", `rename with filesystem:${fsGrant}`);
|
|
124
|
+
await rename(scoped(from), scoped(to));
|
|
125
|
+
},
|
|
126
|
+
async rm(path, opts) {
|
|
127
|
+
if (fsGrant !== "readwrite") deny("filesystem", `rm with filesystem:${fsGrant}`);
|
|
128
|
+
await rm(scoped(path), { recursive: opts?.recursive ?? false, force: true });
|
|
129
|
+
},
|
|
130
|
+
async stat(path) {
|
|
131
|
+
if (fsGrant === "none") deny("filesystem", "stat with filesystem:none");
|
|
132
|
+
const st = await stat(scoped(path));
|
|
133
|
+
return { size: st.size, mtimeMs: st.mtimeMs, isDirectory: st.isDirectory() };
|
|
134
|
+
},
|
|
75
135
|
},
|
|
76
136
|
evidence: {
|
|
77
137
|
consult: host.hooks?.evidenceConsult ?? (async () => ({ hit: false })),
|
|
@@ -91,8 +151,17 @@ export function createPluginContext(manifest: PluginManifest, host: ContextHostS
|
|
|
91
151
|
},
|
|
92
152
|
git: {
|
|
93
153
|
async exec(args) {
|
|
94
|
-
|
|
95
|
-
|
|
154
|
+
// Redirection flags escape the workspace scope for reads AND writes — refused outright.
|
|
155
|
+
for (const a of args) {
|
|
156
|
+
if (a === "-C" || a === "--git-dir" || a === "--work-tree" || a.startsWith("--git-dir=") || a.startsWith("--work-tree=")) {
|
|
157
|
+
deny("filesystem", `git scope redirection refused: ${a}`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (!caps.gitMutation) {
|
|
161
|
+
const subcommand = gitSubcommand(args);
|
|
162
|
+
if (subcommand && MUTATING_GIT_OPS.has(subcommand)) {
|
|
163
|
+
deny("gitMutation", `mutating git op refused: git ${subcommand}`);
|
|
164
|
+
}
|
|
96
165
|
}
|
|
97
166
|
const { stdout } = await execFileAsync("git", args, { cwd: host.workspaceRoot });
|
|
98
167
|
return stdout;
|
|
@@ -122,6 +191,17 @@ export function createPluginContext(manifest: PluginManifest, host: ContextHostS
|
|
|
122
191
|
return { status: res.status, body: await res.text() };
|
|
123
192
|
},
|
|
124
193
|
},
|
|
194
|
+
env: {
|
|
195
|
+
get(key) {
|
|
196
|
+
if (!(caps.envKeys ?? []).includes(key)) {
|
|
197
|
+
deny("env", `env key not declared in manifest envKeys: ${key}`);
|
|
198
|
+
}
|
|
199
|
+
return process.env[key];
|
|
200
|
+
},
|
|
201
|
+
declared(key) {
|
|
202
|
+
return (caps.envKeys ?? []).includes(key);
|
|
203
|
+
},
|
|
204
|
+
},
|
|
125
205
|
log: {
|
|
126
206
|
info: (msg) => console.log(`[${pid}] ${msg}`),
|
|
127
207
|
warn: (msg) => console.warn(`[${pid}] ${msg}`),
|
package/src/sdk/types.ts
CHANGED
|
@@ -80,6 +80,15 @@ export interface WorkspaceIOPort {
|
|
|
80
80
|
writeFile(path: string, content: string): Promise<void>;
|
|
81
81
|
exists(path: string): Promise<boolean>;
|
|
82
82
|
list(dir: string, pattern?: string): Promise<string[]>;
|
|
83
|
+
/* Symlink primitives — atomic deploy swaps and artifact layouts are link-based;
|
|
84
|
+
readFile follows links and can never observe the link itself. */
|
|
85
|
+
readlink(path: string): Promise<string>;
|
|
86
|
+
symlink(target: string, linkPath: string): Promise<void>;
|
|
87
|
+
unlink(path: string): Promise<void>;
|
|
88
|
+
readFileBytes(path: string): Promise<Uint8Array>;
|
|
89
|
+
rename(from: string, to: string): Promise<void>;
|
|
90
|
+
rm(path: string, opts?: { recursive?: boolean }): Promise<void>;
|
|
91
|
+
stat(path: string): Promise<{ size: number; mtimeMs: number; isDirectory: boolean }>;
|
|
83
92
|
}
|
|
84
93
|
|
|
85
94
|
export interface EvidenceAccessPort {
|
|
@@ -128,6 +137,17 @@ export interface PluginContext {
|
|
|
128
137
|
network: NetworkPort;
|
|
129
138
|
log: LoggerPort;
|
|
130
139
|
paths: PathResolverPort;
|
|
140
|
+
env: EnvPort;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Env access is allowlist-enforced: the manifest's envKeys declares exactly which
|
|
144
|
+
variables the plugin may read — secrets-adjacent access stays transparent and
|
|
145
|
+
auditable at the manifest surface, never a blanket process.env passthrough. */
|
|
146
|
+
export interface EnvPort {
|
|
147
|
+
/** Declared key → value or undefined; undeclared key → CapabilityViolation. */
|
|
148
|
+
get(key: string): string | undefined;
|
|
149
|
+
/** Whether the key is declared in the manifest — no leakage of presence vs value. */
|
|
150
|
+
declared(key: string): boolean;
|
|
131
151
|
}
|
|
132
152
|
|
|
133
153
|
/** Typed incompatibility error — fail-closed, no degraded modes. */
|