shortcutxl 0.3.42 → 0.3.43
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/CHANGELOG.md +5 -1
- package/agent-docs/xll-skill.md +1 -1
- package/dist/app/agent-session.d.ts +2 -0
- package/dist/app/approvals/tool-approval.d.ts +1 -0
- package/dist/app/approvals/types.d.ts +10 -0
- package/dist/app/excel-config.d.ts +22 -0
- package/dist/app/excel-session.d.ts +27 -0
- package/dist/app/extensions/index.impl.d.ts +10 -0
- package/dist/app/new-sheet/sheet-exec.d.ts +36 -0
- package/dist/app/permissions/approval-surface.d.ts +1 -1
- package/dist/app/permissions/runtime-approval-flow.d.ts +3 -1
- package/dist/app/permissions/runtime-permission-bypass.d.ts +5 -0
- package/dist/app/permissions/tool-gates.d.ts +3 -2
- package/dist/app/prompts/com-api-reference.json +146 -215
- package/dist/app/prompts/mog-api-reference.json +11454 -12080
- package/dist/app/sdk.d.ts +3 -0
- package/dist/app/session/session-retry.d.ts +81 -0
- package/dist/app/session/tool-registry.d.ts +2 -1
- package/dist/app/tools/excel-code-analyzer.d.ts +30 -0
- package/dist/app/tools/excel-diff.d.ts +21 -0
- package/dist/app/tools/excel-exec.d.ts +25 -0
- package/dist/app/tools/task/subprocess.d.ts +1 -0
- package/dist/app/tools/task/task.d.ts +8 -0
- package/dist/cli/args.d.ts +2 -1
- package/dist/cli.js +1050 -1022
- package/dist/cloud/bridge-tool-catalog.d.ts +2 -2
- package/dist/cloud/cloud-shell-adapter.d.ts +3 -1
- package/dist/cloud/index.d.ts +1 -1
- package/dist/cloud/local-bridge-tools.d.ts +2 -1
- package/dist/cloud/observability/client-logging/client-logger.d.ts +57 -0
- package/dist/cloud/observability/client-logging/context.d.ts +26 -0
- package/dist/cloud/observability/client-logging/index.d.ts +8 -0
- package/dist/cloud/observability/client-logging/session-events.d.ts +4 -0
- package/dist/cloud/observability/client-logging/settings-events.d.ts +5 -0
- package/dist/cloud/observability/client-logging/startup-events.d.ts +7 -0
- package/dist/cloud/observability/client-logging/transport.d.ts +15 -0
- package/dist/cloud/observability/client-logging/types.d.ts +31 -0
- package/dist/cloud/observability/index.d.ts +1 -0
- package/dist/core/core-types.d.ts +18 -0
- package/dist/core/permission-policy-codec.d.ts +9 -0
- package/dist/core/permission-policy.d.ts +4 -6
- package/dist/server/server-types.d.ts +1 -1
- package/dist/server-sse-only/server-types.d.ts +1 -1
- package/dist/shared/logging/langfuse-trace-context.d.ts +0 -1
- package/dist/shell/approvals/approval.d.ts +20 -0
- package/dist/shell/approvals/task-spawn-approval.d.ts +17 -0
- package/dist/shell/approvals/tool-approval.d.ts +6 -2
- package/dist/shell/components/active-task-overlay.d.ts +21 -0
- package/dist/shell/components/interactive-mode-helpers.d.ts +10 -0
- package/dist/shell/components/interactive-task-surface-controller.d.ts +23 -0
- package/dist/shell/components/primitives/footer.d.ts +0 -17
- package/dist/shell/export-html/index.impl.d.ts +35 -0
- package/dist/shell/extension-ui.d.ts +1 -0
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/interactive/interactive-actions.d.ts +1 -0
- package/dist/shell/interactive/interactive-mode.d.ts +5 -1
- package/dist/shell/keybindings.d.ts +1 -1
- package/dist/shell/tools/runtime/tool-group.d.ts +2 -0
- package/dist/startup/subagent-bootstrap.d.ts +3 -1
- package/dist/tui/autocomplete.js +616 -616
- package/dist/tui/components/editor.js +1733 -1733
- package/dist/tui/skill-autocomplete.js +30 -30
- package/dist/tui/tui.d.ts +6 -0
- package/dist/tui/tui.js +5 -0
- package/package.json +150 -150
- package/user-docs/dist/shortcutxl-docs.pdf +0 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/modules/shortcut_xl/_exec_sandbox.py +222 -0
- package/xll/modules/shortcut_xl/_managed.py +9 -47
- package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/pip-26.0.1.dist-info/RECORD +3 -3
- package/xll/python/Scripts/httpx.exe +0 -0
- package/xll/python/Scripts/pip.exe +0 -0
- package/xll/python/Scripts/pip3.12.exe +0 -0
- package/xll/python/Scripts/pip3.exe +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.3.
|
|
3
|
+
## [0.3.43]
|
|
4
|
+
|
|
5
|
+
- **Security & stability** — Internal hardening fixes across the runtime.
|
|
6
|
+
|
|
7
|
+
## [0.3.42]
|
|
4
8
|
|
|
5
9
|
- **Hosted MCP OAuth** — ShortcutXL now supports OAuth-authenticated hosted MCP servers. Configure a hosted MCP in `mcp.json`, then log in from `/mcp` or `/login`, see `login required` status when auth is missing, and log out again directly from the MCP menu.
|
|
6
10
|
- **Agent context cleanup** — Simplified agent context and prompt behavior for cleaner single-turn and multi-turn execution.
|
package/agent-docs/xll-skill.md
CHANGED
|
@@ -51,7 +51,7 @@ Rules: function name = formula name, args are `float`/`str`/`None`, return `floa
|
|
|
51
51
|
| | `/exec` | `modules/` |
|
|
52
52
|
|---|---|---|
|
|
53
53
|
| **Use for** | One-shot actions, layout, formatting | Custom formulas, live data, tick loops |
|
|
54
|
-
| **Imports** |
|
|
54
|
+
| **Imports** | Allowed (safe stdlib only; blacklist blocks `os`, `subprocess`, `socket`, etc.) | `xl_func`, `xl_app`, `xl_batch`, `schedule_call`, `xl_log` |
|
|
55
55
|
|
|
56
56
|
Never mix the two.
|
|
57
57
|
|
|
@@ -93,6 +93,8 @@ export interface AgentSessionConfig {
|
|
|
93
93
|
initialToolNames?: string[];
|
|
94
94
|
/** Optional initial mode name used to seed runtime permission policy. */
|
|
95
95
|
initialModeName?: string;
|
|
96
|
+
/** Optional fixed permission policy for isolated runtimes such as subagents. */
|
|
97
|
+
initialPermissionPolicy?: RuntimePermissionPolicy;
|
|
96
98
|
/** Model registry for API key resolution and model discovery */
|
|
97
99
|
modelRegistry: ModelRegistry;
|
|
98
100
|
/** Mutable ref used by Agent to access the current ExtensionRunner */
|
|
@@ -7,6 +7,7 @@ import type { TSchema } from '@sinclair/typebox';
|
|
|
7
7
|
import type { ToolDefinition, ToolExecutionContext } from '../../core/core-types.js';
|
|
8
8
|
import { type ApprovalChoice, type ApprovalGate, type ApprovalRequest } from './types.js';
|
|
9
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
|
+
alwaysPrompt?: boolean;
|
|
10
11
|
isContentSafe?: (params: Record<string, unknown>, ctx: ToolExecutionContext | undefined) => boolean | Promise<boolean>;
|
|
11
12
|
onRequested?: (request: ApprovalRequest<D>) => void;
|
|
12
13
|
onAccepted?: (request: ApprovalRequest<D>, choice: ApprovalChoice) => void;
|
|
@@ -52,4 +52,14 @@ export interface BashApprovalData {
|
|
|
52
52
|
/** Connection names whose credentials will be injected. */
|
|
53
53
|
connections?: string[];
|
|
54
54
|
}
|
|
55
|
+
export interface TaskSpawnApprovalData {
|
|
56
|
+
subagentType: string;
|
|
57
|
+
name: string;
|
|
58
|
+
query: string;
|
|
59
|
+
model?: string;
|
|
60
|
+
/** Task spawn approval is all-or-nothing: approved children run as full workers. */
|
|
61
|
+
fullWorker: true;
|
|
62
|
+
/** True when this subagent can recursively spawn more full-worker children. */
|
|
63
|
+
canSpawnSubagents: boolean;
|
|
64
|
+
}
|
|
55
65
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discover ShortcutXL paths by calling GET /config on the XLL's HTTP server.
|
|
3
|
+
*
|
|
4
|
+
* Returns { xll_dir, modules_path } or null if Excel isn't running.
|
|
5
|
+
* Retries a few times on startup since Excel may still be loading the XLL.
|
|
6
|
+
*/
|
|
7
|
+
interface ExcelConfig {
|
|
8
|
+
xllDir: string;
|
|
9
|
+
modulesPath: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fetch XLL config from the running Excel instance.
|
|
13
|
+
* Retries up to `maxRetries` times with `intervalMs` between attempts.
|
|
14
|
+
* Returns null if Excel/XLL is unreachable after all retries.
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchExcelConfig(options?: {
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
intervalMs?: number;
|
|
19
|
+
url?: string;
|
|
20
|
+
}): Promise<ExcelConfig | null>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=excel-config.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the ShortcutXL session file written by the XLL's HTTP server.
|
|
3
|
+
*
|
|
4
|
+
* The XLL generates a random bearer token on startup and writes it
|
|
5
|
+
* (along with the port) to %APPDATA%\ShortcutXL\session.json.
|
|
6
|
+
* The agent reads this file to authenticate requests to the XLL.
|
|
7
|
+
*
|
|
8
|
+
* Format: { "port": 8080, "token": "hex..." }
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Clear the cached session so the next readXllSession() re-reads from disk.
|
|
12
|
+
* Useful after Excel restarts.
|
|
13
|
+
*/
|
|
14
|
+
export declare function clearXllSessionCache(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Check if the XLL reported an initialization error in session.json.
|
|
17
|
+
* Returns the error string, or undefined if no error.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readXllSessionError(): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Authenticated fetch to the XLL HTTP server.
|
|
22
|
+
*
|
|
23
|
+
* Injects the bearer token from the session file and retries once on 403
|
|
24
|
+
* (handles stale cached token after Excel restart).
|
|
25
|
+
*/
|
|
26
|
+
export declare function xllFetch(url: string, init?: RequestInit): Promise<Response>;
|
|
27
|
+
//# sourceMappingURL=excel-session.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension system for lifecycle events and custom tools.
|
|
3
|
+
*/
|
|
4
|
+
export type { SlashCommandInfo, SlashCommandLocation, SlashCommandSource } from '../../app/extensions/slash-commands.js';
|
|
5
|
+
export { createExtensionRuntime, discoverAndLoadExtensions, loadExtensionFromFactory, loadExtensions } from './loader.js';
|
|
6
|
+
export { ExtensionRunner } from './runner.js';
|
|
7
|
+
export type { ExtensionErrorListener, ForkHandler, NavigateTreeHandler, NewSessionHandler, RunnerEmitEvent, ShutdownHandler, SwitchSessionHandler } from './runner.js';
|
|
8
|
+
export type { AgentToolResult, AgentToolUpdateCallback, CompactOptions, ContextEvent, ContextEventResult, ContextUsage, Extension, ExtensionAPI, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionHandler, ExtensionRuntime, ExtensionSessionSetupStore, ExtensionSessionView, ExtensionUIContext, ExtensionUIDialogOptions, InputEvent, InputEventResult, InputSource, LoadExtensionsResult, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, ResourcesDiscoverResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionCompactEvent, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolInfo, ToolResultEvent, ToolResultEventResult, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult } from './types.js';
|
|
9
|
+
export { wrapToolWithExtensions, wrapToolsWithExtensions } from './wrapper.js';
|
|
10
|
+
//# sourceMappingURL=index.impl.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sheet exec tool — execute TypeScript code against a headless spreadsheet engine.
|
|
3
|
+
*
|
|
4
|
+
* Drop-in replacement for excel-exec (COM). Same tool name (excel_exec),
|
|
5
|
+
* same schema shape, but runs code in-process against @mog-sdk/node's
|
|
6
|
+
* the @mog-sdk/node workbook via a VM sandbox.
|
|
7
|
+
*
|
|
8
|
+
* Workbook lifecycle mirrors COM: workbooks persist across executions,
|
|
9
|
+
* are referenced by name (basename for loaded files, "Book1" etc. for new),
|
|
10
|
+
* and the agent manages open/create/save/close explicitly.
|
|
11
|
+
*
|
|
12
|
+
* Mutation tracking via Proxy wrappers records every setCell/clear call.
|
|
13
|
+
* After execution, mutations are resolved to CellEdit[] and formatted into
|
|
14
|
+
* the same cell diff summary the COM path produces.
|
|
15
|
+
*
|
|
16
|
+
* Code is TypeScript (transpiled to JS before execution).
|
|
17
|
+
*/
|
|
18
|
+
import type { ToolDefinition } from '../../core/core-types.js';
|
|
19
|
+
import type { CellEdit } from './cell-diff/types.js';
|
|
20
|
+
import type { SheetEnginePool } from './sheet-engine.js';
|
|
21
|
+
interface SheetExecResult {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
output?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
logs?: string[];
|
|
26
|
+
change_count?: number;
|
|
27
|
+
edit_ranges?: string[];
|
|
28
|
+
dirty_cells?: CellEdit[];
|
|
29
|
+
}
|
|
30
|
+
declare const schema: import("@sinclair/typebox").TObject<{
|
|
31
|
+
description: import("@sinclair/typebox").TString;
|
|
32
|
+
code: import("@sinclair/typebox").TString;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function createSheetExecTool(pool: SheetEnginePool): ToolDefinition<typeof schema, SheetExecResult>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=sheet-exec.d.ts.map
|
|
@@ -14,7 +14,7 @@ export interface ApprovalExecutionDecisionInput {
|
|
|
14
14
|
isSafe: boolean;
|
|
15
15
|
isAutoApproved: boolean;
|
|
16
16
|
alwaysRequireExplicitApproval: boolean;
|
|
17
|
-
|
|
17
|
+
allowHeadlessApproval?: boolean;
|
|
18
18
|
}
|
|
19
19
|
export type ApprovalExecutionDecision = 'allow' | 'prompt' | 'deny';
|
|
20
20
|
/** Determines whether the current execution context can display approval UI. */
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ToolExecutionContext } from '../../core/core-types.js';
|
|
8
8
|
import type { RuntimeFilesystemPermissionPolicy, RuntimeShellPermissionPolicy } from '../../core/permission-policy.js';
|
|
9
|
-
import { type ApprovalChoice, type ApprovalRequest, type BashApprovalData, type FileAccessApprovalData } from '../approvals/types.js';
|
|
9
|
+
import { type ApprovalChoice, type ApprovalRequest, type BashApprovalData, type FileAccessApprovalData, type TaskSpawnApprovalData } from '../approvals/types.js';
|
|
10
10
|
import type { SettingsManager } from '../settings-manager.js';
|
|
11
11
|
export declare function describeFilesystemApprovalChoice(request: ApprovalRequest<FileAccessApprovalData>, choice: ApprovalChoice): string | undefined;
|
|
12
12
|
export declare function buildFilesystemApprovalRequest(absolutePath: string, access: 'read' | 'write', policy: RuntimeFilesystemPermissionPolicy): Promise<ApprovalRequest<FileAccessApprovalData>>;
|
|
13
13
|
export declare function isFilesystemInvocationSafe(absolutePath: string, access: 'read' | 'write', policy: RuntimeFilesystemPermissionPolicy, ctx: ToolExecutionContext | undefined): Promise<boolean>;
|
|
14
14
|
export declare function applyFilesystemApprovalChoice(choice: ApprovalChoice, request: ApprovalRequest<FileAccessApprovalData>, access: 'read' | 'write', settingsManager: SettingsManager, ctx: ToolExecutionContext | undefined): ToolExecutionContext | undefined;
|
|
15
15
|
export declare function buildShellApprovalRequest(params: Record<string, unknown>, toolName: string): ApprovalRequest<BashApprovalData>;
|
|
16
|
+
export declare function buildTaskSpawnApprovalRequest(payload: TaskSpawnApprovalData): ApprovalRequest<TaskSpawnApprovalData>;
|
|
16
17
|
export declare function isShellInvocationSafe(policy: RuntimeShellPermissionPolicy | undefined): boolean;
|
|
17
18
|
export declare function applyShellApprovalChoice(ctx: ToolExecutionContext | undefined, params: Record<string, unknown>): ToolExecutionContext | undefined;
|
|
19
|
+
export declare function applyTaskSpawnApprovalChoice(ctx: ToolExecutionContext | undefined, _request: ApprovalRequest<TaskSpawnApprovalData>): ToolExecutionContext | undefined;
|
|
18
20
|
//# sourceMappingURL=runtime-approval-flow.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type PermissionBypassSelect = (title: string, options: string[]) => Promise<string | undefined>;
|
|
2
|
+
export declare function formatPermissionBypassStatus(enabled: boolean): string;
|
|
3
|
+
export declare function formatPermissionBypassStatusMessage(enabled: boolean): string;
|
|
4
|
+
export declare function confirmRuntimePermissionBypass(select: PermissionBypassSelect): Promise<boolean>;
|
|
5
|
+
//# sourceMappingURL=runtime-permission-bypass.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolDefinition } from '../../core/core-types.js';
|
|
2
2
|
import { BASH, EDIT, EXECUTE_CODE, FIND, GREP, LS, READ, TASK, WRITE } from '../../tool-names.js';
|
|
3
|
-
import { type ApprovalGate, type BashApprovalData, type FileAccessApprovalData } from '../approvals/types.js';
|
|
3
|
+
import { type ApprovalGate, type BashApprovalData, type FileAccessApprovalData, type TaskSpawnApprovalData } from '../approvals/types.js';
|
|
4
4
|
import type { ShortcutClientLogger } from '../observability/client-logging/client-logger.js';
|
|
5
5
|
import type { SettingsManager } from '../settings-manager.js';
|
|
6
6
|
export type PermissionedRuntimeToolName = typeof READ | typeof WRITE | typeof EDIT | typeof LS | typeof FIND | typeof GREP | typeof BASH | typeof EXECUTE_CODE | typeof TASK;
|
|
@@ -42,7 +42,7 @@ export declare const TOOL_GATES: {
|
|
|
42
42
|
readonly kind: "self-gated";
|
|
43
43
|
};
|
|
44
44
|
readonly task: {
|
|
45
|
-
readonly kind: "
|
|
45
|
+
readonly kind: "task";
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export declare const PERMISSIONED_RUNTIME_TOOL_NAMES: PermissionedRuntimeToolName[];
|
|
@@ -52,6 +52,7 @@ export interface RegisterRuntimeToolDeps {
|
|
|
52
52
|
settingsManager?: SettingsManager;
|
|
53
53
|
filesystemApproval?: ApprovalGate<FileAccessApprovalData>;
|
|
54
54
|
shellApproval?: ApprovalGate<BashApprovalData>;
|
|
55
|
+
taskApproval?: ApprovalGate<TaskSpawnApprovalData>;
|
|
55
56
|
observability?: Pick<ShortcutClientLogger, 'info' | 'warn' | 'error'>;
|
|
56
57
|
}
|
|
57
58
|
export declare function registerRuntimeTool(tools: ToolDefinition<any, any>[], tool: ToolDefinition<any, any>, deps: RegisterRuntimeToolDeps): void;
|
|
@@ -1,215 +1,146 @@
|
|
|
1
|
-
{
|
|
2
|
-
"interfaces": {
|
|
3
|
-
"Workbook": {
|
|
4
|
-
"docstring": "Workbook wrapper.\nUsage:\n wb = Workbook(app.Workbooks(\"MyFile.xlsx\"))\n\nRaw COM access:\n wb._wb \u2014 the underlying COM Workbook object for direct platform API calls.\n Example: wb._wb.Worksheets(\"Sheet1\").Visible = False",
|
|
5
|
-
"functions": {
|
|
6
|
-
"getSheetNames": {
|
|
7
|
-
"signature": "def getSheetNames() -> list[str]",
|
|
8
|
-
"docstring": "Get the names of all sheets in the workbook.",
|
|
9
|
-
"tags": [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
"
|
|
67
|
-
"signature": "def
|
|
68
|
-
"docstring": "
|
|
69
|
-
"tags": [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
|
-
"
|
|
112
|
-
"signature": "def
|
|
113
|
-
"docstring": "
|
|
114
|
-
"tags": [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
]
|
|
148
|
-
},
|
|
149
|
-
"autoFill": {
|
|
150
|
-
"signature": "def autoFill(source_range: str, target_range: str, fill_mode: str = 'auto', ) -> None",
|
|
151
|
-
"docstring": "Drag-fill. Source must be contained within target.\nUse fill_mode=\"constant\" when copying a single value without incrementing.\nWARNING: Single numeric value with \"auto\" creates incrementing sequence (0,1,2,3...).\nExample: sheet.autoFill(\"A1:A2\", \"A1:A10\")",
|
|
152
|
-
"tags": [
|
|
153
|
-
"action"
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
|
-
"addPicture": {
|
|
157
|
-
"signature": "def addPicture(name: str, base64_data: str, anchor_cell: str) -> None",
|
|
158
|
-
"docstring": "Add a picture from base64-encoded PNG or JPEG data. No data URI prefix.\nExample: sheet.addPicture(\"chart1\", base64_string, \"F2\")",
|
|
159
|
-
"tags": [
|
|
160
|
-
"action"
|
|
161
|
-
]
|
|
162
|
-
},
|
|
163
|
-
"setIBTextColors": {
|
|
164
|
-
"signature": "def setIBTextColors(range_addr: str, ignored_constants: list[int] | None = None, colors: dict | None = None, ) -> None",
|
|
165
|
-
"docstring": "IB text colors for numeric inputs only. Text strings and booleans are left untouched.\n- Blue/16711680: hard-coded numeric constants (int/float)\n- Black/0: formulas (same-sheet references)\n- Green/32768: formulas with cross-sheet references (contains '!')\nColors are BGR integers (native COM format).\nExample: sheet.setIBTextColors(\"A1:D10\", ignored_constants=[0])",
|
|
166
|
-
"tags": [
|
|
167
|
-
"action"
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"helpers": {
|
|
174
|
-
"hex_to_bgr": {
|
|
175
|
-
"signature": "def hex_to_bgr(hex_str: str) -> int",
|
|
176
|
-
"docstring": "Convert \"#RRGGBB\" hex string to BGR integer for Excel COM.\nExample: ws.Range(\"A1\").Font.Color = hex_to_bgr(\"#FF0000\") # red",
|
|
177
|
-
"tags": [
|
|
178
|
-
"action",
|
|
179
|
-
"ask"
|
|
180
|
-
]
|
|
181
|
-
},
|
|
182
|
-
"index_to_address": {
|
|
183
|
-
"signature": "def index_to_address(row: int, col: int) -> str",
|
|
184
|
-
"docstring": "Convert 0-based (row, col) to Excel address: index_to_address(0, 0) \u2192 \"A1\".",
|
|
185
|
-
"tags": [
|
|
186
|
-
"action",
|
|
187
|
-
"ask"
|
|
188
|
-
]
|
|
189
|
-
},
|
|
190
|
-
"address_to_index": {
|
|
191
|
-
"signature": "def address_to_index(address: str) -> tuple[int, int]",
|
|
192
|
-
"docstring": "Parse \"A1\" into (row, col) 0-based tuple: address_to_index(\"B3\") \u2192 (2, 1).",
|
|
193
|
-
"tags": [
|
|
194
|
-
"action",
|
|
195
|
-
"ask"
|
|
196
|
-
]
|
|
197
|
-
},
|
|
198
|
-
"col_letter": {
|
|
199
|
-
"signature": "def col_letter(index: int) -> str",
|
|
200
|
-
"docstring": "Convert 0-based column index to letter: col_letter(26) \u2192 \"AA\".",
|
|
201
|
-
"tags": [
|
|
202
|
-
"action",
|
|
203
|
-
"ask"
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
"col_index": {
|
|
207
|
-
"signature": "def col_index(letter: str) -> int",
|
|
208
|
-
"docstring": "Convert column letter to 0-based index: col_index(\"AA\") \u2192 26.",
|
|
209
|
-
"tags": [
|
|
210
|
-
"action",
|
|
211
|
-
"ask"
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"interfaces": {
|
|
3
|
+
"Workbook": {
|
|
4
|
+
"docstring": "Workbook wrapper.\nUsage:\n wb = Workbook(app.Workbooks(\"MyFile.xlsx\"))\n\nRaw COM access:\n wb._wb \u2014 the underlying COM Workbook object for direct platform API calls.\n Example: wb._wb.Worksheets(\"Sheet1\").Visible = False",
|
|
5
|
+
"functions": {
|
|
6
|
+
"getSheetNames": {
|
|
7
|
+
"signature": "def getSheetNames() -> list[str]",
|
|
8
|
+
"docstring": "Get the names of all sheets in the workbook.",
|
|
9
|
+
"tags": ["action", "ask"]
|
|
10
|
+
},
|
|
11
|
+
"getWorkbookSummary": {
|
|
12
|
+
"signature": "def getWorkbookSummary() -> str",
|
|
13
|
+
"docstring": "Get sheet names and used ranges for this workbook.\nReturns lines like:\n Sheets and their used ranges:\n Sheet1: A1:D10 (active)\n Inputs: (empty)",
|
|
14
|
+
"tags": ["action", "ask"]
|
|
15
|
+
},
|
|
16
|
+
"getSheet": {
|
|
17
|
+
"signature": "def getSheet(name: str) -> 'Worksheet'",
|
|
18
|
+
"docstring": "Get a sheet by name, returned as a wrapped Worksheet.",
|
|
19
|
+
"tags": ["action", "ask"]
|
|
20
|
+
},
|
|
21
|
+
"addSheet": {
|
|
22
|
+
"signature": "def addSheet(name: str, index: int | None = None) -> 'Worksheet'",
|
|
23
|
+
"docstring": "Add a new sheet at 0-based index. index=0 inserts before the first sheet.\nOmit index for Excel's default position.\nExample: wb.addSheet(\"NewSheet\", 0) # insert as first sheet",
|
|
24
|
+
"tags": ["action"]
|
|
25
|
+
},
|
|
26
|
+
"moveSheet": {
|
|
27
|
+
"signature": "def moveSheet(name: str, index: int) -> None",
|
|
28
|
+
"docstring": "Move a sheet to 0-based index. index=0 moves to first, index=Count-1 moves to last.\nExample: wb.moveSheet(\"Data\", 0) # move to first position",
|
|
29
|
+
"tags": ["action"]
|
|
30
|
+
},
|
|
31
|
+
"calculate": {
|
|
32
|
+
"signature": "def calculate() -> None",
|
|
33
|
+
"docstring": "Recalculate the entire workbook.\nDependent formulas don't update until after code block completes \u2014 read in a follow-up block.",
|
|
34
|
+
"tags": ["action"]
|
|
35
|
+
},
|
|
36
|
+
"errorCheck": {
|
|
37
|
+
"signature": "def errorCheck(ranges: list[str] | None = None) -> str",
|
|
38
|
+
"docstring": "Scan for errors (#REF!, #DIV/0!, #NAME?, #VALUE!, #N/A, #NULL!, #NUM!). Ranges MUST include a sheet name (\"Sheet1\" or \"Sheet1!A1:D50\") \u2014 bare ranges like \"A1:D50\" will fail.\n Args:\n ranges: Optional sheet names (\"Sheet1\") or ranges (\"Sheet1!A1:D50\"). Omit to check all.\n Returns:\n \"No issues found.\" or \"Errors (N):\nSheet1!A1: #REF!\n...\"",
|
|
39
|
+
"tags": ["action", "ask"]
|
|
40
|
+
},
|
|
41
|
+
"copyPasteRange": {
|
|
42
|
+
"signature": "def copyPasteRange(from_range: str, to_address: str, paste_type: str = 'all', ) -> None",
|
|
43
|
+
"docstring": "Copy range within same workbook via range.Copy + PasteSpecial.\nAddresses must include sheet name. Do NOT use Sheet.Copy (broken via pywin32).\nExample: wb.copyPasteRange(\"Sheet1!A1:D10\", \"Sheet2!A1\", paste_type=\"values\")",
|
|
44
|
+
"tags": ["action"]
|
|
45
|
+
},
|
|
46
|
+
"getNamedRangeInfo": {
|
|
47
|
+
"signature": "def getNamedRangeInfo(max_count: int = 50) -> str",
|
|
48
|
+
"docstring": "Get named ranges. Returns formatted string with name, reference, scope, and comment.\nExample output: \"Named Ranges (2):\\n Name: TaxRate | Ref: =Settings!$B$2 | Scope: workbook | Comment: ...\"\nReturns \"No named ranges found.\" if none exist.",
|
|
49
|
+
"tags": ["action", "ask"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"Worksheet": {
|
|
54
|
+
"docstring": "Worksheet wrapper.\nUsage:\n sheet = wb.getSheet(\"Sheet1\")\n\nRaw COM access:\n sheet._ws \u2014 the underlying COM Worksheet object for direct platform API calls.\n Use for borders, text orientation, cell protection, and other properties not covered by the wrapper.\n Example: sheet._ws.Range(\"A1\").Borders(9).LineStyle = 1 # xlEdgeBottom, xlContinuous",
|
|
55
|
+
"functions": {
|
|
56
|
+
"getSheetSummary": {
|
|
57
|
+
"signature": "def getSheetSummary() -> str",
|
|
58
|
+
"docstring": "Overview: name, used range, tables (with style/banded/header/total props),\npivots (with range), conditional formats (type/range/priority/stopIfTrue),\nautofilter (with filtering status), charts (with type).",
|
|
59
|
+
"tags": ["action", "ask"]
|
|
60
|
+
},
|
|
61
|
+
"getUsedRange": {
|
|
62
|
+
"signature": "def getUsedRange() -> str",
|
|
63
|
+
"docstring": "Get the used range address like \"A1:F20\", or \"\" if empty.",
|
|
64
|
+
"tags": ["action", "ask"]
|
|
65
|
+
},
|
|
66
|
+
"getCell": {
|
|
67
|
+
"signature": "def getCell(address: str, include_style: bool = True) -> str",
|
|
68
|
+
"docstring": "Formatted cell string: \"value(=FORMULA) (style_json)\". Formula always included.\nZero with custom format appends [0]: \"$ - [0]\".\nExample:\n print(sheet.getCell(\"A1\"))\n print(sheet.getCell(\"A1\", include_style=False))",
|
|
69
|
+
"tags": ["action", "ask"]
|
|
70
|
+
},
|
|
71
|
+
"getCellRange": {
|
|
72
|
+
"signature": "def getCellRange(range_addr: str, include_style: bool = True) -> str",
|
|
73
|
+
"docstring": "Markdown-like range: \"A1:Name | B1:Value\\nA2:Alice | B2:100\". Uses display text. Max 3000 cells.\nAppends \"--- Style patterns ---\" section when include_style=True.",
|
|
74
|
+
"tags": ["action", "ask"]
|
|
75
|
+
},
|
|
76
|
+
"getRawCellData": {
|
|
77
|
+
"signature": "def getRawCellData(address: str, formula: bool = False) -> Any",
|
|
78
|
+
"docstring": "Get raw data value from a cell, preserving data type. Set formula=True to get the formula string.",
|
|
79
|
+
"tags": ["action", "ask"]
|
|
80
|
+
},
|
|
81
|
+
"getRawRangeData": {
|
|
82
|
+
"signature": "def getRawRangeData(range_addr: str, formula: bool = False) -> list[list[Any]]",
|
|
83
|
+
"docstring": "Get raw data for a range as 2D list. Always returns 2D list even for single row/column.",
|
|
84
|
+
"tags": ["action", "ask"]
|
|
85
|
+
},
|
|
86
|
+
"regexSearch": {
|
|
87
|
+
"signature": "def regexSearch(patterns: list[str], match_case: bool = False) -> list[dict]",
|
|
88
|
+
"docstring": "Regex search across used range using display text. Returns [{\"address\": \"A1\", \"value\": \"display text\"}, ...].\nExample: sheet.regexSearch([\"revenue\", \"cost\"])",
|
|
89
|
+
"tags": ["action", "ask"]
|
|
90
|
+
},
|
|
91
|
+
"setCell": {
|
|
92
|
+
"signature": "def setCell(address: str, value: Any, number_format: str | None = None, note: str | None = None, ) -> None",
|
|
93
|
+
"docstring": "Write value or formula. \"=\" prefix = formula. None or \"\" clears the cell.\nExamples:\n sheet.setCell(\"A1\", 8000)\n sheet.setCell(\"C1\", 0.15, number_format=\"0%\", note=\"Tax rate\")\n sheet.setCell(\"B1\", \"=SUM(A1:A10)\")",
|
|
94
|
+
"tags": ["action"]
|
|
95
|
+
},
|
|
96
|
+
"setCellRange": {
|
|
97
|
+
"signature": "def setCellRange(range_addr: str, values: list[list[Any]], number_format: str | None = None, ) -> None",
|
|
98
|
+
"docstring": "Bulk write \u2014 ALWAYS use for >100 cells. \"=\" prefix = formula.\nExamples:\n sheet.setCellRange(\"A1:B2\", [[1, 2], [3, 4]])\n sheet.setCellRange(\"A1:B2\", [[\"=SUM(C1)\", \"=SUM(D1)\"], [5, 6]], number_format=\"$#,##0\")",
|
|
99
|
+
"tags": ["action"]
|
|
100
|
+
},
|
|
101
|
+
"autoFill": {
|
|
102
|
+
"signature": "def autoFill(source_range: str, target_range: str, fill_mode: str = 'auto', ) -> None",
|
|
103
|
+
"docstring": "Drag-fill. Source must be contained within target.\nUse fill_mode=\"constant\" when copying a single value without incrementing.\nWARNING: Single numeric value with \"auto\" creates incrementing sequence (0,1,2,3...).\nExample: sheet.autoFill(\"A1:A2\", \"A1:A10\")",
|
|
104
|
+
"tags": ["action"]
|
|
105
|
+
},
|
|
106
|
+
"addPicture": {
|
|
107
|
+
"signature": "def addPicture(name: str, base64_data: str, anchor_cell: str) -> None",
|
|
108
|
+
"docstring": "Add a picture from base64-encoded PNG or JPEG data. No data URI prefix.\nExample: sheet.addPicture(\"chart1\", base64_string, \"F2\")",
|
|
109
|
+
"tags": ["action"]
|
|
110
|
+
},
|
|
111
|
+
"setIBTextColors": {
|
|
112
|
+
"signature": "def setIBTextColors(range_addr: str, ignored_constants: list[int] | None = None, colors: dict | None = None, ) -> None",
|
|
113
|
+
"docstring": "IB text colors for numeric inputs only. Text strings and booleans are left untouched.\n- Blue/16711680: hard-coded numeric constants (int/float)\n- Black/0: formulas (same-sheet references)\n- Green/32768: formulas with cross-sheet references (contains '!')\nColors are BGR integers (native COM format).\nExample: sheet.setIBTextColors(\"A1:D10\", ignored_constants=[0])",
|
|
114
|
+
"tags": ["action"]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"helpers": {
|
|
120
|
+
"hex_to_bgr": {
|
|
121
|
+
"signature": "def hex_to_bgr(hex_str: str) -> int",
|
|
122
|
+
"docstring": "Convert \"#RRGGBB\" hex string to BGR integer for Excel COM.\nExample: ws.Range(\"A1\").Font.Color = hex_to_bgr(\"#FF0000\") # red",
|
|
123
|
+
"tags": ["action", "ask"]
|
|
124
|
+
},
|
|
125
|
+
"index_to_address": {
|
|
126
|
+
"signature": "def index_to_address(row: int, col: int) -> str",
|
|
127
|
+
"docstring": "Convert 0-based (row, col) to Excel address: index_to_address(0, 0) \u2192 \"A1\".",
|
|
128
|
+
"tags": ["action", "ask"]
|
|
129
|
+
},
|
|
130
|
+
"address_to_index": {
|
|
131
|
+
"signature": "def address_to_index(address: str) -> tuple[int, int]",
|
|
132
|
+
"docstring": "Parse \"A1\" into (row, col) 0-based tuple: address_to_index(\"B3\") \u2192 (2, 1).",
|
|
133
|
+
"tags": ["action", "ask"]
|
|
134
|
+
},
|
|
135
|
+
"col_letter": {
|
|
136
|
+
"signature": "def col_letter(index: int) -> str",
|
|
137
|
+
"docstring": "Convert 0-based column index to letter: col_letter(26) \u2192 \"AA\".",
|
|
138
|
+
"tags": ["action", "ask"]
|
|
139
|
+
},
|
|
140
|
+
"col_index": {
|
|
141
|
+
"signature": "def col_index(letter: str) -> int",
|
|
142
|
+
"docstring": "Convert column letter to 0-based index: col_index(\"AA\") \u2192 26.",
|
|
143
|
+
"tags": ["action", "ask"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|