@yagni-app/code 1.0.5 → 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 +89 -27
- package/dist/claudeCompat.d.ts +59 -0
- package/dist/claudeCompat.js +109 -2
- package/dist/claudePlugins.d.ts +45 -3
- package/dist/claudePlugins.js +129 -19
- package/dist/cli.js +28 -4
- package/dist/doctor.d.ts +42 -4
- package/dist/doctor.js +150 -15
- package/dist/extension/condensedTools.d.ts +12 -1
- package/dist/extension/condensedTools.js +17 -9
- package/dist/extension/index.d.ts +18 -5
- package/dist/extension/index.js +319 -72
- package/dist/extension/mcp/approval.d.ts +45 -0
- package/dist/extension/mcp/approval.js +164 -0
- package/dist/extension/mcp/auth.d.ts +124 -0
- package/dist/extension/mcp/auth.js +560 -0
- package/dist/extension/mcp/authStore.d.ts +61 -0
- package/dist/extension/mcp/authStore.js +105 -0
- package/dist/extension/mcp/callbackPage.d.ts +31 -0
- package/dist/extension/mcp/callbackPage.js +222 -0
- package/dist/extension/mcp/cliConfig.d.ts +12 -0
- package/dist/extension/mcp/cliConfig.js +12 -0
- package/dist/extension/mcp/config.d.ts +153 -0
- package/dist/extension/mcp/config.js +381 -0
- package/dist/extension/mcp/log.d.ts +28 -0
- package/dist/extension/mcp/log.js +82 -0
- package/dist/extension/mcp/manager.d.ts +100 -0
- package/dist/extension/mcp/manager.js +273 -0
- package/dist/extension/mcp/names.d.ts +25 -0
- package/dist/extension/mcp/names.js +40 -0
- package/dist/extension/mcp/panel.d.ts +33 -0
- package/dist/extension/mcp/panel.js +268 -0
- package/dist/extension/mcp/prompts.d.ts +23 -0
- package/dist/extension/mcp/prompts.js +93 -0
- package/dist/extension/mcp/startup.d.ts +55 -0
- package/dist/extension/mcp/startup.js +152 -0
- package/dist/extension/mcp/tools.d.ts +31 -0
- package/dist/extension/mcp/tools.js +117 -0
- package/dist/extension/mcp/transports.d.ts +17 -0
- package/dist/extension/mcp/transports.js +44 -0
- package/dist/extension/permission/gate.d.ts +104 -2
- package/dist/extension/permission/gate.js +387 -31
- package/dist/extension/permission/guardian.d.ts +24 -5
- package/dist/extension/permission/guardian.js +162 -24
- 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/personas.js +5 -0
- 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 +122 -0
- package/dist/mcpCommand.js +787 -0
- package/dist/otel.d.ts +69 -63
- package/dist/otel.js +154 -119
- 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/dist/upgrade.d.ts +11 -2
- package/dist/upgrade.js +48 -8
- package/package.json +20 -3
- package/dist/extension/mcpTools.d.ts +0 -57
- package/dist/extension/mcpTools.js +0 -132
package/dist/goHeadless.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export declare function buildHeadlessChildEnv(opts: {
|
|
|
65
65
|
workspaceId?: string;
|
|
66
66
|
cliVersion?: string;
|
|
67
67
|
sessionId?: string;
|
|
68
|
-
/** Resolved OTel export config; stage children
|
|
68
|
+
/** Resolved OTel export config; stage children export when present. */
|
|
69
69
|
otel?: OtelLaunchConfig;
|
|
70
70
|
}): NodeJS.ProcessEnv;
|
|
71
71
|
/**
|
package/dist/goHeadless.js
CHANGED
|
@@ -55,8 +55,8 @@ export function buildHeadlessChildEnv(opts) {
|
|
|
55
55
|
PI_CODING_AGENT_DIR: piAgentDir,
|
|
56
56
|
PI_SKIP_VERSION_CHECK: "1",
|
|
57
57
|
PI_TELEMETRY: "0",
|
|
58
|
-
// OTel export:
|
|
59
|
-
//
|
|
58
|
+
// OTel export: the gate plus the OTLP env, inherited by every stage child
|
|
59
|
+
// (see otel.ts for the policy).
|
|
60
60
|
...(opts.otel ? otelChildEnv(opts.otel, opts.baseEnv) : {}),
|
|
61
61
|
};
|
|
62
62
|
}
|
package/dist/launch.d.ts
CHANGED
|
@@ -95,9 +95,10 @@ export interface BuildLaunchOptions {
|
|
|
95
95
|
extraEnv?: Record<string, string>;
|
|
96
96
|
/**
|
|
97
97
|
* Resolved OTel export config (see `otel.ts`). When present, the session
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* byte-for-byte what it was
|
|
98
|
+
* env carries the export gate and the OTLP variables and the bundled
|
|
99
|
+
* extension exports traces, metrics, and log events; absent means no OTLP
|
|
100
|
+
* endpoint is configured and the launch is byte-for-byte what it was
|
|
101
|
+
* before OTel support existed.
|
|
101
102
|
*/
|
|
102
103
|
otel?: OtelLaunchConfig;
|
|
103
104
|
}
|
package/dist/launch.js
CHANGED
|
@@ -9,6 +9,7 @@ import { randomUUID } from "node:crypto";
|
|
|
9
9
|
import { agentDirEnvVar } from "./branding.js";
|
|
10
10
|
import { otelChildEnv } from "./otel.js";
|
|
11
11
|
import { PAD_X_ENV, resolvePadX } from "./padding.js";
|
|
12
|
+
import { resolveCliPath } from "./paths.js";
|
|
12
13
|
import { ENGINEERING_PRACTICE_SECTION, promptEnrichmentDisabled } from "./promptEnrichment.js";
|
|
13
14
|
/**
|
|
14
15
|
* How close to expiry the token can be before launch warns. A coding session
|
|
@@ -76,6 +77,9 @@ export function buildLaunch(creds, passthroughArgs, opts) {
|
|
|
76
77
|
// the launcher read (0600). Absent when the caller can't resolve it.
|
|
77
78
|
...(opts.profilePath ? { YAGNI_PROFILE_PATH: opts.profilePath } : {}),
|
|
78
79
|
...(opts.stateDir ? { YAGNI_CODE_HOME: opts.stateDir } : {}),
|
|
80
|
+
// The launcher's own entry, so the in-session /plugin panel and
|
|
81
|
+
// /reload-plugins can run `yagni plugin …` with the same binary.
|
|
82
|
+
YAGNI_CLI_PATH: resolveCliPath(),
|
|
79
83
|
// Forward the launcher's version so the extension's crash reports carry
|
|
80
84
|
// the shipping version (the bundled extension has no package.json to read).
|
|
81
85
|
...(opts.cliVersion ? { YAGNI_CODE_VERSION: opts.cliVersion } : {}),
|
|
@@ -106,9 +110,9 @@ export function buildLaunch(creds, passthroughArgs, opts) {
|
|
|
106
110
|
// the editor (which the launcher pads by seeding editorPaddingX). The
|
|
107
111
|
// footer can't read pi's settings, so the value crosses over env.
|
|
108
112
|
[PAD_X_ENV]: String(resolvePadX()),
|
|
109
|
-
// OTel export (gated in otel.ts):
|
|
110
|
-
//
|
|
111
|
-
//
|
|
113
|
+
// OTel export (gated in otel.ts): the YAGNI_OTEL_EXPORT gate plus the
|
|
114
|
+
// workspace's OTLP env; the bundled extension does the exporting, and
|
|
115
|
+
// /go stage children and subagents inherit this env so they export too.
|
|
112
116
|
...(opts.otel ? otelChildEnv(opts.otel, opts.baseEnv ?? {}) : {}),
|
|
113
117
|
};
|
|
114
118
|
// Always load our extension. Default the provider to `yagni` unless the user
|
|
@@ -130,7 +134,6 @@ export function buildLaunch(creds, passthroughArgs, opts) {
|
|
|
130
134
|
const argv = [
|
|
131
135
|
"-e",
|
|
132
136
|
opts.extensionPath,
|
|
133
|
-
...(opts.otel ? ["-e", opts.otel.extensionPath] : []),
|
|
134
137
|
...(userChoseProvider ? [] : ["--provider", "yagni"]),
|
|
135
138
|
...(userChoseModel ? [] : ["--model", "advanced"]),
|
|
136
139
|
...(enrichmentOff ? [] : ["--append-system-prompt", ENGINEERING_PRACTICE_SECTION]),
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `yagni mcp …` — configure MCP servers for YAGNI Code, mirroring Claude
|
|
3
|
+
* Code's CLI surface (add / add-json / remove / get / list /
|
|
4
|
+
* reset-project-choices / add-from-claude).
|
|
5
|
+
*
|
|
6
|
+
* The config module itself lives in pi-extension-yagni (`src/mcp/config.ts`)
|
|
7
|
+
* so the extension session and this CLI read and write the exact same files
|
|
8
|
+
* through the exact same code — loaded here by file path, the same pattern as
|
|
9
|
+
* the session-worktree and headless-go entries. `list` and `get` run real
|
|
10
|
+
* health-check connections (stdio servers are spawned), so they carry the
|
|
11
|
+
* same caution Claude Code prints: only run in directories you trust.
|
|
12
|
+
*
|
|
13
|
+
* Not implemented (deliberate deviations from Claude Code):
|
|
14
|
+
* serve — the YAGNI backend already exposes an MCP endpoint
|
|
15
|
+
* login — enterprise-IdP only in Claude Code; not applicable
|
|
16
|
+
*/
|
|
17
|
+
export interface McpDeps {
|
|
18
|
+
cwd?: string;
|
|
19
|
+
home?: string;
|
|
20
|
+
env?: NodeJS.ProcessEnv;
|
|
21
|
+
stdout?: (text: string) => void;
|
|
22
|
+
stderr?: (text: string) => void;
|
|
23
|
+
/** Test seam: the extension module to import (defaults to the built copy). */
|
|
24
|
+
loadMcpModule?: () => Promise<McpCliModule>;
|
|
25
|
+
/**
|
|
26
|
+
* Test seam: the plugin MCP payload the launcher would hand a session
|
|
27
|
+
* (defaults to running the real, non-interactive discovery). Lets `list`
|
|
28
|
+
* and `get` show plugin-bundled servers outside a session.
|
|
29
|
+
*/
|
|
30
|
+
pluginMcpEnv?: () => Promise<string | undefined>;
|
|
31
|
+
/** Test seam: health probe override (defaults to mod.probeServer). */
|
|
32
|
+
probeServer?: (name: string, config: unknown, opts?: {
|
|
33
|
+
env?: NodeJS.ProcessEnv;
|
|
34
|
+
}) => Promise<{
|
|
35
|
+
status: "connected" | "needs_auth" | "failed";
|
|
36
|
+
error?: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
/** The structural slice of the extension's mcp config surface this file needs. */
|
|
40
|
+
export interface McpCliModule {
|
|
41
|
+
loadMcpServers(cwd: string, env: NodeJS.ProcessEnv): McpLoadResult;
|
|
42
|
+
mcpConfigPath(): string;
|
|
43
|
+
PROJECT_CONFIG_FILENAME: string;
|
|
44
|
+
writeUserMcpConfig(file: unknown): void;
|
|
45
|
+
readUserMcpConfig(): {
|
|
46
|
+
file: unknown;
|
|
47
|
+
errors: unknown[];
|
|
48
|
+
};
|
|
49
|
+
resolveProjectRoot(cwd: string): string;
|
|
50
|
+
resetProjectChoices(repoRoot: string): {
|
|
51
|
+
errors: unknown[];
|
|
52
|
+
};
|
|
53
|
+
decisionFor(state: unknown, serverName: string): "enabled" | "disabled" | "undecided";
|
|
54
|
+
readProjectApproval(repoRoot: string): {
|
|
55
|
+
state: unknown;
|
|
56
|
+
errors: unknown[];
|
|
57
|
+
};
|
|
58
|
+
updateStoredOAuthEntry(serverName: string, config: unknown, mutate: (entry: {
|
|
59
|
+
clientSecret?: string;
|
|
60
|
+
}) => void): {
|
|
61
|
+
errors: unknown[];
|
|
62
|
+
};
|
|
63
|
+
revokeTokensOnRemove(serverName: string, config: unknown, deps?: {
|
|
64
|
+
fetch?: typeof fetch;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
getStoredOAuthEntry(serverName: string, config: unknown): {
|
|
67
|
+
clientSecret?: string;
|
|
68
|
+
} | undefined;
|
|
69
|
+
probeServer(name: string, config: unknown, opts?: {
|
|
70
|
+
connectTimeoutMs?: number;
|
|
71
|
+
env?: NodeJS.ProcessEnv;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
status: "connected" | "needs_auth" | "failed";
|
|
74
|
+
error?: string;
|
|
75
|
+
}>;
|
|
76
|
+
/** ${VAR} expansion over a full server config (url, headers, command, args, env values). */
|
|
77
|
+
expandServerEnv?(config: unknown, env?: NodeJS.ProcessEnv): {
|
|
78
|
+
config: unknown;
|
|
79
|
+
missingVars: string[];
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export type McpListScope = "user" | "project" | "local" | "plugin";
|
|
83
|
+
export interface McpLoadResult {
|
|
84
|
+
servers: {
|
|
85
|
+
name: string;
|
|
86
|
+
scope: McpListScope;
|
|
87
|
+
config: Record<string, unknown>;
|
|
88
|
+
sourcePath: string;
|
|
89
|
+
plugin?: string;
|
|
90
|
+
gated?: boolean;
|
|
91
|
+
}[];
|
|
92
|
+
errors: {
|
|
93
|
+
sourcePath: string;
|
|
94
|
+
serverName?: string;
|
|
95
|
+
message: string;
|
|
96
|
+
}[];
|
|
97
|
+
}
|
|
98
|
+
export declare function resolveMcpConfigPath(): string;
|
|
99
|
+
export interface ParsedMcpArgs {
|
|
100
|
+
subcommand: string | undefined;
|
|
101
|
+
name?: string;
|
|
102
|
+
rest: string[];
|
|
103
|
+
scope: "local" | "user" | "project";
|
|
104
|
+
/** Whether -s/--scope appeared explicitly (remove without it acts across scopes). */
|
|
105
|
+
scopeExplicit: boolean;
|
|
106
|
+
transport: "stdio" | "sse" | "http";
|
|
107
|
+
/** Whether -t/--transport appeared explicitly (drives the URL-misread warning). */
|
|
108
|
+
transportExplicit: boolean;
|
|
109
|
+
env: Record<string, string>;
|
|
110
|
+
headers: Record<string, string>;
|
|
111
|
+
/** Positionals after the subcommand's own first two (stdio command args). */
|
|
112
|
+
commandArgs: string[];
|
|
113
|
+
/** OAuth client id (-only). */
|
|
114
|
+
clientId?: string;
|
|
115
|
+
/** Whether --client-secret was passed (prompt/env-read the secret). */
|
|
116
|
+
clientSecret: boolean;
|
|
117
|
+
/** Fixed loopback callback port. */
|
|
118
|
+
callbackPort?: number;
|
|
119
|
+
}
|
|
120
|
+
export declare function parseMcpArgs(argv: string[]): ParsedMcpArgs;
|
|
121
|
+
export declare function mcpCommand(args: string[], deps?: McpDeps): Promise<number>;
|
|
122
|
+
//# sourceMappingURL=mcpCommand.d.ts.map
|