codiedev 0.10.0-beta.4 → 0.10.0-beta.6

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.
Files changed (157) hide show
  1. package/README.md +11 -5
  2. package/assets/tui-brand-plugin.tsx +14 -2
  3. package/dist/backup/cache.js +1 -5
  4. package/dist/backup/match.js +0 -6
  5. package/dist/backup/run.js +3 -35
  6. package/dist/captureExclusions.js +0 -12
  7. package/dist/captureLog.js +0 -28
  8. package/dist/captureReadiness.js +0 -58
  9. package/dist/captureSignals.js +68 -3
  10. package/dist/cli.js +75 -64
  11. package/dist/codexHookTrust.js +125 -6
  12. package/dist/codexLimitScan.js +2 -109
  13. package/dist/codie.js +50 -114
  14. package/dist/codieBrandInstall.js +0 -18
  15. package/dist/codieLauncher.js +20 -92
  16. package/dist/codieRuntime.js +19 -23
  17. package/dist/codieRuntimeInstall.js +108 -23
  18. package/dist/codieUsage.js +38 -41
  19. package/dist/commands/agentTemplates.generated.js +136 -0
  20. package/dist/commands/agents.js +1066 -0
  21. package/dist/commands/agentsSdk.generated.js +7 -0
  22. package/dist/commands/ask.js +0 -3
  23. package/dist/commands/capture.js +0 -2
  24. package/dist/commands/createTicket.js +0 -10
  25. package/dist/commands/doctor.js +53 -120
  26. package/dist/commands/evals.js +187 -0
  27. package/dist/commands/inbox.js +0 -2
  28. package/dist/commands/library.js +0 -3
  29. package/dist/commands/pack.js +573 -0
  30. package/dist/commands/ping.js +0 -2
  31. package/dist/commands/pull.js +6 -10
  32. package/dist/commands/push.js +2 -12
  33. package/dist/commands/search.js +0 -4
  34. package/dist/commands/send.js +0 -5
  35. package/dist/commands/share.js +0 -4
  36. package/dist/commands/shared.js +0 -35
  37. package/dist/commands/traces.js +344 -0
  38. package/dist/commands/tracesLabel.js +348 -0
  39. package/dist/configDir.js +0 -10
  40. package/dist/connect.js +19 -116
  41. package/dist/connectFlow.js +0 -9
  42. package/dist/copilotHooks.js +391 -0
  43. package/dist/copilotInstallation.js +64 -0
  44. package/dist/cursorHooks.js +38 -30
  45. package/dist/cursorLifecycle.js +109 -0
  46. package/dist/detection.js +0 -30
  47. package/dist/harnessDirs.js +77 -0
  48. package/dist/hook.js +182 -469
  49. package/dist/inboxFormat.js +0 -24
  50. package/dist/launchContext.js +150 -0
  51. package/dist/launcher.js +140 -0
  52. package/dist/limitEvent.js +41 -35
  53. package/dist/limitEventReporter.js +1 -1
  54. package/dist/managedPi.js +240 -0
  55. package/dist/mcp.js +3 -384
  56. package/dist/nativeSteering.js +24 -0
  57. package/dist/packs/codie.js +182 -0
  58. package/dist/packs/harnesses.js +411 -0
  59. package/dist/packs/hookGate.js +256 -0
  60. package/dist/packs/install.js +286 -0
  61. package/dist/packs/manifest.js +126 -0
  62. package/dist/packs/paths.js +81 -0
  63. package/dist/packs/shim.js +214 -0
  64. package/dist/packs/store.js +155 -0
  65. package/dist/packs/sync.js +170 -0
  66. package/dist/piHooks.js +216 -0
  67. package/dist/piRuntime.js +120 -0
  68. package/dist/repoResolver.js +0 -19
  69. package/dist/secret.js +0 -3
  70. package/dist/selfUpdate.js +376 -0
  71. package/dist/skillMarker.js +23 -0
  72. package/dist/subagents.js +135 -0
  73. package/dist/teamSkillContext.js +10 -0
  74. package/dist/transcriptModels.js +6 -8
  75. package/dist/upgradeNudge.js +0 -30
  76. package/dist/utils.js +494 -824
  77. package/dist/version.js +0 -10
  78. package/dist/versionCheck.js +0 -33
  79. package/package.json +8 -9
  80. package/dist/backup/cache.d.ts +0 -14
  81. package/dist/backup/match.d.ts +0 -2
  82. package/dist/backup/run.d.ts +0 -25
  83. package/dist/captureExclusions.d.ts +0 -30
  84. package/dist/captureLog.d.ts +0 -20
  85. package/dist/captureReadiness.d.ts +0 -65
  86. package/dist/captureSignals.d.ts +0 -19
  87. package/dist/cli.d.ts +0 -16
  88. package/dist/codexHookTrust.d.ts +0 -34
  89. package/dist/codexLimitScan.d.ts +0 -64
  90. package/dist/codie.d.ts +0 -2
  91. package/dist/codieBrandInstall.d.ts +0 -11
  92. package/dist/codieLauncher.d.ts +0 -86
  93. package/dist/codieRuntime.d.ts +0 -29
  94. package/dist/codieRuntimeInstall.d.ts +0 -28
  95. package/dist/codieStartup.d.ts +0 -26
  96. package/dist/codieStartup.js +0 -30
  97. package/dist/codieUsage.d.ts +0 -57
  98. package/dist/commands/ask.d.ts +0 -1
  99. package/dist/commands/capture.d.ts +0 -14
  100. package/dist/commands/createTicket.d.ts +0 -27
  101. package/dist/commands/delete.d.ts +0 -1
  102. package/dist/commands/doctor.d.ts +0 -1
  103. package/dist/commands/inbox.d.ts +0 -3
  104. package/dist/commands/library.d.ts +0 -2
  105. package/dist/commands/note.d.ts +0 -1
  106. package/dist/commands/ping.d.ts +0 -1
  107. package/dist/commands/promote.d.ts +0 -1
  108. package/dist/commands/promote.js +0 -53
  109. package/dist/commands/pull.d.ts +0 -2
  110. package/dist/commands/push.d.ts +0 -33
  111. package/dist/commands/react.d.ts +0 -2
  112. package/dist/commands/react.js +0 -40
  113. package/dist/commands/reverseTicket.d.ts +0 -2
  114. package/dist/commands/reverseTicket.js +0 -477
  115. package/dist/commands/search.d.ts +0 -2
  116. package/dist/commands/security.d.ts +0 -1
  117. package/dist/commands/security.js +0 -156
  118. package/dist/commands/send.d.ts +0 -2
  119. package/dist/commands/share.d.ts +0 -2
  120. package/dist/commands/shared.d.ts +0 -64
  121. package/dist/configDir.d.ts +0 -1
  122. package/dist/connect.d.ts +0 -1
  123. package/dist/connectFlow.d.ts +0 -13
  124. package/dist/cursorHooks.d.ts +0 -23
  125. package/dist/detection.d.ts +0 -30
  126. package/dist/hook.d.ts +0 -6
  127. package/dist/inboxFormat.d.ts +0 -38
  128. package/dist/limitEvent.d.ts +0 -16
  129. package/dist/limitEventReporter.d.ts +0 -21
  130. package/dist/mcp.d.ts +0 -12
  131. package/dist/prUrl.d.ts +0 -9
  132. package/dist/prUrl.js +0 -33
  133. package/dist/repoResolver.d.ts +0 -17
  134. package/dist/secret.d.ts +0 -1
  135. package/dist/security.d.ts +0 -102
  136. package/dist/security.js +0 -437
  137. package/dist/securityDeepScan.d.ts +0 -41
  138. package/dist/securityDeepScan.js +0 -248
  139. package/dist/securityDoctor.d.ts +0 -32
  140. package/dist/securityDoctor.js +0 -63
  141. package/dist/securityFeature.d.ts +0 -5
  142. package/dist/securityFeature.js +0 -7
  143. package/dist/securityInstall.d.ts +0 -63
  144. package/dist/securityInstall.js +0 -239
  145. package/dist/securityInventory.d.ts +0 -54
  146. package/dist/securityInventory.js +0 -556
  147. package/dist/securityPilot.d.ts +0 -19
  148. package/dist/securityPilot.js +0 -61
  149. package/dist/securityPolicy.d.ts +0 -33
  150. package/dist/securityPolicy.js +0 -188
  151. package/dist/securitySession.d.ts +0 -6
  152. package/dist/securitySession.js +0 -72
  153. package/dist/transcriptModels.d.ts +0 -18
  154. package/dist/upgradeNudge.d.ts +0 -25
  155. package/dist/utils.d.ts +0 -346
  156. package/dist/version.d.ts +0 -1
  157. package/dist/versionCheck.d.ts +0 -68
@@ -1,64 +0,0 @@
1
- import { CodiedevConfig } from "../utils";
2
- /**
3
- * Layer per-command env overrides on top of the on-disk config. Useful for
4
- * ad-hoc testing — point a prod-connected CLI at a dev Convex deployment
5
- * without re-running `codiedev connect`. Both CODIEDEV_URL and CODIEDEV_TOKEN
6
- * must be set together (half-overrides would mismatch URL and auth realm).
7
- * Other fields (companyId, repos[]) come from the file unchanged.
8
- */
9
- export declare function applyConfigEnvOverrides(config: CodiedevConfig): CodiedevConfig;
10
- /**
11
- * Require a connected Codiedev config. Exits the process with a helpful
12
- * message if the user hasn't run `codiedev connect` yet.
13
- */
14
- export declare function requireConfig(): CodiedevConfig;
15
- /**
16
- * Perform an authenticated HTTP request against the Codiedev backend.
17
- * Returns the parsed JSON response body. Throws on non-2xx.
18
- */
19
- export declare function apiRequest<T = unknown>(method: "GET" | "POST", path: string, options: {
20
- config: CodiedevConfig;
21
- body?: Record<string, unknown>;
22
- query?: Record<string, string | number | undefined>;
23
- }): Promise<T>;
24
- /**
25
- * Fire-and-forget per-invocation telemetry from CLI subcommands. Mirrors
26
- * the MCP server's emitTelemetry but stamps `source: "cli"` so adoption
27
- * dashboards can distinguish between the two surfaces. Never blocks the
28
- * user's command, never throws — telemetry must not change behavior.
29
- */
30
- export declare function recordAgentEvent(config: CodiedevConfig, event: {
31
- tool: string;
32
- ok: boolean;
33
- latencyMs: number;
34
- error?: string;
35
- }): void;
36
- /**
37
- * Per-step install telemetry for `npx codiedev connect`. One row per phase
38
- * (started, detect, install_target, validate_token, completed, failed) so
39
- * the admin company page can show a timeline when a customer says "it says
40
- * connected but it doesn't work." Fire-and-forget, never throws. Auto-stamps
41
- * platform + node + cli version so call sites only need step/target/ok/error.
42
- */
43
- export type InstallTelemetryStep = "started" | "detect" | "install_target" | "validate_token" | "completed" | "failed";
44
- export declare function recordInstallEvent(config: CodiedevConfig, event: {
45
- step: InstallTelemetryStep;
46
- target?: string;
47
- ok: boolean;
48
- error?: string;
49
- }): void;
50
- /**
51
- * Wraps a CLI subcommand body so success and failure both record telemetry
52
- * and the original error propagates after the event is queued. Use this in
53
- * each `runXxx` command instead of inline timing + try/catch boilerplate.
54
- */
55
- export declare function withTelemetry<T>(config: CodiedevConfig, tool: string, fn: () => Promise<T>): Promise<T>;
56
- /**
57
- * Relative-time formatter for inbox / listing output.
58
- */
59
- export declare function timeAgo(ts: number): string;
60
- /**
61
- * Strip surrounding quotes from a CLI argument if the user wrapped it.
62
- * `codiedev ping <name> "hey"` on some shells passes the quotes through.
63
- */
64
- export declare function stripQuotes(s: string): string;
@@ -1 +0,0 @@
1
- export declare function codiedevStateDir(): string;
package/dist/connect.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function runConnect(args?: string[]): Promise<void>;
@@ -1,13 +0,0 @@
1
- import type { CodiedevConfig } from "./utils";
2
- export type ConnectTokenSource = "reused" | "prompt-required";
3
- export interface ConnectTokenInput {
4
- savedConfig: CodiedevConfig | null;
5
- force: boolean;
6
- }
7
- export type ConnectTokenResult = {
8
- source: "reused";
9
- token: string;
10
- } | {
11
- source: "prompt-required";
12
- };
13
- export declare function resolveConnectToken(input: ConnectTokenInput): ConnectTokenResult;
@@ -1,23 +0,0 @@
1
- /** Cursor's native hook payload is close to Claude Code's, but its stable
2
- * conversation identifier and several tool fields use different names. Keep
3
- * the translation at the process boundary so the shared capture/security
4
- * pipeline never has to guess which surface produced an event. */
5
- export declare function normalizeCursorHookInput<T extends Record<string, unknown>>(input: T): T & Record<string, unknown>;
6
- /** Cursor stores JSONL message roles in `role`; the shared capture pipeline
7
- * uses Claude's top-level `type` discriminator. Preserve all original fields
8
- * and add only that discriminator so the existing parsers see real messages. */
9
- export declare function normalizeCursorTranscript(content: string): string;
10
- /** Cursor may change its private JSONL record shape independently of the hook
11
- * contract. Only a byte-empty snapshot is safe to discard; a non-empty file
12
- * that the current normalizer cannot parse must still be uploaded for backend
13
- * recovery and diagnosis. */
14
- export declare function isCursorTranscriptEmpty(content: string): boolean;
15
- export declare function cursorPreToolBlockResponse(reason: string): {
16
- permission: "deny";
17
- user_message: string;
18
- agent_message: string;
19
- };
20
- export declare function cursorPromptBlockResponse(reason: string): {
21
- continue: false;
22
- user_message: string;
23
- };
@@ -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/hook.d.ts DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare function buildDiscoveryContext(skills: Array<{
3
- key: string;
4
- title: string;
5
- score: number;
6
- }>): string | null;
@@ -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[];
@@ -1,16 +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
- /**
11
- * Codex writes a structured RateLimitSnapshot on token_count events. A normal
12
- * turn has `rate_limit_reached_type: null`; a blocked turn names the exact
13
- * boundary. Reading that field avoids locale-dependent terminal copy.
14
- */
15
- export declare function parseCodexLimitEventFromTranscript(transcript: string): LimitEvent | null;
16
- 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";
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/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/prUrl.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export type GitProvider = "github" | "gitlab";
2
- export interface PrOrMrRef {
3
- provider: GitProvider;
4
- host: string;
5
- owner: string;
6
- repo: string;
7
- number: number;
8
- }
9
- export declare function parsePrOrMrUrl(url: string): PrOrMrRef | null;
package/dist/prUrl.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- // PR/MR URL parser. GitHub uses `/pull/<n>`, GitLab uses `/-/merge_requests/<n>`.
3
- // Self-hosted GitLab keeps the same path shape on a different host (Sonifi
4
- // runs git.sonifi.com behind a Cloudflare tunnel, for example). Nested groups
5
- // land in `owner` as a slash-joined path so we can rebuild the full project
6
- // path when calling the GitLab API.
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.parsePrOrMrUrl = parsePrOrMrUrl;
9
- function parsePrOrMrUrl(url) {
10
- if (!url)
11
- return null;
12
- const gh = url.match(/^https?:\/\/([^/]+)\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:[/?#]|$)/);
13
- if (gh && /github/i.test(gh[1])) {
14
- return {
15
- provider: "github",
16
- host: gh[1],
17
- owner: gh[2],
18
- repo: gh[3],
19
- number: Number(gh[4]),
20
- };
21
- }
22
- const gl = url.match(/^https?:\/\/([^/]+)\/(.+)\/([^/]+)\/-\/merge_requests\/(\d+)(?:[/?#]|$)/);
23
- if (gl) {
24
- return {
25
- provider: "gitlab",
26
- host: gl[1],
27
- owner: gl[2],
28
- repo: gl[3],
29
- number: Number(gl[4]),
30
- };
31
- }
32
- return null;
33
- }
@@ -1,17 +0,0 @@
1
- export type ResolveSource = "provided" | "resolved" | "unmatched";
2
- export interface RepoLite {
3
- _id: string;
4
- owner: string;
5
- name: string;
6
- gitProvider?: "github" | "gitlab";
7
- }
8
- export interface ResolveInput {
9
- remoteUrl: string | null | undefined;
10
- providedRepoId: string | null;
11
- companyRepos: ReadonlyArray<RepoLite>;
12
- }
13
- export interface ResolveResult {
14
- repoId: string | null;
15
- source: ResolveSource;
16
- }
17
- export declare function resolveRepoForCapture(input: ResolveInput): ResolveResult;
package/dist/secret.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function maskToken(token: string | null | undefined): string;
@@ -1,102 +0,0 @@
1
- export type SecurityHookPhase = "pre" | "post" | "failure";
2
- export type AgentSurface = "claude-code" | "codex" | "cursor" | "codie-harness";
3
- export declare const SECURITY_RUNTIME_VERSION = 1;
4
- export interface RawSecurityHookInput {
5
- session_id?: string;
6
- sessionId?: string;
7
- cwd?: string;
8
- hook_event_name?: string;
9
- hookEventName?: string;
10
- tool_name?: string;
11
- toolName?: string;
12
- tool_input?: unknown;
13
- toolInput?: unknown;
14
- tool_response?: unknown;
15
- toolResponse?: unknown;
16
- tool_use_id?: string;
17
- toolUseId?: string;
18
- duration_ms?: number;
19
- durationMs?: number;
20
- error?: unknown;
21
- prompt?: string;
22
- }
23
- export interface SecurityWorkflowEvent {
24
- schemaVersion: 1;
25
- source: AgentSurface;
26
- phase: SecurityHookPhase;
27
- sessionId: string;
28
- toolName: string;
29
- toolUseId?: string;
30
- cwd?: string;
31
- observedAt: number;
32
- toolDurationMs?: number;
33
- payload: unknown;
34
- redactionCount: number;
35
- localDecision?: LocalSecurityAction;
36
- localCategory?: LocalSecurityDecision["category"];
37
- endpointId?: string;
38
- endpointName?: string;
39
- cliVersion?: string;
40
- securityRuntimeVersion?: number;
41
- securityPolicyVersion?: number;
42
- }
43
- export type LocalSecurityAction = "allow" | "alert" | "block";
44
- export type SecurityCategory = "secret_in_prompt" | "secret_exfiltration" | "destructive_outside_workspace" | "sensitive_file_read" | "sensitive_file_write" | "protected_agent_config_write" | "unapproved_network_egress" | "untrusted_mcp_tool" | "unapproved_command" | "obfuscated_shell_command" | "package_install" | "sensitive_read_then_egress";
45
- export interface EndpointSecurityPolicy {
46
- schemaVersion: 1;
47
- policyVersion: number;
48
- enforcementMode: "alert" | "block";
49
- rules: Partial<Record<SecurityCategory, LocalSecurityAction>>;
50
- constraints?: {
51
- allowedMcpServers?: string[];
52
- allowedHosts?: string[];
53
- allowedCommands?: string[];
54
- };
55
- exceptions: Array<{
56
- scope: "company" | "user" | "source" | "repository" | "tool" | "category";
57
- scopeValue: string;
58
- }>;
59
- fetchedAt: number;
60
- signature?: {
61
- algorithm: "Ed25519";
62
- keyId: string;
63
- signedAt: number;
64
- value: string;
65
- };
66
- }
67
- export interface LocalSecurityDecision {
68
- action: LocalSecurityAction;
69
- category?: SecurityCategory;
70
- reason?: string;
71
- }
72
- export declare function withEndpointIdentity(event: SecurityWorkflowEvent, identity: {
73
- endpointId?: string;
74
- endpointName?: string;
75
- cliVersion?: string;
76
- securityRuntimeVersion?: number;
77
- securityPolicyVersion?: number;
78
- }): SecurityWorkflowEvent;
79
- /**
80
- * Runs before a user prompt reaches the model. This is intentionally narrow:
81
- * block credential material, but allow safe references such as
82
- * `$OPENAI_API_KEY` so developers can ask agents to use environment variables
83
- * without pasting their values.
84
- */
85
- export declare function evaluatePromptSecurity(prompt: string | undefined, policy?: EndpointSecurityPolicy, source?: AgentSurface): LocalSecurityDecision;
86
- /** Runs synchronously before a tool executes. No network or model is involved. */
87
- export declare function evaluateToolSecurity(input: RawSecurityHookInput, phase: SecurityHookPhase, policy?: EndpointSecurityPolicy, source?: AgentSurface, sessionContext?: {
88
- sensitiveReadAt?: number;
89
- now?: number;
90
- }): LocalSecurityDecision;
91
- export declare function securityInputHasSensitivePath(input: RawSecurityHookInput): boolean;
92
- export declare function buildSecurityWorkflowEvent(input: RawSecurityHookInput, phase: SecurityHookPhase, source: AgentSurface, now?: () => number): SecurityWorkflowEvent | null;
93
- /**
94
- * Captures the intent side of the causal chain without weakening the local
95
- * privacy boundary. A prompt that the deterministic policy blocks never
96
- * becomes an uploadable event; allowed prompts are redacted and bounded using
97
- * the same sanitizer as tool payloads.
98
- */
99
- export declare function buildSecurityPromptEvent(input: Pick<RawSecurityHookInput, "session_id" | "sessionId" | "cwd" | "prompt">, source: AgentSurface, now?: () => number, policy?: EndpointSecurityPolicy): SecurityWorkflowEvent | null;
100
- /** Audit-safe evidence for a blocked prompt. The secret-bearing prompt is
101
- * intentionally omitted; administrators still see that prevention occurred. */
102
- export declare function buildBlockedSecurityPromptEvent(input: Pick<RawSecurityHookInput, "session_id" | "sessionId" | "cwd">, source: AgentSurface, category: NonNullable<LocalSecurityDecision["category"]>, now?: () => number): SecurityWorkflowEvent | null;