shortcutxl 0.3.39 → 0.3.40

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 (73) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/app/agent-session.d.ts +17 -17
  3. package/dist/app/approvals/session-auto-approve.d.ts +26 -0
  4. package/dist/app/approvals/tool-approval.d.ts +18 -0
  5. package/dist/app/approvals/types.d.ts +17 -0
  6. package/dist/app/constants.d.ts +0 -4
  7. package/dist/app/credits/credit-gate.d.ts +0 -5
  8. package/dist/app/extensions/runner.d.ts +2 -2
  9. package/dist/app/extensions/types.d.ts +2 -1
  10. package/dist/app/index.d.ts +2 -1
  11. package/dist/app/observability/client-logging/client-logger.d.ts +57 -0
  12. package/dist/app/observability/client-logging/context.d.ts +26 -0
  13. package/dist/app/observability/client-logging/index.d.ts +8 -0
  14. package/dist/app/observability/client-logging/session-events.d.ts +4 -0
  15. package/dist/app/observability/client-logging/settings-events.d.ts +5 -0
  16. package/dist/app/observability/client-logging/startup-events.d.ts +18 -0
  17. package/dist/app/observability/client-logging/transport.d.ts +15 -0
  18. package/dist/app/observability/client-logging/types.d.ts +31 -0
  19. package/dist/app/observability/index.d.ts +2 -0
  20. package/dist/app/permissions/approval-surface.d.ts +24 -0
  21. package/dist/app/permissions/capability-catalog.d.ts +17 -0
  22. package/dist/app/permissions/compiler.d.ts +19 -0
  23. package/dist/app/permissions/effective-view.d.ts +23 -0
  24. package/dist/app/permissions/filesystem-policy.d.ts +25 -0
  25. package/dist/app/permissions/permissions-command.d.ts +17 -0
  26. package/dist/app/permissions/policy.d.ts +9 -0
  27. package/dist/app/permissions/require-policy.d.ts +4 -0
  28. package/dist/app/permissions/runtime-approval-flow.d.ts +18 -0
  29. package/dist/app/permissions/settings.d.ts +75 -0
  30. package/dist/app/permissions/tool-gates.d.ts +58 -0
  31. package/dist/app/prompts/com-api-reference.json +215 -146
  32. package/dist/app/sdk.d.ts +7 -2
  33. package/dist/app/session/branch-manager.d.ts +8 -2
  34. package/dist/app/session/compaction/compaction.d.ts +3 -1
  35. package/dist/app/session/extension-lifecycle.d.ts +4 -2
  36. package/dist/app/session/forked-agent.d.ts +3 -1
  37. package/dist/app/session/session-lifecycle.d.ts +16 -3
  38. package/dist/app/session/tool-registry.d.ts +10 -2
  39. package/dist/app/settings-manager.d.ts +23 -7
  40. package/dist/app/tools/execute-code/com-executor.d.ts +7 -1
  41. package/dist/app/tools/index.d.ts +0 -2
  42. package/dist/cli/args.d.ts +6 -3
  43. package/dist/cli.js +1281 -1401
  44. package/dist/core/core-types.d.ts +12 -2
  45. package/dist/core/index.d.ts +1 -0
  46. package/dist/core/permission-capabilities.d.ts +17 -0
  47. package/dist/core/permission-policy.d.ts +65 -0
  48. package/dist/core/session-state.d.ts +13 -0
  49. package/dist/main.d.ts +8 -0
  50. package/dist/remote-control/auto-approve-settings.d.ts +2 -2
  51. package/dist/remote-control/bootstrap.d.ts +3 -0
  52. package/dist/remote-control/index.d.ts +1 -1
  53. package/dist/shared/files/path-utils.d.ts +1 -0
  54. package/dist/shell/approvals/approval.d.ts +3 -5
  55. package/dist/shell/approvals/bash-approval.d.ts +6 -10
  56. package/dist/shell/approvals/file-access-approval.d.ts +10 -0
  57. package/dist/shell/index.d.ts +2 -2
  58. package/dist/shell/session-client.d.ts +2 -2
  59. package/dist/startup/runtime-routing.d.ts +0 -2
  60. package/dist/startup/startup-xll.d.ts +2 -13
  61. package/dist/startup/subagent-bootstrap.d.ts +7 -1
  62. package/dist/tool-names.d.ts +0 -2
  63. package/package.json +1 -7
  64. package/user-docs/dist/index.html +168 -1
  65. package/user-docs/dist/shortcutxl-docs.pdf +0 -0
  66. package/xll/ShortcutXL.xll +0 -0
  67. package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
  68. package/xll/python/Lib/site-packages/pip-26.0.1.dist-info/RECORD +3 -3
  69. package/xll/python/Scripts/httpx.exe +0 -0
  70. package/xll/python/Scripts/pip.exe +0 -0
  71. package/xll/python/Scripts/pip3.12.exe +0 -0
  72. package/xll/python/Scripts/pip3.exe +0 -0
  73. package/xll/python/vcruntime140.dll +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.40]
4
+
5
+ - **Runtime permissions** — New `/permissions` command to review and change what file and shell tools can do. Approve individual workspaces, grant narrower read or read/write exceptions to files and folders outside them, and toggle spreadsheet auto-approve per settings profile.
6
+ - **Skip runtime and spreadsheet permissions** — Explicit `/permissions skip-runtime-permissions` (and matching `--skip-runtime-permissions` / `--skip-spreadsheet-permissions` CLI flags) for when you intentionally want those permission boundaries disabled.
7
+
3
8
  ## [0.3.39]
4
9
 
5
10
  - **Claude Opus 4.7** - Added Claude Opus 4.7 as a selectable Shortcut model with a 1M-token context window.
@@ -14,6 +14,8 @@
14
14
  */
15
15
  import type { ImageContent, Model, TextContent } from '@mariozechner/pi-ai';
16
16
  import type { Agent, AgentEvent, AgentMessage, AgentState, ThinkingLevel, ToolDefinition } from '../core/index.js';
17
+ import type { RuntimePermissionPolicy } from '../core/permission-policy.js';
18
+ import type { SessionAutoApproveState } from './approvals/session-auto-approve.js';
17
19
  import type { ContextUsage, ExtensionSessionSetupStore, InputSource } from './extensions/index.js';
18
20
  import { ExtensionRunner } from './extensions/index.js';
19
21
  import { type FileUploadData } from './file-uploads.js';
@@ -26,7 +28,6 @@ import { type ForkResult, type NavigateTreeResult } from './session/branch-manag
26
28
  import { type CompactionCompleteFn, type CompactionResult } from './session/compaction/index.js';
27
29
  import { type ExtensionBindings } from './session/extension-lifecycle.js';
28
30
  import { type ModelCycleResult } from './session/session-models.js';
29
- import type { SessionObservability } from './session/session-observability.js';
30
31
  import { type SessionStats } from './session/session-stats.js';
31
32
  import type { ProductSessionStore } from './session/session-store-types.js';
32
33
  import { type ToolInfo } from './session/tool-registry.js';
@@ -70,9 +71,6 @@ export type AgentSessionEvent = AgentEvent | {
70
71
  type: 'tool_summary';
71
72
  toolCallId: string;
72
73
  summary: string;
73
- } | {
74
- type: 'run_stats';
75
- stats: import('../server-sse-only/extended-state-types.js').RunStats;
76
74
  };
77
75
  /** Listener function for agent session events */
78
76
  export type AgentSessionEventListener = (event: AgentSessionEvent) => void;
@@ -80,6 +78,7 @@ export interface AgentSessionConfig {
80
78
  agent: Agent;
81
79
  sessionManager: ProductSessionStore;
82
80
  settingsManager: SettingsManager;
81
+ approvalState: SessionAutoApproveState;
83
82
  cwd: string;
84
83
  /** Resource loader for skills, prompts, context files, and internal prompt injection */
85
84
  resourceLoader: ResourceLoader;
@@ -92,6 +91,8 @@ export interface AgentSessionConfig {
92
91
  }>;
93
92
  /** Exact tool names to register initially */
94
93
  initialToolNames?: string[];
94
+ /** Optional initial mode name used to seed runtime permission policy. */
95
+ initialModeName?: string;
95
96
  /** Model registry for API key resolution and model discovery */
96
97
  modelRegistry: ModelRegistry;
97
98
  /** Mutable ref used by Agent to access the current ExtensionRunner */
@@ -108,14 +109,18 @@ export interface AgentSessionConfig {
108
109
  maxToolUses?: number;
109
110
  maxTokens?: number;
110
111
  };
111
- /** Extended state store for SSE-only mode (LangGraph-parity fields). */
112
- extendedStateStore?: import('../server-sse-only/extended-state-store.js').ExtendedStateStore;
113
112
  /** When true, generate follow-up suggestions after each agent turn. Disabled in print/no-session modes. */
114
113
  enableSuggestions?: boolean;
115
114
  /** When true, allow tool summaries on this session surface. Disabled in print/subagent flows. */
116
115
  enableToolSummaries?: boolean;
117
- /** Optional client logging sink for session lifecycle observability. */
118
- observability?: SessionObservability;
116
+ observability?: {
117
+ setSessionId?: (sessionId: string) => void;
118
+ info?: (input: {
119
+ module: string;
120
+ event: string;
121
+ data?: Record<string, unknown>;
122
+ }) => void;
123
+ };
119
124
  }
120
125
  export type { ExtensionBindings } from './session/extension-lifecycle.js';
121
126
  /** Options for AgentSession.prompt() */
@@ -135,6 +140,7 @@ export declare class AgentSession {
135
140
  readonly agent: Agent;
136
141
  readonly sessionManager: ProductSessionStore;
137
142
  readonly settingsManager: SettingsManager;
143
+ readonly approvalState: SessionAutoApproveState;
138
144
  private _unsubscribeAgent?;
139
145
  private _eventListeners;
140
146
  private _agentEventQueue;
@@ -158,8 +164,6 @@ export declare class AgentSession {
158
164
  /** Session-scoped file upload metadata. */
159
165
  private _fileUploads;
160
166
  private _collabClient;
161
- private _runStartMessageCount;
162
- private _runStartTimestamp;
163
167
  private _sheetPool;
164
168
  private _collabAwareness;
165
169
  private _collabSync;
@@ -167,20 +171,18 @@ export declare class AgentSession {
167
171
  /** Fire-and-forget tool-call summary generation. */
168
172
  private _summaryEmitter;
169
173
  private _toolSummaryDiagnostics;
174
+ private _observability?;
170
175
  private _tools;
171
176
  private _models;
172
177
  private _extensions;
173
- private _extendedStateStore?;
174
178
  private _compactionActions;
175
179
  private _compactionTriggerDeps;
176
180
  private _errorRecoveryActions;
177
- private readonly _observability?;
178
181
  constructor(config: AgentSessionConfig);
179
182
  /** Model registry for API key resolution and model discovery */
180
183
  get modelRegistry(): ModelRegistry;
181
184
  getToolSummaryDiagnostics(): ToolSummaryDiagnostic[];
182
- /** Extended state store (SSE-only mode). May be undefined if not configured. */
183
- get extendedStateStore(): import("../server-sse-only/extended-state-store.js").ExtendedStateStore | undefined;
185
+ get permissionPolicy(): RuntimePermissionPolicy;
184
186
  /** Emit an event to all listeners */
185
187
  private _emit;
186
188
  /**
@@ -239,7 +241,6 @@ export declare class AgentSession {
239
241
  awaitPendingSuggestions(): Promise<void>;
240
242
  /** Full agent state */
241
243
  get state(): AgentState;
242
- /** Current model (may be overridden by ExtendedStateStore.modelOverride for credit downgrade) */
243
244
  get model(): Model<any> | undefined;
244
245
  /** Current thinking level */
245
246
  get thinkingLevel(): ThinkingLevel;
@@ -253,7 +254,6 @@ export declare class AgentSession {
253
254
  get fileUploads(): readonly FileUploadData[];
254
255
  /**
255
256
  * Merge new file uploads into session state, deduplicating by name.
256
- * Also syncs to the extended state store when available (SSE-only mode).
257
257
  */
258
258
  addFileUploads(files: FileUploadData[]): void;
259
259
  /**
@@ -272,7 +272,7 @@ export declare class AgentSession {
272
272
  * Changes take effect on the next agent turn.
273
273
  */
274
274
  replaceToolsByName(toolNames: string[]): void;
275
- applyMode(toolNames: string[], systemPrompt: string): void;
275
+ applyMode(toolNames: string[], systemPrompt: string, modeName?: string): void;
276
276
  /** Whether compaction (manual or auto) is currently running */
277
277
  get isCompacting(): boolean;
278
278
  /** Set a pending context refresh query (consumed after the current agent loop ends). */
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Session-scoped auto-approve state.
3
+ *
4
+ * The persisted settings layer owns only the default value for new sessions.
5
+ * The live toggle state belongs to the session and is shared by approval UIs,
6
+ * mode switching, and remote-control flows.
7
+ */
8
+ export interface AutoApproveDefaultsStore {
9
+ getAutoApproveDefault(): boolean;
10
+ setAutoApproveDefault(value: boolean): void;
11
+ getSessionAutoApproveDefault?(): boolean;
12
+ }
13
+ export interface AutoApproveState {
14
+ getAutoApprove(): boolean;
15
+ setAutoApprove(value: boolean): void;
16
+ }
17
+ export declare class SessionAutoApproveState implements AutoApproveState, AutoApproveDefaultsStore {
18
+ private autoApprove;
19
+ private readonly defaults;
20
+ constructor(defaults: AutoApproveDefaultsStore);
21
+ getAutoApprove(): boolean;
22
+ setAutoApprove(value: boolean): void;
23
+ getAutoApproveDefault(): boolean;
24
+ setAutoApproveDefault(value: boolean): void;
25
+ }
26
+ //# sourceMappingURL=session-auto-approve.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generic pre-execution approval gate for tools.
3
+ *
4
+ * Wraps a ToolDefinition with a user-approval prompt before executing.
5
+ */
6
+ import type { TSchema } from '@sinclair/typebox';
7
+ import type { ToolDefinition, ToolExecutionContext } from '../../core/core-types.js';
8
+ import { type ApprovalChoice, type ApprovalGate, type ApprovalRequest } from './types.js';
9
+ export declare function withPreApproval<T extends TSchema, D>(tool: ToolDefinition<T>, approval: ApprovalGate<D>, buildRequest: (params: Record<string, unknown>, ctx: ToolExecutionContext | undefined) => ApprovalRequest<D> | Promise<ApprovalRequest<D>>, options?: {
10
+ isContentSafe?: (params: Record<string, unknown>, ctx: ToolExecutionContext | undefined) => boolean | Promise<boolean>;
11
+ onRequested?: (request: ApprovalRequest<D>) => void;
12
+ onAccepted?: (request: ApprovalRequest<D>, choice: ApprovalChoice) => void;
13
+ onRejected?: (request: ApprovalRequest<D>) => void;
14
+ isApprovedChoiceAllowed?: (request: ApprovalRequest<D>, choice: ApprovalChoice) => boolean | Promise<boolean>;
15
+ describeApprovedChoice?: (request: ApprovalRequest<D>, choice: ApprovalChoice) => string | undefined;
16
+ applyApprovalContext?: (ctx: ToolExecutionContext | undefined, params: Record<string, unknown>, request: ApprovalRequest<D>, choice: ApprovalChoice) => ToolExecutionContext | undefined | Promise<ToolExecutionContext | undefined>;
17
+ }): ToolDefinition<T>;
18
+ //# sourceMappingURL=tool-approval.d.ts.map
@@ -9,6 +9,9 @@ import type { ExtensionContext } from '../extensions/index.js';
9
9
  export declare const APPROVAL: {
10
10
  readonly ACCEPT: "Accept";
11
11
  readonly ACCEPT_ALL: "Accept All";
12
+ readonly ALLOW_ONCE: "Allow Once";
13
+ readonly ALLOW_FILE: "Always Allow File";
14
+ readonly ALLOW_FOLDER: "Always Allow Folder";
12
15
  readonly REJECT: "Reject";
13
16
  };
14
17
  export type ApprovalChoice = (typeof APPROVAL)[keyof typeof APPROVAL];
@@ -35,4 +38,18 @@ export interface ApprovalQueueInfo {
35
38
  current: number;
36
39
  total: number;
37
40
  }
41
+ export interface FileAccessApprovalData {
42
+ path: string;
43
+ access: 'read' | 'write';
44
+ workspaceRoots: string[];
45
+ allowPersistentGrant: boolean;
46
+ fileGrantPath: string;
47
+ folderGrantPath: string;
48
+ }
49
+ export interface BashApprovalData {
50
+ command: string;
51
+ description?: string;
52
+ /** Connection names whose credentials will be injected. */
53
+ connections?: string[];
54
+ }
38
55
  //# sourceMappingURL=types.d.ts.map
@@ -14,10 +14,6 @@ export declare const SHORTCUT_API_URL: string;
14
14
  export declare function getShortcutForkTraceDir(): string | undefined;
15
15
  /** WebSocket URL for the collab signaling server. */
16
16
  export declare const COLLAB_SERVER_URL: string;
17
- /**
18
- * Free-tier fallback model used when the user has exhausted their credits.
19
- */
20
- export declare const FREE_MODEL_ID = "claude-sonnet-4-6-20250514";
21
17
  /** uv release version pinned to a known-good Astral release. */
22
18
  export declare const UV_VERSION = "0.7.2";
23
19
  /** Python version installed via uv on macOS. */
@@ -4,11 +4,6 @@
4
4
  * Checks whether the user has remaining credits (or an unlimited plan)
5
5
  * and caches the result for a configurable TTL to avoid hammering the API.
6
6
  *
7
- * Caller wires into ExtendedStateStore:
8
- * ```
9
- * const result = await creditGate.check(accessToken);
10
- * extendedStateStore.set('isOutOfCredits', !result.hasCredits);
11
- * ```
12
7
  */
13
8
  export interface CreditCheckResult {
14
9
  hasCredits: boolean;
@@ -61,6 +61,7 @@ export declare class ExtensionRunner {
61
61
  private deductChildUsageFn;
62
62
  private getMessagesFn;
63
63
  private getToolsFn;
64
+ private getPermissionPolicyFn;
64
65
  private newSessionHandler;
65
66
  private forkHandler;
66
67
  private navigateTreeHandler;
@@ -69,8 +70,7 @@ export declare class ExtensionRunner {
69
70
  private shutdownHandler;
70
71
  private commandDiagnostics;
71
72
  private sessionState?;
72
- private extendedState?;
73
- constructor(extensions: Extension[], runtime: ExtensionRuntime, cwd: string, sessionManager: ExtensionSessionView, modelRegistry: ModelRegistry, sessionState?: SessionState, extendedState?: import('../../server-sse-only/extended-state-store.js').ExtendedStateStore);
73
+ constructor(extensions: Extension[], runtime: ExtensionRuntime, cwd: string, sessionManager: ExtensionSessionView, modelRegistry: ModelRegistry, sessionState?: SessionState);
74
74
  bindCore(actions: ExtensionActions, contextActions: ExtensionContextActions): void;
75
75
  bindCommandContext(actions?: ExtensionCommandContextActions): void;
76
76
  setUIContext(uiContext?: ExtensionUIContext): void;
@@ -11,7 +11,7 @@ import type { AssistantMessage, AssistantMessageEvent, ImageContent, Message, Mo
11
11
  import type { TSchema } from '@sinclair/typebox';
12
12
  import type { ModelRegistry } from '../../app/providers/model-registry.js';
13
13
  import type { CompactionPreparation, CompactionResult } from '../../app/session/compaction/index.js';
14
- import type { AgentMessage, AgentState, AgentToolResult, AgentToolUpdateCallback, ToolDefinition, ToolExecutionContext } from '../../core/core-types.js';
14
+ import type { AgentMessage, AgentState, AgentToolResult, AgentToolUpdateCallback, RuntimePermissionPolicy, ToolDefinition, ToolExecutionContext } from '../../core/core-types.js';
15
15
  import type { CustomMessage } from '../messages.js';
16
16
  import type { BashOperations, BashResult } from '../tools/bash-types.js';
17
17
  export type { AgentToolResult, AgentToolUpdateCallback, ToolDefinition };
@@ -505,6 +505,7 @@ export interface ExtensionContextActions {
505
505
  }) => void;
506
506
  getMessages: () => AgentMessage[];
507
507
  getTools: () => readonly ToolDefinition[];
508
+ getPermissionPolicy: () => RuntimePermissionPolicy;
508
509
  }
509
510
  /**
510
511
  * Actions for ExtensionCommandContext (ctx.* in command handlers).
@@ -1,5 +1,6 @@
1
1
  export type { AgentDefinition } from './agent-definition.js';
2
2
  export { AgentSession, LoginRequiredError, parseSkillBlock, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, type SessionStats } from './agent-session.js';
3
+ export { SessionAutoApproveState } from './approvals/session-auto-approve.js';
3
4
  export { AuthStorage, FileAuthStorageBackend, InMemoryAuthStorageBackend, type AuthCredential, type AuthStorageBackend, type OAuthCredential } from './auth/auth-storage.js';
4
5
  export { startProactiveRefresh } from './auth/refresh-timer.js';
5
6
  export { createTextHash, formatInlineCitation, formatInlineCitations, getCitationId, getSourceKey, mergeCitations, processAnthropicCitations, type AnthropicCharLocationCitation, type AnthropicCitation, type AnthropicContentBlock, type AnthropicPageLocationCitation, type AnthropicTextBlock, type AnthropicWebSearchResultLocationCitation, type Citation, type DocumentCitation, type DraftCitation, type DraftDocumentCitation, type DraftWebCitation, type ProcessCitationsResult, type WebCitation } from './citations.js';
@@ -31,11 +32,11 @@ export { listAllSessions, listSessions } from './session/session-catalog.js';
31
32
  export type { SessionInfo, SessionListProgress } from './session/session-catalog.js';
32
33
  export { continueRecentSessionManager, createInMemorySessionManager, createSessionManager, forkSessionManager, openSessionManager } from './session/session-factory.js';
33
34
  export { SessionManager } from './session/session-manager.js';
34
- export type { SessionObservability } from './session/session-observability.js';
35
35
  export { FileSessionPersistenceBackend } from './session/session-persistence-backend.js';
36
36
  export type { SessionPersistenceBackend } from './session/session-persistence-backend.js';
37
37
  export type { SessionEntry, SessionHeader, SessionInfoEntry, SessionMessageEntry } from './session/session-schema.js';
38
38
  export type { BranchSessionStore, ModelSessionStore, PersistenceSessionStore, ProductSessionStore, SessionInfoStore } from './session/session-store-types.js';
39
+ export type { SessionObservability } from './session/session-observability.js';
39
40
  export { SettingsManager, type CompactionSettings, type ImageSettings, type PackageSource, type RetrySettings } from './settings-manager.js';
40
41
  export type { StartupInfoEntry } from './startup-info.js';
41
42
  export { downloadSkillsWithApproval, syncSkillsConservatively } from './sync/skills-download.js';
@@ -0,0 +1,57 @@
1
+ import { ShortcutClientLogContextStore } from './context.js';
2
+ import { type ShortcutClientLogModule, type ShortcutClientLogTransport } from './types.js';
3
+ export interface ShortcutClientLoggerOptions {
4
+ transport: ShortcutClientLogTransport;
5
+ context?: ShortcutClientLogContextStore;
6
+ flushIntervalMs?: number;
7
+ maxBufferSize?: number;
8
+ now?: () => Date;
9
+ setIntervalFn?: typeof setInterval;
10
+ clearIntervalFn?: typeof clearInterval;
11
+ }
12
+ export interface EmitShortcutClientLogInput {
13
+ module: ShortcutClientLogModule;
14
+ event: string;
15
+ data?: Record<string, unknown>;
16
+ duration?: number;
17
+ }
18
+ /**
19
+ * Runtime-owned client logger for ShortcutXL observability.
20
+ *
21
+ * This package intentionally knows nothing about PostHog, browser super properties,
22
+ * or compatibility with unrelated clients. It owns one contract only:
23
+ * batched client-shortcutxl log rows sent to /api/logs.
24
+ */
25
+ export declare class ShortcutClientLogger {
26
+ private readonly transport;
27
+ private readonly context;
28
+ private readonly flushIntervalMs;
29
+ private readonly maxBufferSize;
30
+ private readonly now;
31
+ private readonly setIntervalFn;
32
+ private readonly clearIntervalFn;
33
+ private buffer;
34
+ private flushTimer;
35
+ private pendingFlush;
36
+ private destroyed;
37
+ private enabled;
38
+ constructor(options: ShortcutClientLoggerOptions);
39
+ setUserId(userId: string): void;
40
+ clearUserId(): void;
41
+ setSessionId(sessionId: string): void;
42
+ clearSessionId(): void;
43
+ setBuildInfo(input: {
44
+ commit?: string;
45
+ version?: string;
46
+ }): void;
47
+ setEnabled(enabled: boolean): void;
48
+ disable(): Promise<void>;
49
+ info(input: EmitShortcutClientLogInput): void;
50
+ warn(input: EmitShortcutClientLogInput): void;
51
+ error(input: EmitShortcutClientLogInput): void;
52
+ private emit;
53
+ private startPeriodicFlush;
54
+ flush(): Promise<void>;
55
+ destroy(): Promise<void>;
56
+ }
57
+ //# sourceMappingURL=client-logger.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { ShortcutClientLogContext } from './types.js';
2
+ /**
3
+ * Mutable runtime-owned log context.
4
+ *
5
+ * Owns only stable correlation fields that should be inherited by emitted log rows.
6
+ * Event-specific payloads stay outside this store.
7
+ */
8
+ export declare class ShortcutClientLogContextStore {
9
+ private context;
10
+ setUserId(userId: string): void;
11
+ clearUserId(): void;
12
+ setSessionId(sessionId: string): void;
13
+ clearSessionId(): void;
14
+ setRequestId(requestId: string): void;
15
+ clearRequestId(): void;
16
+ setRunId(runId: string): void;
17
+ clearRunId(): void;
18
+ setFileId(fileId: string): void;
19
+ clearFileId(): void;
20
+ setBuildInfo(input: {
21
+ commit?: string;
22
+ version?: string;
23
+ }): void;
24
+ getSnapshot(): ShortcutClientLogContext;
25
+ }
26
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1,8 @@
1
+ export { ShortcutClientLogger, type EmitShortcutClientLogInput } from './client-logger.js';
2
+ export { ShortcutClientLogContextStore } from './context.js';
3
+ export { attachShortcutSessionEventLogging } from './session-events.js';
4
+ export { getTelemetryToggleLog } from './settings-events.js';
5
+ export { getXllStartupLog, type StartupXllStatus } from './startup-events.js';
6
+ export { HttpShortcutClientLogTransport, type HttpShortcutClientLogTransportOptions } from './transport.js';
7
+ export { SHORTCUT_CLIENT_LOG_MODULES, SHORTCUT_CLIENT_LOG_SOURCE, type ShortcutClientLogBatch, type ShortcutClientLogContext, type ShortcutClientLogEntry, type ShortcutClientLogLevel, type ShortcutClientLogModule, type ShortcutClientLogSource, type ShortcutClientLogTransport } from './types.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { AgentSession } from '../../agent-session.js';
2
+ import type { ShortcutClientLogger } from './client-logger.js';
3
+ export declare function attachShortcutSessionEventLogging(session: Pick<AgentSession, 'sessionId' | 'subscribe'>, logger: Pick<ShortcutClientLogger, 'setSessionId' | 'info' | 'warn' | 'error'>): () => void;
4
+ //# sourceMappingURL=session-events.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare function getTelemetryToggleLog(enabled: boolean): {
2
+ module: 'settings';
3
+ event: 'telemetry_enabled' | 'telemetry_disabled';
4
+ };
5
+ //# sourceMappingURL=settings-events.d.ts.map
@@ -0,0 +1,18 @@
1
+ export type StartupXllStatus = {
2
+ kind: 'ok';
3
+ updated: number;
4
+ } | {
5
+ kind: 'source-missing';
6
+ missingPaths: string[];
7
+ } | {
8
+ kind: 'install-failed';
9
+ } | {
10
+ kind: 'degraded';
11
+ updated: number;
12
+ };
13
+ export declare function getXllStartupLog(requiresLocalXllRuntime: boolean, status: StartupXllStatus): {
14
+ module: 'xll';
15
+ event: 'xll_connected' | 'xll_connection_failed';
16
+ data?: Record<string, unknown>;
17
+ } | null;
18
+ //# sourceMappingURL=startup-events.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { ShortcutClientLogBatch, ShortcutClientLogTransport } from './types.js';
2
+ export interface HttpShortcutClientLogTransportOptions {
3
+ endpoint?: string;
4
+ fetchImpl?: typeof fetch;
5
+ }
6
+ /**
7
+ * Thin HTTP transport for shipping ShortcutXL client logs to the shared logging ingress.
8
+ */
9
+ export declare class HttpShortcutClientLogTransport implements ShortcutClientLogTransport {
10
+ private readonly endpoint;
11
+ private readonly fetchImpl;
12
+ constructor(options?: HttpShortcutClientLogTransportOptions);
13
+ send(batch: ShortcutClientLogBatch): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1,31 @@
1
+ export declare const SHORTCUT_CLIENT_LOG_SOURCE: "client-shortcutxl";
2
+ export declare const SHORTCUT_CLIENT_LOG_MODULES: readonly ["auth", "session", "agent", "tool", "excel", "xll", "trace_upload", "network", "settings", "ui", "lifecycle"];
3
+ export type ShortcutClientLogSource = typeof SHORTCUT_CLIENT_LOG_SOURCE;
4
+ export type ShortcutClientLogLevel = 'info' | 'warn' | 'error';
5
+ export type ShortcutClientLogModule = (typeof SHORTCUT_CLIENT_LOG_MODULES)[number];
6
+ export interface ShortcutClientLogContext {
7
+ user_id?: string;
8
+ session_id?: string;
9
+ request_id?: string;
10
+ run_id?: string;
11
+ file_id?: string;
12
+ commit?: string;
13
+ version?: string;
14
+ }
15
+ export interface ShortcutClientLogEntry extends ShortcutClientLogContext {
16
+ source: ShortcutClientLogSource;
17
+ level: ShortcutClientLogLevel;
18
+ event: string;
19
+ module: ShortcutClientLogModule;
20
+ created_at: string;
21
+ duration?: number;
22
+ data?: Record<string, unknown>;
23
+ }
24
+ export interface ShortcutClientLogBatch {
25
+ client_time: string;
26
+ entries: ShortcutClientLogEntry[];
27
+ }
28
+ export interface ShortcutClientLogTransport {
29
+ send(batch: ShortcutClientLogBatch): Promise<void>;
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './client-logging/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Approval-surface helpers.
3
+ *
4
+ * Approval gating is a runtime-owned concern: headful surfaces may prompt,
5
+ * headless surfaces must deterministically allow or deny.
6
+ */
7
+ import type { RuntimeApprovalSurface } from '../../core/permission-policy.js';
8
+ export interface ApprovalSurfaceContext {
9
+ hasUI?: boolean;
10
+ }
11
+ export interface ApprovalExecutionDecisionInput {
12
+ surface: RuntimeApprovalSurface;
13
+ gateAvailable?: boolean;
14
+ isSafe: boolean;
15
+ isAutoApproved: boolean;
16
+ alwaysRequireExplicitApproval: boolean;
17
+ denyOnHeadlessApproval?: boolean;
18
+ }
19
+ export type ApprovalExecutionDecision = 'allow' | 'prompt' | 'deny';
20
+ /** Determines whether the current execution context can display approval UI. */
21
+ export declare function getApprovalSurface(ctx: ApprovalSurfaceContext | undefined): RuntimeApprovalSurface;
22
+ /** Resolves an approval-gated execution request into allow, prompt, or deny. */
23
+ export declare function resolveApprovalExecutionDecision(input: ApprovalExecutionDecisionInput): ApprovalExecutionDecision;
24
+ //# sourceMappingURL=approval-surface.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * App-owned mapping from concrete tool names to shared runtime capabilities.
3
+ *
4
+ * This file is intentionally small: the core layer owns capability identity,
5
+ * while the app layer owns which built-in tools declare each capability.
6
+ */
7
+ import { type RuntimeCapabilityId } from '../../core/permission-policy.js';
8
+ export interface RuntimeCapabilityDefinition {
9
+ id: RuntimeCapabilityId;
10
+ toolNames: readonly string[];
11
+ }
12
+ export declare const RUNTIME_CAPABILITY_CATALOG: readonly RuntimeCapabilityDefinition[];
13
+ /** Returns the capability set declared by the current runtime tool selection. */
14
+ export declare function getDeclaredCapabilityIds(toolNames: readonly string[]): RuntimeCapabilityId[];
15
+ /** Convenience predicate for small capability-gated compiler decisions. */
16
+ export declare function hasCapability(capabilityIds: readonly RuntimeCapabilityId[], capabilityId: RuntimeCapabilityId): boolean;
17
+ //# sourceMappingURL=capability-catalog.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Builds the effective runtime-owned permission policy for the active tool set.
3
+ *
4
+ * The compiler is intentionally deterministic and conservative: mode presets
5
+ * define the broad behavior, and declared capabilities only widen the surfaces
6
+ * that are actually available in the current registry.
7
+ */
8
+ import type { RuntimePermissionPolicy } from '../../core/permission-policy.js';
9
+ export interface EffectivePermissionPolicyInput {
10
+ toolNames: readonly string[];
11
+ modeName?: string;
12
+ workspaceRoots?: string[];
13
+ persistentApprovals?: RuntimePermissionPolicy['filesystem']['persistentApprovals'];
14
+ dangerouslySkipRuntimePermissions?: boolean;
15
+ dangerouslySkipSpreadsheetPermissions?: boolean;
16
+ }
17
+ export declare function buildEffectivePermissionPolicy(input: EffectivePermissionPolicyInput): RuntimePermissionPolicy;
18
+ export declare function createDefaultPermissionPolicy(): RuntimePermissionPolicy;
19
+ //# sourceMappingURL=compiler.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * User-facing effective permission view.
3
+ *
4
+ * This is a read model over the compiled runtime policy for showing what the
5
+ * current session can do right now without exposing internal enforcement state.
6
+ */
7
+ import type { RuntimeCapabilityId, RuntimePermissionPolicy } from '../../core/permission-policy.js';
8
+ export interface EffectivePermissionCapabilityView {
9
+ capabilityId: RuntimeCapabilityId;
10
+ label: string;
11
+ status: 'enabled' | 'approval_required' | 'denied';
12
+ summary: string;
13
+ }
14
+ export interface EffectivePermissionView {
15
+ modeName?: string;
16
+ dangerouslySkipRuntimePermissions: boolean;
17
+ headlessApprovalsDenied: boolean;
18
+ headlessSpreadsheetApprovalsDenied: boolean;
19
+ capabilities: EffectivePermissionCapabilityView[];
20
+ }
21
+ export declare function buildEffectivePermissionView(policy: RuntimePermissionPolicy): EffectivePermissionView;
22
+ export declare function formatEffectivePermissionView(view: EffectivePermissionView): string;
23
+ //# sourceMappingURL=effective-view.d.ts.map
@@ -0,0 +1,25 @@
1
+ import type { ApprovedFilesystemAccessGrant } from '../../core/core-types.js';
2
+ import type { RuntimeFilesystemPermissionPolicy } from '../../core/permission-policy.js';
3
+ import type { SessionState } from '../../core/session-state.js';
4
+ export interface FilesystemAccessDecision {
5
+ outcome: 'allow' | 'require_approval' | 'deny';
6
+ canonicalPath: string;
7
+ canonicalWorkspaceRoots: string[];
8
+ allowPersistentGrant?: boolean;
9
+ fileGrantPath?: string;
10
+ folderGrantPath?: string;
11
+ reason?: string;
12
+ }
13
+ export declare function getFilesystemAccessDecision(options: {
14
+ path: string;
15
+ policy: RuntimeFilesystemPermissionPolicy;
16
+ access: 'read' | 'write';
17
+ }): Promise<FilesystemAccessDecision>;
18
+ export declare function enforceFilesystemPolicy(options: {
19
+ path: string;
20
+ policy: RuntimeFilesystemPermissionPolicy;
21
+ access: 'read' | 'write';
22
+ sessionState?: SessionState;
23
+ approvalGrants?: ApprovedFilesystemAccessGrant[];
24
+ }): Promise<void>;
25
+ //# sourceMappingURL=filesystem-policy.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * /permissions slash command handler.
3
+ *
4
+ * The persisted permissioning JSON is the source of truth. This module owns the
5
+ * interactive command flow for viewing and editing that schema so the startup
6
+ * router can remain a thin dispatcher.
7
+ */
8
+ import type { SettingsManager } from '../settings-manager.js';
9
+ type ShowStatus = (msg: string) => void;
10
+ type Select = (title: string, options: string[]) => Promise<string | undefined>;
11
+ type Input = (title: string, placeholder?: string) => Promise<string | undefined>;
12
+ /**
13
+ * Handle the /permissions slash command against the current settings state.
14
+ */
15
+ export declare function handlePermissionsCommand(command: string, showStatus: ShowStatus, select: Select, input: Input, settingsManager: SettingsManager, cwd: string): Promise<boolean>;
16
+ export {};
17
+ //# sourceMappingURL=permissions-command.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * App-owned adapter from tool registry state into the shared permission
3
+ * compiler. The compiler owns the resulting policy shape.
4
+ */
5
+ import type { RuntimePermissionPolicy } from '../../core/permission-policy.js';
6
+ import { createDefaultPermissionPolicy } from './compiler.js';
7
+ export declare function deriveModePermissionPolicy(toolNames: readonly string[], modeName?: string, workspaceRoots?: string[], persistentApprovals?: RuntimePermissionPolicy['filesystem']['persistentApprovals'], dangerouslySkipRuntimePermissions?: boolean, dangerouslySkipSpreadsheetPermissions?: boolean): RuntimePermissionPolicy;
8
+ export { createDefaultPermissionPolicy };
9
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { ToolExecutionContext } from '../../core/core-types.js';
2
+ import type { RuntimePermissionPolicy } from '../../core/permission-policy.js';
3
+ export declare function requirePermissionPolicy(ctx: ToolExecutionContext | undefined, toolName: string): RuntimePermissionPolicy;
4
+ //# sourceMappingURL=require-policy.d.ts.map