shortcutxl 0.2.0

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 (423) hide show
  1. package/README.md +59 -0
  2. package/agent-docs/README.md +397 -0
  3. package/agent-docs/docs/compaction.md +390 -0
  4. package/agent-docs/docs/custom-provider.md +580 -0
  5. package/agent-docs/docs/development.md +69 -0
  6. package/agent-docs/docs/extensions.md +1971 -0
  7. package/agent-docs/docs/json.md +79 -0
  8. package/agent-docs/docs/keybindings.md +174 -0
  9. package/agent-docs/docs/models.md +293 -0
  10. package/agent-docs/docs/packages.md +209 -0
  11. package/agent-docs/docs/prompt-templates.md +67 -0
  12. package/agent-docs/docs/providers.md +186 -0
  13. package/agent-docs/docs/rpc.md +1317 -0
  14. package/agent-docs/docs/sdk.md +962 -0
  15. package/agent-docs/docs/session.md +412 -0
  16. package/agent-docs/docs/settings.md +223 -0
  17. package/agent-docs/docs/shell-aliases.md +13 -0
  18. package/agent-docs/docs/skills.md +231 -0
  19. package/agent-docs/docs/terminal-setup.md +70 -0
  20. package/agent-docs/docs/termux.md +127 -0
  21. package/agent-docs/docs/themes.md +295 -0
  22. package/agent-docs/docs/tree.md +219 -0
  23. package/agent-docs/docs/tui.md +887 -0
  24. package/agent-docs/docs/windows.md +17 -0
  25. package/agent-docs/examples/README.md +25 -0
  26. package/agent-docs/examples/extensions/README.md +205 -0
  27. package/agent-docs/examples/extensions/antigravity-image-gen.ts +447 -0
  28. package/agent-docs/examples/extensions/auto-commit-on-exit.ts +49 -0
  29. package/agent-docs/examples/extensions/bash-spawn-hook.ts +30 -0
  30. package/agent-docs/examples/extensions/bookmark.ts +50 -0
  31. package/agent-docs/examples/extensions/built-in-tool-renderer.ts +256 -0
  32. package/agent-docs/examples/extensions/claude-rules.ts +86 -0
  33. package/agent-docs/examples/extensions/commands.ts +75 -0
  34. package/agent-docs/examples/extensions/confirm-destructive.ts +59 -0
  35. package/agent-docs/examples/extensions/custom-compaction.ts +126 -0
  36. package/agent-docs/examples/extensions/custom-footer.ts +63 -0
  37. package/agent-docs/examples/extensions/custom-header.ts +73 -0
  38. package/agent-docs/examples/extensions/custom-provider-anthropic/index.ts +660 -0
  39. package/agent-docs/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  40. package/agent-docs/examples/extensions/custom-provider-anthropic/package.json +19 -0
  41. package/agent-docs/examples/extensions/custom-provider-gitlab-duo/index.ts +362 -0
  42. package/agent-docs/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  43. package/agent-docs/examples/extensions/custom-provider-gitlab-duo/test.ts +88 -0
  44. package/agent-docs/examples/extensions/custom-provider-qwen-cli/index.ts +349 -0
  45. package/agent-docs/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
  46. package/agent-docs/examples/extensions/dirty-repo-guard.ts +56 -0
  47. package/agent-docs/examples/extensions/doom-overlay/README.md +46 -0
  48. package/agent-docs/examples/extensions/doom-overlay/doom/build.sh +152 -0
  49. package/agent-docs/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  50. package/agent-docs/examples/extensions/doom-overlay/doom-component.ts +133 -0
  51. package/agent-docs/examples/extensions/doom-overlay/doom-engine.ts +186 -0
  52. package/agent-docs/examples/extensions/doom-overlay/doom-keys.ts +108 -0
  53. package/agent-docs/examples/extensions/doom-overlay/index.ts +74 -0
  54. package/agent-docs/examples/extensions/doom-overlay/wad-finder.ts +51 -0
  55. package/agent-docs/examples/extensions/dynamic-resources/SKILL.md +8 -0
  56. package/agent-docs/examples/extensions/dynamic-resources/dynamic.json +79 -0
  57. package/agent-docs/examples/extensions/dynamic-resources/dynamic.md +5 -0
  58. package/agent-docs/examples/extensions/dynamic-resources/index.ts +15 -0
  59. package/agent-docs/examples/extensions/dynamic-tools.ts +77 -0
  60. package/agent-docs/examples/extensions/event-bus.ts +43 -0
  61. package/agent-docs/examples/extensions/file-trigger.ts +41 -0
  62. package/agent-docs/examples/extensions/git-checkpoint.ts +53 -0
  63. package/agent-docs/examples/extensions/handoff.ts +155 -0
  64. package/agent-docs/examples/extensions/hello.ts +25 -0
  65. package/agent-docs/examples/extensions/inline-bash.ts +94 -0
  66. package/agent-docs/examples/extensions/input-transform.ts +43 -0
  67. package/agent-docs/examples/extensions/interactive-shell.ts +209 -0
  68. package/agent-docs/examples/extensions/mac-system-theme.ts +47 -0
  69. package/agent-docs/examples/extensions/message-renderer.ts +59 -0
  70. package/agent-docs/examples/extensions/minimal-mode.ts +430 -0
  71. package/agent-docs/examples/extensions/modal-editor.ts +90 -0
  72. package/agent-docs/examples/extensions/model-status.ts +31 -0
  73. package/agent-docs/examples/extensions/notify.ts +55 -0
  74. package/agent-docs/examples/extensions/overlay-qa-tests.ts +936 -0
  75. package/agent-docs/examples/extensions/overlay-test.ts +159 -0
  76. package/agent-docs/examples/extensions/permission-gate.ts +37 -0
  77. package/agent-docs/examples/extensions/pirate.ts +47 -0
  78. package/agent-docs/examples/extensions/plan-mode/README.md +65 -0
  79. package/agent-docs/examples/extensions/plan-mode/index.ts +363 -0
  80. package/agent-docs/examples/extensions/plan-mode/utils.ts +173 -0
  81. package/agent-docs/examples/extensions/preset.ts +418 -0
  82. package/agent-docs/examples/extensions/protected-paths.ts +30 -0
  83. package/agent-docs/examples/extensions/qna.ts +122 -0
  84. package/agent-docs/examples/extensions/question.ts +278 -0
  85. package/agent-docs/examples/extensions/questionnaire.ts +440 -0
  86. package/agent-docs/examples/extensions/rainbow-editor.ts +90 -0
  87. package/agent-docs/examples/extensions/reload-runtime.ts +37 -0
  88. package/agent-docs/examples/extensions/rpc-demo.ts +124 -0
  89. package/agent-docs/examples/extensions/sandbox/index.ts +324 -0
  90. package/agent-docs/examples/extensions/sandbox/package-lock.json +92 -0
  91. package/agent-docs/examples/extensions/sandbox/package.json +19 -0
  92. package/agent-docs/examples/extensions/send-user-message.ts +97 -0
  93. package/agent-docs/examples/extensions/session-name.ts +27 -0
  94. package/agent-docs/examples/extensions/shutdown-command.ts +69 -0
  95. package/agent-docs/examples/extensions/snake.ts +343 -0
  96. package/agent-docs/examples/extensions/space-invaders.ts +566 -0
  97. package/agent-docs/examples/extensions/ssh.ts +233 -0
  98. package/agent-docs/examples/extensions/status-line.ts +40 -0
  99. package/agent-docs/examples/extensions/subagent/README.md +172 -0
  100. package/agent-docs/examples/extensions/subagent/agents/planner.md +37 -0
  101. package/agent-docs/examples/extensions/subagent/agents/reviewer.md +35 -0
  102. package/agent-docs/examples/extensions/subagent/agents/scout.md +50 -0
  103. package/agent-docs/examples/extensions/subagent/agents/worker.md +24 -0
  104. package/agent-docs/examples/extensions/subagent/agents.ts +130 -0
  105. package/agent-docs/examples/extensions/subagent/index.ts +1068 -0
  106. package/agent-docs/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  107. package/agent-docs/examples/extensions/subagent/prompts/implement.md +10 -0
  108. package/agent-docs/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  109. package/agent-docs/examples/extensions/summarize.ts +206 -0
  110. package/agent-docs/examples/extensions/system-prompt-header.ts +17 -0
  111. package/agent-docs/examples/extensions/timed-confirm.ts +72 -0
  112. package/agent-docs/examples/extensions/titlebar-spinner.ts +58 -0
  113. package/agent-docs/examples/extensions/todo.ts +314 -0
  114. package/agent-docs/examples/extensions/tool-override.ts +146 -0
  115. package/agent-docs/examples/extensions/tools.ts +145 -0
  116. package/agent-docs/examples/extensions/trigger-compact.ts +40 -0
  117. package/agent-docs/examples/extensions/truncated-tool.ts +194 -0
  118. package/agent-docs/examples/extensions/widget-placement.ts +17 -0
  119. package/agent-docs/examples/extensions/with-deps/index.ts +37 -0
  120. package/agent-docs/examples/extensions/with-deps/package-lock.json +31 -0
  121. package/agent-docs/examples/extensions/with-deps/package.json +22 -0
  122. package/agent-docs/examples/rpc-extension-ui.ts +654 -0
  123. package/agent-docs/examples/sdk/01-minimal.ts +22 -0
  124. package/agent-docs/examples/sdk/02-custom-model.ts +48 -0
  125. package/agent-docs/examples/sdk/03-custom-prompt.ts +55 -0
  126. package/agent-docs/examples/sdk/04-skills.ts +53 -0
  127. package/agent-docs/examples/sdk/05-tools.ts +56 -0
  128. package/agent-docs/examples/sdk/06-extensions.ts +88 -0
  129. package/agent-docs/examples/sdk/07-context-files.ts +40 -0
  130. package/agent-docs/examples/sdk/08-prompt-templates.ts +47 -0
  131. package/agent-docs/examples/sdk/09-api-keys-and-oauth.ts +48 -0
  132. package/agent-docs/examples/sdk/10-settings.ts +54 -0
  133. package/agent-docs/examples/sdk/11-sessions.ts +48 -0
  134. package/agent-docs/examples/sdk/12-full-control.ts +82 -0
  135. package/agent-docs/examples/sdk/README.md +144 -0
  136. package/agent-docs/xll-skill.md +61 -0
  137. package/agent-docs/xll-spec.md +110 -0
  138. package/dist/cli/args.js +290 -0
  139. package/dist/cli/config-selector.js +31 -0
  140. package/dist/cli/file-processor.js +79 -0
  141. package/dist/cli/list-models.js +92 -0
  142. package/dist/cli/package-commands.js +210 -0
  143. package/dist/cli/report-settings-errors.js +11 -0
  144. package/dist/cli/session-picker.js +34 -0
  145. package/dist/cli.js +19 -0
  146. package/dist/config.js +288 -0
  147. package/dist/core/abort.js +15 -0
  148. package/dist/core/agent-loop.js +352 -0
  149. package/dist/core/agent-session.js +2019 -0
  150. package/dist/core/agent.js +410 -0
  151. package/dist/core/auth-storage.js +456 -0
  152. package/dist/core/bash-executor.js +222 -0
  153. package/dist/core/compaction/branch-summarization.js +242 -0
  154. package/dist/core/compaction/compaction.js +610 -0
  155. package/dist/core/compaction/index.js +7 -0
  156. package/dist/core/compaction/utils.js +139 -0
  157. package/dist/core/defaults.js +6 -0
  158. package/dist/core/diagnostics.js +2 -0
  159. package/dist/core/event-bus.js +25 -0
  160. package/dist/core/exec.js +71 -0
  161. package/dist/core/export-html/ansi-to-html.js +256 -0
  162. package/dist/core/export-html/index.js +238 -0
  163. package/dist/core/export-html/session-view-model.js +342 -0
  164. package/dist/core/export-html/template.css +1110 -0
  165. package/dist/core/export-html/template.html +76 -0
  166. package/dist/core/export-html/template.js +1990 -0
  167. package/dist/core/export-html/tool-renderer.js +63 -0
  168. package/dist/core/export-html/vendor/highlight.min.js +7725 -0
  169. package/dist/core/export-html/vendor/marked.min.js +1803 -0
  170. package/dist/core/extensions/index.js +9 -0
  171. package/dist/core/extensions/loader.js +422 -0
  172. package/dist/core/extensions/runner.js +651 -0
  173. package/dist/core/extensions/types.js +35 -0
  174. package/dist/core/extensions/wrapper.js +102 -0
  175. package/dist/core/footer-data-provider.js +162 -0
  176. package/dist/core/index.js +9 -0
  177. package/dist/core/keybindings.js +153 -0
  178. package/dist/core/messages.js +133 -0
  179. package/dist/core/model-registry.js +539 -0
  180. package/dist/core/model-resolver.js +370 -0
  181. package/dist/core/package-manager.js +1485 -0
  182. package/dist/core/prompt-templates.js +253 -0
  183. package/dist/core/resolve-config-value.js +59 -0
  184. package/dist/core/resource-loader.js +700 -0
  185. package/dist/core/sdk.js +197 -0
  186. package/dist/core/session-bash.js +99 -0
  187. package/dist/core/session-compaction.js +165 -0
  188. package/dist/core/session-manager.js +1153 -0
  189. package/dist/core/session-models.js +99 -0
  190. package/dist/core/session-retry.js +155 -0
  191. package/dist/core/settings-manager.js +572 -0
  192. package/dist/core/skills.js +382 -0
  193. package/dist/core/slash-commands.js +31 -0
  194. package/dist/core/system-prompt.js +161 -0
  195. package/dist/core/theme.js +770 -0
  196. package/dist/core/timings.js +26 -0
  197. package/dist/core/tools/bash.js +258 -0
  198. package/dist/core/tools/edit-diff.js +245 -0
  199. package/dist/core/tools/edit.js +148 -0
  200. package/dist/core/tools/find.js +208 -0
  201. package/dist/core/tools/grep.js +246 -0
  202. package/dist/core/tools/index.js +67 -0
  203. package/dist/core/tools/ls.js +123 -0
  204. package/dist/core/tools/path-utils.js +81 -0
  205. package/dist/core/tools/read.js +160 -0
  206. package/dist/core/tools/truncate.js +70 -0
  207. package/dist/core/tools/write.js +82 -0
  208. package/dist/custom/agents/action.js +13 -0
  209. package/dist/custom/agents/document-reader.js +70 -0
  210. package/dist/custom/agents/general.js +26 -0
  211. package/dist/custom/agents/index.js +49 -0
  212. package/dist/custom/agents/installation.js +13 -0
  213. package/dist/custom/agents/types.js +7 -0
  214. package/dist/custom/auth/refresh-timer.js +33 -0
  215. package/dist/custom/auth/shortcut-oauth.js +145 -0
  216. package/dist/custom/constants.js +21 -0
  217. package/dist/custom/context/workbook-summary.js +73 -0
  218. package/dist/custom/credits/shortcut-credits.js +29 -0
  219. package/dist/custom/cron/cron-daemon-entry.js +18 -0
  220. package/dist/custom/cron/daemon-ipc.js +131 -0
  221. package/dist/custom/cron/daemon.js +224 -0
  222. package/dist/custom/cron/jobs.js +226 -0
  223. package/dist/custom/cron/run-log.js +51 -0
  224. package/dist/custom/cron/schedule.js +72 -0
  225. package/dist/custom/cron/status-line.js +98 -0
  226. package/dist/custom/cron/store.js +87 -0
  227. package/dist/custom/cron/types.js +8 -0
  228. package/dist/custom/dev/index.js +59 -0
  229. package/dist/custom/dev/trace-export.js +58 -0
  230. package/dist/custom/ensure-excel.js +63 -0
  231. package/dist/custom/excel-config.js +36 -0
  232. package/dist/custom/preflight.js +422 -0
  233. package/dist/custom/prompts/action.js +100 -0
  234. package/dist/custom/prompts/api.js +66 -0
  235. package/dist/custom/prompts/installation.js +124 -0
  236. package/dist/custom/prompts/shared.js +138 -0
  237. package/dist/custom/providers/llm-usage.js +42 -0
  238. package/dist/custom/providers/message-converter.js +74 -0
  239. package/dist/custom/providers/provider-ids.js +9 -0
  240. package/dist/custom/providers/register-openai-codex-provider.js +27 -0
  241. package/dist/custom/providers/register-shortcut-provider.js +52 -0
  242. package/dist/custom/providers/shortcut-invoke.js +117 -0
  243. package/dist/custom/providers/shortcut-stream.js +252 -0
  244. package/dist/custom/providers/sse-protocol.js +38 -0
  245. package/dist/custom/sync-xll.js +130 -0
  246. package/dist/custom/tools/cron.js +413 -0
  247. package/dist/custom/tools/excel-exec.js +167 -0
  248. package/dist/custom/tools/excel-range.js +50 -0
  249. package/dist/custom/tools/llm-analysis.js +265 -0
  250. package/dist/custom/tools/render-helpers.js +38 -0
  251. package/dist/custom/tools/switch-mode.js +94 -0
  252. package/dist/custom/tools/task/agents.js +6 -0
  253. package/dist/custom/tools/task/index.js +8 -0
  254. package/dist/custom/tools/task/render.js +348 -0
  255. package/dist/custom/tools/task/subprocess.js +320 -0
  256. package/dist/custom/tools/task/task.js +205 -0
  257. package/dist/custom/tools/todo-list.js +195 -0
  258. package/dist/custom/tracing/session-upload.js +93 -0
  259. package/dist/index.js +45 -0
  260. package/dist/main.js +613 -0
  261. package/dist/migrations.js +265 -0
  262. package/dist/modes/index.js +8 -0
  263. package/dist/modes/interactive/components/armin.js +337 -0
  264. package/dist/modes/interactive/components/assistant-message.js +94 -0
  265. package/dist/modes/interactive/components/bash-execution.js +171 -0
  266. package/dist/modes/interactive/components/bordered-loader.js +51 -0
  267. package/dist/modes/interactive/components/branch-summary-message.js +45 -0
  268. package/dist/modes/interactive/components/compaction-summary-message.js +46 -0
  269. package/dist/modes/interactive/components/config-selector.js +488 -0
  270. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  271. package/dist/modes/interactive/components/custom-editor.js +93 -0
  272. package/dist/modes/interactive/components/custom-message.js +81 -0
  273. package/dist/modes/interactive/components/daxnuts.js +140 -0
  274. package/dist/modes/interactive/components/diff.js +133 -0
  275. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  276. package/dist/modes/interactive/components/extension-editor.js +105 -0
  277. package/dist/modes/interactive/components/extension-input.js +61 -0
  278. package/dist/modes/interactive/components/extension-selector.js +78 -0
  279. package/dist/modes/interactive/components/footer.js +309 -0
  280. package/dist/modes/interactive/components/index.js +33 -0
  281. package/dist/modes/interactive/components/keybinding-hints.js +61 -0
  282. package/dist/modes/interactive/components/layout.js +64 -0
  283. package/dist/modes/interactive/components/login-dialog.js +148 -0
  284. package/dist/modes/interactive/components/model-selector.js +237 -0
  285. package/dist/modes/interactive/components/oauth-selector.js +111 -0
  286. package/dist/modes/interactive/components/session-selector-search.js +157 -0
  287. package/dist/modes/interactive/components/session-selector.js +860 -0
  288. package/dist/modes/interactive/components/settings-selector.js +123 -0
  289. package/dist/modes/interactive/components/show-images-selector.js +35 -0
  290. package/dist/modes/interactive/components/skill-invocation-message.js +48 -0
  291. package/dist/modes/interactive/components/theme-selector.js +47 -0
  292. package/dist/modes/interactive/components/thinking-selector.js +47 -0
  293. package/dist/modes/interactive/components/tool-execution.js +789 -0
  294. package/dist/modes/interactive/components/tool-group.js +106 -0
  295. package/dist/modes/interactive/components/tree-selector.js +962 -0
  296. package/dist/modes/interactive/components/user-message-selector.js +115 -0
  297. package/dist/modes/interactive/components/user-message.js +48 -0
  298. package/dist/modes/interactive/components/visual-truncate.js +33 -0
  299. package/dist/modes/interactive/file-attachments.js +135 -0
  300. package/dist/modes/interactive/interactive-mode.js +3775 -0
  301. package/dist/modes/interactive/theme/dark.json +85 -0
  302. package/dist/modes/interactive/theme/light.json +85 -0
  303. package/dist/modes/interactive/theme/theme-schema.json +335 -0
  304. package/dist/modes/interactive/theme/theme.js +177 -0
  305. package/dist/modes/print-mode.js +101 -0
  306. package/dist/modes/rpc/rpc-client.js +387 -0
  307. package/dist/modes/rpc/rpc-mode.js +509 -0
  308. package/dist/modes/rpc/rpc-types.js +8 -0
  309. package/dist/subagent-entry.js +145 -0
  310. package/dist/tool-names.js +34 -0
  311. package/dist/tui/autocomplete.js +596 -0
  312. package/dist/tui/components/box.js +104 -0
  313. package/dist/tui/components/cancellable-loader.js +35 -0
  314. package/dist/tui/components/editor.js +1679 -0
  315. package/dist/tui/components/image.js +69 -0
  316. package/dist/tui/components/input.js +433 -0
  317. package/dist/tui/components/loader.js +49 -0
  318. package/dist/tui/components/markdown.js +629 -0
  319. package/dist/tui/components/select-list.js +152 -0
  320. package/dist/tui/components/settings-list.js +185 -0
  321. package/dist/tui/components/spacer.js +23 -0
  322. package/dist/tui/components/text.js +89 -0
  323. package/dist/tui/components/truncated-text.js +51 -0
  324. package/dist/tui/editor-component.js +2 -0
  325. package/dist/tui/fuzzy.js +107 -0
  326. package/dist/tui/get-east-asian-width/index.js +32 -0
  327. package/dist/tui/get-east-asian-width/lookup.js +404 -0
  328. package/dist/tui/index.js +32 -0
  329. package/dist/tui/keybindings.js +114 -0
  330. package/dist/tui/keys.js +959 -0
  331. package/dist/tui/kill-ring.js +44 -0
  332. package/dist/tui/stdin-buffer.js +317 -0
  333. package/dist/tui/terminal-image.js +288 -0
  334. package/dist/tui/terminal.js +249 -0
  335. package/dist/tui/tui/autocomplete.js +596 -0
  336. package/dist/tui/tui/components/box.js +106 -0
  337. package/dist/tui/tui/components/cancellable-loader.js +35 -0
  338. package/dist/tui/tui/components/editor.js +1679 -0
  339. package/dist/tui/tui/components/image.js +69 -0
  340. package/dist/tui/tui/components/input.js +433 -0
  341. package/dist/tui/tui/components/loader.js +49 -0
  342. package/dist/tui/tui/components/markdown.js +629 -0
  343. package/dist/tui/tui/components/select-list.js +152 -0
  344. package/dist/tui/tui/components/settings-list.js +185 -0
  345. package/dist/tui/tui/components/spacer.js +23 -0
  346. package/dist/tui/tui/components/text.js +91 -0
  347. package/dist/tui/tui/components/truncated-text.js +51 -0
  348. package/dist/tui/tui/editor-component.js +2 -0
  349. package/dist/tui/tui/fuzzy.js +107 -0
  350. package/dist/tui/tui/get-east-asian-width/index.js +32 -0
  351. package/dist/tui/tui/get-east-asian-width/lookup.js +404 -0
  352. package/dist/tui/tui/index.js +32 -0
  353. package/dist/tui/tui/keybindings.js +114 -0
  354. package/dist/tui/tui/keys.js +959 -0
  355. package/dist/tui/tui/kill-ring.js +44 -0
  356. package/dist/tui/tui/stdin-buffer.js +317 -0
  357. package/dist/tui/tui/terminal-image.js +288 -0
  358. package/dist/tui/tui/terminal.js +249 -0
  359. package/dist/tui/tui/tui.js +955 -0
  360. package/dist/tui/tui/undo-stack.js +25 -0
  361. package/dist/tui/tui/utils.js +800 -0
  362. package/dist/tui/tui.js +955 -0
  363. package/dist/tui/undo-stack.js +25 -0
  364. package/dist/tui/utils.js +800 -0
  365. package/dist/utils/changelog.js +87 -0
  366. package/dist/utils/clipboard-image.js +164 -0
  367. package/dist/utils/clipboard-native.js +14 -0
  368. package/dist/utils/clipboard.js +67 -0
  369. package/dist/utils/frontmatter.js +26 -0
  370. package/dist/utils/git.js +166 -0
  371. package/dist/utils/image-convert.js +35 -0
  372. package/dist/utils/image-resize.js +183 -0
  373. package/dist/utils/mime.js +26 -0
  374. package/dist/utils/photon.js +121 -0
  375. package/dist/utils/shell.js +217 -0
  376. package/dist/utils/sleep.js +17 -0
  377. package/dist/utils/tools-manager.js +259 -0
  378. package/package.json +78 -0
  379. package/skills/excel-com-api/SKILL.md +74 -0
  380. package/skills/excel-com-api/excel-type-library.py +27767 -0
  381. package/skills/excel-com-api/office-type-library.py +10867 -0
  382. package/skills/integrations/SKILL.md +138 -0
  383. package/skills/integrations/alphasense.md +457 -0
  384. package/skills/integrations/bloomberg.md +803 -0
  385. package/skills/integrations/calcbench.md +315 -0
  386. package/skills/integrations/capiq.md +848 -0
  387. package/skills/integrations/dynamics-365-finance.md +354 -0
  388. package/skills/integrations/earnings_transcripts.md +387 -0
  389. package/skills/integrations/factset.md +758 -0
  390. package/skills/integrations/ice-fixed-income.md +344 -0
  391. package/skills/integrations/moodys-analytics.md +313 -0
  392. package/skills/integrations/morningstar.md +433 -0
  393. package/skills/integrations/nasdaq-data-link.md +249 -0
  394. package/skills/integrations/pitchbook.md +413 -0
  395. package/skills/integrations/preqin.md +422 -0
  396. package/skills/integrations/quickbooks.md +289 -0
  397. package/skills/integrations/quickfs.md +314 -0
  398. package/skills/integrations/refinitiv.md +473 -0
  399. package/skills/integrations/sage-intacct.md +401 -0
  400. package/skills/integrations/visible-alpha.md +320 -0
  401. package/skills/integrations/xero.md +393 -0
  402. package/skills/integrations/ycharts.md +306 -0
  403. package/skills/pdf-creation/SKILL.md +93 -0
  404. package/skills/pdf-extraction/SKILL.md +32 -0
  405. package/skills/powerpoint-creation/SKILL.md +110 -0
  406. package/skills/sec-edgar/SKILL.md +127 -0
  407. package/skills/sec-edgar/sec_to_pdf.py +109 -0
  408. package/xll/ShortcutXL.xll +0 -0
  409. package/xll/modules/debug_render.py +272 -0
  410. package/xll/modules/gameboy.py +241 -0
  411. package/xll/modules/pong.py +188 -0
  412. package/xll/modules/shortcut_xl/__init__.py +18 -0
  413. package/xll/modules/shortcut_xl/_categorize.py +200 -0
  414. package/xll/modules/shortcut_xl/_com.py +108 -0
  415. package/xll/modules/shortcut_xl/_format.py +252 -0
  416. package/xll/modules/shortcut_xl/_log.py +12 -0
  417. package/xll/modules/shortcut_xl/_managed.py +116 -0
  418. package/xll/modules/shortcut_xl/_registry.py +44 -0
  419. package/xll/modules/shortcut_xl/_threading.py +161 -0
  420. package/xll/modules/shortcut_xl/_tracking.py +283 -0
  421. package/xll/modules/stocks.py +100 -0
  422. package/xll/python3.dll +0 -0
  423. package/xll/python312.dll +0 -0
@@ -0,0 +1,306 @@
1
+ **YCharts Excel Formula Guide**
2
+
3
+ **Intro**
4
+ You have full access to YCharts data through the native Excel Add-in (included with YCharts Professional subscription), but you should only pull YCharts data **when the user explicitly tells you to**. YCharts specializes in investment research data including fundamental metrics, valuation ratios, and portfolio analytics for stocks, ETFs, and mutual funds. You can retrieve any data point by writing YCharts formulas directly in Excel cells.
5
+
6
+ **IMPORTANT:** Before completing a task involving YCharts, you must verify:
7
+ 1. Your YCharts formulas do not return errors.
8
+ 2. All values should seem reasonable and make intuitive sense based on your general knowledge of finance.
9
+ 3. Use cell references for tickers and metrics when possible as opposed to hardcoded values.
10
+ 4. Be aware of data coverage - YCharts focuses on US securities and major global markets.
11
+ 5. Mutual funds require the M: prefix; ETFs use standard tickers.
12
+
13
+ You should essentially gut check every value that shows up. If there are any errors or the values seem wrong, you likely wrote the formula syntax incorrectly or are using invalid metric names. Please correct the formula until it outputs the proper value.
14
+
15
+ ---
16
+
17
+ **YCharts Excel Functions Overview**
18
+
19
+ YCharts provides these main Excel functions:
20
+
21
+ | Function | Purpose | Use Case |
22
+ |----------|---------|----------|
23
+ | YCD | YCharts Data | Current or point-in-time single value |
24
+ | YCDS | YCharts Data Series | Historical time series data |
25
+ | YCDU | YCharts Data Universe | Screen securities by criteria |
26
+
27
+ ---
28
+
29
+ **1. YCD - YCharts Data (Single Value)**
30
+
31
+ Returns a single data point for current or historical date.
32
+
33
+ **Syntax:** =YCD("ticker", "metric") or =YCD("ticker", "metric", "date")
34
+
35
+ **Parameters:**
36
+ | Parameter | Description | Required |
37
+ |-----------|-------------|----------|
38
+ | ticker | Security identifier | Yes |
39
+ | metric | Metric name | Yes |
40
+ | date | Optional date (YYYY-MM-DD) | No |
41
+
42
+ **Examples:**
43
+ =YCD("AAPL", "price")
44
+ -> Apple's current stock price.
45
+
46
+ =YCD("MSFT", "pe_ratio")
47
+ -> Microsoft's current P/E ratio.
48
+
49
+ =YCD("AAPL", "price", "2024-01-02")
50
+ -> Apple's price on Jan 2, 2024.
51
+
52
+ **Using Cell References:**
53
+ =YCD(A1, "price")
54
+ -> Price for ticker in cell A1.
55
+
56
+ =YCD("AAPL", B1)
57
+ -> Metric specified in cell B1 for Apple.
58
+
59
+ ---
60
+
61
+ **2. YCDS - YCharts Data Series (Time Series)**
62
+
63
+ Returns historical data over a date range.
64
+
65
+ **Syntax:** =YCDS("ticker", "metric", "start_date", "end_date")
66
+
67
+ **Parameters:**
68
+ | Parameter | Description | Required |
69
+ |-----------|-------------|----------|
70
+ | ticker | Security identifier | Yes |
71
+ | metric | Metric name | Yes |
72
+ | start_date | Start date (YYYY-MM-DD) | Yes |
73
+ | end_date | End date (YYYY-MM-DD) | Yes |
74
+
75
+ **Examples:**
76
+ =YCDS("AAPL", "price", "2024-01-01", "2024-12-31")
77
+ -> Apple daily prices for 2024.
78
+
79
+ =YCDS("SPY", "dividend_yield", "2020-01-01", "2024-01-01")
80
+ -> SPY dividend yield history.
81
+
82
+ =YCDS("M:VFIAX", "nav", "2023-01-01", "2023-12-31")
83
+ -> Vanguard 500 Index Fund NAV history.
84
+
85
+ ---
86
+
87
+ **3. Ticker Format**
88
+
89
+ **Stocks:**
90
+ | Type | Format | Example |
91
+ |------|--------|---------|
92
+ | US Stocks | Standard ticker | `AAPL`, `MSFT`, `GOOGL` |
93
+ | ADRs | Standard ticker | `BABA`, `TSM` |
94
+
95
+ **ETFs:**
96
+ | Type | Format | Example |
97
+ |------|--------|---------|
98
+ | US ETFs | Standard ticker | `SPY`, `QQQ`, `IWM` |
99
+ | International ETFs | Standard ticker | `EFA`, `VWO`, `IEMG` |
100
+
101
+ **Mutual Funds (IMPORTANT: use M: prefix):**
102
+ | Type | Format | Example |
103
+ |------|--------|---------|
104
+ | Mutual Funds | `M:` + ticker | `M:VFIAX`, `M:FXAIX`, `M:TRBCX` |
105
+ | Money Market | `M:` + ticker | `M:SPAXX`, `M:VMFXX` |
106
+
107
+ **Indices:**
108
+ | Index | Ticker |
109
+ |-------|--------|
110
+ | S&P 500 | `^SPX` or `SPY` (ETF proxy) |
111
+ | Nasdaq 100 | `^NDX` or `QQQ` (ETF proxy) |
112
+ | Dow Jones | `^DJI` or `DIA` (ETF proxy) |
113
+ | Russell 2000 | `^RUT` or `IWM` (ETF proxy) |
114
+
115
+ ---
116
+
117
+ **4. Common Metrics Reference**
118
+
119
+ **Pricing Metrics:**
120
+ | Metric | Description |
121
+ |--------|-------------|
122
+ | `price` | Current/last price |
123
+ | `open` | Opening price |
124
+ | `high` | Day's high |
125
+ | `low` | Day's low |
126
+ | `volume` | Trading volume |
127
+ | `price_change_1d` | 1-day price change |
128
+ | `price_change_1d_pct` | 1-day % change |
129
+
130
+ **Valuation Metrics:**
131
+ | Metric | Description |
132
+ |--------|-------------|
133
+ | `pe_ratio` | Price/Earnings ratio |
134
+ | `forward_pe_ratio` | Forward P/E ratio |
135
+ | `peg_ratio` | PEG ratio |
136
+ | `ps_ratio` | Price/Sales ratio |
137
+ | `pb_ratio` | Price/Book ratio |
138
+ | `ev_to_ebitda` | EV/EBITDA |
139
+ | `ev_to_revenue` | EV/Revenue |
140
+ | `dividend_yield` | Dividend yield (%) |
141
+
142
+ **Fundamental Metrics:**
143
+ | Metric | Description |
144
+ |--------|-------------|
145
+ | `market_cap` | Market capitalization |
146
+ | `enterprise_value` | Enterprise value |
147
+ | `revenue` | Total revenue (TTM) |
148
+ | `net_income` | Net income (TTM) |
149
+ | `ebitda` | EBITDA (TTM) |
150
+ | `eps` | Earnings per share |
151
+ | `eps_growth_yoy` | YoY EPS growth |
152
+ | `revenue_growth_yoy` | YoY revenue growth |
153
+
154
+ **Profitability Metrics:**
155
+ | Metric | Description |
156
+ |--------|-------------|
157
+ | `gross_margin` | Gross margin (%) |
158
+ | `operating_margin` | Operating margin (%) |
159
+ | `profit_margin` | Net profit margin (%) |
160
+ | `roe` | Return on equity (%) |
161
+ | `roa` | Return on assets (%) |
162
+ | `roic` | Return on invested capital (%) |
163
+
164
+ **Balance Sheet Metrics:**
165
+ | Metric | Description |
166
+ |--------|-------------|
167
+ | `total_assets` | Total assets |
168
+ | `total_liabilities` | Total liabilities |
169
+ | `total_equity` | Shareholders' equity |
170
+ | `cash_and_equivalents` | Cash on hand |
171
+ | `total_debt` | Total debt |
172
+ | `debt_to_equity` | Debt/Equity ratio |
173
+ | `current_ratio` | Current ratio |
174
+
175
+ **Return Metrics:**
176
+ | Metric | Description |
177
+ |--------|-------------|
178
+ | `return_1m` | 1-month return (%) |
179
+ | `return_3m` | 3-month return (%) |
180
+ | `return_6m` | 6-month return (%) |
181
+ | `return_ytd` | Year-to-date return (%) |
182
+ | `return_1y` | 1-year return (%) |
183
+ | `return_3y` | 3-year annualized return (%) |
184
+ | `return_5y` | 5-year annualized return (%) |
185
+ | `return_10y` | 10-year annualized return (%) |
186
+
187
+ **Fund-Specific Metrics (ETFs & Mutual Funds):**
188
+ | Metric | Description |
189
+ |--------|-------------|
190
+ | `nav` | Net asset value |
191
+ | `expense_ratio` | Expense ratio (%) |
192
+ | `aum` | Assets under management |
193
+ | `morningstar_rating` | Morningstar star rating (1-5) |
194
+ | `turnover_ratio` | Portfolio turnover (%) |
195
+ | `yield_ttm` | Trailing 12-month yield |
196
+ | `sec_yield` | 30-day SEC yield |
197
+
198
+ **Dividend Metrics:**
199
+ | Metric | Description |
200
+ |--------|-------------|
201
+ | `dividend_yield` | Annual dividend yield (%) |
202
+ | `dividend_per_share` | Dividend per share |
203
+ | `dividend_payout_ratio` | Payout ratio (%) |
204
+ | `dividend_growth_5y` | 5-year dividend growth (%) |
205
+ | `ex_dividend_date` | Next ex-dividend date |
206
+
207
+ ---
208
+
209
+ **5. Example Formulas by Use Case**
210
+
211
+ **Current Stock Analysis:**
212
+ =YCD("AAPL", "price")
213
+ -> Apple stock price.
214
+
215
+ =YCD("AAPL", "pe_ratio")
216
+ -> Apple P/E ratio.
217
+
218
+ =YCD("AAPL", "market_cap")
219
+ -> Apple market cap.
220
+
221
+ **Valuation Comparison:**
222
+ =YCD("MSFT", "ev_to_ebitda")
223
+ -> Microsoft EV/EBITDA.
224
+
225
+ =YCD("GOOGL", "ps_ratio")
226
+ -> Google price/sales ratio.
227
+
228
+ **Historical Analysis:**
229
+ =YCDS("AAPL", "price", "2023-01-01", "2023-12-31")
230
+ -> Apple prices for 2023.
231
+
232
+ =YCDS("NVDA", "pe_ratio", "2020-01-01", "2024-01-01")
233
+ -> NVIDIA P/E ratio history.
234
+
235
+ **Fund Analysis:**
236
+ =YCD("M:VFIAX", "expense_ratio")
237
+ -> Vanguard 500 expense ratio.
238
+
239
+ =YCD("M:VFIAX", "morningstar_rating")
240
+ -> Vanguard 500 Morningstar rating.
241
+
242
+ =YCD("SPY", "nav")
243
+ -> SPY ETF NAV.
244
+
245
+ =YCD("QQQ", "yield_ttm")
246
+ -> QQQ trailing yield.
247
+
248
+ **Return Comparison:**
249
+ =YCD("AAPL", "return_1y")
250
+ -> Apple 1-year return.
251
+
252
+ =YCD("M:TRBCX", "return_5y")
253
+ -> T. Rowe Price Blue Chip 5-year return.
254
+
255
+ **Dividend Analysis:**
256
+ =YCD("JNJ", "dividend_yield")
257
+ -> J&J dividend yield.
258
+
259
+ =YCD("KO", "dividend_growth_5y")
260
+ -> Coca-Cola 5-year dividend growth.
261
+
262
+ **Portfolio Building:**
263
+ =YCD(A2, "price") * B2
264
+ -> Position value (ticker in A2, shares in B2).
265
+
266
+ =YCD(A2, "dividend_yield") * YCD(A2, "price") * B2
267
+ -> Annual dividend income for position.
268
+
269
+ ---
270
+
271
+ **6. Error Handling**
272
+
273
+ **Common Errors:**
274
+ | Error | Cause | Solution |
275
+ |-------|-------|----------|
276
+ | #VALUE! | Invalid ticker | Check ticker symbol spelling |
277
+ | #NAME? | Function not recognized | Verify YCharts add-in is enabled |
278
+ | #N/A | Metric not available | Check metric is valid for security type |
279
+ | No data | Coverage gap | Security may not be covered |
280
+ | Wrong value | Missing M: prefix | Use M: prefix for mutual funds |
281
+
282
+ **Debugging Tips:**
283
+ 1. Verify ticker on YCharts website first
284
+ 2. For mutual funds, always use M: prefix
285
+ 3. Check metric names are lowercase with underscores
286
+ 4. Use date format YYYY-MM-DD
287
+ 5. Verify subscription includes Excel add-in access
288
+
289
+ ---
290
+
291
+ **Final Checklist:**
292
+ - What security type? (Stock, ETF, or mutual fund with M: prefix)
293
+ - What metric is needed? (Price, valuation, fundamental, return?)
294
+ - Is this current data (YCD) or historical series (YCDS)?
295
+ - Is the ticker spelled correctly?
296
+ - For mutual funds, did you include the M: prefix?
297
+ - Are metric names in lowercase with underscores?
298
+ - Is the YCharts add-in connected?
299
+
300
+ ---
301
+
302
+ **Additional Resources:**
303
+ - YCharts Platform: https://ycharts.com/
304
+ - Excel Add-in Guide: https://ycharts.com/excel
305
+ - Metric Glossary: https://ycharts.com/glossary
306
+ - Data Coverage: https://ycharts.com/coverage
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: pdf-creation
3
+ description: Use when generating or converting PDFs.
4
+ ---
5
+
6
+ # PDF Generation
7
+
8
+ ## CRITICAL: Work in /tmp, Copy Final to /workspace
9
+
10
+ **Always generate/convert in `/tmp` first**, then copy the final PDF to `/workspace`. Intermediate files aren't useful to the user.
11
+
12
+ ```python
13
+ # Generate in /tmp
14
+ pdf.output('/tmp/report.pdf')
15
+
16
+ # Copy final result to /workspace
17
+ import shutil
18
+ shutil.copy('/tmp/report.pdf', '/workspace/report.pdf')
19
+ ```
20
+
21
+ ---
22
+
23
+ ## CRITICAL: Build Incrementally
24
+
25
+ **DO NOT** write a single massive script. If it fails on page 15, you lose everything.
26
+
27
+ **Build iteratively** - generate a few pages, save to `/tmp`, verify, then add more.
28
+
29
+ ---
30
+
31
+ ## Approaches
32
+
33
+ ### 1. Direct Generation (fpdf/fpdf2, reportlab)
34
+
35
+ Generate in `/tmp`, copy final to `/workspace`:
36
+
37
+ ```python
38
+ pdf = FPDF()
39
+ # ... build PDF ...
40
+ pdf.output('/tmp/report.pdf')
41
+ shutil.copy('/tmp/report.pdf', '/workspace/report.pdf')
42
+ ```
43
+
44
+ ### 2. HTML to PDF (Playwright)
45
+
46
+ Write to `/tmp`, copy final to `/workspace`:
47
+
48
+ ```python
49
+ pdf_bytes = await page.pdf(format="A4")
50
+ with open('/tmp/report.pdf', 'wb') as f:
51
+ f.write(pdf_bytes)
52
+ shutil.copy('/tmp/report.pdf', '/workspace/report.pdf')
53
+ ```
54
+
55
+ ### 3. Office File Conversion (LibreOffice)
56
+
57
+ LibreOffice **cannot** write directly to `/workspace` in GCS:
58
+
59
+ ```
60
+ Error: SfxBaseModel::impl_store failed: 0x507(Error Area:Io Class:Access Code:7)
61
+ ```
62
+
63
+ **Must** write to `/tmp`, then copy:
64
+
65
+ ```bash
66
+ libreoffice --headless --convert-to pdf --outdir /tmp /workspace/file.pptx && cp /tmp/file.pdf /workspace/
67
+ ```
68
+
69
+ The Java warning (`failed to launch javaldx`) is harmless.
70
+
71
+ ---
72
+
73
+ ## fpdf/fpdf2 Gotchas
74
+
75
+ ### Error: "Not enough horizontal space to render a single character"
76
+
77
+ `cell()` moves cursor right; `multi_cell()` needs room.
78
+
79
+ **Fix:** Reset X position before `multi_cell()`:
80
+
81
+ ```python
82
+ pdf.set_x(pdf.l_margin)
83
+ pdf.multi_cell(0, 6, text)
84
+ ```
85
+
86
+ ### Page breaks mid-content
87
+
88
+ **Fix:** Check remaining space before adding content:
89
+
90
+ ```python
91
+ if pdf.get_y() > 250: # Near bottom of A4
92
+ pdf.add_page()
93
+ ```
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: pdf-extraction
3
+ description: Use when extracting data from PDFs. Covers programmatic extraction vs multimodal LLM approaches.
4
+ ---
5
+
6
+ # PDF Data Extraction
7
+
8
+ ## When to Use Programmatic Extraction
9
+
10
+ Use for **structured data with >500 data points** (tables, financial statements, transaction lists). Fast, cheap, accurate, deterministic.
11
+
12
+ ## When to Use Multimodal LLMs
13
+ - **Scanned documents** - No machine-readable text layer
14
+ - **Complex layouts** - Multi-column, nested tables, mixed text/images
15
+ - **Charts and figures** - Visual data that can't be extracted programmatically
16
+ - **Verification** - Spot-check programmatic extraction results
17
+ - **Small extractions** - <500 data points where speed doesn't matter
18
+
19
+ ## Programmatic Library Selection
20
+
21
+ | Library | Best For | Gotchas |
22
+ |---------|----------|---------|
23
+ | **camelot** | Tables with clear borders | `flavor='stream'` for borderless; requires ghostscript |
24
+ | **pdftotext -layout** | Column-aligned text (ideal for LLM input) | CLI only, no Python API for layout mode |
25
+ | **PyMuPDF (fitz)** | Speed, general extraction | Use `sort=True` for reading order; less accurate table detection |
26
+ | **pdfplumber** | Table detection | Loses internal spaces in text cells |
27
+
28
+ ## Key Practices
29
+
30
+ 1. **Use multiple methods and compare** - Run 2-3 extractors, compare row counts and spot-check values
31
+ 2. **Sanity checks** - Verify nulls, empty values, column alignment after extraction
32
+ 3. **Hybrid approach** - Programmatic for bulk structured data, LLM for edge cases and verification
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: powerpoint-creation
3
+ description: Use when creating pptx presentations
4
+ ---
5
+
6
+ # PowerPoint Creation - Common Errors & Fixes
7
+
8
+ ## CRITICAL: Build Incrementally
9
+
10
+ **DO NOT** write a single massive script that creates the entire presentation. If it fails on slide 15, you lose everything.
11
+
12
+ **Instead, build iteratively:**
13
+
14
+ ```python
15
+ # Step 1: Create presentation with title slide, save it
16
+ from pptx import Presentation
17
+ prs = Presentation()
18
+ slide = prs.slides.add_slide(prs.slide_layouts[0])
19
+ slide.shapes.title.text = "Q1 Report"
20
+ prs.save("/workspace/presentation.pptx")
21
+ ```
22
+
23
+ ```python
24
+ # Step 2: Load and add next slide
25
+ prs = Presentation("/workspace/presentation.pptx")
26
+ slide = prs.slides.add_slide(prs.slide_layouts[1])
27
+ slide.shapes.title.text = "Executive Summary"
28
+ # ... add content ...
29
+ prs.save("/workspace/presentation.pptx")
30
+ ```
31
+
32
+ ```python
33
+ # Step 3: Load and add another slide
34
+ prs = Presentation("/workspace/presentation.pptx")
35
+ slide = prs.slides.add_slide(prs.slide_layouts[1])
36
+ slide.shapes.title.text = "Financial Overview"
37
+ # ... add content ...
38
+ prs.save("/workspace/presentation.pptx")
39
+ ```
40
+
41
+ **Benefits:**
42
+ - If slide 3 fails, slides 1-2 are already saved
43
+ - Easier to debug which slide caused the error
44
+ - Can verify each slide looks correct before continuing
45
+
46
+ ---
47
+
48
+ ## Error: RgbColor format issues
49
+
50
+ **Wrong:**
51
+ ```python
52
+ from pptx.dml.color import RgbColor
53
+ color = RgbColor(26, 115, 232) # Integers don't work
54
+ color = RgbColor("#1A73E8") # Strings don't work
55
+ ```
56
+
57
+ **Correct:**
58
+ ```python
59
+ from pptx.dml.color import RgbColor
60
+ color = RgbColor(0x1A, 0x73, 0xE8) # Must use hex literals
61
+
62
+ # Or convert from RGB integers:
63
+ r, g, b = 26, 115, 232
64
+ color = RgbColor(r, g, b) # This works if values are 0-255 integers
65
+ ```
66
+
67
+ **Also correct - use theme colors instead:**
68
+ ```python
69
+ from pptx.enum.dml import MSO_THEME_COLOR
70
+ shape.fill.solid()
71
+ shape.fill.fore_color.theme_color = MSO_THEME_COLOR.ACCENT_1
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Error: OSError [Errno 22] Invalid argument on save
77
+
78
+ ```
79
+ OSError: [Errno 22] Invalid argument
80
+ ```
81
+
82
+ **Causes:**
83
+ 1. Invalid file path (special characters, missing directory)
84
+ 2. Writing to read-only location
85
+ 3. Path doesn't exist
86
+
87
+ **Fix:**
88
+ ```python
89
+ import os
90
+
91
+ # Always use /workspace/ and ensure directory exists
92
+ output_path = "/workspace/outputs/presentation.pptx"
93
+ os.makedirs(os.path.dirname(output_path), exist_ok=True)
94
+ prs.save(output_path)
95
+ ```
96
+
97
+ **Never do:**
98
+ ```python
99
+ prs.save("presentation.pptx") # Relative path - may fail
100
+ prs.save("/tmp/presentation.pptx") # /tmp may have issues
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Output Location
106
+
107
+ Always save to `/workspace/`:
108
+ ```python
109
+ prs.save("/workspace/my_presentation.pptx")
110
+ ```
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: sec-edgar
3
+ description: Research and download SEC EDGAR filings (10-K, 10-Q, 8-K, etc.) for US public companies.
4
+ ---
5
+
6
+ # SEC EDGAR Filing Research
7
+
8
+ **Why PDF instead of XBRL?** SEC filings contain inline XBRL (HTML with embedded XML tags) which creates noise for LLMs. Additionally, ~34% of filings have XBRL tagging errors, companies use non-standard tags, and narrative content (MD&A, Risk Factors) isn't captured in XBRL. PDF + file_perception reads what humans see.
9
+
10
+ **Rate limit:** 10 requests/second. All requests require header: `User-Agent: ShortcutAgent/1.0 (support@shortcut.ai)`
11
+
12
+ ## Workflow Overview
13
+
14
+ 1. **Find company** → Get CIK from ticker/name
15
+ 2. **Fetch metadata** → Get filing list with dates from SEC API
16
+ 3. **VERIFY "LATEST"** → Sort by date, confirm against today's date (CRITICAL!)
17
+ 4. **Convert to PDF** → Use `sec_to_pdf.py` script (Playwright + Chrome)
18
+ 5. **Analyze** → Use `file_perception` on the PDF
19
+
20
+ ---
21
+
22
+ ## API Reference
23
+
24
+ All requests require header: `User-Agent: ShortcutAgent/1.0 (support@shortcut.ai)`
25
+
26
+ | Endpoint | URL |
27
+ |----------|-----|
28
+ | Company tickers | `https://www.sec.gov/files/company_tickers.json` |
29
+ | Filings metadata | `https://data.sec.gov/submissions/CIK{cik_10digit}.json` |
30
+ | Download filing | `https://www.sec.gov/Archives/edgar/data/{cik}/{accession_no_dashes}/{primaryDocument}` |
31
+
32
+ Rate limit: 10 requests/second
33
+
34
+ ## Step 1: Find Company CIK
35
+
36
+ Fetch company tickers JSON and search for the ticker:
37
+
38
+ ```
39
+ GET https://www.sec.gov/files/company_tickers.json
40
+ ```
41
+
42
+ Returns: `{"0": {"cik_str": 320193, "ticker": "AAPL", "title": "Apple Inc."}, ...}`
43
+
44
+ Zero-pad CIK to 10 digits for the next step (e.g., `320193` → `0000320193`).
45
+
46
+ ---
47
+
48
+ ## Step 2: Fetch Filing Metadata
49
+
50
+ ```
51
+ GET https://data.sec.gov/submissions/CIK{cik_10digit}.json
52
+ ```
53
+
54
+ Response contains `filings.recent` with parallel arrays: `form`, `filingDate`, `reportDate`, `accessionNumber`, `primaryDocument`. Index `i` across all arrays gives one filing's info.
55
+
56
+ ---
57
+
58
+ ## Step 3: VERIFY "Latest" Filing (CRITICAL)
59
+
60
+ **NEVER assume the first result is the latest.** The API doesn't guarantee sort order.
61
+
62
+ ### Verification Protocol
63
+
64
+ 1. **Check today's date** from the system prompt (e.g., "Today's date: 2026-01-06")
65
+
66
+ 2. **Collect ALL filings** of the requested type from the parallel arrays
67
+
68
+ 3. **Sort by `filingDate` descending** to find the truly latest
69
+
70
+ 4. **Sanity check against expected filing schedule:**
71
+
72
+ | Filing | Expected Timing |
73
+ |--------|-----------------|
74
+ | 10-K | 60-90 days after fiscal year end |
75
+ | 10-Q | 40-45 days after quarter end |
76
+ | 8-K | Within 4 business days of event |
77
+ | DEF 14A | ~120 days before annual meeting |
78
+
79
+ 5. **Report exact dates to user:**
80
+ > "Found Tesla's latest 10-K filed on 2026-01-29 for fiscal year ending 2025-12-31. Is this the one you need?"
81
+
82
+ ### Red Flags
83
+
84
+ - If today is January 2026 but the "latest" 10-K shows FY2024 → something's wrong
85
+ - If `reportDate` is more than a year old → re-verify or warn user
86
+ - Multiple filings same day → check for amendments (10-K/A vs 10-K)
87
+
88
+ ---
89
+
90
+ ## Step 4: Convert to PDF
91
+
92
+ Build URL from metadata:
93
+
94
+ ```
95
+ https://www.sec.gov/Archives/edgar/data/{cik}/{accession_no_dashes}/{primaryDocument}
96
+ ```
97
+
98
+ - Remove dashes from `accessionNumber` for URL path
99
+ - Use unpadded CIK (no leading zeros)
100
+
101
+ Example:
102
+ - CIK: `320193`
103
+ - Accession: `0000320193-25-000123` → `000032019325000123`
104
+ - Document: `aapl-20250928.htm`
105
+ - URL: `https://www.sec.gov/Archives/edgar/data/320193/000032019325000123/aapl-20250928.htm`
106
+
107
+ Use the `sec_to_pdf.py` script to convert directly from URL (renders images properly):
108
+
109
+ ```bash
110
+ python /skills/default/sec-edgar/sec_to_pdf.py "<filing_url>" "/workspace/sec/{TICKER}/{form}_{report_date}.pdf"
111
+ ```
112
+
113
+ **File path convention:** Always save SEC filings to `/workspace/sec/{TICKER}/{form}_{report_date}.pdf`
114
+ - Example: `/workspace/sec/AAPL/10-K_2024-09-28.pdf`
115
+ - Example: `/workspace/sec/TSLA/10-Q_2024-06-30.pdf`
116
+ - This keeps filings organized by company and makes them easy to find later
117
+
118
+ **Why Chrome?** Two reasons: (1) SEC.gov blocks headless Chromium with 403 errors - real Chrome bypasses this. (2) Downloading HTML locally breaks relative image paths; Chrome navigating directly to the URL keeps images loading from SEC's servers.
119
+
120
+ **Fallback:** If the script fails, you can use httpx to download locally and `weasyprint` amongst other tools and packages to convert the html to PDF.
121
+ If you download HTML first and use `filename=`, relative image paths may break and images may not get rendered. You will have to check and fix this.
122
+
123
+ ---
124
+
125
+ ## Step 5: Analyze with file_perception
126
+
127
+ Use `file_perception` on the PDF to extract information.