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.
- package/LICENSE +191 -0
- package/README.md +301 -10
- package/dist/agent/orchestrator.d.ts +17 -9
- package/dist/agent/orchestrator.js +142 -97
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/prompts/system.md +186 -0
- package/dist/agent/skill-loader.d.ts +48 -0
- package/dist/agent/skill-loader.js +166 -0
- package/dist/agent/skill-loader.js.map +1 -0
- package/dist/agent/skills/enrich-entities.md +136 -0
- package/dist/agent/skills/entity-schema.md +502 -0
- package/dist/agent/skills/gather-context.md +46 -0
- package/dist/agent/skills/obsidian-source-setup.md +246 -0
- package/dist/agent/skills/skill-loader.d.ts +48 -0
- package/dist/agent/skills/skill-loader.js +166 -0
- package/dist/agent/skills/skill-loader.js.map +1 -0
- package/dist/agent/skills/sync-configuration.md +144 -0
- package/dist/agent/skills/sync-setup.md +68 -0
- package/dist/agent/tools/connector-tools.d.ts +37 -0
- package/dist/agent/tools/connector-tools.js +132 -0
- package/dist/agent/tools/connector-tools.js.map +1 -0
- package/dist/agent/tools/fs-tools.d.ts +39 -0
- package/dist/agent/tools/fs-tools.js +106 -0
- package/dist/agent/tools/fs-tools.js.map +1 -0
- package/dist/agent/tools/graph-tools.d.ts +30 -2
- package/dist/agent/tools/graph-tools.js +154 -37
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/load-skill.d.ts +42 -0
- package/dist/agent/tools/load-skill.js +45 -0
- package/dist/agent/tools/load-skill.js.map +1 -0
- package/dist/agent/tools/sync-tools.d.ts +25 -0
- package/dist/agent/tools/sync-tools.js +691 -0
- package/dist/agent/tools/sync-tools.js.map +1 -0
- package/dist/agent/tools/tool-loader.d.ts +25 -0
- package/dist/agent/tools/tool-loader.js +73 -0
- package/dist/agent/tools/tool-loader.js.map +1 -0
- package/dist/auth/github.d.ts +11 -8
- package/dist/auth/github.js +56 -75
- package/dist/auth/github.js.map +1 -1
- package/dist/cli/colors.d.ts +54 -0
- package/dist/cli/colors.js +133 -0
- package/dist/cli/colors.js.map +1 -0
- package/dist/cli/commands/app.d.ts +7 -0
- package/dist/cli/commands/app.js +167 -0
- package/dist/cli/commands/app.js.map +1 -0
- package/dist/cli/commands/auth.d.ts +1 -1
- package/dist/cli/commands/auth.js +26 -10
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/clone.d.ts +9 -0
- package/dist/cli/commands/clone.js +167 -0
- package/dist/cli/commands/clone.js.map +1 -0
- package/dist/cli/commands/commit.d.ts +8 -0
- package/dist/cli/commands/commit.js +43 -0
- package/dist/cli/commands/commit.js.map +1 -0
- package/dist/cli/commands/config.d.ts +13 -0
- package/dist/cli/commands/config.js +276 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/connector.d.ts +33 -0
- package/dist/cli/commands/connector.js +178 -0
- package/dist/cli/commands/connector.js.map +1 -0
- package/dist/cli/commands/deploy.d.ts +11 -0
- package/dist/cli/commands/deploy.js +153 -0
- package/dist/cli/commands/deploy.js.map +1 -0
- package/dist/cli/commands/enrich.d.ts +11 -0
- package/dist/cli/commands/enrich.js +135 -0
- package/dist/cli/commands/enrich.js.map +1 -0
- package/dist/cli/commands/graphrag.d.ts +12 -0
- package/dist/cli/commands/graphrag.js +122 -0
- package/dist/cli/commands/graphrag.js.map +1 -0
- package/dist/cli/commands/index.d.ts +15 -0
- package/dist/cli/commands/index.js +117 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.js +110 -210
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.js +89 -24
- package/dist/cli/commands/join.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +8 -0
- package/dist/cli/commands/lint.js +70 -0
- package/dist/cli/commands/lint.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +27 -0
- package/dist/cli/commands/mcp.js +56 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/orphans.d.ts +8 -0
- package/dist/cli/commands/orphans.js +125 -0
- package/dist/cli/commands/orphans.js.map +1 -0
- package/dist/cli/commands/provision.d.ts +8 -0
- package/dist/cli/commands/provision.js +116 -0
- package/dist/cli/commands/provision.js.map +1 -0
- package/dist/cli/commands/r2.d.ts +2 -0
- package/dist/cli/commands/r2.js +87 -6
- package/dist/cli/commands/r2.js.map +1 -1
- package/dist/cli/commands/reset.d.ts +12 -0
- package/dist/cli/commands/reset.js +137 -0
- package/dist/cli/commands/reset.js.map +1 -0
- package/dist/cli/commands/review.d.ts +19 -0
- package/dist/cli/commands/review.js +128 -0
- package/dist/cli/commands/review.js.map +1 -0
- package/dist/cli/commands/serve.js +47 -2
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/source.d.ts +16 -0
- package/dist/cli/commands/source.js +159 -0
- package/dist/cli/commands/source.js.map +1 -0
- package/dist/cli/commands/start.js +472 -103
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/sync-entities.d.ts +13 -0
- package/dist/cli/commands/sync-entities.js +242 -0
- package/dist/cli/commands/sync-entities.js.map +1 -0
- package/dist/cli/commands/sync.js +40 -9
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/commands/update.d.ts +8 -0
- package/dist/cli/commands/update.js +155 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.js +114 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/scaffolding.d.ts +10 -0
- package/dist/cli/scaffolding.js +302 -0
- package/dist/cli/scaffolding.js.map +1 -0
- package/dist/cli/setup-wizard.d.ts +30 -0
- package/dist/cli/setup-wizard.js +244 -0
- package/dist/cli/setup-wizard.js.map +1 -0
- package/dist/cli/sync-review-interactive.d.ts +31 -0
- package/dist/cli/sync-review-interactive.js +393 -0
- package/dist/cli/sync-review-interactive.js.map +1 -0
- package/dist/cli/theme.d.ts +31 -0
- package/dist/cli/theme.js +116 -0
- package/dist/cli/theme.js.map +1 -0
- package/dist/core/graph.d.ts +16 -9
- package/dist/core/graph.js +263 -145
- package/dist/core/graph.js.map +1 -1
- package/dist/core/migration-runner.d.ts +42 -0
- package/dist/core/migration-runner.js +232 -0
- package/dist/core/migration-runner.js.map +1 -0
- package/dist/core/migration-types.d.ts +101 -0
- package/dist/core/migration-types.js +21 -0
- package/dist/core/migration-types.js.map +1 -0
- package/dist/core/migrations/20260219-formalize-memory-location.d.ts +2 -0
- package/dist/core/migrations/20260219-formalize-memory-location.js +35 -0
- package/dist/core/migrations/20260219-formalize-memory-location.js.map +1 -0
- package/dist/core/migrations/20260220-add-workspace-metadata.d.ts +12 -0
- package/dist/core/migrations/20260220-add-workspace-metadata.js +65 -0
- package/dist/core/migrations/20260220-add-workspace-metadata.js.map +1 -0
- package/dist/core/migrations/20260220-add-workspace-readme.d.ts +11 -0
- package/dist/core/migrations/20260220-add-workspace-readme.js +82 -0
- package/dist/core/migrations/20260220-add-workspace-readme.js.map +1 -0
- package/dist/core/migrations/20260220-migrate-yaml-to-json.d.ts +9 -0
- package/dist/core/migrations/20260220-migrate-yaml-to-json.js +64 -0
- package/dist/core/migrations/20260220-migrate-yaml-to-json.js.map +1 -0
- package/dist/core/migrations/index.d.ts +11 -0
- package/dist/core/migrations/index.js +23 -0
- package/dist/core/migrations/index.js.map +1 -0
- package/dist/core/schema-registry.d.ts +36 -0
- package/dist/core/schema-registry.js +161 -0
- package/dist/core/schema-registry.js.map +1 -0
- package/dist/core/types.d.ts +242 -3
- package/dist/core/types.js +21 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-config.d.ts +16 -0
- package/dist/core/user-config.js +8 -0
- package/dist/core/user-config.js.map +1 -1
- package/dist/core/validation.d.ts +973 -32
- package/dist/core/validation.js +163 -4
- package/dist/core/validation.js.map +1 -1
- package/dist/core/workspace-manager.d.ts +26 -2
- package/dist/core/workspace-manager.js +113 -15
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/core/workspace.d.ts +20 -11
- package/dist/core/workspace.js +123 -34
- package/dist/core/workspace.js.map +1 -1
- package/dist/mcp/connector-manager.d.ts +65 -0
- package/dist/mcp/connector-manager.js +223 -0
- package/dist/mcp/connector-manager.js.map +1 -0
- package/dist/mcp/connectors/asana.d.ts +2 -0
- package/dist/mcp/connectors/asana.js +20 -0
- package/dist/mcp/connectors/asana.js.map +1 -0
- package/dist/mcp/connectors/definitions.d.ts +45 -0
- package/dist/mcp/connectors/definitions.js +32 -0
- package/dist/mcp/connectors/definitions.js.map +1 -0
- package/dist/mcp/connectors/figma.d.ts +5 -0
- package/dist/mcp/connectors/figma.js +21 -0
- package/dist/mcp/connectors/figma.js.map +1 -0
- package/dist/mcp/connectors/gdrive.d.ts +2 -0
- package/dist/mcp/connectors/gdrive.js +20 -0
- package/dist/mcp/connectors/gdrive.js.map +1 -0
- package/dist/mcp/connectors/granola.d.ts +2 -0
- package/dist/mcp/connectors/granola.js +12 -0
- package/dist/mcp/connectors/granola.js.map +1 -0
- package/dist/mcp/connectors/linear.d.ts +2 -0
- package/dist/mcp/connectors/linear.js +19 -0
- package/dist/mcp/connectors/linear.js.map +1 -0
- package/dist/mcp/connectors/obsidian.d.ts +2 -0
- package/dist/mcp/connectors/obsidian.js +19 -0
- package/dist/mcp/connectors/obsidian.js.map +1 -0
- package/dist/mcp/connectors/pipedrive.d.ts +2 -0
- package/dist/mcp/connectors/pipedrive.js +20 -0
- package/dist/mcp/connectors/pipedrive.js.map +1 -0
- package/dist/mcp/connectors/slack.d.ts +2 -0
- package/dist/mcp/connectors/slack.js +21 -0
- package/dist/mcp/connectors/slack.js.map +1 -0
- package/dist/mcp/oauth-provider.d.ts +41 -0
- package/dist/mcp/oauth-provider.js +160 -0
- package/dist/mcp/oauth-provider.js.map +1 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.js +28 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +14 -0
- package/dist/mcp/tools.js +172 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/server/index.js +17 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/plugin-loader.d.ts +15 -0
- package/dist/server/plugin-loader.js +68 -2
- package/dist/server/plugin-loader.js.map +1 -1
- package/dist/server/routes/graph-api.js +1 -1
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/webhook.js +33 -0
- package/dist/server/routes/webhook.js.map +1 -1
- package/dist/services/github-provisioner.d.ts +9 -3
- package/dist/services/github-provisioner.js +46 -8
- package/dist/services/github-provisioner.js.map +1 -1
- package/dist/services/lint-service.d.ts +27 -0
- package/dist/services/lint-service.js +83 -0
- package/dist/services/lint-service.js.map +1 -0
- package/dist/services/markdown.d.ts +9 -0
- package/dist/services/markdown.js +26 -5
- package/dist/services/markdown.js.map +1 -1
- package/dist/services/memory-service.d.ts +1 -2
- package/dist/services/memory-service.js +5 -4
- package/dist/services/memory-service.js.map +1 -1
- package/dist/services/orphan-service.d.ts +31 -0
- package/dist/services/orphan-service.js +100 -0
- package/dist/services/orphan-service.js.map +1 -0
- package/dist/services/sync/commit.d.ts +58 -0
- package/dist/services/sync/commit.js +350 -0
- package/dist/services/sync/commit.js.map +1 -0
- package/dist/services/sync/context-index.d.ts +69 -0
- package/dist/services/sync/context-index.js +280 -0
- package/dist/services/sync/context-index.js.map +1 -0
- package/dist/services/sync/derive.d.ts +34 -0
- package/dist/services/sync/derive.js +164 -0
- package/dist/services/sync/derive.js.map +1 -0
- package/dist/services/sync/enrichment-state.d.ts +31 -0
- package/dist/services/sync/enrichment-state.js +63 -0
- package/dist/services/sync/enrichment-state.js.map +1 -0
- package/dist/services/sync/enrichment.d.ts +25 -0
- package/dist/services/sync/enrichment.js +121 -0
- package/dist/services/sync/enrichment.js.map +1 -0
- package/dist/services/sync/frontmatter-extractor.d.ts +40 -0
- package/dist/services/sync/frontmatter-extractor.js +273 -0
- package/dist/services/sync/frontmatter-extractor.js.map +1 -0
- package/dist/services/sync/graph-match-state.d.ts +33 -0
- package/dist/services/sync/graph-match-state.js +61 -0
- package/dist/services/sync/graph-match-state.js.map +1 -0
- package/dist/services/sync/graph-match.d.ts +53 -0
- package/dist/services/sync/graph-match.js +316 -0
- package/dist/services/sync/graph-match.js.map +1 -0
- package/dist/services/sync/graphrag-client.d.ts +43 -0
- package/dist/services/sync/graphrag-client.js +94 -0
- package/dist/services/sync/graphrag-client.js.map +1 -0
- package/dist/services/sync/graphrag-config.d.ts +16 -0
- package/dist/services/sync/graphrag-config.js +39 -0
- package/dist/services/sync/graphrag-config.js.map +1 -0
- package/dist/services/sync/graphrag-context.d.ts +14 -0
- package/dist/services/sync/graphrag-context.js +109 -0
- package/dist/services/sync/graphrag-context.js.map +1 -0
- package/dist/services/sync/graphrag-indexer.d.ts +30 -0
- package/dist/services/sync/graphrag-indexer.js +358 -0
- package/dist/services/sync/graphrag-indexer.js.map +1 -0
- package/dist/services/sync/llm.d.ts +32 -0
- package/dist/services/sync/llm.js +115 -0
- package/dist/services/sync/llm.js.map +1 -0
- package/dist/services/sync/mcp-client.d.ts +59 -0
- package/dist/services/sync/mcp-client.js +285 -0
- package/dist/services/sync/mcp-client.js.map +1 -0
- package/dist/services/sync/model-factory.d.ts +10 -0
- package/dist/services/sync/model-factory.js +24 -0
- package/dist/services/sync/model-factory.js.map +1 -0
- package/dist/services/sync/name-quality.d.ts +31 -0
- package/dist/services/sync/name-quality.js +60 -0
- package/dist/services/sync/name-quality.js.map +1 -0
- package/dist/services/sync/output-schemas.d.ts +92 -0
- package/dist/services/sync/output-schemas.js +43 -0
- package/dist/services/sync/output-schemas.js.map +1 -0
- package/dist/services/sync/prompts.d.ts +19 -0
- package/dist/services/sync/prompts.js +128 -0
- package/dist/services/sync/prompts.js.map +1 -0
- package/dist/services/sync/reconciler.d.ts +48 -0
- package/dist/services/sync/reconciler.js +295 -0
- package/dist/services/sync/reconciler.js.map +1 -0
- package/dist/services/sync/source-config.d.ts +45 -0
- package/dist/services/sync/source-config.js +208 -0
- package/dist/services/sync/source-config.js.map +1 -0
- package/dist/services/sync/source-definitions/asana.d.ts +15 -0
- package/dist/services/sync/source-definitions/asana.js +48 -0
- package/dist/services/sync/source-definitions/asana.js.map +1 -0
- package/dist/services/sync/source-definitions/definitions.d.ts +21 -0
- package/dist/services/sync/source-definitions/definitions.js +26 -0
- package/dist/services/sync/source-definitions/definitions.js.map +1 -0
- package/dist/services/sync/source-definitions/gdrive.d.ts +16 -0
- package/dist/services/sync/source-definitions/gdrive.js +68 -0
- package/dist/services/sync/source-definitions/gdrive.js.map +1 -0
- package/dist/services/sync/source-definitions/granola.d.ts +2 -0
- package/dist/services/sync/source-definitions/granola.js +28 -0
- package/dist/services/sync/source-definitions/granola.js.map +1 -0
- package/dist/services/sync/source-definitions/linear.d.ts +2 -0
- package/dist/services/sync/source-definitions/linear.js +60 -0
- package/dist/services/sync/source-definitions/linear.js.map +1 -0
- package/dist/services/sync/source-definitions/obsidian.d.ts +2 -0
- package/dist/services/sync/source-definitions/obsidian.js +55 -0
- package/dist/services/sync/source-definitions/obsidian.js.map +1 -0
- package/dist/services/sync/source-definitions/pipedrive.d.ts +2 -0
- package/dist/services/sync/source-definitions/pipedrive.js +52 -0
- package/dist/services/sync/source-definitions/pipedrive.js.map +1 -0
- package/dist/services/sync/staging.d.ts +53 -0
- package/dist/services/sync/staging.js +131 -0
- package/dist/services/sync/staging.js.map +1 -0
- package/dist/services/sync/structured-extractor.d.ts +49 -0
- package/dist/services/sync/structured-extractor.js +344 -0
- package/dist/services/sync/structured-extractor.js.map +1 -0
- package/dist/services/sync/sync-runner.d.ts +32 -0
- package/dist/services/sync/sync-runner.js +195 -0
- package/dist/services/sync/sync-runner.js.map +1 -0
- package/dist/services/sync/sync-state.d.ts +43 -0
- package/dist/services/sync/sync-state.js +154 -0
- package/dist/services/sync/sync-state.js.map +1 -0
- package/dist/services/sync/types.d.ts +203 -0
- package/dist/services/sync/types.js +8 -0
- package/dist/services/sync/types.js.map +1 -0
- package/dist/services/sync/unstructured-extractor.d.ts +29 -0
- package/dist/services/sync/unstructured-extractor.js +197 -0
- package/dist/services/sync/unstructured-extractor.js.map +1 -0
- package/dist/services/vector-service.d.ts +88 -0
- package/dist/services/vector-service.js +322 -0
- package/dist/services/vector-service.js.map +1 -0
- package/dist/utils/git.d.ts +26 -4
- package/dist/utils/git.js +55 -7
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/merge-resolver.d.ts +34 -0
- package/dist/utils/merge-resolver.js +201 -0
- package/dist/utils/merge-resolver.js.map +1 -0
- package/dist/utils/preflight.d.ts +2 -1
- package/dist/utils/preflight.js +8 -1
- package/dist/utils/preflight.js.map +1 -1
- package/dist/utils/version-checker.d.ts +23 -0
- package/dist/utils/version-checker.js +116 -0
- package/dist/utils/version-checker.js.map +1 -0
- package/dist/utils/workspace-config.d.ts +8 -0
- package/dist/utils/workspace-config.js +22 -0
- package/dist/utils/workspace-config.js.map +1 -0
- package/package.json +24 -11
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Manages the Pi-Mono agent instance and coordinates with workspace managers.
|
|
5
5
|
* Loads skills, handles system prompts, and manages conversation flow.
|
|
6
6
|
*/
|
|
7
|
-
import { readFileSync, existsSync
|
|
7
|
+
import { readFileSync, existsSync } from 'fs';
|
|
8
8
|
import { join, dirname } from 'path';
|
|
9
|
+
import { homedir } from 'os';
|
|
9
10
|
import { fileURLToPath } from 'url';
|
|
10
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
12
|
const __dirname = dirname(__filename);
|
|
@@ -13,63 +14,162 @@ import { getModel } from '@mariozechner/pi-ai';
|
|
|
13
14
|
import { Agent } from '@mariozechner/pi-agent-core';
|
|
14
15
|
import { WorkspaceManager } from '../core/workspace-manager.js';
|
|
15
16
|
import { createGraphTools } from './tools/graph-tools.js';
|
|
17
|
+
import { createSyncTools } from './tools/sync-tools.js';
|
|
18
|
+
import { loadSkillIndex, buildSkillIndexPrompt, loadEagerSkills } from './skill-loader.js';
|
|
19
|
+
import { createLoadSkillTool } from './tools/load-skill.js';
|
|
20
|
+
import { loadCustomTools } from './tools/tool-loader.js';
|
|
21
|
+
import { ConnectorManager } from '../mcp/connector-manager.js';
|
|
22
|
+
import { buildConnectorRegistry, createConnectorTools } from './tools/connector-tools.js';
|
|
23
|
+
import { createFsTools } from './tools/fs-tools.js';
|
|
24
|
+
import { loadUserConfig, getAnthropicCredential } from '../core/user-config.js';
|
|
16
25
|
export class AgentOrchestrator {
|
|
17
26
|
workspacePath;
|
|
18
27
|
workspaceManager;
|
|
19
28
|
agent;
|
|
20
29
|
config;
|
|
21
30
|
gitUser;
|
|
22
|
-
|
|
31
|
+
skillsDirs;
|
|
32
|
+
toolsDirs;
|
|
23
33
|
constructor(config) {
|
|
24
34
|
this.workspacePath = config.workspacePath;
|
|
25
35
|
this.config = config.workspaceConfig;
|
|
26
36
|
this.gitUser = config.gitUser;
|
|
27
|
-
|
|
37
|
+
// Priority (highest → lowest): user > workspace > bundled > app
|
|
38
|
+
// First-seen name wins in the loader, so earlier dirs override later ones.
|
|
39
|
+
const userSkillsDir = join(homedir(), '.studiograph', 'skills');
|
|
40
|
+
const userToolsDir = join(homedir(), '.studiograph', 'tools');
|
|
41
|
+
const workspaceSkillsDir = join(this.workspacePath, '.studiograph', 'skills');
|
|
42
|
+
const workspaceToolsDir = join(this.workspacePath, '.studiograph', 'tools');
|
|
43
|
+
const bundledSkillsDir = join(__dirname, 'skills');
|
|
44
|
+
this.skillsDirs = [userSkillsDir, workspaceSkillsDir, bundledSkillsDir, ...(config.skillsDirs ?? [])];
|
|
45
|
+
this.toolsDirs = [userToolsDir, workspaceToolsDir, ...(config.toolsDirs ?? [])];
|
|
28
46
|
// Initialize workspace manager
|
|
29
47
|
const orchestratorUser = { ...this.gitUser, role: 'admin' };
|
|
30
48
|
this.workspaceManager = new WorkspaceManager(this.workspacePath, this.config, this.gitUser, orchestratorUser);
|
|
31
|
-
// Initialize Pi-Mono agent
|
|
49
|
+
// Initialize Pi-Mono agent (async tools loaded in createAgent)
|
|
32
50
|
this.agent = this.createAgent();
|
|
33
51
|
}
|
|
34
52
|
/**
|
|
35
|
-
* Create Pi-Mono agent with tools and system prompt
|
|
53
|
+
* Create Pi-Mono agent with tools and system prompt.
|
|
54
|
+
* Custom tools and skills are loaded asynchronously via initAsync().
|
|
36
55
|
*/
|
|
37
56
|
createAgent() {
|
|
38
|
-
|
|
39
|
-
const provider = this.config.model_provider || 'anthropic';
|
|
40
|
-
const modelId = this.config.model_id || 'claude-sonnet-4-5-20250929';
|
|
41
|
-
const apiKey = this.config.api_key || process.env.ANTHROPIC_API_KEY || '';
|
|
57
|
+
const userConfig = loadUserConfig();
|
|
58
|
+
const provider = userConfig.model_provider || this.config.model_provider || 'anthropic';
|
|
59
|
+
const modelId = userConfig.model_id || this.config.model_id || 'claude-sonnet-4-5-20250929';
|
|
60
|
+
const apiKey = getAnthropicCredential(userConfig) || this.config.api_key || process.env.ANTHROPIC_API_KEY || '';
|
|
42
61
|
if (!apiKey) {
|
|
43
62
|
throw new Error('API key not found in config or environment');
|
|
44
63
|
}
|
|
45
64
|
const model = getModel(provider, modelId);
|
|
46
|
-
//
|
|
47
|
-
const
|
|
48
|
-
//
|
|
49
|
-
const tools =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
65
|
+
// Build skill index (synchronous — reads markdown frontmatter only)
|
|
66
|
+
const skillIndex = loadSkillIndex(this.skillsDirs);
|
|
67
|
+
// Build tools first so we can auto-generate the tool reference for the prompt
|
|
68
|
+
const tools = [
|
|
69
|
+
...createGraphTools(this.workspaceManager, this.gitUser, this.workspacePath),
|
|
70
|
+
...createSyncTools(this.workspacePath, this.config),
|
|
71
|
+
...createFsTools(),
|
|
72
|
+
createLoadSkillTool(skillIndex),
|
|
73
|
+
];
|
|
74
|
+
// Build system prompt — base + auto-generated tool reference + eager skills + skill index
|
|
75
|
+
const systemPrompt = this.buildSystemPrompt(skillIndex, tools);
|
|
76
|
+
// Log registered tools at startup
|
|
77
|
+
console.log(`🔧 ${tools.length} tools registered: ${tools.map((t) => t.name).join(', ')}`);
|
|
78
|
+
const agent = new Agent({ getApiKey: () => apiKey });
|
|
55
79
|
agent.setModel(model);
|
|
56
80
|
agent.setSystemPrompt(systemPrompt);
|
|
57
81
|
agent.setTools(tools);
|
|
82
|
+
// Load custom tools asynchronously and register them
|
|
83
|
+
this.loadCustomToolsAsync(agent);
|
|
58
84
|
return agent;
|
|
59
85
|
}
|
|
60
86
|
/**
|
|
61
|
-
* Load
|
|
87
|
+
* Load custom JS tools from app/workspace tool dirs and append to the agent.
|
|
88
|
+
* Runs async after construction — custom tools may not be available for the
|
|
89
|
+
* very first message if initialisation is extremely fast, but in practice
|
|
90
|
+
* the first user message arrives well after startup.
|
|
91
|
+
*/
|
|
92
|
+
loadCustomToolsAsync(agent) {
|
|
93
|
+
const context = { workspaceManager: this.workspaceManager, gitUser: this.gitUser };
|
|
94
|
+
Promise.all([
|
|
95
|
+
loadCustomTools(this.toolsDirs, context),
|
|
96
|
+
ConnectorManager.buildTools(ConnectorManager.loadConfigs()),
|
|
97
|
+
]).then(([customTools, connectorTools]) => {
|
|
98
|
+
const extra = [...customTools];
|
|
99
|
+
if (connectorTools.length > 0) {
|
|
100
|
+
const registry = buildConnectorRegistry(connectorTools);
|
|
101
|
+
extra.push(...createConnectorTools(registry));
|
|
102
|
+
}
|
|
103
|
+
if (extra.length > 0) {
|
|
104
|
+
const existing = agent.state.tools;
|
|
105
|
+
agent.setTools([...existing, ...extra]);
|
|
106
|
+
}
|
|
107
|
+
}).catch(err => {
|
|
108
|
+
console.warn('Failed to load custom/connector tools:', err);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Build the full system prompt: base prompt + eager skill content + skill index.
|
|
62
113
|
*/
|
|
63
|
-
|
|
114
|
+
buildSystemPrompt(skillIndex, tools) {
|
|
64
115
|
const promptPath = join(__dirname, 'prompts', 'system.md');
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
116
|
+
let base = existsSync(promptPath)
|
|
117
|
+
? readFileSync(promptPath, 'utf-8')
|
|
118
|
+
: this.getDefaultSystemPrompt();
|
|
119
|
+
// Auto-generate tool reference from registered tools, grouped by category
|
|
120
|
+
const categories = {
|
|
121
|
+
'Entity Management': [],
|
|
122
|
+
'Data Sync & Source Config': [],
|
|
123
|
+
'Enrichment': [],
|
|
124
|
+
'Workspace Git': [],
|
|
125
|
+
'External Connectors': [],
|
|
126
|
+
'Skills': [],
|
|
127
|
+
'Other': [],
|
|
128
|
+
};
|
|
129
|
+
for (const t of tools) {
|
|
130
|
+
if (t.description?.startsWith('DEPRECATED'))
|
|
131
|
+
continue;
|
|
132
|
+
const name = t.name ?? '';
|
|
133
|
+
if (name.startsWith('sync_'))
|
|
134
|
+
categories['Data Sync & Source Config'].push(t);
|
|
135
|
+
else if (name.startsWith('enrich_'))
|
|
136
|
+
categories['Enrichment'].push(t);
|
|
137
|
+
else if (name.startsWith('workspace_'))
|
|
138
|
+
categories['Workspace Git'].push(t);
|
|
139
|
+
else if (name.startsWith('connector_'))
|
|
140
|
+
categories['External Connectors'].push(t);
|
|
141
|
+
else if (name === 'load_skill')
|
|
142
|
+
categories['Skills'].push(t);
|
|
143
|
+
else if (['create_entity', 'get_entity', 'update_entity', 'delete_entity', 'search_entities', 'list_entities', 'get_related', 'get_backlinks', 'validate_wikilinks', 'get_workspace_summary', 'list_repos', 'query_dataset', 'append_rows', 'get_entity_schema', 'lint_entities'].includes(name))
|
|
144
|
+
categories['Entity Management'].push(t);
|
|
145
|
+
else
|
|
146
|
+
categories['Other'].push(t);
|
|
147
|
+
}
|
|
148
|
+
const toolRef = Object.entries(categories)
|
|
149
|
+
.filter(([, items]) => items.length > 0)
|
|
150
|
+
.map(([cat, items]) => `**${cat}:**\n${items.map((t) => `- \`${t.name}\` — ${t.description}`).join('\n')}`)
|
|
151
|
+
.join('\n\n');
|
|
152
|
+
base = base.replace('{{TOOL_REFERENCE}}', toolRef);
|
|
153
|
+
const parts = [base.trim()];
|
|
154
|
+
// Append workspace schema extensions (org-specific fields and custom types)
|
|
155
|
+
const schemaSection = this.workspaceManager.getSchemaRegistry().toPromptSection();
|
|
156
|
+
if (schemaSection) {
|
|
157
|
+
parts.push(schemaSection);
|
|
68
158
|
}
|
|
69
|
-
|
|
159
|
+
// Inline eager skills directly into the system prompt
|
|
160
|
+
const eagerContent = loadEagerSkills(skillIndex);
|
|
161
|
+
if (eagerContent) {
|
|
162
|
+
parts.push(eagerContent);
|
|
163
|
+
}
|
|
164
|
+
// Append skill index for on-demand skills
|
|
165
|
+
const index = buildSkillIndexPrompt(skillIndex);
|
|
166
|
+
if (index) {
|
|
167
|
+
parts.push(index);
|
|
168
|
+
}
|
|
169
|
+
return parts.join('\n\n');
|
|
70
170
|
}
|
|
71
171
|
/**
|
|
72
|
-
*
|
|
172
|
+
* Fallback system prompt when prompts/system.md is not found.
|
|
73
173
|
*/
|
|
74
174
|
getDefaultSystemPrompt() {
|
|
75
175
|
const workspaceSummary = this.workspaceManager.getSummary();
|
|
@@ -81,73 +181,14 @@ export class AgentOrchestrator {
|
|
|
81
181
|
|
|
82
182
|
You are Studiograph, an AI assistant helping creative teams manage their knowledge graphs.
|
|
83
183
|
|
|
84
|
-
## Workspace
|
|
184
|
+
## Workspace
|
|
85
185
|
|
|
86
186
|
**Team:** ${this.config.team_name}
|
|
87
187
|
**Repositories:** ${workspaceSummary.totalRepos}
|
|
88
188
|
**Total Entities:** ${workspaceSummary.totalEntities}
|
|
89
189
|
|
|
90
190
|
**Available Repositories:**
|
|
91
|
-
${repoList}
|
|
92
|
-
|
|
93
|
-
## Your Capabilities
|
|
94
|
-
|
|
95
|
-
You can help with:
|
|
96
|
-
- Creating and managing entities (projects, clients, decisions, references, etc.)
|
|
97
|
-
- Searching across repositories
|
|
98
|
-
- Validating wikilinks and relationships
|
|
99
|
-
- Uploading and managing assets
|
|
100
|
-
- Generating insights from the knowledge graph
|
|
101
|
-
|
|
102
|
-
## Guidelines
|
|
103
|
-
|
|
104
|
-
- Always ask clarifying questions before creating entities
|
|
105
|
-
- Validate wikilinks to ensure data integrity
|
|
106
|
-
- Suggest related entities based on context
|
|
107
|
-
- Be proactive in maintaining the knowledge graph
|
|
108
|
-
- Use the tools available to you effectively
|
|
109
|
-
|
|
110
|
-
## Available Tools
|
|
111
|
-
|
|
112
|
-
You have access to graph management tools that allow you to:
|
|
113
|
-
- Create, read, update, and delete entities
|
|
114
|
-
- Search and filter entities
|
|
115
|
-
- Manage wikilinks and relationships
|
|
116
|
-
- Upload and manage assets
|
|
117
|
-
|
|
118
|
-
Use these tools to help users build and navigate their knowledge graph.
|
|
119
|
-
`;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Load tools from skills directory
|
|
123
|
-
*/
|
|
124
|
-
loadTools() {
|
|
125
|
-
const tools = [];
|
|
126
|
-
// Load built-in graph tools
|
|
127
|
-
const graphTools = createGraphTools(this.workspaceManager, this.gitUser);
|
|
128
|
-
tools.push(...graphTools);
|
|
129
|
-
// Load custom skills from skills directory
|
|
130
|
-
if (existsSync(this.skillsPath)) {
|
|
131
|
-
try {
|
|
132
|
-
const skillFiles = readdirSync(this.skillsPath).filter(f => f.endsWith('.js'));
|
|
133
|
-
for (const skillFile of skillFiles) {
|
|
134
|
-
try {
|
|
135
|
-
const skillPath = join(this.skillsPath, skillFile);
|
|
136
|
-
const skill = require(skillPath);
|
|
137
|
-
if (skill.default && typeof skill.default === 'object') {
|
|
138
|
-
tools.push(skill.default);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
console.warn(`Failed to load skill ${skillFile}:`, error);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.warn('Failed to load skills:', error);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return tools;
|
|
191
|
+
${repoList}`;
|
|
151
192
|
}
|
|
152
193
|
/**
|
|
153
194
|
* Send a message to the agent
|
|
@@ -156,28 +197,32 @@ Use these tools to help users build and navigate their knowledge graph.
|
|
|
156
197
|
return new Promise((resolve, reject) => {
|
|
157
198
|
let content = '';
|
|
158
199
|
const toolCalls = [];
|
|
159
|
-
// Subscribe to agent events
|
|
200
|
+
// Subscribe to agent events.
|
|
201
|
+
// message_update: { type, message: PartialMessage } — accumulate text from assistant turns
|
|
202
|
+
// message_end: { type, message: AgentMessage } — also fires for user prompt messages, so filter by role
|
|
203
|
+
// agent_end: fires once when the full agentic loop is done — resolve here
|
|
160
204
|
const unsubscribe = this.agent.subscribe((event) => {
|
|
161
|
-
if (event.type === '
|
|
162
|
-
const msgEvent = event.assistantMessageEvent;
|
|
163
|
-
if (msgEvent.type === 'text_delta') {
|
|
164
|
-
content += msgEvent.delta;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
else if (event.type === 'message_end') {
|
|
168
|
-
// Extract tool calls from message content
|
|
205
|
+
if (event.type === 'message_end') {
|
|
169
206
|
const msg = event.message;
|
|
170
|
-
if (msg
|
|
207
|
+
if (msg?.role === 'assistant') {
|
|
208
|
+
// Collect text and tool calls from completed assistant message
|
|
209
|
+
content = msg.content
|
|
210
|
+
.filter((b) => b.type === 'text')
|
|
211
|
+
.map((b) => b.text)
|
|
212
|
+
.join('');
|
|
171
213
|
for (const block of msg.content) {
|
|
172
214
|
if (block.type === 'toolCall') {
|
|
173
215
|
toolCalls.push({
|
|
174
216
|
tool: block.name,
|
|
175
217
|
input: block.input,
|
|
176
|
-
output: null,
|
|
218
|
+
output: null,
|
|
177
219
|
});
|
|
178
220
|
}
|
|
179
221
|
}
|
|
180
222
|
}
|
|
223
|
+
}
|
|
224
|
+
else if (event.type === 'agent_end') {
|
|
225
|
+
// Full agentic loop complete (all turns + tool calls done)
|
|
181
226
|
unsubscribe();
|
|
182
227
|
resolve({ content, toolCalls });
|
|
183
228
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../src/agent/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../src/agent/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAe,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,s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C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC7C,WAAW,EAAE,CAAC;gBACd,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Studiograph AI Assistant
|
|
2
|
+
|
|
3
|
+
You are Studiograph, an AI assistant helping creative teams manage their knowledge graphs. Your role is to help teams organize projects, clients, decisions, references, and other entities in a structured, interconnected way using Git-backed markdown files.
|
|
4
|
+
|
|
5
|
+
## Core Capabilities
|
|
6
|
+
|
|
7
|
+
You can help users with:
|
|
8
|
+
|
|
9
|
+
1. **Entity Management**
|
|
10
|
+
- Create, read, update, and delete entities (projects, clients, decisions, briefs, etc.)
|
|
11
|
+
- Validate entity data against schemas
|
|
12
|
+
- Suggest appropriate entity types for user needs
|
|
13
|
+
|
|
14
|
+
2. **Knowledge Graph Navigation**
|
|
15
|
+
- Search across repositories
|
|
16
|
+
- Follow wikilink relationships
|
|
17
|
+
- Find related entities and backlinks
|
|
18
|
+
- Validate wikilinks to ensure data integrity
|
|
19
|
+
|
|
20
|
+
3. **Asset Management**
|
|
21
|
+
- Upload and manage media files (images, videos, documents)
|
|
22
|
+
- Organize assets by entity
|
|
23
|
+
- Track asset metadata
|
|
24
|
+
|
|
25
|
+
4. **Insights and Organization**
|
|
26
|
+
- Suggest connections between entities
|
|
27
|
+
- Identify missing relationships
|
|
28
|
+
- Recommend entity creation based on context
|
|
29
|
+
|
|
30
|
+
## Guidelines
|
|
31
|
+
|
|
32
|
+
**Be Action-Oriented:**
|
|
33
|
+
- When you have a tool that can answer a question, call it first — then discuss results
|
|
34
|
+
- Don't ask users to provide information you can look up yourself (e.g. source configs, workspace status, entity data)
|
|
35
|
+
- Explain what you're doing and why
|
|
36
|
+
- Suggest next steps proactively
|
|
37
|
+
|
|
38
|
+
**Maintain Data Integrity:**
|
|
39
|
+
- Always validate wikilinks before creating them
|
|
40
|
+
- Ensure required fields are present
|
|
41
|
+
- Check for duplicate entities
|
|
42
|
+
- Use appropriate entity types
|
|
43
|
+
|
|
44
|
+
**Be Helpful:**
|
|
45
|
+
- Suggest related entities based on context
|
|
46
|
+
- Offer to create missing referenced entities
|
|
47
|
+
- Recommend useful searches or queries
|
|
48
|
+
- Help users discover patterns in their knowledge graph
|
|
49
|
+
|
|
50
|
+
**Respect Structure:**
|
|
51
|
+
- Follow the established entity schemas
|
|
52
|
+
- Maintain consistent naming conventions (kebab-case IDs)
|
|
53
|
+
- Preserve YAML frontmatter formatting
|
|
54
|
+
- Keep wikilinks properly formatted: `[[entity-id]]` or `[[entity-id|Display Text]]`
|
|
55
|
+
|
|
56
|
+
## Entity Types
|
|
57
|
+
|
|
58
|
+
You have access to the following entity types:
|
|
59
|
+
|
|
60
|
+
**Project Repos:**
|
|
61
|
+
- `project`: Client engagements with timelines and deliverables
|
|
62
|
+
- `meeting`: Dated events with attendees, notes, decisions
|
|
63
|
+
- `decision`: Structured decision records (DEC-YYYY-NNN format)
|
|
64
|
+
- `task`: Lightweight action items and to-dos (assignee, due_date, status: open/in-progress/done/cancelled, priority, related to projects/meetings/deliverables)
|
|
65
|
+
- `brief`: Project requirements and specifications
|
|
66
|
+
- `deliverable`: Scoped contractual output promised to a client (e.g. "Brand Identity System"); contains multiple artifacts
|
|
67
|
+
- `artifact`: Individual generated outputs (decks, docs, prototypes) produced within a deliverable
|
|
68
|
+
|
|
69
|
+
**Function Repos:**
|
|
70
|
+
- `deal`: Pre-project sales opportunity moving through the pipeline (scoping → proposal → negotiating → won/lost)
|
|
71
|
+
- `proposal`: Client proposals with pricing
|
|
72
|
+
- `contract`: SOWs, MSAs, NDAs
|
|
73
|
+
- `client`: Organizations — use `status: prospect` for leads not yet engaged
|
|
74
|
+
- `person`: Individual contacts (external clients, partners, team members) with optional `reports_to` and `department`
|
|
75
|
+
- `financial-plan`: Budgets, rates, forecasts
|
|
76
|
+
- `vendor`: External suppliers, freelancers, and partners (type: freelancer/agency/supplier/platform/partner)
|
|
77
|
+
- `role`: Generalized role definitions from the firm's leveling framework (title, department, level, responsibilities + leveling criteria)
|
|
78
|
+
|
|
79
|
+
**Shared Resource Repos:**
|
|
80
|
+
- `template`: Document templates
|
|
81
|
+
- `process`: Standardized workflows
|
|
82
|
+
- `standard`: Guidelines and best practices
|
|
83
|
+
- `reference`: External examples (projects, articles, tools)
|
|
84
|
+
- `technique`: Design patterns and methods
|
|
85
|
+
- `practice-area`: Firm capabilities and disciplines (e.g. Data Visualization, UX Design)
|
|
86
|
+
- `case-study`: Portfolio narratives for completed projects (objective, solution, outcome, team, press, awards)
|
|
87
|
+
|
|
88
|
+
**App Types:**
|
|
89
|
+
- `dataset`: Tabular data with a declared column schema (name, type, required). Body is raw CSV. Use for time tracking, budgets, rosters, inventories.
|
|
90
|
+
- `deck`: Presentation deck entity (rendered by the Schema Slides app)
|
|
91
|
+
|
|
92
|
+
**Deal lifecycle:** `client` (status: prospect) + `person` contacts → `deal` → `proposal` documents → won → `project` → `deliverable` → `artifact[]`
|
|
93
|
+
|
|
94
|
+
## Artifact Placement
|
|
95
|
+
|
|
96
|
+
When you create or file an artifact, follow these rules:
|
|
97
|
+
|
|
98
|
+
**Confirm before writing:**
|
|
99
|
+
Unless the user has explicitly specified where to put an artifact, always confirm the inferred location before creating it. For example: *"I'll save this as an artifact in the `new-business/` repo under the RAA deal — does that sound right?"* Wait for confirmation before calling `create_entity`.
|
|
100
|
+
|
|
101
|
+
**Repo selection:**
|
|
102
|
+
- Related to a deal or proposal → the function repo containing that deal (e.g. `new-business/`)
|
|
103
|
+
- Related to a specific project → that project's repo
|
|
104
|
+
- Team-wide reusable output → shared resource repo
|
|
105
|
+
|
|
106
|
+
**Privacy — `private/` vs. visibility field:**
|
|
107
|
+
|
|
108
|
+
These are two different mechanisms. Do not confuse them:
|
|
109
|
+
|
|
110
|
+
| | `repo: "private"` | `visibility: admin/restricted` |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| What it means | File stays on this machine only, never committed | File is committed but access-controlled in the repo |
|
|
113
|
+
| Use when | "Make it private" / draft / sensitive / not ready to share | Committed file that only certain roles should see |
|
|
114
|
+
|
|
115
|
+
When a user says "make it private", "keep this to myself", "don't share this", or "just for me" → use `repo: "private"`. Do **not** use `visibility: admin` or `visibility: restricted` as a substitute for local-only storage.
|
|
116
|
+
|
|
117
|
+
- If a draft or sensitive artifact should stay local → `repo: "private"`, `entityType: "artifact"`
|
|
118
|
+
- When unsure, ask: *"Should this stay private on your machine, or be committed to the team repo with restricted access?"*
|
|
119
|
+
- Private entities can wikilink to public entities
|
|
120
|
+
- Files in `private/` do not appear in workspace-wide `list_entities` — use `search_entities` with `repoNames: ["private"]` to retrieve them
|
|
121
|
+
- Never suggest committing or pushing anything from `private/`
|
|
122
|
+
|
|
123
|
+
**Entity type for generated content:**
|
|
124
|
+
- Reports, assessments, summaries, email drafts, briefs, analyses → use `artifact` (type field: `"report"`, `"brief"`, etc.)
|
|
125
|
+
- Do not probe for unknown entity types (assessment, report, note, document, etc.) — they don't exist. `artifact` is the correct type for any generated document.
|
|
126
|
+
|
|
127
|
+
**Content format:**
|
|
128
|
+
- Text artifacts (email drafts, briefs, summaries) → content in the markdown body of the artifact entity
|
|
129
|
+
- Binary or externally-hosted files → `url` field pointing to R2 URL or local path
|
|
130
|
+
|
|
131
|
+
## Interaction Patterns
|
|
132
|
+
|
|
133
|
+
**When creating entities:**
|
|
134
|
+
1. Ask for required information
|
|
135
|
+
2. Validate data
|
|
136
|
+
3. Confirm before creating
|
|
137
|
+
4. Suggest related entities to link
|
|
138
|
+
|
|
139
|
+
**When searching:**
|
|
140
|
+
1. Understand user intent
|
|
141
|
+
2. Use appropriate filters
|
|
142
|
+
3. Present results clearly
|
|
143
|
+
4. Offer to narrow or broaden search
|
|
144
|
+
|
|
145
|
+
**When navigating relationships:**
|
|
146
|
+
1. Show related entities
|
|
147
|
+
2. Explain connections
|
|
148
|
+
3. Suggest additional relationships
|
|
149
|
+
4. Help users discover patterns
|
|
150
|
+
|
|
151
|
+
## Tools
|
|
152
|
+
|
|
153
|
+
You have access to tools in the following categories:
|
|
154
|
+
|
|
155
|
+
**Entity Management** — CRUD operations on knowledge graph entities, wikilink traversal, search, schema queries, datasets, and linting.
|
|
156
|
+
|
|
157
|
+
**Data Sync** — Import data from external sources (Pipedrive, Linear, Granola, Obsidian, etc.) through the sync pipeline: extract → reconcile → stage → apply.
|
|
158
|
+
|
|
159
|
+
**Enrichment** — LLM-powered enrichment of sparse entities using cross-source context.
|
|
160
|
+
|
|
161
|
+
**Workspace Git** — Check uncommitted changes, review diffs, and commit across all workspace repos. Use these when users ask about pending changes or want to commit.
|
|
162
|
+
|
|
163
|
+
**Skills** — Load domain-specific guidance on demand (see "Available Skills" below).
|
|
164
|
+
|
|
165
|
+
### Tool Selection
|
|
166
|
+
|
|
167
|
+
**IMPORTANT — match user intent to the right tool category:**
|
|
168
|
+
- "source config", "sync config", "field map", "mappings" → `sync_list_sources` (NOT entity search)
|
|
169
|
+
- "uncommitted changes", "what changed", "pending changes" → `workspace_status`
|
|
170
|
+
- "show diff", "review changes" → `workspace_review`
|
|
171
|
+
- "commit", "save changes" → `workspace_commit`
|
|
172
|
+
- Source configs are NOT entities — they live in `.studiograph/sources/` and are accessed via sync tools, not entity tools.
|
|
173
|
+
|
|
174
|
+
### Tool Reference
|
|
175
|
+
|
|
176
|
+
{{TOOL_REFERENCE}}
|
|
177
|
+
|
|
178
|
+
Use these tools to help users build, navigate, and synchronize their knowledge graph effectively.
|
|
179
|
+
|
|
180
|
+
## Remember
|
|
181
|
+
|
|
182
|
+
- You're here to help teams work better, not just to manage data
|
|
183
|
+
- Every entity represents real work and decisions
|
|
184
|
+
- Wikilinks create the knowledge graph - they're crucial
|
|
185
|
+
- Git provides version history - changes are never lost
|
|
186
|
+
- Be proactive but always confirm before making changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Loader — prompt skills for the Studiograph agent.
|
|
3
|
+
*
|
|
4
|
+
* Skills are markdown files with YAML frontmatter that inject domain-specific
|
|
5
|
+
* knowledge into the agent's system prompt. Two formats supported:
|
|
6
|
+
*
|
|
7
|
+
* Directory skill:
|
|
8
|
+
* skills/create-deck/
|
|
9
|
+
* skill.md ← required entrypoint
|
|
10
|
+
* slide-types.md ← optional sub-files
|
|
11
|
+
*
|
|
12
|
+
* Single-file skill:
|
|
13
|
+
* skills/quick-tip.md
|
|
14
|
+
*
|
|
15
|
+
* Frontmatter fields:
|
|
16
|
+
* name: kebab-case identifier (defaults to directory/filename)
|
|
17
|
+
* description: shown in skill index so agent knows when to load it
|
|
18
|
+
* loading: "on-demand" (default) | "eager" (inlined in system prompt)
|
|
19
|
+
*/
|
|
20
|
+
export interface SkillMeta {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
loading: 'eager' | 'on-demand';
|
|
24
|
+
dir: string;
|
|
25
|
+
entrypoint: string;
|
|
26
|
+
isDirectory: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Scan one or more skill directories and return a de-duplicated skill index.
|
|
30
|
+
* Directories are processed in order — first occurrence of a name wins,
|
|
31
|
+
* so workspace-level skills override app-bundled skills.
|
|
32
|
+
*/
|
|
33
|
+
export declare function loadSkillIndex(skillsDirs: string[]): SkillMeta[];
|
|
34
|
+
/**
|
|
35
|
+
* Load the full content of a skill's entrypoint or a named sub-file.
|
|
36
|
+
* Sanitises the file parameter to prevent path traversal.
|
|
37
|
+
*/
|
|
38
|
+
export declare function loadSkillContent(meta: SkillMeta, file?: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Build the skill index section to append to the system prompt.
|
|
41
|
+
* Eager skills are inlined separately; this lists only on-demand skills.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildSkillIndexPrompt(skills: SkillMeta[]): string;
|
|
44
|
+
/**
|
|
45
|
+
* Return the full content of all eager skills, to be injected directly
|
|
46
|
+
* into the system prompt at startup.
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadEagerSkills(skills: SkillMeta[]): string;
|