studiograph 1.1.2 → 1.2.0-beta.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 (349) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +301 -10
  3. package/dist/agent/orchestrator.d.ts +17 -9
  4. package/dist/agent/orchestrator.js +142 -97
  5. package/dist/agent/orchestrator.js.map +1 -1
  6. package/dist/agent/prompts/system.md +186 -0
  7. package/dist/agent/skill-loader.d.ts +48 -0
  8. package/dist/agent/skill-loader.js +166 -0
  9. package/dist/agent/skill-loader.js.map +1 -0
  10. package/dist/agent/skills/enrich-entities.md +136 -0
  11. package/dist/agent/skills/entity-schema.md +502 -0
  12. package/dist/agent/skills/gather-context.md +46 -0
  13. package/dist/agent/skills/obsidian-source-setup.md +246 -0
  14. package/dist/agent/skills/skill-loader.d.ts +48 -0
  15. package/dist/agent/skills/skill-loader.js +166 -0
  16. package/dist/agent/skills/skill-loader.js.map +1 -0
  17. package/dist/agent/skills/sync-configuration.md +144 -0
  18. package/dist/agent/skills/sync-setup.md +68 -0
  19. package/dist/agent/tools/connector-tools.d.ts +37 -0
  20. package/dist/agent/tools/connector-tools.js +132 -0
  21. package/dist/agent/tools/connector-tools.js.map +1 -0
  22. package/dist/agent/tools/fs-tools.d.ts +39 -0
  23. package/dist/agent/tools/fs-tools.js +106 -0
  24. package/dist/agent/tools/fs-tools.js.map +1 -0
  25. package/dist/agent/tools/graph-tools.d.ts +30 -2
  26. package/dist/agent/tools/graph-tools.js +154 -37
  27. package/dist/agent/tools/graph-tools.js.map +1 -1
  28. package/dist/agent/tools/load-skill.d.ts +42 -0
  29. package/dist/agent/tools/load-skill.js +45 -0
  30. package/dist/agent/tools/load-skill.js.map +1 -0
  31. package/dist/agent/tools/sync-tools.d.ts +25 -0
  32. package/dist/agent/tools/sync-tools.js +691 -0
  33. package/dist/agent/tools/sync-tools.js.map +1 -0
  34. package/dist/agent/tools/tool-loader.d.ts +25 -0
  35. package/dist/agent/tools/tool-loader.js +73 -0
  36. package/dist/agent/tools/tool-loader.js.map +1 -0
  37. package/dist/auth/github.d.ts +11 -8
  38. package/dist/auth/github.js +56 -75
  39. package/dist/auth/github.js.map +1 -1
  40. package/dist/cli/colors.d.ts +54 -0
  41. package/dist/cli/colors.js +133 -0
  42. package/dist/cli/colors.js.map +1 -0
  43. package/dist/cli/commands/app.d.ts +7 -0
  44. package/dist/cli/commands/app.js +167 -0
  45. package/dist/cli/commands/app.js.map +1 -0
  46. package/dist/cli/commands/auth.d.ts +1 -1
  47. package/dist/cli/commands/auth.js +26 -10
  48. package/dist/cli/commands/auth.js.map +1 -1
  49. package/dist/cli/commands/clone.d.ts +9 -0
  50. package/dist/cli/commands/clone.js +167 -0
  51. package/dist/cli/commands/clone.js.map +1 -0
  52. package/dist/cli/commands/commit.d.ts +8 -0
  53. package/dist/cli/commands/commit.js +43 -0
  54. package/dist/cli/commands/commit.js.map +1 -0
  55. package/dist/cli/commands/config.d.ts +13 -0
  56. package/dist/cli/commands/config.js +276 -0
  57. package/dist/cli/commands/config.js.map +1 -0
  58. package/dist/cli/commands/connector.d.ts +33 -0
  59. package/dist/cli/commands/connector.js +178 -0
  60. package/dist/cli/commands/connector.js.map +1 -0
  61. package/dist/cli/commands/deploy.d.ts +11 -0
  62. package/dist/cli/commands/deploy.js +153 -0
  63. package/dist/cli/commands/deploy.js.map +1 -0
  64. package/dist/cli/commands/enrich.d.ts +11 -0
  65. package/dist/cli/commands/enrich.js +135 -0
  66. package/dist/cli/commands/enrich.js.map +1 -0
  67. package/dist/cli/commands/graphrag.d.ts +12 -0
  68. package/dist/cli/commands/graphrag.js +122 -0
  69. package/dist/cli/commands/graphrag.js.map +1 -0
  70. package/dist/cli/commands/index.d.ts +15 -0
  71. package/dist/cli/commands/index.js +117 -0
  72. package/dist/cli/commands/index.js.map +1 -0
  73. package/dist/cli/commands/init.js +110 -210
  74. package/dist/cli/commands/init.js.map +1 -1
  75. package/dist/cli/commands/join.js +89 -24
  76. package/dist/cli/commands/join.js.map +1 -1
  77. package/dist/cli/commands/lint.d.ts +8 -0
  78. package/dist/cli/commands/lint.js +70 -0
  79. package/dist/cli/commands/lint.js.map +1 -0
  80. package/dist/cli/commands/mcp.d.ts +27 -0
  81. package/dist/cli/commands/mcp.js +56 -0
  82. package/dist/cli/commands/mcp.js.map +1 -0
  83. package/dist/cli/commands/orphans.d.ts +8 -0
  84. package/dist/cli/commands/orphans.js +125 -0
  85. package/dist/cli/commands/orphans.js.map +1 -0
  86. package/dist/cli/commands/provision.d.ts +8 -0
  87. package/dist/cli/commands/provision.js +116 -0
  88. package/dist/cli/commands/provision.js.map +1 -0
  89. package/dist/cli/commands/r2.d.ts +2 -0
  90. package/dist/cli/commands/r2.js +87 -6
  91. package/dist/cli/commands/r2.js.map +1 -1
  92. package/dist/cli/commands/reset.d.ts +12 -0
  93. package/dist/cli/commands/reset.js +137 -0
  94. package/dist/cli/commands/reset.js.map +1 -0
  95. package/dist/cli/commands/review.d.ts +19 -0
  96. package/dist/cli/commands/review.js +128 -0
  97. package/dist/cli/commands/review.js.map +1 -0
  98. package/dist/cli/commands/serve.js +47 -2
  99. package/dist/cli/commands/serve.js.map +1 -1
  100. package/dist/cli/commands/source.d.ts +16 -0
  101. package/dist/cli/commands/source.js +159 -0
  102. package/dist/cli/commands/source.js.map +1 -0
  103. package/dist/cli/commands/start.js +472 -103
  104. package/dist/cli/commands/start.js.map +1 -1
  105. package/dist/cli/commands/sync-entities.d.ts +13 -0
  106. package/dist/cli/commands/sync-entities.js +242 -0
  107. package/dist/cli/commands/sync-entities.js.map +1 -0
  108. package/dist/cli/commands/sync.js +40 -9
  109. package/dist/cli/commands/sync.js.map +1 -1
  110. package/dist/cli/commands/update.d.ts +8 -0
  111. package/dist/cli/commands/update.js +155 -0
  112. package/dist/cli/commands/update.js.map +1 -0
  113. package/dist/cli/index.js +114 -3
  114. package/dist/cli/index.js.map +1 -1
  115. package/dist/cli/scaffolding.d.ts +10 -0
  116. package/dist/cli/scaffolding.js +302 -0
  117. package/dist/cli/scaffolding.js.map +1 -0
  118. package/dist/cli/setup-wizard.d.ts +30 -0
  119. package/dist/cli/setup-wizard.js +244 -0
  120. package/dist/cli/setup-wizard.js.map +1 -0
  121. package/dist/cli/sync-review-interactive.d.ts +31 -0
  122. package/dist/cli/sync-review-interactive.js +393 -0
  123. package/dist/cli/sync-review-interactive.js.map +1 -0
  124. package/dist/cli/theme.d.ts +31 -0
  125. package/dist/cli/theme.js +116 -0
  126. package/dist/cli/theme.js.map +1 -0
  127. package/dist/core/graph.d.ts +16 -9
  128. package/dist/core/graph.js +263 -145
  129. package/dist/core/graph.js.map +1 -1
  130. package/dist/core/migration-runner.d.ts +42 -0
  131. package/dist/core/migration-runner.js +232 -0
  132. package/dist/core/migration-runner.js.map +1 -0
  133. package/dist/core/migration-types.d.ts +101 -0
  134. package/dist/core/migration-types.js +21 -0
  135. package/dist/core/migration-types.js.map +1 -0
  136. package/dist/core/migrations/20260219-formalize-memory-location.d.ts +2 -0
  137. package/dist/core/migrations/20260219-formalize-memory-location.js +35 -0
  138. package/dist/core/migrations/20260219-formalize-memory-location.js.map +1 -0
  139. package/dist/core/migrations/20260220-add-workspace-metadata.d.ts +12 -0
  140. package/dist/core/migrations/20260220-add-workspace-metadata.js +65 -0
  141. package/dist/core/migrations/20260220-add-workspace-metadata.js.map +1 -0
  142. package/dist/core/migrations/20260220-add-workspace-readme.d.ts +11 -0
  143. package/dist/core/migrations/20260220-add-workspace-readme.js +82 -0
  144. package/dist/core/migrations/20260220-add-workspace-readme.js.map +1 -0
  145. package/dist/core/migrations/20260220-migrate-yaml-to-json.d.ts +9 -0
  146. package/dist/core/migrations/20260220-migrate-yaml-to-json.js +64 -0
  147. package/dist/core/migrations/20260220-migrate-yaml-to-json.js.map +1 -0
  148. package/dist/core/migrations/index.d.ts +11 -0
  149. package/dist/core/migrations/index.js +23 -0
  150. package/dist/core/migrations/index.js.map +1 -0
  151. package/dist/core/schema-registry.d.ts +36 -0
  152. package/dist/core/schema-registry.js +161 -0
  153. package/dist/core/schema-registry.js.map +1 -0
  154. package/dist/core/types.d.ts +242 -3
  155. package/dist/core/types.js +21 -2
  156. package/dist/core/types.js.map +1 -1
  157. package/dist/core/user-config.d.ts +16 -0
  158. package/dist/core/user-config.js +8 -0
  159. package/dist/core/user-config.js.map +1 -1
  160. package/dist/core/validation.d.ts +973 -32
  161. package/dist/core/validation.js +163 -4
  162. package/dist/core/validation.js.map +1 -1
  163. package/dist/core/workspace-manager.d.ts +26 -2
  164. package/dist/core/workspace-manager.js +113 -15
  165. package/dist/core/workspace-manager.js.map +1 -1
  166. package/dist/core/workspace.d.ts +20 -11
  167. package/dist/core/workspace.js +123 -34
  168. package/dist/core/workspace.js.map +1 -1
  169. package/dist/mcp/connector-manager.d.ts +65 -0
  170. package/dist/mcp/connector-manager.js +223 -0
  171. package/dist/mcp/connector-manager.js.map +1 -0
  172. package/dist/mcp/connectors/asana.d.ts +2 -0
  173. package/dist/mcp/connectors/asana.js +20 -0
  174. package/dist/mcp/connectors/asana.js.map +1 -0
  175. package/dist/mcp/connectors/definitions.d.ts +45 -0
  176. package/dist/mcp/connectors/definitions.js +32 -0
  177. package/dist/mcp/connectors/definitions.js.map +1 -0
  178. package/dist/mcp/connectors/figma.d.ts +5 -0
  179. package/dist/mcp/connectors/figma.js +21 -0
  180. package/dist/mcp/connectors/figma.js.map +1 -0
  181. package/dist/mcp/connectors/gdrive.d.ts +2 -0
  182. package/dist/mcp/connectors/gdrive.js +20 -0
  183. package/dist/mcp/connectors/gdrive.js.map +1 -0
  184. package/dist/mcp/connectors/granola.d.ts +2 -0
  185. package/dist/mcp/connectors/granola.js +12 -0
  186. package/dist/mcp/connectors/granola.js.map +1 -0
  187. package/dist/mcp/connectors/linear.d.ts +2 -0
  188. package/dist/mcp/connectors/linear.js +19 -0
  189. package/dist/mcp/connectors/linear.js.map +1 -0
  190. package/dist/mcp/connectors/obsidian.d.ts +2 -0
  191. package/dist/mcp/connectors/obsidian.js +19 -0
  192. package/dist/mcp/connectors/obsidian.js.map +1 -0
  193. package/dist/mcp/connectors/pipedrive.d.ts +2 -0
  194. package/dist/mcp/connectors/pipedrive.js +20 -0
  195. package/dist/mcp/connectors/pipedrive.js.map +1 -0
  196. package/dist/mcp/connectors/slack.d.ts +2 -0
  197. package/dist/mcp/connectors/slack.js +21 -0
  198. package/dist/mcp/connectors/slack.js.map +1 -0
  199. package/dist/mcp/oauth-provider.d.ts +41 -0
  200. package/dist/mcp/oauth-provider.js +160 -0
  201. package/dist/mcp/oauth-provider.js.map +1 -0
  202. package/dist/mcp/server.d.ts +11 -0
  203. package/dist/mcp/server.js +28 -0
  204. package/dist/mcp/server.js.map +1 -0
  205. package/dist/mcp/tools.d.ts +14 -0
  206. package/dist/mcp/tools.js +172 -0
  207. package/dist/mcp/tools.js.map +1 -0
  208. package/dist/server/index.js +17 -4
  209. package/dist/server/index.js.map +1 -1
  210. package/dist/server/plugin-loader.d.ts +15 -0
  211. package/dist/server/plugin-loader.js +68 -2
  212. package/dist/server/plugin-loader.js.map +1 -1
  213. package/dist/server/routes/graph-api.js +1 -1
  214. package/dist/server/routes/graph-api.js.map +1 -1
  215. package/dist/server/routes/webhook.js +33 -0
  216. package/dist/server/routes/webhook.js.map +1 -1
  217. package/dist/services/github-provisioner.d.ts +9 -3
  218. package/dist/services/github-provisioner.js +46 -8
  219. package/dist/services/github-provisioner.js.map +1 -1
  220. package/dist/services/lint-service.d.ts +27 -0
  221. package/dist/services/lint-service.js +83 -0
  222. package/dist/services/lint-service.js.map +1 -0
  223. package/dist/services/markdown.d.ts +9 -0
  224. package/dist/services/markdown.js +26 -5
  225. package/dist/services/markdown.js.map +1 -1
  226. package/dist/services/memory-service.d.ts +1 -2
  227. package/dist/services/memory-service.js +5 -4
  228. package/dist/services/memory-service.js.map +1 -1
  229. package/dist/services/orphan-service.d.ts +31 -0
  230. package/dist/services/orphan-service.js +100 -0
  231. package/dist/services/orphan-service.js.map +1 -0
  232. package/dist/services/sync/commit.d.ts +58 -0
  233. package/dist/services/sync/commit.js +350 -0
  234. package/dist/services/sync/commit.js.map +1 -0
  235. package/dist/services/sync/context-index.d.ts +69 -0
  236. package/dist/services/sync/context-index.js +280 -0
  237. package/dist/services/sync/context-index.js.map +1 -0
  238. package/dist/services/sync/derive.d.ts +34 -0
  239. package/dist/services/sync/derive.js +164 -0
  240. package/dist/services/sync/derive.js.map +1 -0
  241. package/dist/services/sync/enrichment-state.d.ts +31 -0
  242. package/dist/services/sync/enrichment-state.js +63 -0
  243. package/dist/services/sync/enrichment-state.js.map +1 -0
  244. package/dist/services/sync/enrichment.d.ts +25 -0
  245. package/dist/services/sync/enrichment.js +121 -0
  246. package/dist/services/sync/enrichment.js.map +1 -0
  247. package/dist/services/sync/frontmatter-extractor.d.ts +40 -0
  248. package/dist/services/sync/frontmatter-extractor.js +273 -0
  249. package/dist/services/sync/frontmatter-extractor.js.map +1 -0
  250. package/dist/services/sync/graph-match-state.d.ts +33 -0
  251. package/dist/services/sync/graph-match-state.js +61 -0
  252. package/dist/services/sync/graph-match-state.js.map +1 -0
  253. package/dist/services/sync/graph-match.d.ts +53 -0
  254. package/dist/services/sync/graph-match.js +316 -0
  255. package/dist/services/sync/graph-match.js.map +1 -0
  256. package/dist/services/sync/graphrag-client.d.ts +43 -0
  257. package/dist/services/sync/graphrag-client.js +94 -0
  258. package/dist/services/sync/graphrag-client.js.map +1 -0
  259. package/dist/services/sync/graphrag-config.d.ts +16 -0
  260. package/dist/services/sync/graphrag-config.js +39 -0
  261. package/dist/services/sync/graphrag-config.js.map +1 -0
  262. package/dist/services/sync/graphrag-context.d.ts +14 -0
  263. package/dist/services/sync/graphrag-context.js +109 -0
  264. package/dist/services/sync/graphrag-context.js.map +1 -0
  265. package/dist/services/sync/graphrag-indexer.d.ts +30 -0
  266. package/dist/services/sync/graphrag-indexer.js +358 -0
  267. package/dist/services/sync/graphrag-indexer.js.map +1 -0
  268. package/dist/services/sync/llm.d.ts +32 -0
  269. package/dist/services/sync/llm.js +115 -0
  270. package/dist/services/sync/llm.js.map +1 -0
  271. package/dist/services/sync/mcp-client.d.ts +59 -0
  272. package/dist/services/sync/mcp-client.js +285 -0
  273. package/dist/services/sync/mcp-client.js.map +1 -0
  274. package/dist/services/sync/model-factory.d.ts +10 -0
  275. package/dist/services/sync/model-factory.js +24 -0
  276. package/dist/services/sync/model-factory.js.map +1 -0
  277. package/dist/services/sync/name-quality.d.ts +31 -0
  278. package/dist/services/sync/name-quality.js +60 -0
  279. package/dist/services/sync/name-quality.js.map +1 -0
  280. package/dist/services/sync/output-schemas.d.ts +92 -0
  281. package/dist/services/sync/output-schemas.js +43 -0
  282. package/dist/services/sync/output-schemas.js.map +1 -0
  283. package/dist/services/sync/prompts.d.ts +19 -0
  284. package/dist/services/sync/prompts.js +128 -0
  285. package/dist/services/sync/prompts.js.map +1 -0
  286. package/dist/services/sync/reconciler.d.ts +48 -0
  287. package/dist/services/sync/reconciler.js +295 -0
  288. package/dist/services/sync/reconciler.js.map +1 -0
  289. package/dist/services/sync/source-config.d.ts +45 -0
  290. package/dist/services/sync/source-config.js +208 -0
  291. package/dist/services/sync/source-config.js.map +1 -0
  292. package/dist/services/sync/source-definitions/asana.d.ts +15 -0
  293. package/dist/services/sync/source-definitions/asana.js +48 -0
  294. package/dist/services/sync/source-definitions/asana.js.map +1 -0
  295. package/dist/services/sync/source-definitions/definitions.d.ts +21 -0
  296. package/dist/services/sync/source-definitions/definitions.js +26 -0
  297. package/dist/services/sync/source-definitions/definitions.js.map +1 -0
  298. package/dist/services/sync/source-definitions/gdrive.d.ts +16 -0
  299. package/dist/services/sync/source-definitions/gdrive.js +68 -0
  300. package/dist/services/sync/source-definitions/gdrive.js.map +1 -0
  301. package/dist/services/sync/source-definitions/granola.d.ts +2 -0
  302. package/dist/services/sync/source-definitions/granola.js +28 -0
  303. package/dist/services/sync/source-definitions/granola.js.map +1 -0
  304. package/dist/services/sync/source-definitions/linear.d.ts +2 -0
  305. package/dist/services/sync/source-definitions/linear.js +60 -0
  306. package/dist/services/sync/source-definitions/linear.js.map +1 -0
  307. package/dist/services/sync/source-definitions/obsidian.d.ts +2 -0
  308. package/dist/services/sync/source-definitions/obsidian.js +55 -0
  309. package/dist/services/sync/source-definitions/obsidian.js.map +1 -0
  310. package/dist/services/sync/source-definitions/pipedrive.d.ts +2 -0
  311. package/dist/services/sync/source-definitions/pipedrive.js +52 -0
  312. package/dist/services/sync/source-definitions/pipedrive.js.map +1 -0
  313. package/dist/services/sync/staging.d.ts +53 -0
  314. package/dist/services/sync/staging.js +131 -0
  315. package/dist/services/sync/staging.js.map +1 -0
  316. package/dist/services/sync/structured-extractor.d.ts +49 -0
  317. package/dist/services/sync/structured-extractor.js +344 -0
  318. package/dist/services/sync/structured-extractor.js.map +1 -0
  319. package/dist/services/sync/sync-runner.d.ts +32 -0
  320. package/dist/services/sync/sync-runner.js +195 -0
  321. package/dist/services/sync/sync-runner.js.map +1 -0
  322. package/dist/services/sync/sync-state.d.ts +43 -0
  323. package/dist/services/sync/sync-state.js +154 -0
  324. package/dist/services/sync/sync-state.js.map +1 -0
  325. package/dist/services/sync/types.d.ts +203 -0
  326. package/dist/services/sync/types.js +8 -0
  327. package/dist/services/sync/types.js.map +1 -0
  328. package/dist/services/sync/unstructured-extractor.d.ts +29 -0
  329. package/dist/services/sync/unstructured-extractor.js +197 -0
  330. package/dist/services/sync/unstructured-extractor.js.map +1 -0
  331. package/dist/services/vector-service.d.ts +88 -0
  332. package/dist/services/vector-service.js +322 -0
  333. package/dist/services/vector-service.js.map +1 -0
  334. package/dist/utils/git.d.ts +26 -4
  335. package/dist/utils/git.js +55 -7
  336. package/dist/utils/git.js.map +1 -1
  337. package/dist/utils/merge-resolver.d.ts +34 -0
  338. package/dist/utils/merge-resolver.js +201 -0
  339. package/dist/utils/merge-resolver.js.map +1 -0
  340. package/dist/utils/preflight.d.ts +2 -1
  341. package/dist/utils/preflight.js +8 -1
  342. package/dist/utils/preflight.js.map +1 -1
  343. package/dist/utils/version-checker.d.ts +23 -0
  344. package/dist/utils/version-checker.js +116 -0
  345. package/dist/utils/version-checker.js.map +1 -0
  346. package/dist/utils/workspace-config.d.ts +8 -0
  347. package/dist/utils/workspace-config.js +22 -0
  348. package/dist/utils/workspace-config.js.map +1 -0
  349. package/package.json +24 -11
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2025 Studiograph
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/README.md CHANGED
@@ -1,18 +1,309 @@
1
1
  # Studiograph
2
2
 
3
- Team-based AI agent platform with Git-backed knowledge graphs.
3
+ Team-based AI agent platform with Git-backed knowledge graphs. Studiograph helps creative services teams capture operational knowledge as Markdown entities with YAML frontmatter, organized into Git repositories, and enables AI agents to produce work reflecting real team context.
4
4
 
5
- ## Architecture
5
+ ## Quick Start
6
6
 
7
- **Granular Repos** (one per project/function/resource):
8
- - **Project repos**: cooper-hewitt/, globalance/, etc.
9
- - **Function repos**: new-business/, accounting/, hr/, etc.
10
- - **Shared resources**: templates/, research/, resources/, etc.
7
+ ### Prerequisites
11
8
 
12
- **Flexible entity types** - not hardcoded schemas.
9
+ - **Node.js** 20+
10
+ - **Git** installed and configured
11
+ - An API key from a supported LLM provider (Anthropic, OpenAI, Google, xAI, Groq, or OpenRouter)
13
12
 
14
- ## Status
13
+ ### Install
15
14
 
16
- 🚧 **Phase 1: MVP Build (In Progress)**
15
+ ```bash
16
+ npm install -g studiograph
17
+ ```
17
18
 
18
- See [Build Plan](../Vaults/Schema/Projects/Studiograph/Build%20Plan.md) for details.
19
+ ### Create a Workspace
20
+
21
+ ```bash
22
+ studiograph init "My Studio"
23
+ ```
24
+
25
+ This creates a workspace directory with a `.studiograph/` config folder — similar to how Git uses `.git/` — and scaffolds example entities to get you started.
26
+
27
+ To create repos on GitHub during init:
28
+
29
+ ```bash
30
+ studiograph init "My Studio" --github --github-org my-org
31
+ ```
32
+
33
+ ### Join an Existing Workspace
34
+
35
+ ```bash
36
+ studiograph join https://github.com/my-org/.studiograph.git
37
+ ```
38
+
39
+ This clones the config repo, identifies your role from the team roster, and clones all repos you have access to.
40
+
41
+ ### Start the Agent
42
+
43
+ ```bash
44
+ cd my-studio
45
+ studiograph start
46
+ ```
47
+
48
+ On first run, you'll be prompted to select an AI provider and model. The agent provides a chat interface where you can create, search, and manage entities across your knowledge graph.
49
+
50
+ ## How It Works
51
+
52
+ ### Workspace Structure
53
+
54
+ A Studiograph workspace is a directory containing a `.studiograph/` configuration folder and one or more content repositories:
55
+
56
+ ```
57
+ my-studio/
58
+ ├── .studiograph/ # Config repo (workspace.json, team roster, migrations)
59
+ ├── acme-rebrand/ # Project repo (one per client engagement)
60
+ ├── website-redesign/ # Another project repo
61
+ ├── new-business/ # Function repo (business operations)
62
+ ├── accounting/ # Function repo
63
+ ├── templates/ # Shared resource repo (team knowledge)
64
+ └── private/ # Local-only, gitignored
65
+ ```
66
+
67
+ ### Repository Types
68
+
69
+ | Type | Purpose | Examples |
70
+ |------|---------|---------|
71
+ | **Project** | One per client or engagement | `meridian-rebrand/`, `terra-dashboard/` |
72
+ | **Function** | Business operations | `new-business/`, `accounting/`, `hr/` |
73
+ | **Shared Resource** | Team knowledge | `templates/`, `research/`, `design-systems/` |
74
+
75
+ ### Entities
76
+
77
+ Entities are Markdown files with YAML frontmatter, stored in type-based directories within repos:
78
+
79
+ ```
80
+ acme-rebrand/
81
+ ├── project/
82
+ │ └── acme-rebrand.md
83
+ ├── meeting/
84
+ │ └── kickoff-2024-01-15.md
85
+ ├── deliverable/
86
+ │ └── brand-guidelines-v1.md
87
+ └── person/
88
+ └── jane-doe.md
89
+ ```
90
+
91
+ Each entity file looks like:
92
+
93
+ ```markdown
94
+ ---
95
+ entity_type: project
96
+ entity_id: acme-rebrand
97
+ name: "Acme Rebrand"
98
+ status: active
99
+ team:
100
+ - [[alice-smith]]
101
+ - [[bob-jones]]
102
+ related_projects:
103
+ - [[website-redesign]]
104
+ created_at: 2024-01-15T10:00:00Z
105
+ updated_at: 2024-02-20T14:30:00Z
106
+ created_by: alice
107
+ updated_by: alice
108
+ ---
109
+
110
+ # Acme Rebrand
111
+
112
+ Project notes and context go here...
113
+ ```
114
+
115
+ Entity IDs are always kebab-case. Entities link to each other with wikilinks (`[[entity-id]]`), which work across repos.
116
+
117
+ There are 30+ built-in entity types (project, meeting, client, deliverable, proposal, contract, etc.), and workspaces can define custom types via `schema_extensions` in `workspace.json`.
118
+
119
+ ## CLI Commands
120
+
121
+ ### Getting Started
122
+
123
+ | Command | Description |
124
+ |---------|-------------|
125
+ | `studiograph init <team-name> [dir]` | Initialize a new workspace |
126
+ | `studiograph join <url> [dir]` | Join an existing workspace via GitHub URL |
127
+ | `studiograph auth` | Manage GitHub authentication |
128
+
129
+ ### Daily Workflow
130
+
131
+ | Command | Description |
132
+ |---------|-------------|
133
+ | `studiograph start` | Launch the AI agent chat interface |
134
+ | `studiograph pull` | Pull latest changes from remote |
135
+ | `studiograph push` | Push local commits to remote |
136
+
137
+ ### Workspace Management
138
+
139
+ | Command | Description |
140
+ |---------|-------------|
141
+ | `studiograph provision` | Push workspace config to GitHub as a separate repo |
142
+ | `studiograph members` | Manage team members and roles |
143
+ | `studiograph index` | Rebuild search index |
144
+ | `studiograph lint` | Check entity completeness and broken wikilinks |
145
+ | `studiograph config` | View and update workspace configuration |
146
+
147
+ ### Server & Deployment
148
+
149
+ | Command | Description |
150
+ |---------|-------------|
151
+ | `studiograph serve` | Start the HTTP server (Graph API, Chat API, webhooks) |
152
+ | `studiograph deploy railway` | Guided Railway deployment wizard |
153
+
154
+ ### Integrations
155
+
156
+ | Command | Description |
157
+ |---------|-------------|
158
+ | `studiograph mcp` | Start the MCP server for Claude Desktop |
159
+ | `studiograph connector` | Configure third-party integrations (Linear, Slack, Figma, etc.) |
160
+ | `studiograph app` | Manage installed app plugins |
161
+ | `studiograph r2` | Configure Cloudflare R2 for asset storage |
162
+ | `studiograph source` | Manage sync sources for entity extraction ([configuration reference](docs/sync-configuration.md)) |
163
+
164
+ ## Integrations
165
+
166
+ ### Claude Desktop & Claude Code (MCP)
167
+
168
+ Studiograph exposes a [Model Context Protocol](https://modelcontextprotocol.io/) server so any MCP client can read and write your knowledge graph directly.
169
+
170
+ **Claude Desktop** — add to your config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
171
+
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "studiograph": {
176
+ "command": "studiograph",
177
+ "args": ["mcp"],
178
+ "cwd": "/absolute/path/to/your/workspace"
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ **Claude Code** — add to your project's `.mcp.json`:
185
+
186
+ ```json
187
+ {
188
+ "mcpServers": {
189
+ "studiograph": {
190
+ "command": "studiograph",
191
+ "args": ["mcp"],
192
+ "cwd": "/absolute/path/to/your/workspace"
193
+ }
194
+ }
195
+ }
196
+ ```
197
+
198
+ MCP tools available: `list_repos`, `list_entities`, `get_entity`, `search_entities`, `create_entity`, `update_entity`, `delete_entity`.
199
+
200
+ ### Third-Party Connectors
201
+
202
+ Studiograph can connect to external services via MCP connectors. Built-in connector configs are available for:
203
+
204
+ - **Linear** — issues and project tracking
205
+ - **Slack** — messages and channels
206
+ - **Figma** — design files
207
+ - **Google Workspace** — docs, sheets, calendar
208
+ - **Granola** — meeting notes
209
+ - **Pipedrive** — CRM deals and contacts
210
+
211
+ Configure with:
212
+
213
+ ```bash
214
+ studiograph connector add linear
215
+ ```
216
+
217
+ Connector credentials are stored at `~/.studiograph/connectors/` with restricted file permissions.
218
+
219
+ ## HTTP Server
220
+
221
+ `studiograph serve` starts a Fastify server with:
222
+
223
+ | Route | Method | Description |
224
+ |-------|--------|-------------|
225
+ | `/api/repos` | GET | List all repositories |
226
+ | `/api/repos/:repo/entities/:type` | GET | List entities by type |
227
+ | `/api/repos/:repo/entities/:type/:id` | GET | Get a single entity |
228
+ | `/api/repos/:repo/search` | GET | Search within a repo |
229
+ | `/api/search` | GET | Search across all repos |
230
+ | `/api/chat` | POST | Send a message to the agent |
231
+ | `/api/chat/stream` | GET | SSE streaming chat |
232
+ | `/webhooks/github` | POST | GitHub push webhook (auto-pull) |
233
+
234
+ Authentication uses bearer tokens set via the `API_KEYS` environment variable (semicolon-separated). When no keys are configured, the server runs in open dev mode.
235
+
236
+ ## Deployment
237
+
238
+ ### Railway
239
+
240
+ ```bash
241
+ studiograph deploy railway
242
+ ```
243
+
244
+ The guided wizard walks through setup. Required environment variables:
245
+
246
+ | Variable | Description |
247
+ |----------|-------------|
248
+ | `STUDIOGRAPH_CONFIG_REPO` | GitHub URL to your `.studiograph` config repo |
249
+ | `GITHUB_TOKEN` | Fine-grained PAT with repo Contents read access |
250
+ | `API_KEYS` | Semicolon-separated bearer tokens for client auth |
251
+ | `WEBHOOK_SECRET` | GitHub webhook HMAC-SHA256 secret (optional) |
252
+ | `PORT` | Set automatically by Railway |
253
+
254
+ On first boot, the server clones the config repo and all content repos automatically.
255
+
256
+ ## Development
257
+
258
+ ### Setup
259
+
260
+ ```bash
261
+ git clone <repo-url>
262
+ cd studiograph
263
+ npm install
264
+ npm run build
265
+ ```
266
+
267
+ ### Scripts
268
+
269
+ ```bash
270
+ npm run build # Compile TypeScript + copy prompt/skill files to dist/
271
+ npm run dev # Watch mode (tsc --watch)
272
+ npm run test # Run tests in watch mode (Vitest)
273
+ npm run lint # ESLint
274
+ npx vitest run # Run tests once (CI mode)
275
+ ```
276
+
277
+ ### Run a Single Test
278
+
279
+ ```bash
280
+ npx vitest run src/core/__tests__/graph.test.ts
281
+ ```
282
+
283
+ ### Project Layout
284
+
285
+ ```
286
+ src/
287
+ ├── cli/ # Commander.js commands
288
+ ├── core/ # Workspace, graph, validation, schema registry, types
289
+ ├── services/ # Git, Markdown, CSV, vector search, assets, memory, lint
290
+ ├── agent/ # AI orchestrator, tools, skills, system prompts
291
+ ├── server/ # Fastify HTTP server and API routes
292
+ ├── mcp/ # Model Context Protocol server and connector manager
293
+ ├── auth/ # GitHub authentication (OAuth device flow)
294
+ └── utils/ # Preflight checks, version checking, git helpers
295
+ ```
296
+
297
+ ### Key Files
298
+
299
+ - `src/core/types.ts` — Zod schemas for workspace config, entities, repos
300
+ - `src/core/validation.ts` — All 30+ built-in entity type schemas
301
+ - `src/core/graph.ts` — `BaseGraphManager` (CRUD for a single repo)
302
+ - `src/core/workspace-manager.ts` — `WorkspaceManager` (multi-repo coordination)
303
+ - `src/core/workspace.ts` — `.studiograph/` directory management
304
+ - `src/agent/orchestrator.ts` — AI agent setup with multi-provider support
305
+ - `src/server/index.ts` — Fastify server factory
306
+
307
+ ## License
308
+
309
+ Apache 2.0 — see [LICENSE](LICENSE) for details.
@@ -11,7 +11,10 @@ export interface AgentConfig {
11
11
  workspacePath: string;
12
12
  workspaceConfig: WorkspaceConfig;
13
13
  gitUser: GitUser;
14
- skillsPath?: string;
14
+ /** Additional skill directories from installed apps (highest-priority first). */
15
+ skillsDirs?: string[];
16
+ /** Additional custom tool directories from installed apps (highest-priority first). */
17
+ toolsDirs?: string[];
15
18
  }
16
19
  export interface AgentResponse {
17
20
  content: string;
@@ -27,24 +30,29 @@ export declare class AgentOrchestrator {
27
30
  private agent;
28
31
  private config;
29
32
  private gitUser;
30
- private skillsPath;
33
+ private skillsDirs;
34
+ private toolsDirs;
31
35
  constructor(config: AgentConfig);
32
36
  /**
33
- * Create Pi-Mono agent with tools and system prompt
37
+ * Create Pi-Mono agent with tools and system prompt.
38
+ * Custom tools and skills are loaded asynchronously via initAsync().
34
39
  */
35
40
  private createAgent;
36
41
  /**
37
- * Load system prompt from file
42
+ * Load custom JS tools from app/workspace tool dirs and append to the agent.
43
+ * Runs async after construction — custom tools may not be available for the
44
+ * very first message if initialisation is extremely fast, but in practice
45
+ * the first user message arrives well after startup.
38
46
  */
39
- private loadSystemPrompt;
47
+ private loadCustomToolsAsync;
40
48
  /**
41
- * Get default system prompt
49
+ * Build the full system prompt: base prompt + eager skill content + skill index.
42
50
  */
43
- private getDefaultSystemPrompt;
51
+ private buildSystemPrompt;
44
52
  /**
45
- * Load tools from skills directory
53
+ * Fallback system prompt when prompts/system.md is not found.
46
54
  */
47
- private loadTools;
55
+ private getDefaultSystemPrompt;
48
56
  /**
49
57
  * Send a message to the agent
50
58
  */