@schoolai/shipyard 3.7.0 → 3.8.0-rc.20260529.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 (104) hide show
  1. package/dist/{auth-SS7LV5XK.js → auth-EXHO3AG5.js} +4 -4
  2. package/dist/capability-detector-worker.js +142 -0
  3. package/dist/capability-detector-worker.js.map +1 -0
  4. package/dist/{chunk-DKMDBOFU.js → chunk-2CNIEBKO.js} +21 -11
  5. package/dist/chunk-2CNIEBKO.js.map +1 -0
  6. package/dist/chunk-422NIGWV.js +6963 -0
  7. package/dist/chunk-422NIGWV.js.map +1 -0
  8. package/dist/chunk-4T2OQAVL.js +51 -0
  9. package/dist/chunk-4T2OQAVL.js.map +1 -0
  10. package/dist/chunk-5ER6ZHA2.js +46 -0
  11. package/dist/chunk-5ER6ZHA2.js.map +1 -0
  12. package/dist/chunk-7LSEE26O.js +24227 -0
  13. package/dist/chunk-7LSEE26O.js.map +1 -0
  14. package/dist/{chunk-7AHRFPAL.js → chunk-7YOU7MBN.js} +183 -17
  15. package/dist/chunk-7YOU7MBN.js.map +1 -0
  16. package/dist/chunk-CMGJGK6R.js +382 -0
  17. package/dist/chunk-CMGJGK6R.js.map +1 -0
  18. package/dist/{chunk-VPMN47TL.js → chunk-CNR7O5YH.js} +1 -2
  19. package/dist/{chunk-2J3WSIAF.js → chunk-EF2DAODF.js} +18 -3
  20. package/dist/chunk-EF2DAODF.js.map +1 -0
  21. package/dist/chunk-HQ43PHOH.js +1203 -0
  22. package/dist/chunk-HQ43PHOH.js.map +1 -0
  23. package/dist/chunk-KITSAHTX.js +134 -0
  24. package/dist/chunk-KITSAHTX.js.map +1 -0
  25. package/dist/{chunk-LW2MS4T5.js → chunk-LMJFHKRD.js} +15 -12
  26. package/dist/chunk-LMJFHKRD.js.map +1 -0
  27. package/dist/{chunk-SNYEQHUK.js → chunk-NACJENDW.js} +14 -21
  28. package/dist/chunk-NACJENDW.js.map +1 -0
  29. package/dist/{chunk-IISLTKYY.js → chunk-TU63KZFW.js} +2 -2
  30. package/dist/chunk-TX6DK4PK.js +186 -0
  31. package/dist/chunk-TX6DK4PK.js.map +1 -0
  32. package/dist/chunk-UQVXWOPT.js +48 -0
  33. package/dist/chunk-UQVXWOPT.js.map +1 -0
  34. package/dist/{chunk-3MNPDCO5.js → chunk-WBB4XHLH.js} +139 -140
  35. package/dist/chunk-WBB4XHLH.js.map +1 -0
  36. package/dist/chunk-X3MULCV5.js +11 -0
  37. package/dist/chunk-X3MULCV5.js.map +1 -0
  38. package/dist/chunk-YZ3Z3ZYI.js +787 -0
  39. package/dist/chunk-YZ3Z3ZYI.js.map +1 -0
  40. package/dist/{chunk-2UN5AR7V.js → chunk-ZAOPND5G.js} +2 -2
  41. package/dist/chunk-ZFKJAYAN.js +542 -0
  42. package/dist/chunk-ZFKJAYAN.js.map +1 -0
  43. package/dist/cursor-hook-shim.js +316 -0
  44. package/dist/cursor-hook-shim.js.map +1 -0
  45. package/dist/cursor-runner.js +358 -0
  46. package/dist/cursor-runner.js.map +1 -0
  47. package/dist/electron-utility.js +111 -0
  48. package/dist/electron-utility.js.map +1 -0
  49. package/dist/git-pool-V73Q53NX.js +18 -0
  50. package/dist/{git-repo-VRT57DGC.js → git-repo-TN3VZXQV.js} +9 -6
  51. package/dist/index.js +12 -12
  52. package/dist/index.js.map +1 -1
  53. package/dist/{logger-GQCSLSZH.js → logger-QHPTO22N.js} +4 -4
  54. package/dist/login-Q7SZI7JJ.js +20 -0
  55. package/dist/{logout-VUNCW5B2.js → logout-O4AVMO5S.js} +6 -6
  56. package/dist/mcp-servers-F64M5T4I.js +24 -0
  57. package/dist/{roi-Y3MX5UW4.js → roi-EYDLPOCS.js} +5 -5
  58. package/dist/rss-worker.js +159 -0
  59. package/dist/rss-worker.js.map +1 -0
  60. package/dist/{serve-O53FNK64.js → serve-GMRVBGVV.js} +89872 -103000
  61. package/dist/{serve-O53FNK64.js.map → serve-GMRVBGVV.js.map} +1 -1
  62. package/dist/skills-ZHEPSBHW.js +11 -0
  63. package/dist/{start-IDFDHRD6.js → start-4UCUZPIV.js} +229 -27
  64. package/dist/start-4UCUZPIV.js.map +1 -0
  65. package/dist/vault-crypto-BKDOA65F.js +13 -0
  66. package/dist/vault-crypto-BKDOA65F.js.map +1 -0
  67. package/dist/worker.js +6 -3
  68. package/dist/worker.js.map +1 -1
  69. package/package.json +17 -10
  70. package/dist/chunk-2J3WSIAF.js.map +0 -1
  71. package/dist/chunk-3MNPDCO5.js.map +0 -1
  72. package/dist/chunk-66OBOZ3X.js +0 -79
  73. package/dist/chunk-66OBOZ3X.js.map +0 -1
  74. package/dist/chunk-7AHRFPAL.js.map +0 -1
  75. package/dist/chunk-DKMDBOFU.js.map +0 -1
  76. package/dist/chunk-L2WQMPWS.js +0 -666
  77. package/dist/chunk-L2WQMPWS.js.map +0 -1
  78. package/dist/chunk-LW2MS4T5.js.map +0 -1
  79. package/dist/chunk-PI77CUEP.js +0 -49
  80. package/dist/chunk-PI77CUEP.js.map +0 -1
  81. package/dist/chunk-RXI4637N.js +0 -395
  82. package/dist/chunk-RXI4637N.js.map +0 -1
  83. package/dist/chunk-SNYEQHUK.js.map +0 -1
  84. package/dist/chunk-VBPHGPBR.js +0 -126
  85. package/dist/chunk-VBPHGPBR.js.map +0 -1
  86. package/dist/index.d.ts +0 -2
  87. package/dist/login-L4BBPUYO.js +0 -20
  88. package/dist/mcp-servers-MXS5VAWI.js +0 -18
  89. package/dist/shell-V36EX2IJ.js +0 -27
  90. package/dist/skills-GPGRNV4R.js +0 -9
  91. package/dist/start-IDFDHRD6.js.map +0 -1
  92. package/dist/worker.d.ts +0 -49
  93. /package/dist/{auth-SS7LV5XK.js.map → auth-EXHO3AG5.js.map} +0 -0
  94. /package/dist/{chunk-VPMN47TL.js.map → chunk-CNR7O5YH.js.map} +0 -0
  95. /package/dist/{chunk-IISLTKYY.js.map → chunk-TU63KZFW.js.map} +0 -0
  96. /package/dist/{chunk-2UN5AR7V.js.map → chunk-ZAOPND5G.js.map} +0 -0
  97. /package/dist/{git-repo-VRT57DGC.js.map → git-pool-V73Q53NX.js.map} +0 -0
  98. /package/dist/{logger-GQCSLSZH.js.map → git-repo-TN3VZXQV.js.map} +0 -0
  99. /package/dist/{login-L4BBPUYO.js.map → logger-QHPTO22N.js.map} +0 -0
  100. /package/dist/{mcp-servers-MXS5VAWI.js.map → login-Q7SZI7JJ.js.map} +0 -0
  101. /package/dist/{logout-VUNCW5B2.js.map → logout-O4AVMO5S.js.map} +0 -0
  102. /package/dist/{shell-V36EX2IJ.js.map → mcp-servers-F64M5T4I.js.map} +0 -0
  103. /package/dist/{roi-Y3MX5UW4.js.map → roi-EYDLPOCS.js.map} +0 -0
  104. /package/dist/{skills-GPGRNV4R.js.map → skills-ZHEPSBHW.js.map} +0 -0
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ createOneShotPool
4
+ } from "./chunk-ZFKJAYAN.js";
5
+
6
+ // src/shared/capabilities/git-pool.ts
7
+ var GIT_POOL_TTL_MS = 5e3;
8
+ var GIT_POOL_MAX_CONCURRENT = 4;
9
+ var poolsByCwd = /* @__PURE__ */ new Map();
10
+ function getGitPool(cwd, deps) {
11
+ const existing = poolsByCwd.get(cwd);
12
+ if (existing !== void 0) return existing;
13
+ const pool = createOneShotPool(
14
+ { ttlMs: GIT_POOL_TTL_MS, maxConcurrent: GIT_POOL_MAX_CONCURRENT },
15
+ deps ?? {}
16
+ );
17
+ poolsByCwd.set(cwd, pool);
18
+ return pool;
19
+ }
20
+ async function gitExec(cwd, args) {
21
+ const result = await getGitPool(cwd).exec(["git", ...args], { cwd });
22
+ return result.value.trim();
23
+ }
24
+ async function gitExecSafe(cwd, args) {
25
+ try {
26
+ return await gitExec(cwd, args);
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+ function invalidateGitPool(cwd) {
32
+ poolsByCwd.get(cwd)?.invalidate();
33
+ }
34
+ var _testing = {
35
+ /** Dispose all pools and clear the registry. Used in test beforeEach to prevent cross-test cache pollution. */
36
+ clearAllPools: () => {
37
+ for (const pool of poolsByCwd.values()) {
38
+ pool.dispose();
39
+ }
40
+ poolsByCwd.clear();
41
+ }
42
+ };
43
+
44
+ export {
45
+ getGitPool,
46
+ gitExec,
47
+ gitExecSafe,
48
+ invalidateGitPool,
49
+ _testing
50
+ };
51
+ //# sourceMappingURL=chunk-4T2OQAVL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/capabilities/git-pool.ts"],"sourcesContent":["import { createOneShotPool, type OneShotPool, type OneShotPoolDeps } from '@shipyard/local-runtime';\n\n/**\n * Per-cwd OneShotPool instances for caching high-frequency git reads.\n *\n * Each unique working directory gets its own pool so cache entries are scoped\n * to a repo — a `git rev-parse HEAD` for /home/user/repo-a is never mistaken\n * for /home/user/repo-b. The pool handles TTL expiry and in-flight coalescing,\n * eliminating repeated subprocess spawns within the same 5-second window.\n *\n * Write operations (add, commit, push, reset, checkout) are never routed here.\n * Only reads whose staleness within a 5-second window is tolerable belong in\n * this pool: HEAD resolution, branch detection, remote URL, default-branch ref.\n */\n\nconst GIT_POOL_TTL_MS = 5_000;\nconst GIT_POOL_MAX_CONCURRENT = 4;\n\nconst poolsByCwd = new Map<string, OneShotPool>();\n\n/**\n * Return the per-cwd OneShotPool, creating it on first access.\n *\n * Exposed as a named export so callers that need DI (tests, mocks) can\n * bypass the module-level map and inject a fake pool directly.\n */\nexport function getGitPool(cwd: string, deps?: OneShotPoolDeps): OneShotPool {\n const existing = poolsByCwd.get(cwd);\n if (existing !== undefined) return existing;\n const pool = createOneShotPool(\n { ttlMs: GIT_POOL_TTL_MS, maxConcurrent: GIT_POOL_MAX_CONCURRENT },\n deps ?? {}\n );\n poolsByCwd.set(cwd, pool);\n return pool;\n}\n\n/**\n * Run a git read command in the given cwd, returning trimmed stdout.\n * Throws on non-zero exit (same semantics as `runWithTimeout`).\n *\n * Results are cached for 5 seconds; concurrent calls with the same\n * command string coalesce to a single subprocess.\n */\nexport async function gitExec(cwd: string, args: readonly string[]): Promise<string> {\n const result = await getGitPool(cwd).exec(['git', ...args], { cwd });\n return result.value.trim();\n}\n\n/**\n * Like `gitExec` but returns null on any error instead of throwing.\n * Mirrors the try/catch-returning-null pattern common in git helpers.\n */\nexport async function gitExecSafe(cwd: string, args: readonly string[]): Promise<string | null> {\n try {\n return await gitExec(cwd, args);\n } catch {\n return null;\n }\n}\n\n/**\n * Invalidate all cached results for a cwd — e.g. after a commit or branch\n * switch. Callers that write to the repo should invoke this so the next\n * read reflects the updated state rather than the stale 5s cache.\n */\nexport function invalidateGitPool(cwd: string): void {\n poolsByCwd.get(cwd)?.invalidate();\n}\n\nexport const _testing = {\n /** Dispose all pools and clear the registry. Used in test beforeEach to prevent cross-test cache pollution. */\n clearAllPools: () => {\n for (const pool of poolsByCwd.values()) {\n pool.dispose();\n }\n poolsByCwd.clear();\n },\n};\n"],"mappings":";;;;;;AAeA,IAAM,kBAAkB;AACxB,IAAM,0BAA0B;AAEhC,IAAM,aAAa,oBAAI,IAAyB;AAQzC,SAAS,WAAW,KAAa,MAAqC;AAC3E,QAAM,WAAW,WAAW,IAAI,GAAG;AACnC,MAAI,aAAa,OAAW,QAAO;AACnC,QAAM,OAAO;AAAA,IACX,EAAE,OAAO,iBAAiB,eAAe,wBAAwB;AAAA,IACjE,QAAQ,CAAC;AAAA,EACX;AACA,aAAW,IAAI,KAAK,IAAI;AACxB,SAAO;AACT;AASA,eAAsB,QAAQ,KAAa,MAA0C;AACnF,QAAM,SAAS,MAAM,WAAW,GAAG,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,IAAI,CAAC;AACnE,SAAO,OAAO,MAAM,KAAK;AAC3B;AAMA,eAAsB,YAAY,KAAa,MAAiD;AAC9F,MAAI;AACF,WAAO,MAAM,QAAQ,KAAK,IAAI;AAAA,EAChC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOO,SAAS,kBAAkB,KAAmB;AACnD,aAAW,IAAI,GAAG,GAAG,WAAW;AAClC;AAEO,IAAM,WAAW;AAAA;AAAA,EAEtB,eAAe,MAAM;AACnB,eAAW,QAAQ,WAAW,OAAO,GAAG;AACtC,WAAK,QAAQ;AAAA,IACf;AACA,eAAW,MAAM;AAAA,EACnB;AACF;","names":[]}
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/services/credentials/vault-crypto.ts
4
+ async function generateVaultKey() {
5
+ const key = new Uint8Array(32);
6
+ globalThis.crypto.getRandomValues(key);
7
+ return Buffer.from(key).toString("hex");
8
+ }
9
+ async function importKey(hexKey) {
10
+ const keyBytes = Buffer.from(hexKey, "hex");
11
+ if (keyBytes.length !== 32)
12
+ throw new Error(`Invalid vault key length: expected 32 bytes, got ${keyBytes.length}`);
13
+ return globalThis.crypto.subtle.importKey("raw", keyBytes, { name: "AES-GCM" }, false, [
14
+ "encrypt",
15
+ "decrypt"
16
+ ]);
17
+ }
18
+ async function encryptCredential(plaintext, hexKey) {
19
+ const key = await importKey(hexKey);
20
+ const iv = new Uint8Array(12);
21
+ globalThis.crypto.getRandomValues(iv);
22
+ const encoded = new TextEncoder().encode(plaintext);
23
+ const encrypted = await globalThis.crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, encoded);
24
+ return {
25
+ ciphertext: Buffer.from(encrypted).toString("base64"),
26
+ iv: Buffer.from(iv).toString("base64")
27
+ };
28
+ }
29
+ async function decryptCredential(ciphertext, iv, hexKey) {
30
+ const key = await importKey(hexKey);
31
+ const ivBytes = Buffer.from(iv, "base64");
32
+ const encrypted = Buffer.from(ciphertext, "base64");
33
+ const decrypted = await globalThis.crypto.subtle.decrypt(
34
+ { name: "AES-GCM", iv: ivBytes },
35
+ key,
36
+ encrypted
37
+ );
38
+ return new TextDecoder().decode(decrypted);
39
+ }
40
+
41
+ export {
42
+ generateVaultKey,
43
+ encryptCredential,
44
+ decryptCredential
45
+ };
46
+ //# sourceMappingURL=chunk-5ER6ZHA2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/credentials/vault-crypto.ts"],"sourcesContent":["export { encryptCredential, decryptCredential, generateVaultKey };\n\nasync function generateVaultKey(): Promise<string> {\n const key = new Uint8Array(32);\n globalThis.crypto.getRandomValues(key);\n return Buffer.from(key).toString('hex');\n}\n\nasync function importKey(hexKey: string): Promise<CryptoKey> {\n const keyBytes = Buffer.from(hexKey, 'hex');\n if (keyBytes.length !== 32)\n throw new Error(`Invalid vault key length: expected 32 bytes, got ${keyBytes.length}`);\n return globalThis.crypto.subtle.importKey('raw', keyBytes, { name: 'AES-GCM' }, false, [\n 'encrypt',\n 'decrypt',\n ]);\n}\n\nasync function encryptCredential(\n plaintext: string,\n hexKey: string\n): Promise<{ ciphertext: string; iv: string }> {\n const key = await importKey(hexKey);\n const iv = new Uint8Array(12);\n globalThis.crypto.getRandomValues(iv);\n const encoded = new TextEncoder().encode(plaintext);\n const encrypted = await globalThis.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, encoded);\n return {\n ciphertext: Buffer.from(encrypted).toString('base64'),\n iv: Buffer.from(iv).toString('base64'),\n };\n}\n\nasync function decryptCredential(ciphertext: string, iv: string, hexKey: string): Promise<string> {\n const key = await importKey(hexKey);\n const ivBytes = Buffer.from(iv, 'base64');\n const encrypted = Buffer.from(ciphertext, 'base64');\n const decrypted = await globalThis.crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: ivBytes },\n key,\n encrypted\n );\n return new TextDecoder().decode(decrypted);\n}\n"],"mappings":";;;AAEA,eAAe,mBAAoC;AACjD,QAAM,MAAM,IAAI,WAAW,EAAE;AAC7B,aAAW,OAAO,gBAAgB,GAAG;AACrC,SAAO,OAAO,KAAK,GAAG,EAAE,SAAS,KAAK;AACxC;AAEA,eAAe,UAAU,QAAoC;AAC3D,QAAM,WAAW,OAAO,KAAK,QAAQ,KAAK;AAC1C,MAAI,SAAS,WAAW;AACtB,UAAM,IAAI,MAAM,oDAAoD,SAAS,MAAM,EAAE;AACvF,SAAO,WAAW,OAAO,OAAO,UAAU,OAAO,UAAU,EAAE,MAAM,UAAU,GAAG,OAAO;AAAA,IACrF;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEA,eAAe,kBACb,WACA,QAC6C;AAC7C,QAAM,MAAM,MAAM,UAAU,MAAM;AAClC,QAAM,KAAK,IAAI,WAAW,EAAE;AAC5B,aAAW,OAAO,gBAAgB,EAAE;AACpC,QAAM,UAAU,IAAI,YAAY,EAAE,OAAO,SAAS;AAClD,QAAM,YAAY,MAAM,WAAW,OAAO,OAAO,QAAQ,EAAE,MAAM,WAAW,GAAG,GAAG,KAAK,OAAO;AAC9F,SAAO;AAAA,IACL,YAAY,OAAO,KAAK,SAAS,EAAE,SAAS,QAAQ;AAAA,IACpD,IAAI,OAAO,KAAK,EAAE,EAAE,SAAS,QAAQ;AAAA,EACvC;AACF;AAEA,eAAe,kBAAkB,YAAoB,IAAY,QAAiC;AAChG,QAAM,MAAM,MAAM,UAAU,MAAM;AAClC,QAAM,UAAU,OAAO,KAAK,IAAI,QAAQ;AACxC,QAAM,YAAY,OAAO,KAAK,YAAY,QAAQ;AAClD,QAAM,YAAY,MAAM,WAAW,OAAO,OAAO;AAAA,IAC/C,EAAE,MAAM,WAAW,IAAI,QAAQ;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AACA,SAAO,IAAI,YAAY,EAAE,OAAO,SAAS;AAC3C;","names":[]}