codiedev 0.9.80 → 0.10.0-beta.10
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 +12 -5
- package/dist/backup/cache.js +1 -5
- package/dist/backup/match.js +0 -6
- package/dist/backup/run.js +3 -35
- package/dist/captureExclusions.js +0 -12
- package/dist/captureLog.js +0 -28
- package/dist/captureReadiness.js +0 -58
- package/dist/captureSignals.js +0 -11
- package/dist/cli.js +11 -33
- package/dist/cliSession.js +3 -60
- package/dist/codexHookTrust.js +0 -28
- package/dist/codexLimitScan.js +0 -107
- package/dist/codie.js +64 -57
- package/dist/codieBrandInstall.js +0 -18
- package/dist/codieLauncher.js +1 -72
- package/dist/codieRuntime.js +27 -32
- package/dist/codieRuntimeInstall.js +11 -43
- package/dist/codieUsage.js +0 -49
- package/dist/commands/agentTemplates.generated.js +136 -0
- package/dist/commands/agents.js +1088 -0
- package/dist/commands/agentsSdk.generated.js +7 -0
- package/dist/commands/ask.js +0 -3
- package/dist/commands/capture.js +0 -2
- package/dist/commands/createTicket.js +0 -10
- package/dist/commands/doctor.js +2 -72
- package/dist/commands/evals.js +3 -9
- package/dist/commands/inbox.js +0 -2
- package/dist/commands/library.js +0 -3
- package/dist/commands/pack.js +0 -29
- package/dist/commands/ping.js +0 -2
- package/dist/commands/pull.js +0 -9
- package/dist/commands/push.js +0 -12
- package/dist/commands/search.js +0 -4
- package/dist/commands/send.js +0 -5
- package/dist/commands/share.js +0 -4
- package/dist/commands/shared.js +0 -35
- package/dist/commands/traces.js +0 -13
- package/dist/commands/tracesLabel.js +0 -8
- package/dist/configDir.js +1 -18
- package/dist/connect.js +3 -75
- package/dist/connectFlow.js +0 -15
- package/dist/copilotHooks.js +0 -67
- package/dist/copilotInstallation.js +0 -1
- package/dist/cursorHooks.js +1 -11
- package/dist/cursorLifecycle.js +1 -7
- package/dist/detection.js +0 -30
- package/dist/harnessDirs.js +0 -19
- package/dist/hook.js +43 -293
- package/dist/inboxFormat.js +0 -24
- package/dist/launchContext.js +0 -50
- package/dist/launcher.js +0 -33
- package/dist/limitEvent.js +2 -34
- package/dist/managedPi.js +2 -50
- package/dist/mcp.js +0 -48
- package/dist/nativeSteering.js +1 -4
- package/dist/packs/codie.js +0 -15
- package/dist/packs/harnesses.js +1 -38
- package/dist/packs/hookGate.js +0 -33
- package/dist/packs/install.js +0 -20
- package/dist/packs/manifest.js +1 -15
- package/dist/packs/paths.js +0 -8
- package/dist/packs/shim.js +0 -8
- package/dist/packs/store.js +0 -12
- package/dist/packs/sync.js +0 -20
- package/dist/piHooks.js +4 -45
- package/dist/piRuntime.js +0 -18
- package/dist/repoResolver.js +0 -19
- package/dist/secret.js +0 -3
- package/dist/selfUpdate.js +2 -77
- package/dist/skillMarker.js +0 -14
- package/dist/subagents.js +0 -18
- package/dist/teamSkillContext.js +0 -1
- package/dist/transcriptModels.js +0 -8
- package/dist/upgradeNudge.js +1 -30
- package/dist/utils.js +165 -768
- package/dist/version.js +0 -10
- package/dist/versionCheck.js +0 -33
- package/package.json +13 -8
- package/dist/backup/cache.d.ts +0 -14
- package/dist/backup/match.d.ts +0 -2
- package/dist/backup/run.d.ts +0 -25
- package/dist/captureExclusions.d.ts +0 -30
- package/dist/captureLog.d.ts +0 -20
- package/dist/captureReadiness.d.ts +0 -65
- package/dist/captureSignals.d.ts +0 -47
- package/dist/cli.d.ts +0 -15
- package/dist/cliSession.d.ts +0 -108
- package/dist/codexHookTrust.d.ts +0 -49
- package/dist/codexLimitScan.d.ts +0 -64
- package/dist/codie.d.ts +0 -2
- package/dist/codieBrandInstall.d.ts +0 -11
- package/dist/codieLauncher.d.ts +0 -87
- package/dist/codieRuntime.d.ts +0 -35
- package/dist/codieRuntimeInstall.d.ts +0 -56
- package/dist/codieUsage.d.ts +0 -64
- package/dist/commands/ask.d.ts +0 -1
- package/dist/commands/capture.d.ts +0 -14
- package/dist/commands/createTicket.d.ts +0 -27
- package/dist/commands/delete.d.ts +0 -1
- package/dist/commands/doctor.d.ts +0 -9
- package/dist/commands/evals.d.ts +0 -3
- package/dist/commands/inbox.d.ts +0 -3
- package/dist/commands/library.d.ts +0 -2
- package/dist/commands/note.d.ts +0 -1
- package/dist/commands/pack.d.ts +0 -54
- package/dist/commands/ping.d.ts +0 -1
- package/dist/commands/pull.d.ts +0 -2
- package/dist/commands/push.d.ts +0 -33
- package/dist/commands/search.d.ts +0 -2
- package/dist/commands/send.d.ts +0 -2
- package/dist/commands/share.d.ts +0 -2
- package/dist/commands/shared.d.ts +0 -64
- package/dist/commands/traces.d.ts +0 -72
- package/dist/commands/tracesLabel.d.ts +0 -24
- package/dist/configDir.d.ts +0 -10
- package/dist/connect.d.ts +0 -1
- package/dist/connectFlow.d.ts +0 -34
- package/dist/copilotHooks.d.ts +0 -85
- package/dist/copilotInstallation.d.ts +0 -10
- package/dist/cursorHooks.d.ts +0 -13
- package/dist/cursorLifecycle.d.ts +0 -2
- package/dist/detection.d.ts +0 -30
- package/dist/harnessDirs.d.ts +0 -15
- package/dist/hook.d.ts +0 -6
- package/dist/inboxFormat.d.ts +0 -38
- package/dist/launchContext.d.ts +0 -46
- package/dist/launcher.d.ts +0 -25
- package/dist/limitEvent.d.ts +0 -15
- package/dist/limitEventReporter.d.ts +0 -21
- package/dist/managedPi.d.ts +0 -48
- package/dist/mcp.d.ts +0 -12
- package/dist/nativeSteering.d.ts +0 -5
- package/dist/packs/codie.d.ts +0 -45
- package/dist/packs/harnesses.d.ts +0 -74
- package/dist/packs/hookGate.d.ts +0 -53
- package/dist/packs/install.d.ts +0 -46
- package/dist/packs/manifest.d.ts +0 -52
- package/dist/packs/paths.d.ts +0 -17
- package/dist/packs/shim.d.ts +0 -26
- package/dist/packs/store.d.ts +0 -42
- package/dist/packs/sync.d.ts +0 -40
- package/dist/piHooks.d.ts +0 -22
- package/dist/piRuntime.d.ts +0 -26
- package/dist/repoResolver.d.ts +0 -17
- package/dist/secret.d.ts +0 -1
- package/dist/selfUpdate.d.ts +0 -64
- package/dist/skillMarker.d.ts +0 -6
- package/dist/subagents.d.ts +0 -36
- package/dist/teamSkillContext.d.ts +0 -9
- package/dist/transcriptModels.d.ts +0 -20
- package/dist/upgradeNudge.d.ts +0 -24
- package/dist/utils.d.ts +0 -396
- package/dist/version.d.ts +0 -1
- package/dist/versionCheck.d.ts +0 -68
package/dist/copilotHooks.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Copilot: VS Code Copilot Chat's agent and the Copilot CLI run on the
|
|
3
|
-
* same runtime and write the same session record,
|
|
4
|
-
* `$COPILOT_HOME/session-state/<sessionId>/events.jsonl` (plus
|
|
5
|
-
* `workspace.yaml`), and both read user hooks from `$COPILOT_HOME/hooks/*.json`.
|
|
6
|
-
* Everything Copilot-specific is translated here, at the process boundary, so
|
|
7
|
-
* the shared capture pipeline only ever sees the Claude-shaped transcript it
|
|
8
|
-
* already parses.
|
|
9
|
-
*/
|
|
10
|
-
/** `$COPILOT_HOME`, else `~/.copilot` (the runtime honours the same variable). */
|
|
11
|
-
export declare function copilotHome(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
12
|
-
export declare function copilotSessionDir(sessionId: string, home?: string): string | undefined;
|
|
13
|
-
/** sessionEnd carries no transcript path; the session id names the file. */
|
|
14
|
-
export declare function copilotTranscriptPath(sessionId: string | undefined, home?: string): string | undefined;
|
|
15
|
-
export type CopilotWorkspace = {
|
|
16
|
-
id?: string;
|
|
17
|
-
cwd?: string;
|
|
18
|
-
gitRoot?: string;
|
|
19
|
-
branch?: string;
|
|
20
|
-
/** "vscode-agent-host" (VS Code Copilot Chat) or "github/cli" (Copilot CLI). */
|
|
21
|
-
clientName?: string;
|
|
22
|
-
};
|
|
23
|
-
/** workspace.yaml is flat `key: value` lines; no YAML dependency needed. */
|
|
24
|
-
export declare function parseCopilotWorkspace(yaml: string): CopilotWorkspace;
|
|
25
|
-
/** The workspace.yaml beside a transcript (or for a session id); {} if absent. */
|
|
26
|
-
export declare function readCopilotWorkspace(transcriptPathOrDir: string | undefined): CopilotWorkspace;
|
|
27
|
-
export declare const COPILOT_VSCODE_CLIENT = "vscode-agent-host";
|
|
28
|
-
/**
|
|
29
|
-
* How the session was launched. VS Code names itself in workspace.yaml; the
|
|
30
|
-
* CLI doesn't record whether it ran headless, so that comes from the process
|
|
31
|
-
* that launched the hook (`detected`, see launchContext). Unknown stays
|
|
32
|
-
* unknown rather than guessing "human".
|
|
33
|
-
*/
|
|
34
|
-
export declare function copilotLaunch(clientName: string | undefined, detected: string | undefined): string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Copilot's hook payloads are camelCase (`sessionId`, `transcriptPath`,
|
|
37
|
-
* `toolName`/`toolArgs`/`toolResult`); preToolUse in the CLI batches calls as
|
|
38
|
-
* `toolCalls: [{id, name, args}]`. Translate to the shared snake_case shape.
|
|
39
|
-
* The FIRST tool call fills tool_name/tool_input; `copilotToolCalls` keeps all
|
|
40
|
-
* of them so security can check each.
|
|
41
|
-
*/
|
|
42
|
-
export declare function normalizeCopilotHookInput<T extends Record<string, unknown>>(input: T, home?: string): T & Record<string, unknown>;
|
|
43
|
-
export type CopilotToolCall = {
|
|
44
|
-
id?: string;
|
|
45
|
-
name: string;
|
|
46
|
-
input: unknown;
|
|
47
|
-
};
|
|
48
|
-
/** Copilot's preToolUse deny output. */
|
|
49
|
-
export declare function copilotPreToolBlockResponse(reason: string): {
|
|
50
|
-
permissionDecision: "deny";
|
|
51
|
-
permissionDecisionReason: string;
|
|
52
|
-
};
|
|
53
|
-
/** Only a byte-empty record is safe to discard (same rule as Cursor). */
|
|
54
|
-
export declare function isCopilotTranscriptEmpty(content: string): boolean;
|
|
55
|
-
/** session.shutdown carries the per-model token totals; written after sessionEnd. */
|
|
56
|
-
export declare function hasCopilotShutdown(content: string): boolean;
|
|
57
|
-
export type NormalizedCopilotTranscript = {
|
|
58
|
-
/** Claude-shaped JSONL for the shared parsers and the upload. */
|
|
59
|
-
content: string;
|
|
60
|
-
/** Fleet-mode sub-agents run inside this file (subagent.started). */
|
|
61
|
-
subagents: {
|
|
62
|
-
count: number;
|
|
63
|
-
truncated: boolean;
|
|
64
|
-
};
|
|
65
|
-
/** True once session.shutdown (token totals) has been written. */
|
|
66
|
-
final: boolean;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* events.jsonl → Claude-shaped JSONL:
|
|
70
|
-
* session.start → system record (cwd, branch, entrypoint for VS Code)
|
|
71
|
-
* user.message → user text
|
|
72
|
-
* assistant.message → assistant text + tool_use blocks (model on every call)
|
|
73
|
-
* tool.execution_complete→ user tool_result (git output feeds branch/sha joins)
|
|
74
|
-
* skill.invoked → copilot.skill_invoked (one skill run)
|
|
75
|
-
* session.shutdown → copilot.usage per model (tokens, sub-agents
|
|
76
|
-
* included; requests counted from the assistant
|
|
77
|
-
* calls, so 0 here) + copilot.usage_summary
|
|
78
|
-
* session.usage_checkpoint → copilot.usage_summary (premium requests and
|
|
79
|
-
* nano-AIU so far; superseded by shutdown)
|
|
80
|
-
* subagent.started → counted as a fleet sub-agent
|
|
81
|
-
* Hooks, permissions, system prompts and checkpoints are dropped.
|
|
82
|
-
*/
|
|
83
|
-
export declare function normalizeCopilotTranscript(raw: string, opts?: {
|
|
84
|
-
clientName?: string;
|
|
85
|
-
}): NormalizedCopilotTranscript;
|
package/dist/cursorHooks.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** Normalize Cursor's native hook payload into the shared capture shape. */
|
|
2
|
-
export declare function normalizeCursorHookInput<T extends Record<string, unknown>>(input: T): T & Record<string, unknown>;
|
|
3
|
-
/** Normalize Cursor message roles and native tools at the capture boundary. */
|
|
4
|
-
export declare function normalizeCursorTranscript(content: string): string;
|
|
5
|
-
/** Cursor may change its private JSONL record shape independently of the hook
|
|
6
|
-
* contract. Only a byte-empty snapshot is safe to discard; a non-empty file
|
|
7
|
-
* that the current normalizer cannot parse must still be uploaded for backend
|
|
8
|
-
* recovery and diagnosis. */
|
|
9
|
-
export declare function isCursorTranscriptEmpty(content: string): boolean;
|
|
10
|
-
/** The IDE transcript often omits usage entirely; absence must not become
|
|
11
|
-
* measured zero. CLI records with explicit token fields retain their totals. */
|
|
12
|
-
export declare function cursorTranscriptHasUsage(content: string): boolean;
|
|
13
|
-
export declare function cursorObservedModel(content: string): string | undefined;
|
package/dist/detection.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface ClaudeCodeProbe {
|
|
2
|
-
dirExists: boolean;
|
|
3
|
-
binOnPath: boolean;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Claude Code is "installed" if either ~/.claude exists (the user has
|
|
7
|
-
* launched the app at least once) OR the `claude` binary is on PATH (the
|
|
8
|
-
* user installed via npm/brew but hasn't launched yet). Either signal is
|
|
9
|
-
* sufficient — we want to wire up the hook the moment the user has
|
|
10
|
-
* obviously committed to the tool.
|
|
11
|
-
*/
|
|
12
|
-
export declare function detectClaudeCode(probe: ClaudeCodeProbe): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* True iff `cmd` looks like a hook command codiedev itself wrote. Used
|
|
15
|
-
* both by the install filter (so `connect` replaces the existing entry
|
|
16
|
-
* instead of stacking another one) and by `codiedev doctor` (so it can
|
|
17
|
-
* grade whether the hook is wired up).
|
|
18
|
-
*
|
|
19
|
-
* Must match every form codiedev can write:
|
|
20
|
-
* - Legacy `npx codiedev-hook <subcommand>`
|
|
21
|
-
* - Absolute path from npm-registry install:
|
|
22
|
-
* `<node> /.../node_modules/codiedev/dist/hook.js <subcommand>`
|
|
23
|
-
* - Absolute path from `npm link` dev install (the monorepo folder
|
|
24
|
-
* is named `codiedev-cli`, not `codiedev`):
|
|
25
|
-
* `<node> /.../codiedev-cli/dist/hook.js <subcommand>`
|
|
26
|
-
*
|
|
27
|
-
* The `codiedev[^/\\]*` allows the trailing `-cli` (or any future suffix)
|
|
28
|
-
* without matching unrelated paths like `notcodiedev/dist/hook.js`.
|
|
29
|
-
*/
|
|
30
|
-
export declare function isCodiedevHookCommand(cmd: string | undefined): boolean;
|
package/dist/harnessDirs.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** Claude Code: `$CLAUDE_CONFIG_DIR` or ~/.claude. */
|
|
2
|
-
export declare function claudeConfigDir(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
3
|
-
/** Claude Code's user state file. Lives inside `$CLAUDE_CONFIG_DIR` when set, else ~/.claude.json. */
|
|
4
|
-
export declare function claudeUserConfigPath(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
5
|
-
/** Codex: `$CODEX_HOME` or ~/.codex. */
|
|
6
|
-
export declare function codexHome(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
7
|
-
/** OpenCode: `$XDG_CONFIG_HOME/opencode` or ~/.config/opencode. */
|
|
8
|
-
export declare function openCodeConfigDir(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
9
|
-
/** pi: `$PI_CODING_AGENT_DIR` or ~/.pi/agent. Holds extensions/, skills/,
|
|
10
|
-
* sessions/ and the global AGENTS.md. */
|
|
11
|
-
export declare function piAgentDir(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
12
|
-
/** `~`-abbreviated path for user-facing output. */
|
|
13
|
-
export declare function displayPath(p: string, home?: string): string;
|
|
14
|
-
export declare function claudeConfigDirInUse(dir?: string, exists?: (p: string) => boolean): boolean;
|
|
15
|
-
export declare function codexHomeInUse(dir?: string, exists?: (p: string) => boolean): boolean;
|
package/dist/hook.d.ts
DELETED
package/dist/inboxFormat.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface InboxPing {
|
|
2
|
-
pingId: string;
|
|
3
|
-
createdAt: number;
|
|
4
|
-
readAt?: number;
|
|
5
|
-
from: {
|
|
6
|
-
name: string;
|
|
7
|
-
email: string;
|
|
8
|
-
} | null;
|
|
9
|
-
subjectKey: string | null;
|
|
10
|
-
subject: {
|
|
11
|
-
title?: string;
|
|
12
|
-
} | null;
|
|
13
|
-
preview: string;
|
|
14
|
-
}
|
|
15
|
-
export interface InboxMention {
|
|
16
|
-
mentionId: string;
|
|
17
|
-
createdAt: number;
|
|
18
|
-
readAt?: number | null;
|
|
19
|
-
from: {
|
|
20
|
-
name: string;
|
|
21
|
-
email: string;
|
|
22
|
-
} | null;
|
|
23
|
-
postTitle: string | null;
|
|
24
|
-
preview: string | null;
|
|
25
|
-
url: string | null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Render the inbox for BOTH surfaces — `codiedev inbox` and the MCP
|
|
29
|
-
* `codiedev_inbox` tool an agent calls for "any messages?". Shared so the
|
|
30
|
-
* agent path can never drift back to pings-only while the human path shows
|
|
31
|
-
* mentions.
|
|
32
|
-
*/
|
|
33
|
-
export declare function formatInbox(opts: {
|
|
34
|
-
pings: InboxPing[];
|
|
35
|
-
mentions?: InboxMention[];
|
|
36
|
-
unreadOnly: boolean;
|
|
37
|
-
limit?: number;
|
|
38
|
-
}): string[];
|
package/dist/launchContext.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare function codieLaunchFromArgv(argv: readonly string[]): string;
|
|
2
|
-
/** One launching process's command line → a Cursor launch value. */
|
|
3
|
-
export declare function cursorLaunchFromCommand(command: string): string | undefined;
|
|
4
|
-
/**
|
|
5
|
-
* One launching process's command line → a Copilot CLI launch value. The CLI
|
|
6
|
-
* runs as `…/@github/copilot-<platform>/copilot [flags]` under
|
|
7
|
-
* `node …/bin/copilot [flags]`; `-p`/`--prompt` is headless (scripted). VS
|
|
8
|
-
* Code's agent (`copilot-runtime --headless`) is named by workspace.yaml
|
|
9
|
-
* instead, so it never matches here.
|
|
10
|
-
*/
|
|
11
|
-
export declare function copilotLaunchFromCommand(command: string): string | undefined;
|
|
12
|
-
type Ps = (pid: number) => {
|
|
13
|
-
ppid: number;
|
|
14
|
-
command: string;
|
|
15
|
-
} | null;
|
|
16
|
-
/**
|
|
17
|
-
* Windows: one PowerShell call returns the whole ancestor chain (spawning
|
|
18
|
-
* PowerShell per level would cost ~0.5s each). CommandLine needs CIM, which
|
|
19
|
-
* every supported Windows has; any failure means "unknown", never a guess.
|
|
20
|
-
*/
|
|
21
|
-
export declare function windowsAncestors(startPid: number, depth: number): Array<{
|
|
22
|
-
pid: number;
|
|
23
|
-
ppid: number;
|
|
24
|
-
command: string;
|
|
25
|
-
}> | null;
|
|
26
|
-
type LaunchDeps = {
|
|
27
|
-
platform?: string;
|
|
28
|
-
ps?: Ps;
|
|
29
|
-
depth?: number;
|
|
30
|
-
windows?: typeof windowsAncestors;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Walk up to `depth` ancestors (a shell or `npx` usually sits between Cursor
|
|
34
|
-
* and the hook) and return the first Cursor launch found.
|
|
35
|
-
*/
|
|
36
|
-
export declare function detectCursorLaunch(startPid?: number, deps?: LaunchDeps): string | undefined;
|
|
37
|
-
/** The Copilot CLI that launched this hook (`copilot:print` / `copilot:cli`). */
|
|
38
|
-
export declare function detectCopilotLaunch(startPid?: number, deps?: LaunchDeps): string | undefined;
|
|
39
|
-
/** The launch value a hook invocation should carry into its capture job. */
|
|
40
|
-
export declare function hookLaunch(hookCommand: string | undefined, input: {
|
|
41
|
-
launch?: unknown;
|
|
42
|
-
}, deps?: {
|
|
43
|
-
copilotClientName?: string;
|
|
44
|
-
detectCopilot?: () => string | undefined;
|
|
45
|
-
}): string | undefined;
|
|
46
|
-
export {};
|
package/dist/launcher.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const LAUNCHER_FILE = "codiedev-hook-launcher.cjs";
|
|
2
|
-
export interface InstallRecord {
|
|
3
|
-
hookScript: string;
|
|
4
|
-
version?: string;
|
|
5
|
-
recordedAt: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function launcherPath(): string;
|
|
8
|
-
/** True iff `cmd` invokes the stable launcher (from any state dir). */
|
|
9
|
-
export declare function usesLauncher(cmd: string | undefined): boolean;
|
|
10
|
-
export declare function readInstallRecord(): InstallRecord | null;
|
|
11
|
-
/**
|
|
12
|
-
* The hook script worth recording: absolute and present, and a global install over an npx cache
|
|
13
|
-
* copy (npm prunes ~/.npm/_npx, and hooks pointed there go quietly dead). Null = don't record.
|
|
14
|
-
*/
|
|
15
|
-
export declare function stableHookScript(hookScript: string, globalCandidates?: string[]): string | null;
|
|
16
|
-
/** Point the launcher at `hookScript`. Atomic, so a hook mid-launch never reads half a file. */
|
|
17
|
-
export declare function recordCurrentInstall(requested: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Make sure the launcher exists and forwards to `hookScript`, returning the
|
|
20
|
-
* launcher path to bake into hook configs — or null if the state dir is not
|
|
21
|
-
* writable, in which case callers keep baking the direct path. Memoized:
|
|
22
|
-
* one connect writes ~20 hook entries.
|
|
23
|
-
*/
|
|
24
|
-
export declare function ensureLauncher(requested: string): string | null;
|
|
25
|
-
export declare function resetLauncherCacheForTests(): void;
|
package/dist/limitEvent.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type LimitKind = "session" | "user_spend" | "org_spend" | "other";
|
|
2
|
-
export interface LimitEvent {
|
|
3
|
-
kind: LimitKind;
|
|
4
|
-
at: number;
|
|
5
|
-
resetText: string | null;
|
|
6
|
-
reason?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function classifyLimitKind(text: string): LimitKind;
|
|
9
|
-
export declare function parseLimitEventFromTranscript(transcript: string): LimitEvent | null;
|
|
10
|
-
/** Parse the structured rate-limit snapshot written to Codex rollout JSONL. */
|
|
11
|
-
export declare function parseCodexLimitEventFromTranscript(transcript: string): LimitEvent | null;
|
|
12
|
-
/** Only explicit provider errors qualify; never scan user/assistant prose. */
|
|
13
|
-
export declare function parseNativeLimitError(input: Record<string, unknown>, now?: number): LimitEvent | null;
|
|
14
|
-
export declare function parseNativeLimitEventFromTranscript(transcript: string): LimitEvent | null;
|
|
15
|
-
export declare function tailForLimitEvent(transcript: string, maxChars?: number): string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type LimitEvent } from "./limitEvent";
|
|
2
|
-
export type LimitEventSource = "claude-code" | "codex" | "cursor" | "copilot" | "pi";
|
|
3
|
-
export type LimitEventPayload = LimitEvent & {
|
|
4
|
-
source: LimitEventSource;
|
|
5
|
-
sessionId?: string;
|
|
6
|
-
transcriptTail?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function postLimitEvent(config: {
|
|
9
|
-
backendUrl: string;
|
|
10
|
-
token: string;
|
|
11
|
-
}, payload: LimitEventPayload, timeoutMs?: number): Promise<void>;
|
|
12
|
-
export declare function reportTranscriptLimitEvent(args: {
|
|
13
|
-
config: {
|
|
14
|
-
backendUrl: string;
|
|
15
|
-
token: string;
|
|
16
|
-
};
|
|
17
|
-
source: LimitEventSource;
|
|
18
|
-
sessionId?: string;
|
|
19
|
-
transcript: string;
|
|
20
|
-
emitMinimalOnMiss?: boolean;
|
|
21
|
-
}): Promise<boolean>;
|
package/dist/managedPi.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type CatalogModel } from "./codieLauncher";
|
|
2
|
-
export declare const PI_PROVIDER_ID = "codiedev";
|
|
3
|
-
/** Env vars pi reads provider credentials from (`pi --help`, pi 0.73). */
|
|
4
|
-
export declare const PI_PROVIDER_ENV: string[];
|
|
5
|
-
export declare const GUARD_FILE = "codie-guard.ts";
|
|
6
|
-
export declare const CAPTURE_FILE = "codiedev-capture.ts";
|
|
7
|
-
/** Where the guard points every other provider: a loopback port nothing
|
|
8
|
-
* listens on, so a request (and whatever key it carries) never leaves the
|
|
9
|
-
* machine. */
|
|
10
|
-
export declare const BLOCKED_BASE_URL = "http://127.0.0.1:9/blocked-by-codiedev";
|
|
11
|
-
/** The pi extension that keeps a managed session on Codiedev models and tags
|
|
12
|
-
* each gateway request with the session, repo and skills, so gateway billing
|
|
13
|
-
* joins the captured pi session (same headers as the OpenCode metadata
|
|
14
|
-
* plugin, assets/git-refs.mjs). */
|
|
15
|
-
export declare const GUARD_SOURCE: string;
|
|
16
|
-
export declare function managedPiAgentDir(stateDir: string): string;
|
|
17
|
-
/** pi's models.json entry for the gateway. The key is read from
|
|
18
|
-
* CODIEDEV_GATEWAY_KEY at request time (pi resolves an env var name). */
|
|
19
|
-
export declare function piProviderConfig(gatewayUrl: string, catalog: CatalogModel[]): Record<string, unknown>;
|
|
20
|
-
/** Rewrite everything Codiedev owns in the managed agent dir. Sessions (and
|
|
21
|
-
* anything else pi keeps there) are left alone. Returns the extensions to load. */
|
|
22
|
-
export declare function prepareManagedPiDir(opts: {
|
|
23
|
-
agentDir: string;
|
|
24
|
-
gatewayUrl: string;
|
|
25
|
-
catalog: CatalogModel[];
|
|
26
|
-
model?: string;
|
|
27
|
-
skillPaths?: string[];
|
|
28
|
-
agentSecurityEnabled: boolean;
|
|
29
|
-
}): string[];
|
|
30
|
-
/** The child env: no provider credentials, pi pointed at the managed dir. */
|
|
31
|
-
export declare function managedPiEnv(env: NodeJS.ProcessEnv, agentDir: string, key: string, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
|
|
32
|
-
export declare class ManagedPiArgError extends Error {
|
|
33
|
-
}
|
|
34
|
-
/** Refuse what would bring other credentials or code into the session, then
|
|
35
|
-
* pin extension loading to the managed extensions. */
|
|
36
|
-
export declare function managedPiArgs(args: string[], extensions: string[]): string[];
|
|
37
|
-
export declare function runManagedPi(opts: {
|
|
38
|
-
args: string[];
|
|
39
|
-
key: string;
|
|
40
|
-
gatewayUrl: string;
|
|
41
|
-
catalog: CatalogModel[];
|
|
42
|
-
stateDir: string;
|
|
43
|
-
skillPaths?: string[];
|
|
44
|
-
agentSecurityEnabled: boolean;
|
|
45
|
-
env?: NodeJS.ProcessEnv;
|
|
46
|
-
/** Test seam: resolve the pi CLI entry without installing. */
|
|
47
|
-
resolvePi?: () => string;
|
|
48
|
-
}): number;
|
package/dist/mcp.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Codiedev MCP server.
|
|
4
|
-
*
|
|
5
|
-
* Exposes the Codiedev artifact-collaboration surface as Model Context
|
|
6
|
-
* Protocol tools so Claude Code / Codex / any MCP-capable agent can invoke
|
|
7
|
-
* them natively from natural language (e.g. "push the spec we just worked on").
|
|
8
|
-
*
|
|
9
|
-
* Reads the same ~/.codiedev/config.json the CLI uses. Install + wire up by
|
|
10
|
-
* running `npx codiedev connect`.
|
|
11
|
-
*/
|
|
12
|
-
export {};
|
package/dist/nativeSteering.d.ts
DELETED
package/dist/packs/codie.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface CodiePackConfig {
|
|
2
|
-
skillPaths: string[];
|
|
3
|
-
agents: Record<string, {
|
|
4
|
-
description: string;
|
|
5
|
-
prompt: string;
|
|
6
|
-
mode: "subagent";
|
|
7
|
-
model?: string;
|
|
8
|
-
}>;
|
|
9
|
-
plugins: string[];
|
|
10
|
-
notes: string[];
|
|
11
|
-
}
|
|
12
|
-
/** A model the account approves, as Codie's catalog lists it. */
|
|
13
|
-
export interface LevelCatalogModel {
|
|
14
|
-
id: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
cost?: {
|
|
17
|
-
input: number;
|
|
18
|
-
output: number;
|
|
19
|
-
};
|
|
20
|
-
tier?: string;
|
|
21
|
-
level?: string;
|
|
22
|
-
}
|
|
23
|
-
/** Resolve an agent level (opus = Strongest, sonnet = Balanced, haiku =
|
|
24
|
-
* Fastest) to one of the account's approved models:
|
|
25
|
-
* 1. explicit tier/level metadata on the catalog entry, when the gateway sends it
|
|
26
|
-
* 2. the same model family by name (e.g. a "claude-opus-…" model), newest first
|
|
27
|
-
* 3. by price: Strongest = priciest, Fastest = cheapest, Balanced = in between
|
|
28
|
-
* Otherwise undefined → Codie's governed default. Only catalog ids are returned. */
|
|
29
|
-
export declare function levelToModel(level: string, catalog: LevelCatalogModel[]): {
|
|
30
|
-
model?: string;
|
|
31
|
-
how: string;
|
|
32
|
-
};
|
|
33
|
-
/** Map a Claude agent `model:` to an OpenCode model id, or undefined to let
|
|
34
|
-
* Codie's governed default apply. */
|
|
35
|
-
export declare function mapAgentModel(value: string | undefined, approved?: Set<string>, catalog?: LevelCatalogModel[]): {
|
|
36
|
-
model?: string;
|
|
37
|
-
note?: string;
|
|
38
|
-
};
|
|
39
|
-
export declare function codiePackConfig(root: string, options?: {
|
|
40
|
-
approvedModels?: Set<string>;
|
|
41
|
-
catalog?: LevelCatalogModel[];
|
|
42
|
-
}): CodiePackConfig;
|
|
43
|
-
/** Merge pack config into an OpenCode config without clobbering anything the
|
|
44
|
-
* user or Codie already set: existing skill paths, agents and plugins win. */
|
|
45
|
-
export declare function mergeCodiePackConfig(existing: Record<string, any>, packs: CodiePackConfig): Record<string, any>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { PackManifest } from "./manifest";
|
|
2
|
-
import { RegistryEntry } from "./store";
|
|
3
|
-
export declare const HARNESSES: readonly ["claude", "copilot", "codex", "cursor", "codie", "pi"];
|
|
4
|
-
export type HarnessName = (typeof HARNESSES)[number];
|
|
5
|
-
export interface RunResult {
|
|
6
|
-
status: number | null;
|
|
7
|
-
stdout: string;
|
|
8
|
-
stderr: string;
|
|
9
|
-
error?: string;
|
|
10
|
-
}
|
|
11
|
-
export type Runner = (command: string, args: string[], options?: {
|
|
12
|
-
cwd?: string;
|
|
13
|
-
}) => RunResult;
|
|
14
|
-
export declare function defaultRunner(env: NodeJS.ProcessEnv): Runner;
|
|
15
|
-
/** True when `bin` is an executable file on `env.PATH`. */
|
|
16
|
-
export declare function onPath(bin: string, env: NodeJS.ProcessEnv): boolean;
|
|
17
|
-
export interface AdapterContext {
|
|
18
|
-
root: string;
|
|
19
|
-
env: NodeJS.ProcessEnv;
|
|
20
|
-
home: string;
|
|
21
|
-
run: Runner;
|
|
22
|
-
manifest: PackManifest;
|
|
23
|
-
pluginDir: string;
|
|
24
|
-
/** Same plugin without agent model levels (Codex, Copilot, Cursor). */
|
|
25
|
-
portablePluginDir: string;
|
|
26
|
-
previous?: RegistryEntry;
|
|
27
|
-
}
|
|
28
|
-
export interface AdapterResult {
|
|
29
|
-
harness: HarnessName;
|
|
30
|
-
status: "ok" | "skipped" | "failed" | "dry-run";
|
|
31
|
-
detail: string;
|
|
32
|
-
/** Debug-level notes (printed with CODIEDEV_DEBUG; always in --json). */
|
|
33
|
-
notes?: string[];
|
|
34
|
-
}
|
|
35
|
-
export interface Adapter {
|
|
36
|
-
name: HarnessName;
|
|
37
|
-
detect(ctx: Omit<AdapterContext, "manifest" | "pluginDir" | "portablePluginDir" | "previous">): boolean;
|
|
38
|
-
/** Returns a short success detail; throws on failure. */
|
|
39
|
-
install(ctx: AdapterContext): string;
|
|
40
|
-
/** Human-readable description of what install would do (for --dry-run). */
|
|
41
|
-
plan(ctx: AdapterContext): string;
|
|
42
|
-
/** Remove the pack from this tool. Returns a detail; throws on failure. */
|
|
43
|
-
uninstall(ctx: UninstallContext): string;
|
|
44
|
-
}
|
|
45
|
-
export interface UninstallContext {
|
|
46
|
-
root: string;
|
|
47
|
-
env: NodeJS.ProcessEnv;
|
|
48
|
-
home: string;
|
|
49
|
-
run: Runner;
|
|
50
|
-
slug: string;
|
|
51
|
-
}
|
|
52
|
-
export declare const claudeAdapter: Adapter;
|
|
53
|
-
export declare const copilotAdapter: Adapter;
|
|
54
|
-
export declare const codexAdapter: Adapter;
|
|
55
|
-
export declare const CURSOR_MARKER = ".codiedev-pack";
|
|
56
|
-
/** Fallback: copy skills to ~/.cursor/skills/<name>/, never overwriting a
|
|
57
|
-
* skill dir Codiedev didn't write, and pruning ones this pack no longer has. */
|
|
58
|
-
export declare function copyCursorSkills(home: string, manifest: PackManifest, pluginDirPath: string): string[];
|
|
59
|
-
/** Remove every ~/.cursor/skills dir this pack's fallback copy wrote. */
|
|
60
|
-
export declare function removeCursorSkills(home: string, slug: string): number;
|
|
61
|
-
export declare function cursorLocalPluginsDir(home: string): string;
|
|
62
|
-
export declare function cursorPluginDir(home: string, slug: string): string;
|
|
63
|
-
/** Copy the plugin dir into place via a sibling temp dir + rename. Refuses to
|
|
64
|
-
* replace a dir that doesn't carry our marker for this pack. */
|
|
65
|
-
export declare function installCursorPlugin(home: string, slug: string, sourceDir: string): string;
|
|
66
|
-
/** Remove our copy (only when it carries our marker). */
|
|
67
|
-
export declare function removeCursorPlugin(home: string, slug: string): boolean;
|
|
68
|
-
export declare const cursorAdapter: Adapter;
|
|
69
|
-
export declare const codieAdapter: Adapter;
|
|
70
|
-
/** pi has no plugin system; it loads extra skill dirs from settings.json
|
|
71
|
-
* `skills`. Point it at the portable copy (no Claude model aliases). */
|
|
72
|
-
export declare const piAdapter: Adapter;
|
|
73
|
-
export declare const ADAPTERS: Adapter[];
|
|
74
|
-
export declare function parseHarnessList(value: string | undefined): HarnessName[] | undefined;
|
package/dist/packs/hookGate.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from "child_process";
|
|
2
|
-
/** Skill names a hook payload shows as running, across the five tools:
|
|
3
|
-
* - Claude: tool_name "Skill", tool_input.skill "<plugin>:<name>"
|
|
4
|
-
* - Copilot: tool_name "skill", tool_input.skill "<name>" (also camelCase toolName/toolArgs)
|
|
5
|
-
* - Codie: tool_name "skill", tool_input.name "<name>"
|
|
6
|
-
* - Cursor: tool_name "Read", tool_input.file_path ".../skills/<name>/SKILL.md"
|
|
7
|
-
* - Codex: tool_name "Bash", tool_input.command containing ".../skills/<name>/SKILL.md" */
|
|
8
|
-
export declare function skillsFromPayload(payload: unknown): string[];
|
|
9
|
-
export interface GateArgs {
|
|
10
|
-
skills: string[];
|
|
11
|
-
/** `-- <argv…>`: exec'd directly (legacy `sh -c '<cmd>'` included). */
|
|
12
|
-
command: string[];
|
|
13
|
-
/** `--cmd-b64 <base64url>`: a command line for the platform shell. */
|
|
14
|
-
cmdB64?: string;
|
|
15
|
-
}
|
|
16
|
-
/** Largest decoded `--cmd-b64` command we run. */
|
|
17
|
-
export declare const MAX_GATED_COMMAND_BYTES: number;
|
|
18
|
-
/** Canonical form (what the portal writes): base64url of the UTF-8 command, no
|
|
19
|
-
* padding. Only [A-Za-z0-9_-], so no shell on any platform expands or
|
|
20
|
-
* re-quotes it — a `$(…)` in the gated command can't run before the gate. */
|
|
21
|
-
export declare function encodeGatedCommand(command: string): string;
|
|
22
|
-
/** Strict decode: canonical base64url only, ≤16KB, valid UTF-8, no NUL. */
|
|
23
|
-
export declare function decodeGatedCommand(value: string): string;
|
|
24
|
-
export declare function parseGateArgs(argv: string[]): GateArgs;
|
|
25
|
-
export declare function gateMatches(skills: string[], payload: unknown): boolean;
|
|
26
|
-
export interface GatePlan {
|
|
27
|
-
file: string;
|
|
28
|
-
args: string[];
|
|
29
|
-
/** cmd.exe needs its /c line passed verbatim (Node would re-quote it). */
|
|
30
|
-
verbatim?: boolean;
|
|
31
|
-
note?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface PlanOptions {
|
|
34
|
-
platform?: NodeJS.Platform;
|
|
35
|
-
env?: NodeJS.ProcessEnv;
|
|
36
|
-
/** Whether `sh` is runnable (only consulted for the legacy form on Windows). */
|
|
37
|
-
hasSh?: () => boolean;
|
|
38
|
-
}
|
|
39
|
-
/** Split a CODIEDEV_HOOK_SHELL value ("pwsh -NoProfile -Command") into argv,
|
|
40
|
-
* honouring simple "double" or 'single' quotes. */
|
|
41
|
-
export declare function splitShellOverride(value: string): string[];
|
|
42
|
-
/** The decoded `--cmd-b64` command line, run by the platform shell
|
|
43
|
-
* (/bin/sh -c on POSIX, cmd.exe /d /s /c on Windows, or CODIEDEV_HOOK_SHELL). */
|
|
44
|
-
export declare function planShellCommand(line: string, options?: PlanOptions): GatePlan;
|
|
45
|
-
/** `-- <argv…>`: exec'd directly, no shell. Legacy `sh -c '<cmd>'` (packs saved
|
|
46
|
-
* before --cmd-b64) runs as given, except on Windows without sh, where <cmd>
|
|
47
|
-
* goes to cmd.exe. */
|
|
48
|
-
export declare function planGateCommand(command: string[], options?: PlanOptions): GatePlan;
|
|
49
|
-
/** Returns the exit status to use. */
|
|
50
|
-
export declare function runHookGate(argv: string[], stdin: string, env?: NodeJS.ProcessEnv, options?: Omit<PlanOptions, "env"> & {
|
|
51
|
-
spawn?: typeof spawnSync;
|
|
52
|
-
}): number;
|
|
53
|
-
export declare function runHookGateCli(argv: string[]): void;
|
package/dist/packs/install.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { CodexHookTrustEntry } from "../codexHookTrust";
|
|
2
|
-
import { AdapterResult, HarnessName, Runner } from "./harnesses";
|
|
3
|
-
import { PackManifest } from "./manifest";
|
|
4
|
-
import { Registry } from "./store";
|
|
5
|
-
export interface InstallOptions {
|
|
6
|
-
manifests: PackManifest[];
|
|
7
|
-
harnesses?: HarnessName[];
|
|
8
|
-
dryRun?: boolean;
|
|
9
|
-
env?: NodeJS.ProcessEnv;
|
|
10
|
-
home?: string;
|
|
11
|
-
run?: Runner;
|
|
12
|
-
now?: () => number;
|
|
13
|
-
}
|
|
14
|
-
export interface PackInstallResult {
|
|
15
|
-
slug: string;
|
|
16
|
-
channel?: string;
|
|
17
|
-
version: number;
|
|
18
|
-
contentHash: string;
|
|
19
|
-
dir: string;
|
|
20
|
-
files: string[];
|
|
21
|
-
results: AdapterResult[];
|
|
22
|
-
harnesses: string[];
|
|
23
|
-
}
|
|
24
|
-
/** Where Codex unpacked this pack's hooks.json after `codex plugin add`. */
|
|
25
|
-
export declare function codexPackHooksPath(codexDir: string, slug: string, version: number): string | null;
|
|
26
|
-
/** Trust entries for every registry pack installed into Codex. */
|
|
27
|
-
export declare function codexPackTrustEntries(registry: Registry, codexDir: string): Map<string, CodexHookTrustEntry[]>;
|
|
28
|
-
export declare function installPacks(options: InstallOptions): PackInstallResult[];
|
|
29
|
-
export interface UninstallOptions {
|
|
30
|
-
slugs: string[];
|
|
31
|
-
env?: NodeJS.ProcessEnv;
|
|
32
|
-
home?: string;
|
|
33
|
-
run?: Runner;
|
|
34
|
-
}
|
|
35
|
-
export interface PackUninstallResult {
|
|
36
|
-
slug: string;
|
|
37
|
-
results: AdapterResult[];
|
|
38
|
-
}
|
|
39
|
-
/** Remove packs that no longer apply (unassigned or archived): run each
|
|
40
|
-
* tool's uninstall, drop the plugin dir, the marketplace entry, the registry
|
|
41
|
-
* entry, its Codex trust entries and its shim hooks. Unknown slugs are a
|
|
42
|
-
* no-op. A tool failing to uninstall never keeps the pack registered — the
|
|
43
|
-
* pack is no longer authorized, so local state must stop advertising it. */
|
|
44
|
-
export declare function uninstallPacks(options: UninstallOptions): PackUninstallResult[];
|
|
45
|
-
export declare function formatUninstallLines(results: PackUninstallResult[]): string[];
|
|
46
|
-
export declare function formatResultLines(results: PackInstallResult[]): string[];
|