@kortix/sandbox 0.4.1

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 (246) hide show
  1. package/config/customize.sh +143 -0
  2. package/config/kortix-env-setup.sh +25 -0
  3. package/kortix-master/package.json +22 -0
  4. package/kortix-master/src/config.ts +22 -0
  5. package/kortix-master/src/index.ts +44 -0
  6. package/kortix-master/src/routes/env.ts +65 -0
  7. package/kortix-master/src/routes/proxy.ts +108 -0
  8. package/kortix-master/src/routes/update.ts +185 -0
  9. package/kortix-master/src/services/proxy.ts +43 -0
  10. package/kortix-master/src/services/secret-store.ts +156 -0
  11. package/kortix-master/tsconfig.json +14 -0
  12. package/opencode/agents/kortix-browser.md +142 -0
  13. package/opencode/agents/kortix-build.md +62 -0
  14. package/opencode/agents/kortix-explore.md +66 -0
  15. package/opencode/agents/kortix-image-gen.md +33 -0
  16. package/opencode/agents/kortix-main.md +450 -0
  17. package/opencode/agents/kortix-plan.md +100 -0
  18. package/opencode/agents/kortix-research.md +84 -0
  19. package/opencode/agents/kortix-sheets.md +61 -0
  20. package/opencode/agents/kortix-slides.md +64 -0
  21. package/opencode/agents/kortix-web-dev.md +572 -0
  22. package/opencode/commands/email.md +36 -0
  23. package/opencode/commands/init.md +43 -0
  24. package/opencode/commands/journal.md +44 -0
  25. package/opencode/commands/memory-init.md +81 -0
  26. package/opencode/commands/memory-search.md +50 -0
  27. package/opencode/commands/memory-status.md +56 -0
  28. package/opencode/commands/research.md +36 -0
  29. package/opencode/commands/search.md +38 -0
  30. package/opencode/commands/slides.md +32 -0
  31. package/opencode/commands/spreadsheet.md +30 -0
  32. package/opencode/memory.json +37 -0
  33. package/opencode/ocx.jsonc +10 -0
  34. package/opencode/opencode.jsonc +103 -0
  35. package/opencode/package.json +25 -0
  36. package/opencode/patches/apply.sh +19 -0
  37. package/opencode/patches/opencode-pty-spawn.txt +49 -0
  38. package/opencode/plugin/background-agents.ts.disabled +483 -0
  39. package/opencode/plugin/kdco-primitives/get-project-id.ts +172 -0
  40. package/opencode/plugin/kdco-primitives/index.ts +26 -0
  41. package/opencode/plugin/kdco-primitives/log-warn.ts +51 -0
  42. package/opencode/plugin/kdco-primitives/mutex.ts +122 -0
  43. package/opencode/plugin/kdco-primitives/shell.ts +138 -0
  44. package/opencode/plugin/kdco-primitives/temp.ts +36 -0
  45. package/opencode/plugin/kdco-primitives/terminal-detect.ts +34 -0
  46. package/opencode/plugin/kdco-primitives/types.ts +13 -0
  47. package/opencode/plugin/kdco-primitives/with-timeout.ts +84 -0
  48. package/opencode/plugin/memory.ts +306 -0
  49. package/opencode/plugin/worktree/state.ts +412 -0
  50. package/opencode/plugin/worktree/terminal.ts +1002 -0
  51. package/opencode/plugin/worktree.ts +861 -0
  52. package/opencode/skills/KORTIX-browser/SKILL.md +478 -0
  53. package/opencode/skills/KORTIX-cron-triggers/SKILL.md +173 -0
  54. package/opencode/skills/KORTIX-deep-research/SKILL.md +278 -0
  55. package/opencode/skills/KORTIX-docx/SKILL.md +398 -0
  56. package/opencode/skills/KORTIX-docx/scripts/__init__.py +1 -0
  57. package/opencode/skills/KORTIX-docx/scripts/accept_changes.py +104 -0
  58. package/opencode/skills/KORTIX-docx/scripts/comment.py +244 -0
  59. package/opencode/skills/KORTIX-docx/scripts/office/helpers/__init__.py +0 -0
  60. package/opencode/skills/KORTIX-docx/scripts/office/helpers/merge_runs.py +199 -0
  61. package/opencode/skills/KORTIX-docx/scripts/office/helpers/simplify_redlines.py +197 -0
  62. package/opencode/skills/KORTIX-docx/scripts/office/pack.py +159 -0
  63. package/opencode/skills/KORTIX-docx/scripts/office/soffice.py +183 -0
  64. package/opencode/skills/KORTIX-docx/scripts/office/unpack.py +132 -0
  65. package/opencode/skills/KORTIX-docx/scripts/office/validate.py +111 -0
  66. package/opencode/skills/KORTIX-docx/scripts/office/validators/__init__.py +15 -0
  67. package/opencode/skills/KORTIX-docx/scripts/office/validators/base.py +847 -0
  68. package/opencode/skills/KORTIX-docx/scripts/office/validators/docx.py +446 -0
  69. package/opencode/skills/KORTIX-docx/scripts/office/validators/pptx.py +275 -0
  70. package/opencode/skills/KORTIX-docx/scripts/office/validators/redlining.py +247 -0
  71. package/opencode/skills/KORTIX-docx/scripts/render_docx.py +179 -0
  72. package/opencode/skills/KORTIX-docx/scripts/templates/comments.xml +3 -0
  73. package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtended.xml +3 -0
  74. package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtensible.xml +3 -0
  75. package/opencode/skills/KORTIX-docx/scripts/templates/commentsIds.xml +3 -0
  76. package/opencode/skills/KORTIX-docx/scripts/templates/people.xml +3 -0
  77. package/opencode/skills/KORTIX-domain-research/SKILL.md +96 -0
  78. package/opencode/skills/KORTIX-domain-research/scripts/domain-lookup.py +810 -0
  79. package/opencode/skills/KORTIX-elevenlabs/SKILL.md +230 -0
  80. package/opencode/skills/KORTIX-elevenlabs/scripts/tts.py +389 -0
  81. package/opencode/skills/KORTIX-email/SKILL.md +145 -0
  82. package/opencode/skills/KORTIX-legal-writer/SKILL.md +409 -0
  83. package/opencode/skills/KORTIX-legal-writer/references/bluebook.md +152 -0
  84. package/opencode/skills/KORTIX-legal-writer/references/document-types.md +416 -0
  85. package/opencode/skills/KORTIX-legal-writer/scripts/courtlistener.py +291 -0
  86. package/opencode/skills/KORTIX-legal-writer/scripts/ecfr_lookup.py +299 -0
  87. package/opencode/skills/KORTIX-legal-writer/scripts/verify-legal.py +507 -0
  88. package/opencode/skills/KORTIX-logo-creator/SKILL.md +293 -0
  89. package/opencode/skills/KORTIX-logo-creator/references/prompt-patterns.md +134 -0
  90. package/opencode/skills/KORTIX-logo-creator/scripts/compose_logo.py +406 -0
  91. package/opencode/skills/KORTIX-logo-creator/scripts/create_logo_sheet.py +258 -0
  92. package/opencode/skills/KORTIX-logo-creator/scripts/remove_bg.py +96 -0
  93. package/opencode/skills/KORTIX-memory/SKILL.md +261 -0
  94. package/opencode/skills/KORTIX-memory/scripts/export-sessions.py +409 -0
  95. package/opencode/skills/KORTIX-paper-creator/SKILL.md +549 -0
  96. package/opencode/skills/KORTIX-paper-creator/assets/template.tex +101 -0
  97. package/opencode/skills/KORTIX-paper-creator/scripts/compile.sh +177 -0
  98. package/opencode/skills/KORTIX-paper-creator/scripts/openalex_to_bibtex.py +220 -0
  99. package/opencode/skills/KORTIX-paper-creator/scripts/verify.sh +354 -0
  100. package/opencode/skills/KORTIX-paper-search/SKILL.md +418 -0
  101. package/opencode/skills/KORTIX-pdf/SKILL.md +232 -0
  102. package/opencode/skills/KORTIX-pdf/forms.md +36 -0
  103. package/opencode/skills/KORTIX-pdf/reference.md +105 -0
  104. package/opencode/skills/KORTIX-pdf/scripts/check_bounding_boxes.py +65 -0
  105. package/opencode/skills/KORTIX-pdf/scripts/check_fillable_fields.py +11 -0
  106. package/opencode/skills/KORTIX-pdf/scripts/convert_pdf_to_images.py +33 -0
  107. package/opencode/skills/KORTIX-pdf/scripts/create_validation_image.py +37 -0
  108. package/opencode/skills/KORTIX-pdf/scripts/extract_form_field_info.py +122 -0
  109. package/opencode/skills/KORTIX-pdf/scripts/extract_form_structure.py +115 -0
  110. package/opencode/skills/KORTIX-pdf/scripts/fill_fillable_fields.py +98 -0
  111. package/opencode/skills/KORTIX-pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  112. package/opencode/skills/KORTIX-plan/SKILL.md +228 -0
  113. package/opencode/skills/KORTIX-presentation-viewer/SKILL.md +87 -0
  114. package/opencode/skills/KORTIX-presentation-viewer/serve.ts +136 -0
  115. package/opencode/skills/KORTIX-presentation-viewer/viewer.html +559 -0
  116. package/opencode/skills/KORTIX-presentations/SKILL.md +344 -0
  117. package/opencode/skills/KORTIX-remotion/SKILL.md +56 -0
  118. package/opencode/skills/KORTIX-remotion/rules/3d.md +86 -0
  119. package/opencode/skills/KORTIX-remotion/rules/animations.md +29 -0
  120. package/opencode/skills/KORTIX-remotion/rules/assets.md +78 -0
  121. package/opencode/skills/KORTIX-remotion/rules/audio-visualization.md +198 -0
  122. package/opencode/skills/KORTIX-remotion/rules/audio.md +169 -0
  123. package/opencode/skills/KORTIX-remotion/rules/calculate-metadata.md +104 -0
  124. package/opencode/skills/KORTIX-remotion/rules/can-decode.md +75 -0
  125. package/opencode/skills/KORTIX-remotion/rules/charts.md +120 -0
  126. package/opencode/skills/KORTIX-remotion/rules/compositions.md +141 -0
  127. package/opencode/skills/KORTIX-remotion/rules/display-captions.md +184 -0
  128. package/opencode/skills/KORTIX-remotion/rules/extract-frames.md +229 -0
  129. package/opencode/skills/KORTIX-remotion/rules/ffmpeg.md +38 -0
  130. package/opencode/skills/KORTIX-remotion/rules/fonts.md +152 -0
  131. package/opencode/skills/KORTIX-remotion/rules/get-audio-duration.md +58 -0
  132. package/opencode/skills/KORTIX-remotion/rules/get-video-dimensions.md +68 -0
  133. package/opencode/skills/KORTIX-remotion/rules/get-video-duration.md +58 -0
  134. package/opencode/skills/KORTIX-remotion/rules/gifs.md +141 -0
  135. package/opencode/skills/KORTIX-remotion/rules/images.md +130 -0
  136. package/opencode/skills/KORTIX-remotion/rules/import-srt-captions.md +69 -0
  137. package/opencode/skills/KORTIX-remotion/rules/light-leaks.md +73 -0
  138. package/opencode/skills/KORTIX-remotion/rules/lottie.md +68 -0
  139. package/opencode/skills/KORTIX-remotion/rules/maps.md +401 -0
  140. package/opencode/skills/KORTIX-remotion/rules/measuring-dom-nodes.md +35 -0
  141. package/opencode/skills/KORTIX-remotion/rules/measuring-text.md +143 -0
  142. package/opencode/skills/KORTIX-remotion/rules/parameters.md +98 -0
  143. package/opencode/skills/KORTIX-remotion/rules/sequencing.md +118 -0
  144. package/opencode/skills/KORTIX-remotion/rules/subtitles.md +36 -0
  145. package/opencode/skills/KORTIX-remotion/rules/tailwind.md +11 -0
  146. package/opencode/skills/KORTIX-remotion/rules/text-animations.md +20 -0
  147. package/opencode/skills/KORTIX-remotion/rules/timing.md +179 -0
  148. package/opencode/skills/KORTIX-remotion/rules/transcribe-captions.md +70 -0
  149. package/opencode/skills/KORTIX-remotion/rules/transitions.md +197 -0
  150. package/opencode/skills/KORTIX-remotion/rules/transparent-videos.md +106 -0
  151. package/opencode/skills/KORTIX-remotion/rules/trimming.md +53 -0
  152. package/opencode/skills/KORTIX-remotion/rules/videos.md +171 -0
  153. package/opencode/skills/KORTIX-secrets/SKILL.md +280 -0
  154. package/opencode/skills/KORTIX-semantic-search/SKILL.md +213 -0
  155. package/opencode/skills/KORTIX-session-search/SKILL.md +807 -0
  156. package/opencode/skills/KORTIX-session-search/Untitled +1 -0
  157. package/opencode/skills/KORTIX-skill-creator/SKILL.md +163 -0
  158. package/opencode/skills/KORTIX-web-research/SKILL.md +69 -0
  159. package/opencode/skills/KORTIX-xlsx/LICENSE.txt +30 -0
  160. package/opencode/skills/KORTIX-xlsx/SKILL.md +549 -0
  161. package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/__init__.py +0 -0
  162. package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/merge_runs.py +199 -0
  163. package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
  164. package/opencode/skills/KORTIX-xlsx/scripts/office/pack.py +159 -0
  165. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  166. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  167. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  168. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  169. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  170. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  171. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  172. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  173. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  174. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  175. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  176. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  177. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  178. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  179. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  180. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  181. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  182. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  183. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  184. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  185. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  186. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  187. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  188. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  189. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  190. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  191. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  192. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  193. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  194. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  195. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  196. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  197. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  198. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  199. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  200. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  201. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  202. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  203. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  204. package/opencode/skills/KORTIX-xlsx/scripts/office/soffice.py +183 -0
  205. package/opencode/skills/KORTIX-xlsx/scripts/office/unpack.py +132 -0
  206. package/opencode/skills/KORTIX-xlsx/scripts/office/validate.py +111 -0
  207. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/__init__.py +15 -0
  208. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/base.py +847 -0
  209. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/docx.py +446 -0
  210. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/pptx.py +275 -0
  211. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/redlining.py +247 -0
  212. package/opencode/skills/KORTIX-xlsx/scripts/recalc.py +184 -0
  213. package/opencode/tools/image-gen.ts +342 -0
  214. package/opencode/tools/image-search.ts +190 -0
  215. package/opencode/tools/memory-get.ts +168 -0
  216. package/opencode/tools/memory-search.ts +247 -0
  217. package/opencode/tools/presentation-gen.ts +723 -0
  218. package/opencode/tools/scrape-webpage.ts +115 -0
  219. package/opencode/tools/scripts/.python-version +1 -0
  220. package/opencode/tools/scripts/convert_pdf.py +184 -0
  221. package/opencode/tools/scripts/convert_pptx.py +562 -0
  222. package/opencode/tools/scripts/pyproject.toml +11 -0
  223. package/opencode/tools/scripts/uv.lock +287 -0
  224. package/opencode/tools/scripts/validate_slide.py +74 -0
  225. package/opencode/tools/show-user.ts +217 -0
  226. package/opencode/tools/tests/e2e-presentation-fix.ts +277 -0
  227. package/opencode/tools/tests/image-gen.test.ts +215 -0
  228. package/opencode/tools/tests/image-search.test.ts +125 -0
  229. package/opencode/tools/tests/memory-system-benchmark.ts +1076 -0
  230. package/opencode/tools/tests/presentation-gen.test.ts +389 -0
  231. package/opencode/tools/tests/scrape-webpage.test.ts +74 -0
  232. package/opencode/tools/tests/show-user.test.ts +241 -0
  233. package/opencode/tools/tests/video-gen.test.ts +110 -0
  234. package/opencode/tools/tests/web-search.test.ts +106 -0
  235. package/opencode/tools/video-gen.ts +200 -0
  236. package/opencode/tools/web-search.ts +153 -0
  237. package/opencode/tsconfig.json +29 -0
  238. package/package.json +36 -0
  239. package/patch-agent-browser.js +100 -0
  240. package/postinstall.sh +88 -0
  241. package/services/KORTIX-presentation-viewer/run +37 -0
  242. package/services/agent-browser-viewer/run +48 -0
  243. package/services/kortix-master/run +16 -0
  244. package/services/lss-sync/run +22 -0
  245. package/services/opencode-serve/run +25 -0
  246. package/services/opencode-web/run +21 -0
@@ -0,0 +1,280 @@
1
+ ---
2
+ name: kortix-secrets
3
+ description: "Simple global environment variable manager. Set ENV vars once, available everywhere - like .zshrc for the entire sandbox."
4
+ ---
5
+
6
+ # Kortix Secrets - Global ENV Manager
7
+
8
+ Universal environment variable storage that persists across container restarts and makes secrets available to all applications (Node.js, Python, Go, Bash, etc.) via standard `process.env` / `os.environ` / `$ENV` patterns.
9
+
10
+ ## Core Concept
11
+
12
+ Like `.zshrc` sets environment variables for your shell sessions, Kortix Secrets sets environment variables for your entire sandbox environment. Set once via API, available everywhere until explicitly deleted.
13
+
14
+ ## Architecture
15
+
16
+ ```
17
+ ┌─────────────────────────────────────────┐
18
+ │ API Request (set ANTHROPIC_API_KEY) │
19
+ ├─────────────────────────────────────────┤
20
+ │ Encrypted Storage (/app/secrets/) │
21
+ ├─────────────────────────────────────────┤
22
+ │ Runtime injection (process.env) │
23
+ ├─────────────────────────────────────────┤
24
+ │ All child processes inherit ENV vars │
25
+ │ • Node.js apps: process.env.API_KEY │
26
+ │ • Python scripts: os.environ['API_KEY']│
27
+ │ • Bash scripts: $API_KEY │
28
+ │ • Go binaries: os.Getenv("API_KEY") │
29
+ └─────────────────────────────────────────┘
30
+ ```
31
+
32
+ ## API Endpoints
33
+
34
+ All endpoints use the kortix-master server (default: `localhost:8000`).
35
+
36
+ ### List all environment variables
37
+ ```bash
38
+ curl http://localhost:8000/env
39
+ ```
40
+
41
+ **Response:**
42
+ ```json
43
+ {
44
+ "ANTHROPIC_API_KEY": "sk-ant-...",
45
+ "REPLICATE_API_TOKEN": "r8_...",
46
+ "DATABASE_URL": "postgresql://..."
47
+ }
48
+ ```
49
+
50
+ ### Get specific environment variable
51
+ ```bash
52
+ curl http://localhost:8000/env/ANTHROPIC_API_KEY
53
+ ```
54
+
55
+ **Response:**
56
+ ```json
57
+ {
58
+ "ANTHROPIC_API_KEY": "sk-ant-api-key-here"
59
+ }
60
+ ```
61
+
62
+ **404 Response (if not found):**
63
+ ```json
64
+ {
65
+ "error": "Environment variable not found"
66
+ }
67
+ ```
68
+
69
+ ### Set environment variable
70
+ ```bash
71
+ curl -X POST http://localhost:8000/env/ANTHROPIC_API_KEY \
72
+ -H "Content-Type: application/json" \
73
+ -d '{"value": "sk-ant-your-key-here"}'
74
+ ```
75
+
76
+ **Response:**
77
+ ```json
78
+ {
79
+ "message": "Environment variable set",
80
+ "key": "ANTHROPIC_API_KEY",
81
+ "value": "sk-ant-your-key-here"
82
+ }
83
+ ```
84
+
85
+ The variable is immediately available in `process.env` and persists across restarts.
86
+
87
+ ### Delete environment variable
88
+ ```bash
89
+ curl -X DELETE http://localhost:8000/env/OLD_API_KEY
90
+ ```
91
+
92
+ **Response:**
93
+ ```json
94
+ {
95
+ "message": "Environment variable deleted",
96
+ "key": "OLD_API_KEY"
97
+ }
98
+ ```
99
+
100
+ ## Usage Patterns
101
+
102
+ ### Setting API Keys
103
+ ```bash
104
+ # Set multiple API keys
105
+ curl -X POST localhost:8000/env/ANTHROPIC_API_KEY -H "Content-Type: application/json" -d '{"value":"sk-ant-..."}'
106
+ curl -X POST localhost:8000/env/OPENAI_API_KEY -H "Content-Type: application/json" -d '{"value":"sk-..."}'
107
+ curl -X POST localhost:8000/env/REPLICATE_API_TOKEN -H "Content-Type: application/json" -d '{"value":"r8_..."}'
108
+
109
+ # Verify they're set
110
+ env | grep API_KEY
111
+ ```
112
+
113
+ ### Database URLs and Config
114
+ ```bash
115
+ # Set database connection
116
+ curl -X POST localhost:8000/env/DATABASE_URL \
117
+ -H "Content-Type: application/json" \
118
+ -d '{"value":"postgresql://user:pass@localhost:5432/mydb"}'
119
+
120
+ # Set application config
121
+ curl -X POST localhost:8000/env/NODE_ENV \
122
+ -H "Content-Type: application/json" \
123
+ -d '{"value":"production"}'
124
+ ```
125
+
126
+ ### Checking Current Environment
127
+ ```bash
128
+ # See all managed secrets
129
+ curl localhost:8000/env
130
+
131
+ # Check specific value
132
+ curl localhost:8000/env/DATABASE_URL
133
+
134
+ # See what's actually in the environment
135
+ env | grep -E "(API_KEY|TOKEN|SECRET|DATABASE|_URL)"
136
+ ```
137
+
138
+ ### Cleaning Up
139
+ ```bash
140
+ # Remove old/unused secrets
141
+ curl -X DELETE localhost:8000/env/DEPRECATED_API_KEY
142
+ curl -X DELETE localhost:8000/env/OLD_DATABASE_URL
143
+ ```
144
+
145
+ ## Cross-Language Access
146
+
147
+ Once set via the API, environment variables are available in all languages:
148
+
149
+ ### Node.js
150
+ ```javascript
151
+ // Automatically available
152
+ console.log(process.env.ANTHROPIC_API_KEY);
153
+ console.log(process.env.DATABASE_URL);
154
+ ```
155
+
156
+ ### Python
157
+ ```python
158
+ import os
159
+
160
+ # Automatically available
161
+ api_key = os.environ.get('ANTHROPIC_API_KEY')
162
+ db_url = os.environ['DATABASE_URL']
163
+ ```
164
+
165
+ ### Bash/Shell
166
+ ```bash
167
+ #!/bin/bash
168
+ # Automatically available
169
+ echo "API Key: $ANTHROPIC_API_KEY"
170
+ echo "Database: $DATABASE_URL"
171
+ ```
172
+
173
+ ### Go
174
+ ```go
175
+ package main
176
+ import "os"
177
+
178
+ func main() {
179
+ apiKey := os.Getenv("ANTHROPIC_API_KEY")
180
+ dbURL := os.Getenv("DATABASE_URL")
181
+ }
182
+ ```
183
+
184
+ ## Security Features
185
+
186
+ - **AES-256-GCM Encryption**: All values encrypted at rest
187
+ - **Secure File Permissions**: Secret files have 0o600 permissions
188
+ - **Key Derivation**: Master key derived from KORTIX_TOKEN + salt
189
+ - **No Plaintext Logging**: Values not exposed in server logs
190
+ - **Persistence**: Survives container restarts, not rebuilds
191
+
192
+ ## Integration with Other Skills
193
+
194
+ ### Use in skill implementations
195
+ When your skills need API keys, they can access them directly:
196
+
197
+ ```typescript
198
+ // In a skill implementation
199
+ const apiKey = process.env.ANTHROPIC_API_KEY;
200
+ const replicateToken = process.env.REPLICATE_API_TOKEN;
201
+ ```
202
+
203
+ ### Common patterns for skill setup
204
+ ```bash
205
+ # Set up a skill's dependencies
206
+ curl -X POST localhost:8000/env/ELEVENLABS_API_KEY -H "Content-Type: application/json" -d '{"value":"..."}'
207
+ curl -X POST localhost:8000/env/FIRECRAWL_API_KEY -H "Content-Type: application/json" -d '{"value":"..."}'
208
+
209
+ # Then the skill can use: process.env.ELEVENLABS_API_KEY
210
+ ```
211
+
212
+ ## Best Practices
213
+
214
+ ### Naming Conventions
215
+ - Use `UPPER_SNAKE_CASE` for environment variables
216
+ - End API keys with `_API_KEY` or `_TOKEN`
217
+ - Use descriptive prefixes: `DATABASE_URL`, `REDIS_URL`, `SMTP_HOST`
218
+
219
+ ### Organization
220
+ - Group related configs: `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_PASSWORD`
221
+ - Use service prefixes: `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET`
222
+
223
+ ### Security
224
+ - Rotate API keys regularly by updating them via the API
225
+ - Use environment-specific values: `DATABASE_URL_PROD`, `DATABASE_URL_DEV`
226
+ - Delete unused secrets: `curl -X DELETE localhost:8000/env/OLD_KEY`
227
+
228
+ ### Development Workflow
229
+ ```bash
230
+ # Development setup
231
+ curl -X POST localhost:8000/env/NODE_ENV -H "Content-Type: application/json" -d '{"value":"development"}'
232
+ curl -X POST localhost:8000/env/DEBUG -H "Content-Type: application/json" -d '{"value":"true"}'
233
+
234
+ # Production setup
235
+ curl -X POST localhost:8000/env/NODE_ENV -H "Content-Type: application/json" -d '{"value":"production"}'
236
+ curl -X DELETE localhost:8000/env/DEBUG
237
+ ```
238
+
239
+ ## Troubleshooting
240
+
241
+ ### Variable not showing up?
242
+ ```bash
243
+ # Check if it's set in the secret store
244
+ curl localhost:8000/env/YOUR_KEY
245
+
246
+ # Check if it's in the current environment
247
+ env | grep YOUR_KEY
248
+
249
+ # Try restarting the server to reload all variables
250
+ ```
251
+
252
+ ### Permission errors?
253
+ ```bash
254
+ # Check secret file permissions
255
+ ls -la /app/secrets/
256
+
257
+ # Should show -rw------- (0o600)
258
+ ```
259
+
260
+ ### Decryption errors?
261
+ - Verify `KORTIX_TOKEN` is consistent
262
+ - Check if salt file was corrupted
263
+ - May need to recreate secrets if encryption key changed
264
+
265
+ ## File Locations
266
+
267
+ - **Secrets**: `/app/secrets/.secrets.json` (encrypted)
268
+ - **Salt**: `/app/secrets/.salt` (for key derivation)
269
+ - **Server**: `kortix-master` on port 8000
270
+
271
+ ## API Error Codes
272
+
273
+ - `200` - Success
274
+ - `404` - Environment variable not found
275
+ - `400` - Invalid request (missing value, invalid JSON)
276
+ - `500` - Server error (encryption/storage failure)
277
+
278
+ ---
279
+
280
+ This skill provides the foundation for secure, persistent environment variable management across your entire sandbox environment. Set once, use everywhere, like a global `.zshrc` for all your applications.
@@ -0,0 +1,213 @@
1
+ ---
2
+ name: kortix-semantic-search
3
+ description: "Full semantic search over Desktop files, agent memory, and knowledge. Use when the agent needs to find relevant files or search knowledge semantically."
4
+ ---
5
+
6
+ # Semantic Search
7
+
8
+ You have a **full semantic search engine** running on this machine, powered by [lss](https://github.com/kortix-ai/lss) (Local Semantic Search). It indexes text files, code, PDFs, DOCX, XLSX, PPTX, HTML, EML, JSON, CSV — virtually everything.
9
+
10
+ A background file-watcher daemon (`lss-sync`) detects file changes in real time via FSEvents/inotify and re-indexes within seconds.
11
+
12
+ ## How It Works
13
+
14
+ lss combines **BM25 full-text search** (keyword matching with custom re-scoring) and **embedding similarity** (semantic meaning via OpenAI or local fastembed) using Reciprocal Rank Fusion. Queries can be natural language — you don't need exact keywords.
15
+
16
+ The database lives at `/workspace/.lss/lss.db`.
17
+
18
+ ## What's Indexed
19
+
20
+ | Source | Path | Content |
21
+ |--------|------|---------|
22
+ | **Desktop files** | `/workspace` | Code, docs, PDFs, DOCX, XLSX, PPTX, HTML, JSON, CSV — all text-like files recursively |
23
+ | **Agent memory** | `/workspace/.kortix/` | MEMORY.md, memory/*.md, journal/*.md, knowledge/*.md |
24
+
25
+ Indexed formats: ~80 known extensions (code, markup, config, documents). Unknown extensions are skipped. `.gitignore` patterns are respected.
26
+
27
+ ## Quick Reference
28
+
29
+ ```bash
30
+ # Search EVERYTHING indexed
31
+ lss "your natural language query" -p /workspace -k 10 --json
32
+
33
+ # Search only agent memory + knowledge
34
+ lss "user deployment preferences" -p /workspace/.kortix/ -k 5 --json
35
+
36
+ # Search a specific project directory
37
+ lss "database migration strategy" -p /workspace/myproject/ -k 5 --json
38
+
39
+ # Search without triggering re-indexing (faster, uses existing index)
40
+ lss "query" -p /workspace --no-index -k 10 --json
41
+
42
+ # Filter by file type
43
+ lss "auth logic" -p /workspace -e .py -e .ts -k 10 --json
44
+
45
+ # Exclude file types
46
+ lss "config" -p /workspace -E .json -E .yaml -k 10 --json
47
+
48
+ # Exclude content patterns
49
+ lss "user data" -p /workspace -x '\d{4}-\d{2}-\d{2}' -k 10 --json
50
+
51
+ # Force re-index a path immediately
52
+ lss index /workspace/important-file.md
53
+
54
+ # List all indexed files
55
+ lss ls
56
+
57
+ # Check index stats and configuration
58
+ lss status
59
+ ```
60
+
61
+ ## Search Filters
62
+
63
+ Narrow results at query time without re-indexing.
64
+
65
+ | Flag | Meaning | Applied | Example |
66
+ |------|---------|---------|---------|
67
+ | `-e EXT` / `--ext` | Include only these extensions (repeatable) | In SQL, pre-scoring | `-e .py -e .ts` |
68
+ | `-E EXT` / `--exclude-ext` | Exclude these extensions (repeatable) | In SQL, pre-scoring | `-E .json -E .yaml` |
69
+ | `-x REGEX` / `--exclude-pattern` | Exclude chunks matching regex (repeatable) | Post-scoring | `-x 'test_' -x 'TODO'` |
70
+
71
+ ### Filter Strategy for Agents
72
+
73
+ **Narrow first, then broaden.** Start with tight extension filters, then remove them if results are insufficient:
74
+
75
+ ```bash
76
+ # 1. Try narrow: only Python source files
77
+ lss "authentication flow" -p /workspace/project -e .py -k 10 --json
78
+
79
+ # 2. If too few results, broaden to all code
80
+ lss "authentication flow" -p /workspace/project -e .py -e .ts -e .go -e .rs -k 10 --json
81
+
82
+ # 3. If still insufficient, search everything
83
+ lss "authentication flow" -p /workspace/project -k 10 --json
84
+ ```
85
+
86
+ **Exclude noise, not signal:**
87
+
88
+ ```bash
89
+ # Exclude generated/test code when looking for implementations
90
+ lss "rate limiting" -e .py -x "test_" -x "mock_" -x "fixture" --json -k 10
91
+
92
+ # Exclude logs and config when looking for code
93
+ lss "database connection" -E .log -E .yaml -E .json -E .toml --json -k 10
94
+
95
+ # Exclude dates/timestamps from data searches
96
+ lss "customer report" -x '\d{4}-\d{2}-\d{2}' --json -k 10
97
+ ```
98
+
99
+ ## JSON Output Format
100
+
101
+ **Always use `--json` for programmatic parsing.**
102
+
103
+ ```bash
104
+ lss "query" -p /workspace --json -k 10
105
+ ```
106
+
107
+ Returns an array of result arrays (one per query):
108
+ ```json
109
+ [
110
+ {
111
+ "query": "authentication flow",
112
+ "hits": [
113
+ {
114
+ "file_path": "/workspace/project/auth.py",
115
+ "score": 0.0345,
116
+ "snippet": "def authenticate(user, password):\n \"\"\"Authenticate user with JWT...",
117
+ "rank_stage": "S3_MMR",
118
+ "indexed_at": 1738900000.0
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ ```
124
+
125
+ Key fields:
126
+ - `file_path` — Full path to the source file
127
+ - `score` — Relevance score (higher is better)
128
+ - `snippet` — Best-matching text excerpt (~280 chars)
129
+ - `rank_stage` — S1=BM25 only, S3=fusion, S3_MMR=fusion+diversity
130
+
131
+ ## Multi-Query Decomposition
132
+
133
+ For complex questions, **decompose into multiple specific queries**:
134
+
135
+ ```bash
136
+ # BAD: single vague query
137
+ lss "how does the system work" --json -k 10
138
+
139
+ # GOOD: decomposed into specific queries
140
+ lss "system architecture overview" "API endpoint design" "database schema" "authentication flow" --json -k 5
141
+ ```
142
+
143
+ Or use a query file:
144
+ ```bash
145
+ echo "system architecture overview" > /tmp/queries.txt
146
+ echo "API endpoint design" >> /tmp/queries.txt
147
+ echo "database schema" >> /tmp/queries.txt
148
+ lss -Q /tmp/queries.txt -p /workspace/project --json -k 5
149
+ ```
150
+
151
+ ## When to Use lss vs grep
152
+
153
+ | Use lss | Use grep |
154
+ |---------|----------|
155
+ | Conceptual queries ("how to handle errors") | Exact string ("ERROR_CODE_429") |
156
+ | Fuzzy matching ("something like the email template") | Specific variable name (`userSessionToken`) |
157
+ | Cross-file discovery ("files about API design") | Known file + line search |
158
+ | Natural language ("what's the deploy process") | Regex pattern matching |
159
+
160
+ ## Iterative Search Strategy
161
+
162
+ For large codebases, use an iterative approach:
163
+
164
+ ```bash
165
+ # Step 1: Broad discovery — find relevant areas
166
+ lss "payment processing" -p /workspace/project -k 20 --json
167
+
168
+ # Step 2: Narrow by extension — focus on implementation
169
+ lss "payment processing" -p /workspace/project -e .py -k 10 --json
170
+
171
+ # Step 3: Narrow by path — focus on specific module
172
+ lss "payment processing" -p /workspace/project/src/payments/ -k 10 --json
173
+
174
+ # Step 4: Read the actual files for full context
175
+ cat /workspace/project/src/payments/processor.py
176
+ ```
177
+
178
+ ## Indexing
179
+
180
+ ```bash
181
+ # Index a directory (auto-triggered on first search)
182
+ lss index /workspace/project/
183
+
184
+ # Index a single file
185
+ lss index /workspace/important.pdf
186
+
187
+ # The daemon handles real-time updates automatically
188
+ # Use manual indexing only for immediate needs
189
+ ```
190
+
191
+ ## Maintenance
192
+
193
+ ```bash
194
+ # Sweep stale entries (files deleted from disk)
195
+ lss sweep --retention-days 90
196
+
197
+ # Clear all embeddings (forces re-embedding on next search)
198
+ lss sweep --clear-embeddings 0
199
+
200
+ # Full reset
201
+ lss sweep --clear-all
202
+ ```
203
+
204
+ ## Rules
205
+
206
+ 1. **Always use `--json` flag** when searching programmatically. Parse the JSON output.
207
+ 2. **Always use `-p <path>`** to scope searches. Never search without a path scope.
208
+ 3. **Use `-k` to control result count.** `-k 5` for focused, `-k 20` for broad exploration.
209
+ 4. **Decompose complex queries.** Multiple specific queries beat one vague query.
210
+ 5. **Read source files for full context.** Snippets are excerpts — always read the full file after finding a match.
211
+ 6. **Narrow with filters first.** Use `-e` to target file types before broadening.
212
+ 7. **Don't grep when lss is better.** Conceptual, fuzzy, and cross-file queries belong in lss.
213
+ 8. **The index auto-updates.** Only use `lss index` for immediate needs. The daemon handles the rest.