@ken-jo/agent-connector 0.6.3 → 0.6.5
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 +25 -12
- package/dist/{action-IKJ2J3X4.js → action-DFUJOXVJ.js} +9 -8
- package/dist/{action-IKJ2J3X4.js.map → action-DFUJOXVJ.js.map} +1 -1
- package/dist/{audit-5K2H7PAT.js → audit-IMNQJZ4W.js} +6 -5
- package/dist/{audit-5K2H7PAT.js.map → audit-IMNQJZ4W.js.map} +1 -1
- package/dist/{chunk-K67UJSJI.js → chunk-66TGBYSL.js} +5 -5
- package/dist/{chunk-QG26JEJF.js → chunk-7C3COFOD.js} +9 -9
- package/dist/{chunk-QG26JEJF.js.map → chunk-7C3COFOD.js.map} +1 -1
- package/dist/{chunk-HUL5CRF2.js → chunk-BAJL27XI.js} +4 -4
- package/dist/{codex-C7ERS3TW.js → chunk-BB4DFAHC.js} +21 -8
- package/dist/chunk-BB4DFAHC.js.map +1 -0
- package/dist/{chunk-STR3CRH3.js → chunk-C4NDV6GW.js} +2 -2
- package/dist/{chunk-LO6NIZSL.js → chunk-CG44RWYJ.js} +5 -5
- package/dist/chunk-D35FMUFZ.js +48 -0
- package/dist/chunk-D35FMUFZ.js.map +1 -0
- package/dist/{chunk-OXANBA4I.js → chunk-ITVST3SZ.js} +2 -2
- package/dist/{chunk-W4GVN3TJ.js → chunk-KQBRUI3Y.js} +3 -3
- package/dist/{chunk-TCJN5S4T.js → chunk-PTITNBSS.js} +22 -33
- package/dist/chunk-PTITNBSS.js.map +1 -0
- package/dist/{chunk-O7CFTOM5.js → chunk-S2TAC22E.js} +2 -2
- package/dist/{chunk-BD72ZF6D.js → chunk-V7GZ3AMV.js} +2 -2
- package/dist/{chunk-BGPVMJOG.js → chunk-ZYB2UFEN.js} +6 -2
- package/dist/chunk-ZYB2UFEN.js.map +1 -0
- package/dist/{claude-code-EIC4Q7OT.js → claude-code-JRKJARPH.js} +5 -4
- package/dist/{claude-code-EIC4Q7OT.js.map → claude-code-JRKJARPH.js.map} +1 -1
- package/dist/cli/sdk.js +5 -4
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/{cline-AJZ67XEE.js → cline-XAFNCZFQ.js} +26 -5
- package/dist/cline-XAFNCZFQ.js.map +1 -0
- package/dist/codex-X3WZZOJ4.js +22 -0
- package/dist/codex-X3WZZOJ4.js.map +1 -0
- package/dist/{define-connector-iosc34CA.d.ts → define-connector-D4UOI__e.d.ts} +1 -1
- package/dist/{detect-KYRQJUDY.js → detect-RT75DWQ5.js} +5 -4
- package/dist/{detect-KYRQJUDY.js.map → detect-RT75DWQ5.js.map} +1 -1
- package/dist/{doctor-BGWPZ676.js → doctor-F3RRQBQN.js} +135 -11
- package/dist/doctor-F3RRQBQN.js.map +1 -0
- package/dist/{hook-YMCFZRJE.js → hook-VYA4Q3YR.js} +9 -8
- package/dist/{hook-YMCFZRJE.js.map → hook-VYA4Q3YR.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{install-RCHVHCHO.js → install-XNTRLUZI.js} +9 -8
- package/dist/{install-RCHVHCHO.js.map → install-XNTRLUZI.js.map} +1 -1
- package/dist/{introspect-z3eKVWHN.d.ts → introspect-gaKVzg2q.d.ts} +1 -1
- package/dist/{leaderboard-V3DXXZNL.js → leaderboard-VF4W6PZ2.js} +3 -2
- package/dist/{leaderboard-V3DXXZNL.js.map → leaderboard-VF4W6PZ2.js.map} +1 -1
- package/dist/open-interpreter-ZHBMASXY.js +154 -0
- package/dist/open-interpreter-ZHBMASXY.js.map +1 -0
- package/dist/{package-75T46SXP.js → package-VRV5YHUJ.js} +7 -6
- package/dist/{package-75T46SXP.js.map → package-VRV5YHUJ.js.map} +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +7 -6
- package/dist/sdk/index.d.ts +4 -4
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/test.d.ts +2 -2
- package/dist/sdk/test.js +7 -6
- package/dist/{serve-IRMYJWFT.js → serve-EPEAGVOE.js} +9 -8
- package/dist/{serve-IRMYJWFT.js.map → serve-EPEAGVOE.js.map} +1 -1
- package/dist/{status-VJVNMWT7.js → status-3EHFFIQ7.js} +7 -6
- package/dist/{status-VJVNMWT7.js.map → status-3EHFFIQ7.js.map} +1 -1
- package/dist/{statusline-OKW44KFR.js → statusline-64IDYANK.js} +8 -7
- package/dist/{statusline-OKW44KFR.js.map → statusline-64IDYANK.js.map} +1 -1
- package/dist/{telemetry-YVMUXTDG.js → telemetry-AEE4TOFA.js} +6 -5
- package/dist/{telemetry-YVMUXTDG.js.map → telemetry-AEE4TOFA.js.map} +1 -1
- package/dist/{types-CAKApZpX.d.ts → types-htm_wrWo.d.ts} +6 -5
- package/dist/{uninstall-WZHO4CVL.js → uninstall-EJLQGZRN.js} +9 -8
- package/dist/{uninstall-WZHO4CVL.js.map → uninstall-EJLQGZRN.js.map} +1 -1
- package/dist/{upgrade-DZMEUPF2.js → upgrade-ZPHQELKG.js} +9 -8
- package/dist/{upgrade-DZMEUPF2.js.map → upgrade-ZPHQELKG.js.map} +1 -1
- package/dist/{usage-QSM4PP3E.js → usage-IWPGACHN.js} +3 -2
- package/dist/{usage-QSM4PP3E.js.map → usage-IWPGACHN.js.map} +1 -1
- package/dist/{usage-event-FH3X232T.js → usage-event-W5VLRA3X.js} +8 -7
- package/dist/{usage-event-FH3X232T.js.map → usage-event-W5VLRA3X.js.map} +1 -1
- package/package.json +20 -7
- package/dist/chunk-BGPVMJOG.js.map +0 -1
- package/dist/chunk-TCJN5S4T.js.map +0 -1
- package/dist/cline-AJZ67XEE.js.map +0 -1
- package/dist/codex-C7ERS3TW.js.map +0 -1
- package/dist/doctor-BGWPZ676.js.map +0 -1
- package/dist/open-interpreter-CXUCCZI3.js +0 -264
- package/dist/open-interpreter-CXUCCZI3.js.map +0 -1
- /package/dist/{chunk-K67UJSJI.js.map → chunk-66TGBYSL.js.map} +0 -0
- /package/dist/{chunk-HUL5CRF2.js.map → chunk-BAJL27XI.js.map} +0 -0
- /package/dist/{chunk-STR3CRH3.js.map → chunk-C4NDV6GW.js.map} +0 -0
- /package/dist/{chunk-LO6NIZSL.js.map → chunk-CG44RWYJ.js.map} +0 -0
- /package/dist/{chunk-OXANBA4I.js.map → chunk-ITVST3SZ.js.map} +0 -0
- /package/dist/{chunk-W4GVN3TJ.js.map → chunk-KQBRUI3Y.js.map} +0 -0
- /package/dist/{chunk-O7CFTOM5.js.map → chunk-S2TAC22E.js.map} +0 -0
- /package/dist/{chunk-BD72ZF6D.js.map → chunk-V7GZ3AMV.js.map} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
CODEX_HOOK_EVENTS,
|
|
4
|
+
CodexAdapter
|
|
5
|
+
} from "./chunk-BB4DFAHC.js";
|
|
6
|
+
import "./chunk-KOFCNA5T.js";
|
|
7
|
+
import "./chunk-OPXAP3AC.js";
|
|
8
|
+
import "./chunk-H53QZQJI.js";
|
|
9
|
+
import "./chunk-BEFVJ2OE.js";
|
|
10
|
+
import "./chunk-PMOFA5BT.js";
|
|
11
|
+
import "./chunk-QSY74NAP.js";
|
|
12
|
+
import "./chunk-UMQ6NBQR.js";
|
|
13
|
+
import "./chunk-GZGLCCEE.js";
|
|
14
|
+
|
|
15
|
+
// src/adapters/open-interpreter/index.ts
|
|
16
|
+
import { existsSync } from "fs";
|
|
17
|
+
import { homedir } from "os";
|
|
18
|
+
import { join, resolve } from "path";
|
|
19
|
+
var HOST = "open-interpreter";
|
|
20
|
+
var OPEN_INTERPRETER_HOOK_EVENTS = [...CODEX_HOOK_EVENTS, "SessionEnd"];
|
|
21
|
+
var OpenInterpreterAdapter = class extends CodexAdapter {
|
|
22
|
+
id = HOST;
|
|
23
|
+
name = "Open Interpreter";
|
|
24
|
+
paradigm = "json-stdio";
|
|
25
|
+
capabilities = {
|
|
26
|
+
supportsMemory: true,
|
|
27
|
+
preToolUse: true,
|
|
28
|
+
postToolUse: true,
|
|
29
|
+
preCompact: true,
|
|
30
|
+
sessionStart: true,
|
|
31
|
+
// Live-verified: the SessionEnd hook fires at process exit (host clamps its timeout to 3s).
|
|
32
|
+
sessionEnd: true,
|
|
33
|
+
userPromptSubmit: true,
|
|
34
|
+
stop: true,
|
|
35
|
+
notification: false,
|
|
36
|
+
permissionRequest: true,
|
|
37
|
+
subagentStart: true,
|
|
38
|
+
subagentStop: true,
|
|
39
|
+
postCompact: true,
|
|
40
|
+
canModifyArgs: true,
|
|
41
|
+
canModifyOutput: false,
|
|
42
|
+
canInjectSessionContext: true,
|
|
43
|
+
transports: ["stdio", "http"],
|
|
44
|
+
// See header: skills are wired; commands and subagents stay unwired.
|
|
45
|
+
supportsCommands: false,
|
|
46
|
+
supportsSkills: true,
|
|
47
|
+
supportsSubagents: false
|
|
48
|
+
};
|
|
49
|
+
get hookEventNames() {
|
|
50
|
+
return OPEN_INTERPRETER_HOOK_EVENTS;
|
|
51
|
+
}
|
|
52
|
+
get hookHostLabel() {
|
|
53
|
+
return "Open Interpreter";
|
|
54
|
+
}
|
|
55
|
+
// ── Detection ──────────────────────────────────────────────────────────
|
|
56
|
+
detectInstalled(projectDir) {
|
|
57
|
+
const userDir = this.userConfigDir();
|
|
58
|
+
const projDir = join(projectDir, ".openinterpreter");
|
|
59
|
+
const userCfg = join(userDir, "config.toml");
|
|
60
|
+
const projCfg = join(projDir, "config.toml");
|
|
61
|
+
const userInstalled = existsSync(userDir) || existsSync(userCfg);
|
|
62
|
+
const projInstalled = existsSync(projDir) || existsSync(projCfg);
|
|
63
|
+
const installed = userInstalled || projInstalled;
|
|
64
|
+
const scope = projInstalled && !userInstalled ? "project" : "user";
|
|
65
|
+
return {
|
|
66
|
+
id: this.id,
|
|
67
|
+
name: this.name,
|
|
68
|
+
installed,
|
|
69
|
+
paradigm: this.paradigm,
|
|
70
|
+
capabilities: this.capabilities,
|
|
71
|
+
configPath: scope === "project" ? projCfg : userCfg,
|
|
72
|
+
scope,
|
|
73
|
+
reason: installed ? `Found Open Interpreter config dir (${scope})` : `No Open Interpreter config dir at ${userDir} or ${projDir}`,
|
|
74
|
+
confidence: installed ? "high" : "low"
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// ── Native paths ───────────────────────────────────────────────────────
|
|
78
|
+
getConfigDir(ctx) {
|
|
79
|
+
if (ctx.scope === "project") return join(ctx.projectDir, ".openinterpreter");
|
|
80
|
+
return this.userConfigDir();
|
|
81
|
+
}
|
|
82
|
+
/** $INTERPRETER_HOME (tilde-expanded, then resolved) when set & non-empty,
|
|
83
|
+
* else ~/.openinterpreter. $CODEX_HOME is deliberately ignored (see header). */
|
|
84
|
+
userConfigDir() {
|
|
85
|
+
const env = process.env.INTERPRETER_HOME;
|
|
86
|
+
if (env && env.trim() !== "") {
|
|
87
|
+
if (env.startsWith("~")) return join(homedir(), env.replace(/^~[/\\]?/, ""));
|
|
88
|
+
return resolve(env);
|
|
89
|
+
}
|
|
90
|
+
return join(homedir(), ".openinterpreter");
|
|
91
|
+
}
|
|
92
|
+
/** Project skills live in the tool-neutral `.agents/skills` (docs/skills.md), not under `.openinterpreter`. */
|
|
93
|
+
skillDir(ctx, name) {
|
|
94
|
+
if (ctx.scope === "project") return join(ctx.projectDir, ".agents", "skills", name);
|
|
95
|
+
return join(homedir(), ".agents", "skills", name);
|
|
96
|
+
}
|
|
97
|
+
// ── Memory: AGENTS.override.md > AGENTS.md per directory (codex rule, OI home) ─
|
|
98
|
+
memoryTargets(ctx) {
|
|
99
|
+
if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);
|
|
100
|
+
if (ctx.scope !== "project" && ctx.scope !== "user") return [];
|
|
101
|
+
const budgetBytes = 28 * 1024;
|
|
102
|
+
const dir = ctx.scope === "project" ? ctx.projectDir : this.userConfigDir();
|
|
103
|
+
const overrideMd = join(dir, "AGENTS.override.md");
|
|
104
|
+
if (existsSync(overrideMd)) {
|
|
105
|
+
return [
|
|
106
|
+
{
|
|
107
|
+
path: overrideMd,
|
|
108
|
+
reason: "AGENTS.override.md shadows AGENTS.md on Open Interpreter (one doc per directory)",
|
|
109
|
+
budgetBytes
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
return [
|
|
114
|
+
{
|
|
115
|
+
path: join(dir, "AGENTS.md"),
|
|
116
|
+
reason: ctx.scope === "project" ? "AGENTS.md standard (project root; read root-down to cwd)" : "Open Interpreter global guidance ($INTERPRETER_HOME/AGENTS.md)",
|
|
117
|
+
budgetBytes
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
// ── Unwired content surfaces (host-native, path not byte-confirmed) ──────
|
|
122
|
+
installCommands(_ctx) {
|
|
123
|
+
return [
|
|
124
|
+
{
|
|
125
|
+
platform: this.id,
|
|
126
|
+
action: "skip",
|
|
127
|
+
detail: "commands unavailable (no custom-prompts directory is documented for Open Interpreter)"
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
uninstallCommands(_ctx) {
|
|
132
|
+
return [{ platform: this.id, action: "skip", detail: "commands unavailable" }];
|
|
133
|
+
}
|
|
134
|
+
installSubagents(_ctx) {
|
|
135
|
+
return [
|
|
136
|
+
{
|
|
137
|
+
platform: this.id,
|
|
138
|
+
action: "skip",
|
|
139
|
+
detail: "subagents unavailable (Open Interpreter defines roles as [agents.<name>] tables in config.toml; not wired)"
|
|
140
|
+
}
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
uninstallSubagents(_ctx) {
|
|
144
|
+
return [{ platform: this.id, action: "skip", detail: "subagents unavailable" }];
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
var adapter = new OpenInterpreterAdapter();
|
|
148
|
+
var open_interpreter_default = adapter;
|
|
149
|
+
export {
|
|
150
|
+
OpenInterpreterAdapter,
|
|
151
|
+
adapter,
|
|
152
|
+
open_interpreter_default as default
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=open-interpreter-ZHBMASXY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/open-interpreter/index.ts"],"sourcesContent":["/**\n * adapters/open-interpreter — Open Interpreter (the new Rust `interpreter` / `i`\n * CLI) platform adapter for agent-connector.\n *\n * Open Interpreter is a FORK of OpenAI's Codex. The project's own README states\n * verbatim: \"This is the new Rust version of Open Interpreter … Open Interpreter\n * is a fork of OpenAI's Codex, with a focus on emulating the agent harness that\n * gets the best performance out of low-cost models.\" (The original Python project\n * lives on as the community fork endolith/open-interpreter.) The repo at\n * github.com/openinterpreter/open-interpreter IS the codex-rs source tree, and\n * docs/open-interpreter-delta.md keeps the maintained delta to product identity,\n * installers and provider-neutral model config — the config and hook subsystems\n * are upstream Codex's. This adapter therefore EXTENDS CodexAdapter and overrides\n * only what the fork renames.\n *\n * Config HOME (byte-confirmed against codex-rs/utils/home-dir/src/lib.rs):\n * - The `interpreter` binary deliberately does NOT honor $CODEX_HOME (\"sharing\n * the Codex home leaks Codex config, update caches, and credentials into the\n * Interpreter identity\"). The ONLY honored override is $INTERPRETER_HOME, and\n * the default is ~/.openinterpreter. The install script\n * (scripts/install/install-open-interpreter.sh) confirms both: it sets\n * CODEX_COMMAND_NAME=interpreter and CODEX_HOME=\"${INTERPRETER_HOME:-$HOME/.openinterpreter}\".\n * - Project layer dir is `.openinterpreter` (codex-rs/config/src/loader/mod.rs:\n * `Product::OpenInterpreter => \".openinterpreter\"`), NOT `.codex`.\n *\n * MCP — inherited from codex: `[mcp_servers.<id>]` tables in <home>/config.toml\n * (codex-rs/config/src/mcp_edit.rs); stdio { command, args, env }, streamable-\n * HTTP { url, bearer_token_env_var?, http_headers? }. TOML has NO native\n * interpolation, so `${env:VAR}` refs resolve to LITERALS at install time.\n *\n * HOOKS — json-stdio, VERIFIED 2026-09-07 (source + live run, v0.0.41):\n * - `features.hooks` is `Stage::Stable, default_enabled: true`\n * (codex-rs/features/src/lib.rs) and docs/hooks.md says \"enabled by default\".\n * - Files: `~/.openinterpreter/hooks.json` (user) and `.openinterpreter/hooks.json`\n * (trusted project), plus inline `[[hooks.<Event>]]` in config.toml; all\n * matching sources run (docs/hooks.md \"Where Hooks Live\"). We write the\n * Claude-compatible hooks.json exactly as the codex adapter does.\n * - Live run against a local mock chat-completions provider fired, in order:\n * SessionStart (source=startup), UserPromptSubmit, PreToolUse (tool_name\n * \"Bash\" for exec_command), PostToolUse, Stop, SessionEnd — each with the\n * Claude-shaped stdin JSON (`hook_event_name`, `session_id`, `cwd`, …).\n * SessionEnd is therefore ADDED on top of CODEX_HOOK_EVENTS (its hook\n * timeout is clamped to 3s by the host; the entry we write carries none).\n * - Trust gate (shared with upstream Codex): non-managed command hooks run\n * only after `/hooks` review in the TUI or `--dangerously-bypass-hook-trust`.\n *\n * CONTENT SURFACES (docs/skills.md, docs/agents_md.md, docs/subagents.md):\n * - skills → project `<projectDir>/.agents/skills/<name>/SKILL.md` (the\n * tool-neutral location the docs tell users to use; `~/.openinterpreter/skills`\n * is a legacy fallback) · user `~/.agents/skills/<name>/SKILL.md`.\n * - memory → `~/.openinterpreter/AGENTS.md` (global) / project AGENTS.md,\n * with `AGENTS.override.md` shadowing per directory — codex's rule.\n * - commands / subagents → NOT wired. Subagents are `[agents.<name>]` tables\n * in config.toml (a different shape from codex's `agents/<name>.toml`), and\n * no custom-prompts directory is documented for the interpreter product;\n * both stay host-native-but-unwired until a path is byte-confirmed.\n *\n * DETECTION: keys on `<home>/config.toml` (or the home dir itself) under\n * $INTERPRETER_HOME || ~/.openinterpreter, and on a project `.openinterpreter`\n * dir — never on ~/.codex, so a Codex install is never misreported.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\n\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n} from \"../../core/types.js\";\nimport type { InstallContext, MemoryTarget } from \"../spi.js\";\nimport { CODEX_HOOK_EVENTS, CodexAdapter } from \"../codex/index.js\";\n\nconst HOST: PlatformId = \"open-interpreter\";\n\n/** Codex's event table plus SessionEnd, which the interpreter product fires (live-verified). */\nconst OPEN_INTERPRETER_HOOK_EVENTS: readonly string[] = [...CODEX_HOOK_EVENTS, \"SessionEnd\"];\n\nexport class OpenInterpreterAdapter extends CodexAdapter {\n override readonly id: PlatformId = HOST;\n override readonly name = \"Open Interpreter\";\n override readonly paradigm: HookParadigm = \"json-stdio\";\n\n override readonly capabilities: PlatformCapabilities = {\n supportsMemory: true,\n preToolUse: true,\n postToolUse: true,\n preCompact: true,\n sessionStart: true,\n // Live-verified: the SessionEnd hook fires at process exit (host clamps its timeout to 3s).\n sessionEnd: true,\n userPromptSubmit: true,\n stop: true,\n notification: false,\n permissionRequest: true,\n subagentStart: true,\n subagentStop: true,\n postCompact: true,\n canModifyArgs: true,\n canModifyOutput: false,\n canInjectSessionContext: true,\n transports: [\"stdio\", \"http\"],\n // See header: skills are wired; commands and subagents stay unwired.\n supportsCommands: false,\n supportsSkills: true,\n supportsSubagents: false,\n };\n\n protected override get hookEventNames(): readonly string[] {\n return OPEN_INTERPRETER_HOOK_EVENTS;\n }\n\n protected override get hookHostLabel(): string {\n return \"Open Interpreter\";\n }\n\n // ── Detection ──────────────────────────────────────────────────────────\n\n override detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = this.userConfigDir();\n const projDir = join(projectDir, \".openinterpreter\");\n const userCfg = join(userDir, \"config.toml\");\n const projCfg = join(projDir, \"config.toml\");\n\n const userInstalled = existsSync(userDir) || existsSync(userCfg);\n const projInstalled = existsSync(projDir) || existsSync(projCfg);\n const installed = userInstalled || projInstalled;\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n configPath: scope === \"project\" ? projCfg : userCfg,\n scope,\n reason: installed\n ? `Found Open Interpreter config dir (${scope})`\n : `No Open Interpreter config dir at ${userDir} or ${projDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ───────────────────────────────────────────────────────\n\n override getConfigDir(ctx: InstallContext): string {\n if (ctx.scope === \"project\") return join(ctx.projectDir, \".openinterpreter\");\n return this.userConfigDir();\n }\n\n /** $INTERPRETER_HOME (tilde-expanded, then resolved) when set & non-empty,\n * else ~/.openinterpreter. $CODEX_HOME is deliberately ignored (see header). */\n protected override userConfigDir(): string {\n const env = process.env.INTERPRETER_HOME;\n if (env && env.trim() !== \"\") {\n if (env.startsWith(\"~\")) return join(homedir(), env.replace(/^~[/\\\\]?/, \"\"));\n return resolve(env);\n }\n return join(homedir(), \".openinterpreter\");\n }\n\n /** Project skills live in the tool-neutral `.agents/skills` (docs/skills.md), not under `.openinterpreter`. */\n protected override skillDir(ctx: InstallContext, name: string): string {\n if (ctx.scope === \"project\") return join(ctx.projectDir, \".agents\", \"skills\", name);\n return join(homedir(), \".agents\", \"skills\", name);\n }\n\n // ── Memory: AGENTS.override.md > AGENTS.md per directory (codex rule, OI home) ─\n protected override memoryTargets(ctx: InstallContext): MemoryTarget[] {\n if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);\n if (ctx.scope !== \"project\" && ctx.scope !== \"user\") return [];\n const budgetBytes = 28 * 1024;\n const dir = ctx.scope === \"project\" ? ctx.projectDir : this.userConfigDir();\n const overrideMd = join(dir, \"AGENTS.override.md\");\n if (existsSync(overrideMd)) {\n return [\n {\n path: overrideMd,\n reason: \"AGENTS.override.md shadows AGENTS.md on Open Interpreter (one doc per directory)\",\n budgetBytes,\n },\n ];\n }\n return [\n {\n path: join(dir, \"AGENTS.md\"),\n reason:\n ctx.scope === \"project\"\n ? \"AGENTS.md standard (project root; read root-down to cwd)\"\n : \"Open Interpreter global guidance ($INTERPRETER_HOME/AGENTS.md)\",\n budgetBytes,\n },\n ];\n }\n\n // ── Unwired content surfaces (host-native, path not byte-confirmed) ──────\n\n override installCommands(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"commands unavailable (no custom-prompts directory is documented for Open Interpreter)\",\n },\n ];\n }\n\n override uninstallCommands(_ctx: InstallContext): ChangeRecord[] {\n return [{ platform: this.id, action: \"skip\", detail: \"commands unavailable\" }];\n }\n\n override installSubagents(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail:\n \"subagents unavailable (Open Interpreter defines roles as [agents.<name>] tables in config.toml; not wired)\",\n },\n ];\n }\n\n override uninstallSubagents(_ctx: InstallContext): ChangeRecord[] {\n return [{ platform: this.id, action: \"skip\", detail: \"subagents unavailable\" }];\n }\n}\n\nexport const adapter = new OpenInterpreterAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;AA8DA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,MAAM,eAAe;AAY9B,IAAM,OAAmB;AAGzB,IAAM,+BAAkD,CAAC,GAAG,mBAAmB,YAAY;AAEpF,IAAM,yBAAN,cAAqC,aAAa;AAAA,EACrC,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA,IACrD,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA,IAEd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,MAAM;AAAA,IACN,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,cAAc;AAAA,IACd,aAAa;AAAA,IACb,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,yBAAyB;AAAA,IACzB,YAAY,CAAC,SAAS,MAAM;AAAA;AAAA,IAE5B,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,EACrB;AAAA,EAEA,IAAuB,iBAAoC;AACzD,WA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@@ -7,19 +7,20 @@ import {
|
|
|
7
7
|
packageConnector,
|
|
8
8
|
packageConnectorAll,
|
|
9
9
|
resolvePackageFormat
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-C4NDV6GW.js";
|
|
11
11
|
import "./chunk-WAALPWR4.js";
|
|
12
12
|
import "./chunk-OPXAP3AC.js";
|
|
13
13
|
import {
|
|
14
14
|
fail,
|
|
15
15
|
print
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PTITNBSS.js";
|
|
17
17
|
import {
|
|
18
18
|
findConnectorConfig,
|
|
19
19
|
loadConnectorFromPath
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-ZYB2UFEN.js";
|
|
21
|
+
import "./chunk-D35FMUFZ.js";
|
|
22
|
+
import "./chunk-S2TAC22E.js";
|
|
23
|
+
import "./chunk-7C3COFOD.js";
|
|
23
24
|
import "./chunk-NBYKLUF6.js";
|
|
24
25
|
import "./chunk-H53QZQJI.js";
|
|
25
26
|
import "./chunk-BEFVJ2OE.js";
|
|
@@ -140,4 +141,4 @@ async function run(argv) {
|
|
|
140
141
|
export {
|
|
141
142
|
run
|
|
142
143
|
};
|
|
143
|
-
//# sourceMappingURL=package-
|
|
144
|
+
//# sourceMappingURL=package-VRV5YHUJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/package.ts"],"sourcesContent":["/**\n * cli/commands/package — emit a marketplace/extension-installable connector bundle.\n *\n * Resolves the connector config (--connector <path>, else findConnectorConfig\n * walking up from the project dir, exactly like install.ts), packages it for the\n * requested --format into --out (default <cwd>/dist-plugin), then prints the\n * emitted file tree plus per-format install instructions.\n *\n * `--format <x>` accepts the full union; `--format all` emits EVERY feasible\n * format, each into <out>/<format>/..., printing install instructions per format.\n * Default --format agent-plugin (the Agent Plugins 1.0.0 bundle every\n * spec-speaking host installs). Retired names (codex-plugin, copilot-plugin)\n * still parse — they resolve to agent-plugin with a deprecation line.\n */\n\nimport { parseArgs } from \"node:util\";\nimport { join, relative } from \"node:path\";\n\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\nimport {\n ALL_FORMATS,\n DEFAULT_PACKAGE_FORMAT,\n FEASIBLE_FORMATS,\n installInstructions,\n packageConnector,\n packageConnectorAll,\n resolvePackageFormat,\n type PackageFormat,\n type PackageResult,\n} from \"../../core/package.js\";\nimport { fail, print } from \"../app.js\";\n\nconst HELP = `agent-connector package — emit a plugin/extension/marketplace bundle.\n\nusage: agent-connector package [flags]\n\nflags:\n --connector <path> Connector config to package (else auto-discovered).\n --format <fmt> Output format (default: ${DEFAULT_PACKAGE_FORMAT}). One of:\n ${ALL_FORMATS.join(\", \")}\n or \"all\" to emit every feasible format into <out>/<fmt>/.\n --out <dir> Output directory. Default: <cwd>/dist-plugin.\n --project <dir> Project root for connector discovery (default: cwd).\n --dry-run Compute the file tree without writing anything.\n --help Show this help.`;\n\n/** Hosts whose marketplace flow agent-connector can DRIVE for a given format. */\nconst DRIVABLE_TARGETS_BY_FORMAT: Partial<Record<PackageFormat, string>> = {\n \"agent-plugin\": \"codex,copilot-cli\",\n \"claude-plugin\": \"claude-code\",\n};\n\n/** Print the file tree + the per-format install instructions for one bundle. */\nfunction printFormatResult(\n format: PackageFormat,\n connectorId: string,\n outDir: string,\n result: PackageResult,\n): void {\n print(` pluginDir: ${result.pluginDir}`);\n if (result.marketplacePath) {\n print(` marketplace: ${relative(outDir, result.marketplacePath)}`);\n }\n print(\" emitted files:\");\n for (const f of result.files) {\n print(` + ${relative(outDir, f)}`);\n }\n if (result.notes && result.notes.length > 0) {\n print(\" notes:\");\n for (const n of result.notes) print(` ! ${n}`);\n }\n print(\" install:\");\n for (const line of installInstructions(format, connectorId, outDir)) {\n print(` ${line}`);\n }\n // `package` stays a pure emitter (no host CLIs spawned) — but for hosts whose\n // marketplace flow agent-connector can DRIVE, point at the lifecycle verb.\n const drivable = DRIVABLE_TARGETS_BY_FORMAT[format];\n if (drivable) {\n print(\n ` (or let agent-connector drive it: agent-connector install --method marketplace --targets ${drivable})`,\n );\n }\n print(\"\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n format: { type: \"string\", default: DEFAULT_PACKAGE_FORMAT },\n out: { type: \"string\" },\n project: { type: \"string\" },\n \"dry-run\": { type: \"boolean\", default: false },\n help: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n if (values.help) {\n print(HELP);\n return 0;\n }\n\n const formatArg = values.format ?? DEFAULT_PACKAGE_FORMAT;\n const isAll = formatArg === \"all\";\n const resolved = isAll ? null : resolvePackageFormat(formatArg);\n if (!isAll && resolved === null) {\n return fail(\n `invalid --format \"${formatArg}\" (expected one of: ${ALL_FORMATS.join(\", \")}, or \"all\")`,\n );\n }\n\n const projectDir = values.project ?? process.cwd();\n const configPath = values.connector ?? findConnectorConfig(projectDir);\n if (!configPath) {\n return fail(\n \"no connector config found. Pass --connector <path> or add an \" +\n \"agent-connector.config.{mjs,js,json} to your project.\",\n );\n }\n\n const outDir = values.out ?? `${process.cwd()}/dist-plugin`;\n const dryRun = values[\"dry-run\"];\n const mode = dryRun ? \" (dry-run — nothing written)\" : \"\";\n\n const { connector } = await loadConnectorFromPath(configPath);\n\n if (isAll) {\n print(`package \"${connector.id}\" → all formats${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n const results = packageConnectorAll(connector, { outDir, dryRun });\n for (const { format, result } of results) {\n const formatOut = join(outDir, format);\n print(`── ${format} ──`);\n printFormatResult(format, connector.id, formatOut, result);\n }\n print(`emitted ${results.length} formats: ${FEASIBLE_FORMATS.join(\", \")}`);\n return 0;\n }\n\n const { format, deprecation } = resolved!;\n if (deprecation) print(`! ${deprecation}`);\n let result: PackageResult;\n try {\n result = packageConnector(connector, { outDir, format, dryRun });\n } catch (err) {\n // Emitter validation errors (e.g. mcp-server-json without\n // publish.registryNamespace) are actionable one-liners — print them as a\n // normal CLI error, never a stack trace.\n const message = err instanceof Error ? err.message : String(err);\n return fail(message);\n }\n\n print(`package \"${connector.id}\" → ${format}${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n printFormatResult(format, connector.id, outDir, result);\n return 0;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/package.ts"],"sourcesContent":["/**\n * cli/commands/package — emit a marketplace/extension-installable connector bundle.\n *\n * Resolves the connector config (--connector <path>, else findConnectorConfig\n * walking up from the project dir, exactly like install.ts), packages it for the\n * requested --format into --out (default <cwd>/dist-plugin), then prints the\n * emitted file tree plus per-format install instructions.\n *\n * `--format <x>` accepts the full union; `--format all` emits EVERY feasible\n * format, each into <out>/<format>/..., printing install instructions per format.\n * Default --format agent-plugin (the Agent Plugins 1.0.0 bundle every\n * spec-speaking host installs). Retired names (codex-plugin, copilot-plugin)\n * still parse — they resolve to agent-plugin with a deprecation line.\n */\n\nimport { parseArgs } from \"node:util\";\nimport { join, relative } from \"node:path\";\n\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\nimport {\n ALL_FORMATS,\n DEFAULT_PACKAGE_FORMAT,\n FEASIBLE_FORMATS,\n installInstructions,\n packageConnector,\n packageConnectorAll,\n resolvePackageFormat,\n type PackageFormat,\n type PackageResult,\n} from \"../../core/package.js\";\nimport { fail, print } from \"../app.js\";\n\nconst HELP = `agent-connector package — emit a plugin/extension/marketplace bundle.\n\nusage: agent-connector package [flags]\n\nflags:\n --connector <path> Connector config to package (else auto-discovered).\n --format <fmt> Output format (default: ${DEFAULT_PACKAGE_FORMAT}). One of:\n ${ALL_FORMATS.join(\", \")}\n or \"all\" to emit every feasible format into <out>/<fmt>/.\n --out <dir> Output directory. Default: <cwd>/dist-plugin.\n --project <dir> Project root for connector discovery (default: cwd).\n --dry-run Compute the file tree without writing anything.\n --help Show this help.`;\n\n/** Hosts whose marketplace flow agent-connector can DRIVE for a given format. */\nconst DRIVABLE_TARGETS_BY_FORMAT: Partial<Record<PackageFormat, string>> = {\n \"agent-plugin\": \"codex,copilot-cli\",\n \"claude-plugin\": \"claude-code\",\n};\n\n/** Print the file tree + the per-format install instructions for one bundle. */\nfunction printFormatResult(\n format: PackageFormat,\n connectorId: string,\n outDir: string,\n result: PackageResult,\n): void {\n print(` pluginDir: ${result.pluginDir}`);\n if (result.marketplacePath) {\n print(` marketplace: ${relative(outDir, result.marketplacePath)}`);\n }\n print(\" emitted files:\");\n for (const f of result.files) {\n print(` + ${relative(outDir, f)}`);\n }\n if (result.notes && result.notes.length > 0) {\n print(\" notes:\");\n for (const n of result.notes) print(` ! ${n}`);\n }\n print(\" install:\");\n for (const line of installInstructions(format, connectorId, outDir)) {\n print(` ${line}`);\n }\n // `package` stays a pure emitter (no host CLIs spawned) — but for hosts whose\n // marketplace flow agent-connector can DRIVE, point at the lifecycle verb.\n const drivable = DRIVABLE_TARGETS_BY_FORMAT[format];\n if (drivable) {\n print(\n ` (or let agent-connector drive it: agent-connector install --method marketplace --targets ${drivable})`,\n );\n }\n print(\"\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n format: { type: \"string\", default: DEFAULT_PACKAGE_FORMAT },\n out: { type: \"string\" },\n project: { type: \"string\" },\n \"dry-run\": { type: \"boolean\", default: false },\n help: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n if (values.help) {\n print(HELP);\n return 0;\n }\n\n const formatArg = values.format ?? DEFAULT_PACKAGE_FORMAT;\n const isAll = formatArg === \"all\";\n const resolved = isAll ? null : resolvePackageFormat(formatArg);\n if (!isAll && resolved === null) {\n return fail(\n `invalid --format \"${formatArg}\" (expected one of: ${ALL_FORMATS.join(\", \")}, or \"all\")`,\n );\n }\n\n const projectDir = values.project ?? process.cwd();\n const configPath = values.connector ?? findConnectorConfig(projectDir);\n if (!configPath) {\n return fail(\n \"no connector config found. Pass --connector <path> or add an \" +\n \"agent-connector.config.{mjs,js,json} to your project.\",\n );\n }\n\n const outDir = values.out ?? `${process.cwd()}/dist-plugin`;\n const dryRun = values[\"dry-run\"];\n const mode = dryRun ? \" (dry-run — nothing written)\" : \"\";\n\n const { connector } = await loadConnectorFromPath(configPath);\n\n if (isAll) {\n print(`package \"${connector.id}\" → all formats${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n const results = packageConnectorAll(connector, { outDir, dryRun });\n for (const { format, result } of results) {\n const formatOut = join(outDir, format);\n print(`── ${format} ──`);\n printFormatResult(format, connector.id, formatOut, result);\n }\n print(`emitted ${results.length} formats: ${FEASIBLE_FORMATS.join(\", \")}`);\n return 0;\n }\n\n const { format, deprecation } = resolved!;\n if (deprecation) print(`! ${deprecation}`);\n let result: PackageResult;\n try {\n result = packageConnector(connector, { outDir, format, dryRun });\n } catch (err) {\n // Emitter validation errors (e.g. mcp-server-json without\n // publish.registryNamespace) are actionable one-liners — print them as a\n // normal CLI error, never a stack trace.\n const message = err instanceof Error ? err.message : String(err);\n return fail(message);\n }\n\n print(`package \"${connector.id}\" → ${format}${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n printFormatResult(format, connector.id, outDir, result);\n return 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,iBAAiB;AAC1B,SAAS,MAAM,gBAAgB;AAgB/B,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iDAMoC,sBAAsB;AAAA,2BAC5C,YAAY,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAQjD,IAAM,6BAAqE;AAAA,EACzE,gBAAgB;AAAA,EAChB,iBAAiB;AACnB;AAGA,SAAS,kBACP,QACA,aACA,QACA,QACM;AACN,QAAM,gBAAgB,OAAO,SAAS,EAAE;AACxC,MAAI,OAAO,iBAAiB;AAC1B,UAAM,kBAAkB,SAAS,QAAQ,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["format","result"]}
|
package/dist/runtime/index.d.ts
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -4,21 +4,22 @@ import {
|
|
|
4
4
|
runServe,
|
|
5
5
|
runStatusline,
|
|
6
6
|
runUsageEvent
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-66TGBYSL.js";
|
|
8
8
|
import "../chunk-OP4KBXUO.js";
|
|
9
9
|
import "../chunk-GDIAHWNY.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ITVST3SZ.js";
|
|
11
11
|
import {
|
|
12
12
|
isNativeHookDeclared,
|
|
13
13
|
runHook,
|
|
14
14
|
runNativeHook
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-KQBRUI3Y.js";
|
|
16
16
|
import "../chunk-IVAWP6HH.js";
|
|
17
17
|
import "../chunk-KHO5WNTP.js";
|
|
18
18
|
import "../chunk-4NFDNY3C.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-ZYB2UFEN.js";
|
|
20
|
+
import "../chunk-D35FMUFZ.js";
|
|
21
|
+
import "../chunk-S2TAC22E.js";
|
|
22
|
+
import "../chunk-7C3COFOD.js";
|
|
22
23
|
import "../chunk-NBYKLUF6.js";
|
|
23
24
|
import "../chunk-QSY74NAP.js";
|
|
24
25
|
import "../chunk-UMQ6NBQR.js";
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as ConnectorConfigError, d as defineAction, a as defineCommand, b as defineConfigPatch, c as defineConnector, e as defineHook, f as defineMemory, g as defineNativeHook, h as defineSkill, i as defineStatusline, j as defineSubagent } from '../define-connector-
|
|
2
|
-
export { S as SURFACE_PREDICATES, a as SurfaceName, c as capabilitiesOf, h as hostsSupporting, s as surfaceSupport } from '../introspect-
|
|
3
|
-
import { o as PlatformId } from '../types-
|
|
4
|
-
export { A as ActionDef, a as ActionResult, b as AuthSpec, Q as CommandDef, V as ConfigPatchDef, c as ConnectorConfig, E as EventPayloadMap, H as HookDefinition, e as HookEventName, f as HookParadigm, g as HookResponse, h as HooksConfig, i as HostCtx, j as InstallScope, W as JsonValue, k as MemoryDef, N as NativeHookDef, l as NativeHookEvent, m as NotificationEvent, P as PermissionRequestEvent, n as PlatformCapabilities, p as PlatformMemoryOverride, q as PlatformOverride, r as PostToolUseEvent, s as PostToolUseFailureEvent, t as PreCompactEvent, u as PreToolUseEvent, X as PublishConfig, v as ResolvedConnector, S as ServerDef, w as SessionEndEvent, x as SessionStartEvent, Y as SkillDef, y as StatuslineContext, z as StatuslineDef, B as StopEvent, Z as SubagentDef, F as SubagentStartEvent, G as SubagentStopEvent, _ as SurfaceToolPolicy, T as TelemetryAccessor, J as TelemetryConfig, K as TelemetryUsageSummary, L as ToolFilter, O as Transport, U as UserPromptSubmitEvent } from '../types-
|
|
1
|
+
export { C as ConnectorConfigError, d as defineAction, a as defineCommand, b as defineConfigPatch, c as defineConnector, e as defineHook, f as defineMemory, g as defineNativeHook, h as defineSkill, i as defineStatusline, j as defineSubagent } from '../define-connector-D4UOI__e.js';
|
|
2
|
+
export { S as SURFACE_PREDICATES, a as SurfaceName, c as capabilitiesOf, h as hostsSupporting, s as surfaceSupport } from '../introspect-gaKVzg2q.js';
|
|
3
|
+
import { o as PlatformId } from '../types-htm_wrWo.js';
|
|
4
|
+
export { A as ActionDef, a as ActionResult, b as AuthSpec, Q as CommandDef, V as ConfigPatchDef, c as ConnectorConfig, E as EventPayloadMap, H as HookDefinition, e as HookEventName, f as HookParadigm, g as HookResponse, h as HooksConfig, i as HostCtx, j as InstallScope, W as JsonValue, k as MemoryDef, N as NativeHookDef, l as NativeHookEvent, m as NotificationEvent, P as PermissionRequestEvent, n as PlatformCapabilities, p as PlatformMemoryOverride, q as PlatformOverride, r as PostToolUseEvent, s as PostToolUseFailureEvent, t as PreCompactEvent, u as PreToolUseEvent, X as PublishConfig, v as ResolvedConnector, S as ServerDef, w as SessionEndEvent, x as SessionStartEvent, Y as SkillDef, y as StatuslineContext, z as StatuslineDef, B as StopEvent, Z as SubagentDef, F as SubagentStartEvent, G as SubagentStopEvent, _ as SurfaceToolPolicy, T as TelemetryAccessor, J as TelemetryConfig, K as TelemetryUsageSummary, L as ToolFilter, O as Transport, U as UserPromptSubmitEvent } from '../types-htm_wrWo.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* sdk/helpers — host-aware authoring helpers for connector handlers.
|
package/dist/sdk/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
capabilitiesOf,
|
|
5
5
|
hostsSupporting,
|
|
6
6
|
surfaceSupport
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-V7GZ3AMV.js";
|
|
8
8
|
import {
|
|
9
9
|
ConnectorConfigError,
|
|
10
10
|
defineAction,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
defineSkill,
|
|
18
18
|
defineStatusline,
|
|
19
19
|
defineSubagent
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-S2TAC22E.js";
|
|
21
|
+
import "../chunk-7C3COFOD.js";
|
|
22
22
|
import "../chunk-NBYKLUF6.js";
|
|
23
23
|
import "../chunk-UMQ6NBQR.js";
|
|
24
24
|
import "../chunk-GZGLCCEE.js";
|
package/dist/sdk/test.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as PlatformId, e as HookEventName, v as ResolvedConnector } from '../types-
|
|
2
|
-
import { a as SurfaceName } from '../introspect-
|
|
1
|
+
import { o as PlatformId, e as HookEventName, v as ResolvedConnector } from '../types-htm_wrWo.js';
|
|
2
|
+
import { a as SurfaceName } from '../introspect-gaKVzg2q.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* sdk/test-harness — the SHIPPED, OFFLINE behavioral harness.
|
package/dist/sdk/test.js
CHANGED
|
@@ -3,15 +3,16 @@ import {
|
|
|
3
3
|
explain,
|
|
4
4
|
explainHooks,
|
|
5
5
|
simulate
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-BAJL27XI.js";
|
|
7
|
+
import "../chunk-KQBRUI3Y.js";
|
|
8
8
|
import "../chunk-IVAWP6HH.js";
|
|
9
9
|
import "../chunk-KHO5WNTP.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-V7GZ3AMV.js";
|
|
11
11
|
import "../chunk-4NFDNY3C.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-ZYB2UFEN.js";
|
|
13
|
+
import "../chunk-D35FMUFZ.js";
|
|
14
|
+
import "../chunk-S2TAC22E.js";
|
|
15
|
+
import "../chunk-7C3COFOD.js";
|
|
15
16
|
import "../chunk-NBYKLUF6.js";
|
|
16
17
|
import "../chunk-UMQ6NBQR.js";
|
|
17
18
|
import "../chunk-GZGLCCEE.js";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
fail
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PTITNBSS.js";
|
|
5
5
|
import {
|
|
6
6
|
runServe
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-66TGBYSL.js";
|
|
8
8
|
import "./chunk-OP4KBXUO.js";
|
|
9
9
|
import "./chunk-GDIAHWNY.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ITVST3SZ.js";
|
|
11
|
+
import "./chunk-KQBRUI3Y.js";
|
|
12
12
|
import "./chunk-IVAWP6HH.js";
|
|
13
13
|
import "./chunk-KHO5WNTP.js";
|
|
14
14
|
import "./chunk-4NFDNY3C.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-ZYB2UFEN.js";
|
|
16
|
+
import "./chunk-D35FMUFZ.js";
|
|
17
|
+
import "./chunk-S2TAC22E.js";
|
|
18
|
+
import "./chunk-7C3COFOD.js";
|
|
18
19
|
import "./chunk-NBYKLUF6.js";
|
|
19
20
|
import "./chunk-QSY74NAP.js";
|
|
20
21
|
import "./chunk-UMQ6NBQR.js";
|
|
@@ -75,4 +76,4 @@ async function run(argv) {
|
|
|
75
76
|
export {
|
|
76
77
|
run
|
|
77
78
|
};
|
|
78
|
-
//# sourceMappingURL=serve-
|
|
79
|
+
//# sourceMappingURL=serve-EPEAGVOE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/serve.ts"],"sourcesContent":["/**\n * cli/commands/serve — the telemetry-wrapping MCP stdio proxy entrypoint.\n *\n * agent-connector serve --connector <id> [--scope <user|project>] [--host <platformId>] -- <realCommand> <realArgs...>\n *\n * A stdio MCP server that opts into transparent telemetry has its host config\n * rewritten to launch THIS instead of the server directly. We split argv at the\n * literal `--` separator: flags on the left, the real server command + args on\n * the right (taken verbatim). The optional `--scope` flag records the install\n * dimension (global user vs project-local) onto telemetry; it is absent for\n * configs written before scope plumbing existed → the runtime reads \"unknown\".\n * The optional `--host` flag carries the install TARGET platform id so the proxy\n * stamps hostPlatform correctly under a headless spawn; absent configs fall back\n * to runtime env detection.\n * The optional `--data-dir` flag pins the framework data-root the child must use\n * to resolve the connector record (and write telemetry). It is written by the\n * wrapper only for a NON-DEFAULT root, because some hosts (codex) strip the MCP\n * child's environment and would otherwise not propagate AGENT_CONNECTOR_DATA_DIR\n * — the child would then resolve the default root and fail \"Connector not\n * registered\". Absent configs resolve the data-root the usual way.\n * runServe stands up the per-session telemetry context and proxies bytes both\n * ways, resolving with the child's exit code.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport type { PlatformId } from \"../../core/types.js\";\nimport type { TelemetryInstallScope } from \"../../telemetry/types.js\";\nimport { runServe } from \"../../runtime/index.js\";\nimport { fail } from \"../app.js\";\n\nexport async function run(argv: string[]): Promise<number> {\n // Split at the FIRST literal \"--\": everything after it is the real server\n // invocation and must be passed through verbatim (never re-parsed as flags).\n const sepIndex = argv.indexOf(\"--\");\n if (sepIndex === -1) {\n return fail(\n \"usage: agent-connector serve --connector <id> [--scope <user|project>] [--host <platformId>] [--data-dir <path>] -- <command> [args...]\",\n );\n }\n const flagArgs = argv.slice(0, sepIndex);\n const serverInvocation = argv.slice(sepIndex + 1);\n\n // strict:false so an unknown FUTURE flag before `--` (written by a newer host\n // config) is ignored instead of throwing — a parse throw here would prevent the\n // real MCP server from ever spawning and wedge the host's tool call. We only\n // read the flags we understand; everything else is tolerated.\n const { values } = parseArgs({\n args: flagArgs,\n options: {\n connector: { type: \"string\" },\n scope: { type: \"string\" },\n // `--host <platformId>` bakes the install TARGET platform into the wrapper\n // so the proxy stamps hostPlatform correctly under a headless spawn (where\n // runtime env markers are absent). Optional + tolerated (strict:false).\n host: { type: \"string\" },\n // `--data-dir <path>` pins the framework data-root for the child (connector\n // record + telemetry). Written only for a NON-DEFAULT root, so the child\n // never depends on inheriting AGENT_CONNECTOR_DATA_DIR (codex strips it).\n // Optional + tolerated (strict:false).\n \"data-dir\": { type: \"string\" },\n },\n allowPositionals: true,\n strict: false,\n });\n\n // With strict:false, parseArgs types each value as string | boolean; we only\n // accept the string form (a bare `--connector` flag with no value is invalid).\n const connectorId = typeof values.connector === \"string\" ? values.connector : undefined;\n if (!connectorId || connectorId.trim() === \"\") {\n return fail(\"serve requires --connector <id>\");\n }\n\n // `--scope` is optional and only ever \"user\" | \"project\" (the wrapper emits\n // exactly those). An unrecognized value is ignored rather than fatal so a\n // future/older wrapper can never break a real tool call over a flag mismatch.\n const rawScope = values.scope;\n const installScope: TelemetryInstallScope | undefined =\n rawScope === \"user\" || rawScope === \"project\" ? rawScope : undefined;\n\n // `--host` carries the install TARGET platform id (string only). runServe\n // validates it against the registry and falls back to runtime detection when\n // it is absent or unrecognized — so a future/older wrapper never breaks here.\n const hostPlatformOverride =\n typeof values.host === \"string\" ? (values.host as PlatformId) : undefined;\n\n // `--data-dir` pins the framework data-root (string only). When present and\n // non-empty, runServe makes the WHOLE child resolve this root — connector\n // record lookup AND telemetry store — so the wrap is independent of the child\n // env that codex strips. Absent → resolve the data-root the usual way.\n const dataDir =\n typeof values[\"data-dir\"] === \"string\" && values[\"data-dir\"].trim() !== \"\"\n ? values[\"data-dir\"]\n : undefined;\n\n const serverCommand = serverInvocation[0];\n if (!serverCommand) {\n return fail(\"serve requires a command after `--`\");\n }\n const serverArgs = serverInvocation.slice(1);\n\n const code = await runServe({\n connectorId,\n serverCommand,\n serverArgs,\n installScope,\n hostPlatformOverride,\n dataDir,\n });\n process.exit(code);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/serve.ts"],"sourcesContent":["/**\n * cli/commands/serve — the telemetry-wrapping MCP stdio proxy entrypoint.\n *\n * agent-connector serve --connector <id> [--scope <user|project>] [--host <platformId>] -- <realCommand> <realArgs...>\n *\n * A stdio MCP server that opts into transparent telemetry has its host config\n * rewritten to launch THIS instead of the server directly. We split argv at the\n * literal `--` separator: flags on the left, the real server command + args on\n * the right (taken verbatim). The optional `--scope` flag records the install\n * dimension (global user vs project-local) onto telemetry; it is absent for\n * configs written before scope plumbing existed → the runtime reads \"unknown\".\n * The optional `--host` flag carries the install TARGET platform id so the proxy\n * stamps hostPlatform correctly under a headless spawn; absent configs fall back\n * to runtime env detection.\n * The optional `--data-dir` flag pins the framework data-root the child must use\n * to resolve the connector record (and write telemetry). It is written by the\n * wrapper only for a NON-DEFAULT root, because some hosts (codex) strip the MCP\n * child's environment and would otherwise not propagate AGENT_CONNECTOR_DATA_DIR\n * — the child would then resolve the default root and fail \"Connector not\n * registered\". Absent configs resolve the data-root the usual way.\n * runServe stands up the per-session telemetry context and proxies bytes both\n * ways, resolving with the child's exit code.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport type { PlatformId } from \"../../core/types.js\";\nimport type { TelemetryInstallScope } from \"../../telemetry/types.js\";\nimport { runServe } from \"../../runtime/index.js\";\nimport { fail } from \"../app.js\";\n\nexport async function run(argv: string[]): Promise<number> {\n // Split at the FIRST literal \"--\": everything after it is the real server\n // invocation and must be passed through verbatim (never re-parsed as flags).\n const sepIndex = argv.indexOf(\"--\");\n if (sepIndex === -1) {\n return fail(\n \"usage: agent-connector serve --connector <id> [--scope <user|project>] [--host <platformId>] [--data-dir <path>] -- <command> [args...]\",\n );\n }\n const flagArgs = argv.slice(0, sepIndex);\n const serverInvocation = argv.slice(sepIndex + 1);\n\n // strict:false so an unknown FUTURE flag before `--` (written by a newer host\n // config) is ignored instead of throwing — a parse throw here would prevent the\n // real MCP server from ever spawning and wedge the host's tool call. We only\n // read the flags we understand; everything else is tolerated.\n const { values } = parseArgs({\n args: flagArgs,\n options: {\n connector: { type: \"string\" },\n scope: { type: \"string\" },\n // `--host <platformId>` bakes the install TARGET platform into the wrapper\n // so the proxy stamps hostPlatform correctly under a headless spawn (where\n // runtime env markers are absent). Optional + tolerated (strict:false).\n host: { type: \"string\" },\n // `--data-dir <path>` pins the framework data-root for the child (connector\n // record + telemetry). Written only for a NON-DEFAULT root, so the child\n // never depends on inheriting AGENT_CONNECTOR_DATA_DIR (codex strips it).\n // Optional + tolerated (strict:false).\n \"data-dir\": { type: \"string\" },\n },\n allowPositionals: true,\n strict: false,\n });\n\n // With strict:false, parseArgs types each value as string | boolean; we only\n // accept the string form (a bare `--connector` flag with no value is invalid).\n const connectorId = typeof values.connector === \"string\" ? values.connector : undefined;\n if (!connectorId || connectorId.trim() === \"\") {\n return fail(\"serve requires --connector <id>\");\n }\n\n // `--scope` is optional and only ever \"user\" | \"project\" (the wrapper emits\n // exactly those). An unrecognized value is ignored rather than fatal so a\n // future/older wrapper can never break a real tool call over a flag mismatch.\n const rawScope = values.scope;\n const installScope: TelemetryInstallScope | undefined =\n rawScope === \"user\" || rawScope === \"project\" ? rawScope : undefined;\n\n // `--host` carries the install TARGET platform id (string only). runServe\n // validates it against the registry and falls back to runtime detection when\n // it is absent or unrecognized — so a future/older wrapper never breaks here.\n const hostPlatformOverride =\n typeof values.host === \"string\" ? (values.host as PlatformId) : undefined;\n\n // `--data-dir` pins the framework data-root (string only). When present and\n // non-empty, runServe makes the WHOLE child resolve this root — connector\n // record lookup AND telemetry store — so the wrap is independent of the child\n // env that codex strips. Absent → resolve the data-root the usual way.\n const dataDir =\n typeof values[\"data-dir\"] === \"string\" && values[\"data-dir\"].trim() !== \"\"\n ? values[\"data-dir\"]\n : undefined;\n\n const serverCommand = serverInvocation[0];\n if (!serverCommand) {\n return fail(\"serve requires a command after `--`\");\n }\n const serverArgs = serverInvocation.slice(1);\n\n const code = await runServe({\n connectorId,\n serverCommand,\n serverArgs,\n installScope,\n hostPlatformOverride,\n dataDir,\n });\n process.exit(code);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,iBAAiB;AAO1B,eAAsB,IAAI,MAAiC;AAGzD,QAAM,WAAW,KAAK,QAAQ,IAAI;AAClC,MAAI,aAAa,IAAI;AACnB,WAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACA,QAAM,WAAW,KAAK,MAAM,GAAG,QAAQ;AACvC,QAAM,mBAAmB,KAAK,MAAM,WAAW,CAAC;AAMhD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC3B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW,EAAE,MAAM,SAAS;AAAA,MAC5B,OAAO,EAAE,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA,MAIxB,MAAM,EAAE,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,MAKvB,YAAY,EAAE,MAAM,SAAS;AAAA,IAC/B;AAAA,IACA,kBAAkB;AAAA,IAClB,QAAQ;AAAA,EACV,CAAC;AAID,QAAM,cAAc,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY;AAC9E,MAAI,CAAC,eAAe,YAAY,KAAK,MAAM,IAAI;AAC7C,WAAO,KAAK,iCAAiC;AAAA,EAC/C;AAKA,QAAM,WAAW,OAAO;AACxB,QAAM,eACJ,aAAa,UAAU,aAAa,YAAY,WAAW;AAK7D,QAAM,uBACJ,OAAO,OAAO,SAAS,WAAY,OAAO,OAAsB;AAMlE,QAAM,UACJ,OAAO,OAAO,UAAU,MAAM,YAAY,OAAO,UAAU,EAAE,KAAK,MAAM,KACpE,OAAO,UAAU,IACjB;AAEN,QAAM,gBAAgB,iBAAiB,CAAC;AACxC,MAAI,CAAC,eAAe;AAClB,WAAO,KAAK,qCAAqC;AAAA,EACnD;AACA,QAAM,aAAa,iBAAiB,MAAM,CAAC;AAE3C,QAAM,OAAO,MAAM,SAAS;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,KAAK,IAAI;AACnB;","names":[]}
|
|
@@ -7,19 +7,20 @@ import {
|
|
|
7
7
|
fail,
|
|
8
8
|
parseScope,
|
|
9
9
|
print
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PTITNBSS.js";
|
|
11
11
|
import {
|
|
12
12
|
detectInstalledPlatforms
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ITVST3SZ.js";
|
|
14
14
|
import {
|
|
15
15
|
findConnectorConfig,
|
|
16
16
|
listRegisteredConnectors,
|
|
17
17
|
loadConnectorFromPath
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-ZYB2UFEN.js";
|
|
19
|
+
import "./chunk-D35FMUFZ.js";
|
|
20
|
+
import "./chunk-S2TAC22E.js";
|
|
20
21
|
import {
|
|
21
22
|
loadAdapter
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7C3COFOD.js";
|
|
23
24
|
import "./chunk-NBYKLUF6.js";
|
|
24
25
|
import "./chunk-UMQ6NBQR.js";
|
|
25
26
|
import {
|
|
@@ -139,4 +140,4 @@ async function run(argv) {
|
|
|
139
140
|
export {
|
|
140
141
|
run
|
|
141
142
|
};
|
|
142
|
-
//# sourceMappingURL=status-
|
|
143
|
+
//# sourceMappingURL=status-3EHFFIQ7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/status.ts"],"sourcesContent":["/**\n * cli/commands/status — a light, glanceable install-state summary.\n *\n * There is NO MCP standard for \"which connectors are installed into which host\n * configs on this machine\" — distribution/wire standards (server.json, MCPB,\n * the lifecycle) cover publishing + the protocol, not local install state. So\n * `status` is purely agent-connector infrastructure, and we design it for the\n * everyday question it answers in one line per platform:\n *\n * \"which of my connectors are present on which hosts?\"\n *\n * It REUSES detect (host enumeration) + the adapters' own config-path resolvers\n * (a read-only presence check) — NO new adapter SPI methods. Unlike `doctor`\n * (deep health checks, non-zero exit on failure) and `doctor --probe` (a live\n * protocol probe that FAILs on a dead server), `status` ALWAYS exits 0: it\n * describes, it never gates. A connector being absent is informational.\n */\n\nimport { parseArgs } from \"node:util\";\nimport { readFileSync } from \"node:fs\";\n\nimport type { InstallScope, PlatformId, ResolvedConnector } from \"../../core/types.js\";\nimport type { InstallContext } from \"../../adapters/spi.js\";\nimport { detectInstalledPlatforms } from \"../../adapters/detect.js\";\nimport { loadAdapter } from \"../../adapters/registry.js\";\nimport {\n findConnectorConfig,\n listRegisteredConnectors,\n loadConnectorFromPath,\n} from \"../../core/load-connector.js\";\nimport { marketplaceEvidence } from \"../../core/marketplace-state.js\";\nimport { dataRoot, homeBinPath } from \"../../core/paths.js\";\nimport { fail, parseScope, print } from \"../app.js\";\n\n/**\n * Resolve which connector(s) status reports on: an explicit --connector path or\n * a local config first, else every connector registered under the data-root\n * (what is actually installed). Empty array when none — status still lists the\n * detected platforms.\n */\nasync function resolveConnectors(\n connectorPath: string | undefined,\n projectDir: string,\n): Promise<ResolvedConnector[]> {\n const configPath = connectorPath ?? findConnectorConfig(projectDir);\n if (configPath) {\n try {\n const { connector } = await loadConnectorFromPath(configPath);\n return [connector];\n } catch {\n /* fall through to the registry */\n }\n }\n return listRegisteredConnectors();\n}\n\nfunction buildContext(\n connector: ResolvedConnector,\n id: PlatformId,\n scope: InstallScope,\n projectDir: string,\n): InstallContext {\n return {\n connector,\n scope: connector.platforms[id]?.scope ?? scope,\n projectDir,\n homeBinPath: homeBinPath(),\n dataRoot: dataRoot(),\n dryRun: true,\n };\n}\n\n/** Read-only: does the file at `path` mention `needle`? Missing/unreadable → false. */\nfunction fileMentions(path: string, needle: string): boolean {\n try {\n return readFileSync(path, \"utf8\").includes(needle);\n } catch {\n return false;\n }\n}\n\ninterface ConnStatus {\n id: string;\n serverPresent: boolean;\n hooksPresent: boolean;\n /**\n * Delivery method actually present on this host: `direct` (managed entries in\n * the host config), `marketplace` (the host's own plugin state / our install\n * record), `both` (the double-install invariant is VIOLATED — doctor FAILs\n * it), or null when absent.\n */\n method: \"direct\" | \"marketplace\" | \"both\" | null;\n}\ninterface StatusRow {\n platform: PlatformId;\n scope: InstallScope;\n configPath: string;\n connectors: ConnStatus[];\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n scope: { type: \"string\", default: \"user\" },\n connector: { type: \"string\" },\n project: { type: \"string\" },\n json: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n const projectDir = values.project ?? process.cwd();\n const scope = parseScope(values.scope);\n if (scope == null) return fail(`invalid --scope \"${values.scope}\" (use user|project)`);\n\n const connectors = await resolveConnectors(values.connector, projectDir);\n const detected = await detectInstalledPlatforms(projectDir);\n\n const rows: StatusRow[] = [];\n for (const p of detected) {\n const adapter = await loadAdapter(p.id);\n if (!adapter) continue;\n const connStatuses: ConnStatus[] = connectors.map((connector) => {\n const ctx = buildContext(connector, p.id, scope, projectDir);\n let serverPath = \"\";\n let hookPath = \"\";\n try {\n serverPath = adapter.getServerConfigPath(ctx);\n } catch {\n /* adapter has no server config path */\n }\n try {\n hookPath = adapter.getHookConfigPath(ctx);\n } catch {\n /* adapter has no hook config path */\n }\n const serverPresent = serverPath\n ? fileMentions(serverPath, connector.id)\n : false;\n const hooksPresent = hookPath ? fileMentions(hookPath, connector.id) : false;\n const direct = serverPresent || hooksPresent;\n const viaMarketplace = marketplaceEvidence(connector.id, p.id) != null;\n return {\n id: connector.id,\n serverPresent,\n hooksPresent,\n method: direct && viaMarketplace\n ? (\"both\" as const)\n : direct\n ? (\"direct\" as const)\n : viaMarketplace\n ? (\"marketplace\" as const)\n : null,\n };\n });\n rows.push({\n platform: p.id,\n scope: p.scope,\n configPath: p.configPath,\n connectors: connStatuses,\n });\n }\n\n if (values.json) {\n print(JSON.stringify(rows, null, 2));\n return 0;\n }\n\n if (rows.length === 0) {\n print(\"status: no agent platforms detected.\");\n return 0;\n }\n if (connectors.length === 0) {\n print(\"status: no connectors found (pass --connector <path> or install one).\\n\");\n }\n\n for (const r of rows) {\n print(`${r.platform} [${r.scope}] ${r.configPath}`);\n if (r.connectors.length === 0) {\n print(\" (no connectors to check)\");\n } else {\n for (const c of r.connectors) {\n const mark = c.method != null ? \"[installed]\" : \"[absent ]\";\n const server = c.serverPresent ? \"server ✓\" : \"server ·\";\n const hooks = c.hooksPresent ? \"hooks ✓\" : \"hooks ·\";\n // `both(!)` flags a violated one-method-per-host invariant — doctor's\n // duplicate-registration check FAILs it with the fix.\n const method =\n c.method == null ? \"\" : c.method === \"both\" ? \" (both!)\" : ` (${c.method})`;\n print(` ${mark} ${c.id} ${server} ${hooks}${method}`);\n }\n }\n print(\"\");\n }\n\n // Always 0: status is descriptive (what is installed where), never a gate —\n // that contrast with doctor (non-zero on FAIL) is the reason it exists.\n return 0;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/status.ts"],"sourcesContent":["/**\n * cli/commands/status — a light, glanceable install-state summary.\n *\n * There is NO MCP standard for \"which connectors are installed into which host\n * configs on this machine\" — distribution/wire standards (server.json, MCPB,\n * the lifecycle) cover publishing + the protocol, not local install state. So\n * `status` is purely agent-connector infrastructure, and we design it for the\n * everyday question it answers in one line per platform:\n *\n * \"which of my connectors are present on which hosts?\"\n *\n * It REUSES detect (host enumeration) + the adapters' own config-path resolvers\n * (a read-only presence check) — NO new adapter SPI methods. Unlike `doctor`\n * (deep health checks, non-zero exit on failure) and `doctor --probe` (a live\n * protocol probe that FAILs on a dead server), `status` ALWAYS exits 0: it\n * describes, it never gates. A connector being absent is informational.\n */\n\nimport { parseArgs } from \"node:util\";\nimport { readFileSync } from \"node:fs\";\n\nimport type { InstallScope, PlatformId, ResolvedConnector } from \"../../core/types.js\";\nimport type { InstallContext } from \"../../adapters/spi.js\";\nimport { detectInstalledPlatforms } from \"../../adapters/detect.js\";\nimport { loadAdapter } from \"../../adapters/registry.js\";\nimport {\n findConnectorConfig,\n listRegisteredConnectors,\n loadConnectorFromPath,\n} from \"../../core/load-connector.js\";\nimport { marketplaceEvidence } from \"../../core/marketplace-state.js\";\nimport { dataRoot, homeBinPath } from \"../../core/paths.js\";\nimport { fail, parseScope, print } from \"../app.js\";\n\n/**\n * Resolve which connector(s) status reports on: an explicit --connector path or\n * a local config first, else every connector registered under the data-root\n * (what is actually installed). Empty array when none — status still lists the\n * detected platforms.\n */\nasync function resolveConnectors(\n connectorPath: string | undefined,\n projectDir: string,\n): Promise<ResolvedConnector[]> {\n const configPath = connectorPath ?? findConnectorConfig(projectDir);\n if (configPath) {\n try {\n const { connector } = await loadConnectorFromPath(configPath);\n return [connector];\n } catch {\n /* fall through to the registry */\n }\n }\n return listRegisteredConnectors();\n}\n\nfunction buildContext(\n connector: ResolvedConnector,\n id: PlatformId,\n scope: InstallScope,\n projectDir: string,\n): InstallContext {\n return {\n connector,\n scope: connector.platforms[id]?.scope ?? scope,\n projectDir,\n homeBinPath: homeBinPath(),\n dataRoot: dataRoot(),\n dryRun: true,\n };\n}\n\n/** Read-only: does the file at `path` mention `needle`? Missing/unreadable → false. */\nfunction fileMentions(path: string, needle: string): boolean {\n try {\n return readFileSync(path, \"utf8\").includes(needle);\n } catch {\n return false;\n }\n}\n\ninterface ConnStatus {\n id: string;\n serverPresent: boolean;\n hooksPresent: boolean;\n /**\n * Delivery method actually present on this host: `direct` (managed entries in\n * the host config), `marketplace` (the host's own plugin state / our install\n * record), `both` (the double-install invariant is VIOLATED — doctor FAILs\n * it), or null when absent.\n */\n method: \"direct\" | \"marketplace\" | \"both\" | null;\n}\ninterface StatusRow {\n platform: PlatformId;\n scope: InstallScope;\n configPath: string;\n connectors: ConnStatus[];\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n scope: { type: \"string\", default: \"user\" },\n connector: { type: \"string\" },\n project: { type: \"string\" },\n json: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n const projectDir = values.project ?? process.cwd();\n const scope = parseScope(values.scope);\n if (scope == null) return fail(`invalid --scope \"${values.scope}\" (use user|project)`);\n\n const connectors = await resolveConnectors(values.connector, projectDir);\n const detected = await detectInstalledPlatforms(projectDir);\n\n const rows: StatusRow[] = [];\n for (const p of detected) {\n const adapter = await loadAdapter(p.id);\n if (!adapter) continue;\n const connStatuses: ConnStatus[] = connectors.map((connector) => {\n const ctx = buildContext(connector, p.id, scope, projectDir);\n let serverPath = \"\";\n let hookPath = \"\";\n try {\n serverPath = adapter.getServerConfigPath(ctx);\n } catch {\n /* adapter has no server config path */\n }\n try {\n hookPath = adapter.getHookConfigPath(ctx);\n } catch {\n /* adapter has no hook config path */\n }\n const serverPresent = serverPath\n ? fileMentions(serverPath, connector.id)\n : false;\n const hooksPresent = hookPath ? fileMentions(hookPath, connector.id) : false;\n const direct = serverPresent || hooksPresent;\n const viaMarketplace = marketplaceEvidence(connector.id, p.id) != null;\n return {\n id: connector.id,\n serverPresent,\n hooksPresent,\n method: direct && viaMarketplace\n ? (\"both\" as const)\n : direct\n ? (\"direct\" as const)\n : viaMarketplace\n ? (\"marketplace\" as const)\n : null,\n };\n });\n rows.push({\n platform: p.id,\n scope: p.scope,\n configPath: p.configPath,\n connectors: connStatuses,\n });\n }\n\n if (values.json) {\n print(JSON.stringify(rows, null, 2));\n return 0;\n }\n\n if (rows.length === 0) {\n print(\"status: no agent platforms detected.\");\n return 0;\n }\n if (connectors.length === 0) {\n print(\"status: no connectors found (pass --connector <path> or install one).\\n\");\n }\n\n for (const r of rows) {\n print(`${r.platform} [${r.scope}] ${r.configPath}`);\n if (r.connectors.length === 0) {\n print(\" (no connectors to check)\");\n } else {\n for (const c of r.connectors) {\n const mark = c.method != null ? \"[installed]\" : \"[absent ]\";\n const server = c.serverPresent ? \"server ✓\" : \"server ·\";\n const hooks = c.hooksPresent ? \"hooks ✓\" : \"hooks ·\";\n // `both(!)` flags a violated one-method-per-host invariant — doctor's\n // duplicate-registration check FAILs it with the fix.\n const method =\n c.method == null ? \"\" : c.method === \"both\" ? \" (both!)\" : ` (${c.method})`;\n print(` ${mark} ${c.id} ${server} ${hooks}${method}`);\n }\n }\n print(\"\");\n }\n\n // Always 0: status is descriptive (what is installed where), never a gate —\n // that contrast with doctor (non-zero on FAIL) is the reason it exists.\n return 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAqB7B,eAAe,kBACb,eACA,YAC8B;AAC9B,QAAM,aAAa,iBAAiB,oBAAoB,UAAU;AAClE,MAAI,YAAY;AACd,QAAI;AACF,YAAM,EAAE,UAAU,IAAI,MAAM,sBAAsB,UAAU;AAC5D,aAAO,CAAC,SAAS;AAAA,IACnB,QAAQ;AAAA,IAER;AAAA,EACF;AACA,SAAO,yBAAyB;AAClC;AAEA,SAAS,aACP,WACA,IACA,OACA,YACgB;AAChB,SAAO;AAAA,IACL;AAAA,IACA,OAAO,UAAU,UAAU,EAAE,GAAG,SAAS;AAAA,IACzC;AAAA,IACA,aAAa,YAAY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|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runStatusline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-66TGBYSL.js";
|
|
5
5
|
import "./chunk-OP4KBXUO.js";
|
|
6
6
|
import "./chunk-GDIAHWNY.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-ITVST3SZ.js";
|
|
8
|
+
import "./chunk-KQBRUI3Y.js";
|
|
9
9
|
import "./chunk-IVAWP6HH.js";
|
|
10
10
|
import "./chunk-KHO5WNTP.js";
|
|
11
11
|
import "./chunk-4NFDNY3C.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-ZYB2UFEN.js";
|
|
13
|
+
import "./chunk-D35FMUFZ.js";
|
|
14
|
+
import "./chunk-S2TAC22E.js";
|
|
15
|
+
import "./chunk-7C3COFOD.js";
|
|
15
16
|
import "./chunk-NBYKLUF6.js";
|
|
16
17
|
import "./chunk-QSY74NAP.js";
|
|
17
18
|
import "./chunk-UMQ6NBQR.js";
|
|
@@ -58,4 +59,4 @@ async function run(argv) {
|
|
|
58
59
|
export {
|
|
59
60
|
run
|
|
60
61
|
};
|
|
61
|
-
//# sourceMappingURL=statusline-
|
|
62
|
+
//# sourceMappingURL=statusline-64IDYANK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/statusline.ts"],"sourcesContent":["/**\n * cli/commands/statusline — the universal statusline (HUD) entrypoint.\n *\n * agent-connector statusline <platform> --connector <id>\n *\n * A statusline-supporting host points its status line config at the single stable\n * home binary (via core/spawn.buildHomeBinStatuslineCommand). This command reads\n * the ENTIRE host payload from stdin, dispatches through runStatusline, writes the\n * rendered line to stdout, and exits with the adapter's exit code.\n *\n * FAIL-SAFE is the runtime's contract: a status line must NEVER wedge the host or\n * spew an error into the status bar. runStatusline never rejects (always exits 0\n * with at most a rendered line), and even a malformed invocation here degrades to\n * exit 0 with no output — never the strict `fail()` non-zero used by other\n * commands.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { runStatusline } from \"../../runtime/index.js\";\n\n/** Read all of a readable stream to a UTF-8 string. */\nasync function readAll(stream: NodeJS.ReadStream): Promise<string> {\n const chunks: Buffer[] = [];\n for await (const chunk of stream) {\n chunks.push(typeof chunk === \"string\" ? Buffer.from(chunk) : chunk);\n }\n return Buffer.concat(chunks).toString(\"utf8\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n // strict:false so a future flag from a newer install can never make this throw\n // and surface a non-zero exit into the host's status bar.\n let platformId = \"\";\n let connectorId = \"\";\n try {\n const { values, positionals } = parseArgs({\n args: argv,\n options: { connector: { type: \"string\" } },\n allowPositionals: true,\n strict: false,\n });\n platformId = positionals[0] ?? \"\";\n connectorId = typeof values.connector === \"string\" ? values.connector : \"\";\n } catch {\n // A malformed invocation must still fail-safe (render nothing, exit 0).\n return 0;\n }\n\n // Drain stdin regardless — a host expects the command to consume its payload.\n const stdin = await readAll(process.stdin).catch(() => \"\");\n\n // Missing platform/connector → render nothing, exit 0 (never a non-zero exit).\n if (platformId === \"\" || connectorId === \"\") {\n return 0;\n }\n\n const reply = await runStatusline({ platformId, connectorId, stdin });\n if (reply.stdout !== undefined && reply.stdout !== \"\") {\n process.stdout.write(reply.stdout);\n }\n if (reply.stderr !== undefined && reply.stderr !== \"\") {\n process.stderr.write(reply.stderr.endsWith(\"\\n\") ? reply.stderr : `${reply.stderr}\\n`);\n }\n return reply.exitCode;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/statusline.ts"],"sourcesContent":["/**\n * cli/commands/statusline — the universal statusline (HUD) entrypoint.\n *\n * agent-connector statusline <platform> --connector <id>\n *\n * A statusline-supporting host points its status line config at the single stable\n * home binary (via core/spawn.buildHomeBinStatuslineCommand). This command reads\n * the ENTIRE host payload from stdin, dispatches through runStatusline, writes the\n * rendered line to stdout, and exits with the adapter's exit code.\n *\n * FAIL-SAFE is the runtime's contract: a status line must NEVER wedge the host or\n * spew an error into the status bar. runStatusline never rejects (always exits 0\n * with at most a rendered line), and even a malformed invocation here degrades to\n * exit 0 with no output — never the strict `fail()` non-zero used by other\n * commands.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { runStatusline } from \"../../runtime/index.js\";\n\n/** Read all of a readable stream to a UTF-8 string. */\nasync function readAll(stream: NodeJS.ReadStream): Promise<string> {\n const chunks: Buffer[] = [];\n for await (const chunk of stream) {\n chunks.push(typeof chunk === \"string\" ? Buffer.from(chunk) : chunk);\n }\n return Buffer.concat(chunks).toString(\"utf8\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n // strict:false so a future flag from a newer install can never make this throw\n // and surface a non-zero exit into the host's status bar.\n let platformId = \"\";\n let connectorId = \"\";\n try {\n const { values, positionals } = parseArgs({\n args: argv,\n options: { connector: { type: \"string\" } },\n allowPositionals: true,\n strict: false,\n });\n platformId = positionals[0] ?? \"\";\n connectorId = typeof values.connector === \"string\" ? values.connector : \"\";\n } catch {\n // A malformed invocation must still fail-safe (render nothing, exit 0).\n return 0;\n }\n\n // Drain stdin regardless — a host expects the command to consume its payload.\n const stdin = await readAll(process.stdin).catch(() => \"\");\n\n // Missing platform/connector → render nothing, exit 0 (never a non-zero exit).\n if (platformId === \"\" || connectorId === \"\") {\n return 0;\n }\n\n const reply = await runStatusline({ platformId, connectorId, stdin });\n if (reply.stdout !== undefined && reply.stdout !== \"\") {\n process.stdout.write(reply.stdout);\n }\n if (reply.stderr !== undefined && reply.stderr !== \"\") {\n process.stderr.write(reply.stderr.endsWith(\"\\n\") ? reply.stderr : `${reply.stderr}\\n`);\n }\n return reply.exitCode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,SAAS,iBAAiB;AAK1B,eAAe,QAAQ,QAA4C;AACjE,QAAM,SAAmB,CAAC;AAC1B,mBAAiB,SAAS,QAAQ;AAChC,WAAO,KAAK,OAAO,UAAU,WAAW,OAAO,KAAK,KAAK,IAAI,KAAK;AAAA,EACpE;AACA,SAAO,OAAO,OAAO,MAAM,EAAE,SAAS,MAAM;AAC9C;AAEA,eAAsB,IAAI,MAAiC;AAGzD,MAAI,aAAa;AACjB,MAAI,cAAc;AAClB,MAAI;AACF,UAAM,EAAE,QAAQ,YAAY,IAAI,UAAU;AAAA,MACxC,MAAM;AAAA,MACN,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,EAAE;AAAA,MACzC,kBAAkB;AAAA,MAClB,QAAQ;AAAA,IACV,CAAC;AACD,iBAAa,YAAY,CAAC,KAAK;AAC/B,kBAAc,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY;AAAA,EAC1E,QAAQ;AAEN,WAAO;AAAA,EACT;AAGA,QAAM,QAAQ,MAAM,QAAQ,QAAQ,KAAK,EAAE,MAAM,MAAM,EAAE;AAGzD,MAAI,eAAe,MAAM,gBAAgB,IAAI;AAC3C,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,MAAM,cAAc,EAAE,YAAY,aAAa,MAAM,CAAC;AACpE,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,MAAM;AAAA,EACnC;AACA,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,SAAO,MAAM;AACf;","names":[]}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
fail,
|
|
14
14
|
print
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PTITNBSS.js";
|
|
16
16
|
import {
|
|
17
17
|
openStore
|
|
18
18
|
} from "./chunk-IVAWP6HH.js";
|
|
@@ -21,9 +21,10 @@ import {
|
|
|
21
21
|
listRegisteredConnectors,
|
|
22
22
|
loadRegisteredConnector,
|
|
23
23
|
readRegisteredMeta
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-ZYB2UFEN.js";
|
|
25
|
+
import "./chunk-D35FMUFZ.js";
|
|
26
|
+
import "./chunk-S2TAC22E.js";
|
|
27
|
+
import "./chunk-7C3COFOD.js";
|
|
27
28
|
import "./chunk-NBYKLUF6.js";
|
|
28
29
|
import "./chunk-UMQ6NBQR.js";
|
|
29
30
|
import "./chunk-GZGLCCEE.js";
|
|
@@ -349,4 +350,4 @@ export {
|
|
|
349
350
|
parseSince,
|
|
350
351
|
run
|
|
351
352
|
};
|
|
352
|
-
//# sourceMappingURL=telemetry-
|
|
353
|
+
//# sourceMappingURL=telemetry-AEE4TOFA.js.map
|