@yagni-app/code 1.0.6 → 1.0.7
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 +84 -46
- package/dist/claudeCompat.d.ts +59 -0
- package/dist/claudeCompat.js +109 -2
- package/dist/claudePlugins.d.ts +45 -5
- package/dist/claudePlugins.js +129 -21
- package/dist/cli.js +16 -4
- package/dist/doctor.d.ts +21 -8
- package/dist/doctor.js +53 -28
- package/dist/extension/condensedTools.d.ts +12 -1
- package/dist/extension/condensedTools.js +17 -9
- package/dist/extension/index.d.ts +13 -0
- package/dist/extension/index.js +230 -43
- package/dist/extension/mcp/cliConfig.d.ts +1 -1
- package/dist/extension/mcp/cliConfig.js +1 -1
- package/dist/extension/mcp/config.d.ts +24 -2
- package/dist/extension/mcp/config.js +75 -3
- package/dist/extension/mcp/manager.d.ts +3 -1
- package/dist/extension/mcp/manager.js +2 -2
- package/dist/extension/mcp/panel.d.ts +0 -1
- package/dist/extension/mcp/panel.js +13 -3
- package/dist/extension/mcp/startup.js +8 -6
- package/dist/extension/permission/gate.d.ts +97 -2
- package/dist/extension/permission/gate.js +375 -26
- package/dist/extension/permissionRules/bashFileArgs.d.ts +39 -0
- package/dist/extension/permissionRules/bashFileArgs.js +236 -0
- package/dist/extension/permissionRules/engine.d.ts +50 -0
- package/dist/extension/permissionRules/engine.js +238 -0
- package/dist/extension/permissionRules/loadConfig.d.ts +53 -0
- package/dist/extension/permissionRules/loadConfig.js +90 -0
- package/dist/extension/permissionRules/parser.d.ts +38 -0
- package/dist/extension/permissionRules/parser.js +136 -0
- package/dist/extension/permissionRules/pathRules.d.ts +58 -0
- package/dist/extension/permissionRules/pathRules.js +120 -0
- package/dist/extension/permissionRules/shellRules.d.ts +52 -0
- package/dist/extension/permissionRules/shellRules.js +221 -0
- package/dist/extension/pipeline/invocation.d.ts +3 -6
- package/dist/extension/pipeline/invocation.js +3 -6
- package/dist/extension/pipeline/runner.d.ts +0 -1
- package/dist/extension/pipeline/runner.js +6 -14
- package/dist/extension/plugins/inventory.d.ts +88 -0
- package/dist/extension/plugins/inventory.js +144 -0
- package/dist/extension/plugins/panel.d.ts +45 -0
- package/dist/extension/plugins/panel.js +293 -0
- package/dist/extension/sandbox/bash.d.ts +99 -0
- package/dist/extension/sandbox/bash.js +190 -0
- package/dist/extension/sandbox/config.d.ts +114 -0
- package/dist/extension/sandbox/config.js +366 -0
- package/dist/extension/sandbox/manager.d.ts +98 -0
- package/dist/extension/sandbox/manager.js +216 -0
- package/dist/extension/sandbox/panel.d.ts +111 -0
- package/dist/extension/sandbox/panel.js +342 -0
- package/dist/extension/sandbox/session.d.ts +85 -0
- package/dist/extension/sandbox/session.js +775 -0
- package/dist/extension/telemetry/attrs.d.ts +96 -0
- package/dist/extension/telemetry/attrs.js +149 -0
- package/dist/extension/telemetry/config.d.ts +99 -0
- package/dist/extension/telemetry/config.js +193 -0
- package/dist/extension/telemetry/index.d.ts +7 -0
- package/dist/extension/telemetry/index.js +7 -0
- package/dist/extension/telemetry/probe.d.ts +29 -0
- package/dist/extension/telemetry/probe.js +122 -0
- package/dist/extension/telemetry/register.d.ts +40 -0
- package/dist/extension/telemetry/register.js +192 -0
- package/dist/extension/telemetry/sdk.d.ts +63 -0
- package/dist/extension/telemetry/sdk.js +207 -0
- package/dist/extension/telemetry/tracker.d.ts +131 -0
- package/dist/extension/telemetry/tracker.js +551 -0
- package/dist/extension/vendor/IGNORE-LICENSE-MIT +21 -0
- package/dist/extension/vendor/ignore.d.ts +86 -0
- package/dist/extension/vendor/ignore.js +788 -0
- package/dist/goHeadless.d.ts +1 -1
- package/dist/goHeadless.js +2 -2
- package/dist/launch.d.ts +4 -3
- package/dist/launch.js +7 -4
- package/dist/mcpCommand.d.ts +10 -1
- package/dist/mcpCommand.js +42 -10
- package/dist/otel.d.ts +67 -90
- package/dist/otel.js +152 -195
- package/dist/paths.d.ts +13 -0
- package/dist/paths.js +18 -0
- package/dist/pluginCommand.d.ts +43 -0
- package/dist/pluginCommand.js +499 -0
- package/dist/pluginStore.d.ts +170 -0
- package/dist/pluginStore.js +554 -0
- package/package.json +19 -3
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox session wiring: owns the per-session YagniSandboxManager
|
|
3
|
+
* and hooks it into pi — bash tool re-registration with the sandbox
|
|
4
|
+
* spawnHook, user_bash (! commands) routing, session lifecycle, and the
|
|
5
|
+
* network ask flow (interactive prompt in TUI/RPC, fail-closed in
|
|
6
|
+
* print/headless).
|
|
7
|
+
*
|
|
8
|
+
* Registration model: the sandbox re-registers the bash tool ONLY when
|
|
9
|
+
* sandbox.enabled is true in the loaded settings — default-off sessions keep
|
|
10
|
+
* pi's stock bash byte-identical (a duplicate tool name is a hard 400 on
|
|
11
|
+
* some providers). /sandbox (M5) toggles by rewriting settings and asking
|
|
12
|
+
* for a session restart, the same way Claude persists the toggle.
|
|
13
|
+
*/
|
|
14
|
+
import { type ExtensionAPI, type ExtensionContext, type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
15
|
+
import { type SandboxSettings } from "./config.js";
|
|
16
|
+
import { YagniSandboxManager } from "./manager.js";
|
|
17
|
+
import type { PermissionRule } from "../permissionRules/loadConfig.js";
|
|
18
|
+
/**
|
|
19
|
+
* Build the sandbox bash composition: given ANY stock bash definition (pi's
|
|
20
|
+
* own or condensedTools'), return the sandbox-aware version — schema gains
|
|
21
|
+
* dangerouslyDisableSandbox, execute wraps via the manager when the decision
|
|
22
|
+
* says so, and EPERM output is annotated. Identity when the sandbox is
|
|
23
|
+
* disabled at load time (default-off sessions stay byte-identical).
|
|
24
|
+
*
|
|
25
|
+
* Exported so condensedTools consumes it through its wrapBash seam — the
|
|
26
|
+
* M4 e2e lesson: condensed registers bash LAST, so a competing registration
|
|
27
|
+
* here would be overwritten and the sandbox would silently never reach
|
|
28
|
+
* model-driven tool calls.
|
|
29
|
+
*/
|
|
30
|
+
export declare function makeBashComposition(manager: YagniSandboxManager, settings: () => SandboxSettings, cwd: string): (def: ToolDefinition) => ToolDefinition;
|
|
31
|
+
export interface SandboxSessionHandle {
|
|
32
|
+
manager: YagniSandboxManager;
|
|
33
|
+
settings: () => SandboxSettings;
|
|
34
|
+
/** Latest permission rules snapshot (updated by the gate on load). */
|
|
35
|
+
setRules: (rules: readonly PermissionRule[]) => void;
|
|
36
|
+
/** Session-scoped network grants (memory-only, agent-invisible). */
|
|
37
|
+
grantDomainSession: (domain: string) => void;
|
|
38
|
+
sessionDomains: () => readonly string[];
|
|
39
|
+
/** The bash-definition composition (identity when disabled). condensedTools
|
|
40
|
+
* consumes this via its wrapBash seam; index.ts passes it through. */
|
|
41
|
+
composeBash: (def: ToolDefinition) => ToolDefinition;
|
|
42
|
+
/**
|
|
43
|
+
* Register the sandbox-wrapped bash directly on pi (the fallback path when
|
|
44
|
+
* condensedTools is NOT active: eval mode, classic rows, desktop). No-op
|
|
45
|
+
* when the sandbox is disabled. index.ts calls this in the else-branch so
|
|
46
|
+
* the two bash-defining sites never double-register.
|
|
47
|
+
*/
|
|
48
|
+
registerOwnBash: () => void;
|
|
49
|
+
}
|
|
50
|
+
export interface RegisterSandboxOptions {
|
|
51
|
+
cwd: string;
|
|
52
|
+
env?: NodeJS.ProcessEnv;
|
|
53
|
+
userHome?: string;
|
|
54
|
+
stateHomeOverride?: string | null;
|
|
55
|
+
projectRoot?: string | null;
|
|
56
|
+
rgPath?: string;
|
|
57
|
+
/** Injectable manager factory (tests simulate init failure / disabled
|
|
58
|
+
* platforms without touching the real srt singleton). */
|
|
59
|
+
makeManager?: (opts: {
|
|
60
|
+
cwd: string;
|
|
61
|
+
env?: NodeJS.ProcessEnv;
|
|
62
|
+
userHome?: string;
|
|
63
|
+
stateHomeOverride?: string | null;
|
|
64
|
+
projectRoot?: string | null;
|
|
65
|
+
rgPath?: string;
|
|
66
|
+
}) => Pick<YagniSandboxManager, "initialized" | "initialize" | "reset" | "refreshConfig" | "setAskHandler" | "wrapWithSandbox" | "cleanupAfterCommand" | "annotateStderrWithSandboxFailures"> & YagniSandboxManager;
|
|
67
|
+
/** Whether interactive prompts are possible (TUI/RPC). */
|
|
68
|
+
hasUI: (ctx: ExtensionContext) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* When true, the sandbox registers its OWN wrapped bash tool at extension
|
|
71
|
+
* load (the fallback path — index.ts decides and calls registerOwnBash
|
|
72
|
+
* explicitly when condensedTools is inactive). Default false: the common
|
|
73
|
+
* path composes through condensedTools' wrapBash seam instead, because
|
|
74
|
+
* condensed registers last and would otherwise overwrite a competing
|
|
75
|
+
* registration (the duplicate-name 400 + silent-unwrap lesson from M4).
|
|
76
|
+
*/
|
|
77
|
+
registerOwnBash?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Register the sandbox surfaces on the ExtensionAPI. Returns the session
|
|
81
|
+
* handle (manager + accessors) or null when the platform can never run the
|
|
82
|
+
* sandbox (no-op registration, stock bash stays).
|
|
83
|
+
*/
|
|
84
|
+
export declare function registerSandbox(pi: ExtensionAPI, opts: RegisterSandboxOptions): SandboxSessionHandle | null;
|
|
85
|
+
//# sourceMappingURL=session.d.ts.map
|