studiograph 1.1.3 → 1.2.0-beta.2
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/README.md +2 -8
- package/dist/agent/orchestrator.js +56 -11
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/prompts/system.md +28 -10
- 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/{bundled/enrich-entities.md → enrich-entities.md} +12 -0
- package/dist/agent/skills/entity-schema.md +502 -0
- package/dist/agent/skills/obsidian-source-setup.md +246 -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 +11 -1
- package/dist/agent/tools/graph-tools.js +90 -29
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/load-skill.d.ts +1 -1
- package/dist/agent/tools/load-skill.js +1 -1
- package/dist/agent/tools/load-skill.js.map +1 -1
- 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/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/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/connector.js +10 -2
- package/dist/cli/commands/connector.js.map +1 -1
- package/dist/cli/commands/deploy.d.ts +4 -6
- package/dist/cli/commands/deploy.js +262 -112
- package/dist/cli/commands/deploy.js.map +1 -1
- 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/init.js +21 -203
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.js +23 -3
- package/dist/cli/commands/join.js.map +1 -1
- 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.js +11 -7
- package/dist/cli/commands/provision.js.map +1 -1
- package/dist/cli/commands/r2.js +8 -2
- 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/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 +285 -55
- 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 +36 -5
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/index.js +31 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/scaffolding.d.ts +2 -1
- package/dist/cli/scaffolding.js +36 -22
- package/dist/cli/scaffolding.js.map +1 -1
- 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 +4 -8
- package/dist/core/graph.js +145 -96
- package/dist/core/graph.js.map +1 -1
- package/dist/core/migration-runner.d.ts +4 -1
- package/dist/core/migration-runner.js +14 -3
- package/dist/core/migration-runner.js.map +1 -1
- package/dist/core/types.d.ts +0 -3
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-config.d.ts +6 -0
- package/dist/core/user-config.js.map +1 -1
- package/dist/core/workspace.d.ts +13 -5
- package/dist/core/workspace.js +110 -33
- package/dist/core/workspace.js.map +1 -1
- package/dist/mcp/connector-manager.d.ts +7 -3
- package/dist/mcp/connector-manager.js +61 -16
- package/dist/mcp/connector-manager.js.map +1 -1
- 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 +3 -1
- package/dist/mcp/connectors/definitions.js +19 -127
- package/dist/mcp/connectors/definitions.js.map +1 -1
- 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/server/index.js +14 -9
- package/dist/server/index.js.map +1 -1
- package/dist/server/plugin-loader.d.ts +7 -0
- package/dist/server/plugin-loader.js +54 -2
- package/dist/server/plugin-loader.js.map +1 -1
- package/dist/services/github-provisioner.d.ts +8 -3
- package/dist/services/github-provisioner.js +35 -8
- package/dist/services/github-provisioner.js.map +1 -1
- package/dist/services/lint-service.js +8 -1
- package/dist/services/lint-service.js.map +1 -1
- package/dist/services/markdown.js +3 -3
- package/dist/services/markdown.js.map +1 -1
- package/dist/services/memory-service.d.ts +1 -1
- package/dist/services/memory-service.js +2 -3
- 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 +354 -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 +11 -0
- package/dist/services/vector-service.js +42 -0
- package/dist/services/vector-service.js.map +1 -1
- 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/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 +16 -7
- /package/dist/agent/skills/{bundled/gather-context.md → gather-context.md} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SourceConfigManager
|
|
3
|
+
*
|
|
4
|
+
* Manages source configurations stored at .studiograph/sources/<name>.json.
|
|
5
|
+
* Each source defines entity mappings from external systems to the graph.
|
|
6
|
+
*/
|
|
7
|
+
import type { SyncMCPClient } from './mcp-client.js';
|
|
8
|
+
import type { SourceConfig, DetectedEntityType } from './types.js';
|
|
9
|
+
export declare class SourceConfigManager {
|
|
10
|
+
private sourcesDir;
|
|
11
|
+
constructor(workspacePath: string);
|
|
12
|
+
/**
|
|
13
|
+
* Get all registered source configs.
|
|
14
|
+
*/
|
|
15
|
+
getAll(): SourceConfig[];
|
|
16
|
+
/**
|
|
17
|
+
* Get a single source config by name.
|
|
18
|
+
*/
|
|
19
|
+
get(name: string): SourceConfig | null;
|
|
20
|
+
/**
|
|
21
|
+
* Save a source config (creates or overwrites).
|
|
22
|
+
*/
|
|
23
|
+
save(config: SourceConfig): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove a source config. Returns true if removed, false if not found.
|
|
26
|
+
*/
|
|
27
|
+
remove(name: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Validate a source config. Returns errors found.
|
|
30
|
+
*/
|
|
31
|
+
validate(config: SourceConfig): {
|
|
32
|
+
valid: boolean;
|
|
33
|
+
errors: string[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Detect entity types available on an MCP source by inspecting tool names.
|
|
37
|
+
*/
|
|
38
|
+
detectEntityTypes(client: SyncMCPClient): DetectedEntityType[];
|
|
39
|
+
/**
|
|
40
|
+
* Propose field mappings by sampling a record from the source.
|
|
41
|
+
* Compares source field names against target schema field names.
|
|
42
|
+
*/
|
|
43
|
+
proposeFieldMappings(client: SyncMCPClient, sourceType: string, entityType: string): Promise<Record<string, string>>;
|
|
44
|
+
private validateMapping;
|
|
45
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SourceConfigManager
|
|
3
|
+
*
|
|
4
|
+
* Manages source configurations stored at .studiograph/sources/<name>.json.
|
|
5
|
+
* Each source defines entity mappings from external systems to the graph.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
import { ENTITY_SCHEMAS } from '../../core/validation.js';
|
|
10
|
+
export class SourceConfigManager {
|
|
11
|
+
sourcesDir;
|
|
12
|
+
constructor(workspacePath) {
|
|
13
|
+
this.sourcesDir = join(workspacePath, '.studiograph', 'sources');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get all registered source configs.
|
|
17
|
+
*/
|
|
18
|
+
getAll() {
|
|
19
|
+
if (!existsSync(this.sourcesDir))
|
|
20
|
+
return [];
|
|
21
|
+
const configs = [];
|
|
22
|
+
let entries;
|
|
23
|
+
try {
|
|
24
|
+
entries = readdirSync(this.sourcesDir);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
if (!entry.endsWith('.json'))
|
|
31
|
+
continue;
|
|
32
|
+
try {
|
|
33
|
+
const raw = JSON.parse(readFileSync(join(this.sourcesDir, entry), 'utf-8'));
|
|
34
|
+
if (typeof raw.name === 'string' && raw.name) {
|
|
35
|
+
configs.push(raw);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// skip malformed files
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return configs;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get a single source config by name.
|
|
46
|
+
*/
|
|
47
|
+
get(name) {
|
|
48
|
+
const path = join(this.sourcesDir, `${name}.json`);
|
|
49
|
+
if (!existsSync(path))
|
|
50
|
+
return null;
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Save a source config (creates or overwrites).
|
|
60
|
+
*/
|
|
61
|
+
save(config) {
|
|
62
|
+
mkdirSync(this.sourcesDir, { recursive: true });
|
|
63
|
+
const path = join(this.sourcesDir, `${config.name}.json`);
|
|
64
|
+
writeFileSync(path, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Remove a source config. Returns true if removed, false if not found.
|
|
68
|
+
*/
|
|
69
|
+
remove(name) {
|
|
70
|
+
const path = join(this.sourcesDir, `${name}.json`);
|
|
71
|
+
if (!existsSync(path))
|
|
72
|
+
return false;
|
|
73
|
+
unlinkSync(path);
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Validate a source config. Returns errors found.
|
|
78
|
+
*/
|
|
79
|
+
validate(config) {
|
|
80
|
+
const errors = [];
|
|
81
|
+
if (!config.name || typeof config.name !== 'string') {
|
|
82
|
+
errors.push('name is required and must be a string');
|
|
83
|
+
}
|
|
84
|
+
else if (!/^[a-z0-9_-]+$/.test(config.name)) {
|
|
85
|
+
errors.push('name must be lowercase alphanumeric with hyphens/underscores');
|
|
86
|
+
}
|
|
87
|
+
if (!config.connector || typeof config.connector !== 'string') {
|
|
88
|
+
errors.push('connector is required and must reference a connector name');
|
|
89
|
+
}
|
|
90
|
+
if (typeof config.enabled !== 'boolean') {
|
|
91
|
+
errors.push('enabled must be a boolean');
|
|
92
|
+
}
|
|
93
|
+
if (!config.added_at || typeof config.added_at !== 'string') {
|
|
94
|
+
errors.push('added_at is required (ISO datetime)');
|
|
95
|
+
}
|
|
96
|
+
if (!Array.isArray(config.entity_mappings)) {
|
|
97
|
+
errors.push('entity_mappings must be an array');
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
for (let i = 0; i < config.entity_mappings.length; i++) {
|
|
101
|
+
const m = config.entity_mappings[i];
|
|
102
|
+
const prefix = `entity_mappings[${i}]`;
|
|
103
|
+
errors.push(...this.validateMapping(m, prefix));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return { valid: errors.length === 0, errors };
|
|
107
|
+
}
|
|
108
|
+
// ── Source Setup Wizard Helpers ────────────────────────────────────────────
|
|
109
|
+
/**
|
|
110
|
+
* Detect entity types available on an MCP source by inspecting tool names.
|
|
111
|
+
*/
|
|
112
|
+
detectEntityTypes(client) {
|
|
113
|
+
return client.detectAvailableEntityTypes();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Propose field mappings by sampling a record from the source.
|
|
117
|
+
* Compares source field names against target schema field names.
|
|
118
|
+
*/
|
|
119
|
+
async proposeFieldMappings(client, sourceType, entityType) {
|
|
120
|
+
const fieldMap = {};
|
|
121
|
+
// Get target schema fields
|
|
122
|
+
const schema = ENTITY_SCHEMAS[entityType];
|
|
123
|
+
if (!schema)
|
|
124
|
+
return fieldMap;
|
|
125
|
+
const shape = schema._def?.shape?.() ?? schema.shape ?? {};
|
|
126
|
+
const targetFields = new Set(Object.keys(shape));
|
|
127
|
+
// Try to sample a record
|
|
128
|
+
const listTool = client.findListTool(sourceType);
|
|
129
|
+
if (!listTool)
|
|
130
|
+
return fieldMap;
|
|
131
|
+
let sampleRecord = null;
|
|
132
|
+
try {
|
|
133
|
+
const raw = await client.callTool(listTool, { limit: 1 });
|
|
134
|
+
const parsed = JSON.parse(raw);
|
|
135
|
+
const records = Array.isArray(parsed) ? parsed : (parsed.data ?? parsed.results ?? parsed.items ?? []);
|
|
136
|
+
if (records.length > 0)
|
|
137
|
+
sampleRecord = records[0];
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return fieldMap;
|
|
141
|
+
}
|
|
142
|
+
if (!sampleRecord)
|
|
143
|
+
return fieldMap;
|
|
144
|
+
// Match source fields to target fields
|
|
145
|
+
const sourceFields = Object.keys(sampleRecord);
|
|
146
|
+
for (const sourceField of sourceFields) {
|
|
147
|
+
const normalized = sourceField.toLowerCase().replace(/_/g, '');
|
|
148
|
+
// Direct name match
|
|
149
|
+
if (targetFields.has(sourceField)) {
|
|
150
|
+
fieldMap[sourceField] = sourceField;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
// Common mappings
|
|
154
|
+
const commonMaps = {
|
|
155
|
+
name: ['title', 'subject', 'headline'],
|
|
156
|
+
client: ['org_name', 'organization', 'company', 'org_id.name'],
|
|
157
|
+
email: ['email_address', 'mail'],
|
|
158
|
+
status: ['state', 'stage'],
|
|
159
|
+
date: ['created_at', 'date_created', 'timestamp'],
|
|
160
|
+
start_date: ['start', 'begin_date'],
|
|
161
|
+
end_date: ['end', 'close_date', 'expected_close_date'],
|
|
162
|
+
};
|
|
163
|
+
for (const [target, aliases] of Object.entries(commonMaps)) {
|
|
164
|
+
if (!targetFields.has(target))
|
|
165
|
+
continue;
|
|
166
|
+
if (aliases.some(a => a.toLowerCase().replace(/_/g, '') === normalized)) {
|
|
167
|
+
fieldMap[sourceField] = target;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return fieldMap;
|
|
173
|
+
}
|
|
174
|
+
validateMapping(m, prefix) {
|
|
175
|
+
const errors = [];
|
|
176
|
+
if (!m.source_type)
|
|
177
|
+
errors.push(`${prefix}.source_type is required`);
|
|
178
|
+
if (!m.entity_type)
|
|
179
|
+
errors.push(`${prefix}.entity_type is required`);
|
|
180
|
+
if (!m.target_repo)
|
|
181
|
+
errors.push(`${prefix}.target_repo is required`);
|
|
182
|
+
if (m.extraction_mode !== 'structured' && m.extraction_mode !== 'unstructured' && m.extraction_mode !== 'frontmatter') {
|
|
183
|
+
errors.push(`${prefix}.extraction_mode must be 'structured', 'unstructured', or 'frontmatter'`);
|
|
184
|
+
}
|
|
185
|
+
if ((m.extraction_mode === 'structured' || m.extraction_mode === 'frontmatter') && !m.field_map) {
|
|
186
|
+
errors.push(`${prefix}.field_map is required for ${m.extraction_mode} extraction`);
|
|
187
|
+
}
|
|
188
|
+
if ((m.extraction_mode === 'unstructured' || m.extraction_mode === 'frontmatter') && (!m.directory_patterns || m.directory_patterns.length === 0)) {
|
|
189
|
+
errors.push(`${prefix}.directory_patterns is required for ${m.extraction_mode} extraction`);
|
|
190
|
+
}
|
|
191
|
+
if (m.co_locate) {
|
|
192
|
+
if (!m.co_locate.parent_field || typeof m.co_locate.parent_field !== 'string') {
|
|
193
|
+
errors.push(`${prefix}.co_locate.parent_field must be a string`);
|
|
194
|
+
}
|
|
195
|
+
if (!m.co_locate.subfolder || typeof m.co_locate.subfolder !== 'string') {
|
|
196
|
+
errors.push(`${prefix}.co_locate.subfolder must be a string`);
|
|
197
|
+
}
|
|
198
|
+
if (m.co_locate.parent_field && m.field_map) {
|
|
199
|
+
const fieldMapTargets = Object.values(m.field_map).map(v => typeof v === 'string' ? v : v.field);
|
|
200
|
+
if (!fieldMapTargets.includes(m.co_locate.parent_field)) {
|
|
201
|
+
errors.push(`${prefix}.co_locate.parent_field "${m.co_locate.parent_field}" is not a target in field_map — the parent field may not be available`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return errors;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=source-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-config.js","sourceRoot":"","sources":["../../../src/services/sync/source-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,MAAM,OAAO,mBAAmB;IACtB,UAAU,CAAS;IAE3B,YAAY,aAAqB;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC;YAAE,OAAO,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAmB,EAAE,CAAC;QACnC,IAAI,OAAiB,CAAC;QACtB,IAAI,CAAC;YACH,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC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C,CAAE,CAAS,CAAC,KAAK,CAC7C,CAAC;gBACF,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;oBACxD,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,4BAA4B,CAAC,CAAC,SAAS,CAAC,YAAY,wEAAwE,CAAC,CAAC;gBACrJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SourceDefinition } from './definitions.js';
|
|
2
|
+
/**
|
|
3
|
+
* Asana source definition.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: Asana's search tools require a `workspace` parameter.
|
|
6
|
+
* After running `studiograph source setup asana`, edit the source config
|
|
7
|
+
* at .studiograph/sources/asana.json to add list_params with your
|
|
8
|
+
* workspace GID to each mapping:
|
|
9
|
+
*
|
|
10
|
+
* "list_params": { "workspace": "YOUR_WORKSPACE_GID" }
|
|
11
|
+
*
|
|
12
|
+
* Find your workspace GID by running:
|
|
13
|
+
* studiograph connector call asana asana_list_workspaces
|
|
14
|
+
*/
|
|
15
|
+
export declare const asana: SourceDefinition;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asana source definition.
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: Asana's search tools require a `workspace` parameter.
|
|
5
|
+
* After running `studiograph source setup asana`, edit the source config
|
|
6
|
+
* at .studiograph/sources/asana.json to add list_params with your
|
|
7
|
+
* workspace GID to each mapping:
|
|
8
|
+
*
|
|
9
|
+
* "list_params": { "workspace": "YOUR_WORKSPACE_GID" }
|
|
10
|
+
*
|
|
11
|
+
* Find your workspace GID by running:
|
|
12
|
+
* studiograph connector call asana asana_list_workspaces
|
|
13
|
+
*/
|
|
14
|
+
export const asana = {
|
|
15
|
+
connector: 'asana',
|
|
16
|
+
defaultMappings: [
|
|
17
|
+
{
|
|
18
|
+
source_type: 'task',
|
|
19
|
+
entity_type: 'task',
|
|
20
|
+
target_repo: 'tasks',
|
|
21
|
+
extraction_mode: 'structured',
|
|
22
|
+
id_from: 'name',
|
|
23
|
+
content_from: 'notes',
|
|
24
|
+
fetch_details: true,
|
|
25
|
+
field_map: {
|
|
26
|
+
'name': 'name',
|
|
27
|
+
'assignee.name': { field: 'assignee', transform: 'wikilink' },
|
|
28
|
+
'due_on': 'due_date',
|
|
29
|
+
'memberships[0].project.name': { field: 'project', transform: 'wikilink' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
source_type: 'project',
|
|
34
|
+
entity_type: 'project',
|
|
35
|
+
target_repo: 'projects',
|
|
36
|
+
extraction_mode: 'structured',
|
|
37
|
+
id_from: 'name',
|
|
38
|
+
content_from: 'notes',
|
|
39
|
+
field_map: {
|
|
40
|
+
'name': 'name',
|
|
41
|
+
'start_on': 'start_date',
|
|
42
|
+
'due_on': 'target_completion',
|
|
43
|
+
'members': { field: 'team', transform: 'wikilink-array', subfield: 'name' },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=asana.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asana.js","sourceRoot":"","sources":["../../../../src/services/sync/source-definitions/asana.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,KAAK,GAAqB;IACrC,SAAS,EAAE,OAAO;IAClB,eAAe,EAAE;QACf;YACE,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,OAAO;YACpB,eAAe,EAAE,YAAY;YAE7B,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,OAAO;YACrB,aAAa,EAAE,IAAI;YACnB,SAAS,EAAE;gBACT,MAAM,EAAE,MAAM;gBACd,eAAe,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;gBAC7D,QAAQ,EAAE,UAAU;gBACpB,6BAA6B,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE;aAC3E;SACF;QACD;YACE,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,YAAY;YAE7B,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,OAAO;YACrB,SAAS,EAAE;gBACT,MAAM,EAAE,MAAM;gBACd,UAAU,EAAE,YAAY;gBACxB,QAAQ,EAAE,mBAAmB;gBAC7B,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE;aAC5E;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync source definitions — default and example entity mappings.
|
|
3
|
+
*
|
|
4
|
+
* These define how external data maps to Studiograph entities during
|
|
5
|
+
* `studiograph source setup`. Separated from MCP connector definitions
|
|
6
|
+
* because connectors and sync sources serve different purposes:
|
|
7
|
+
* - Connectors: agent queries external tools (Figma, Slack, Linear)
|
|
8
|
+
* - Sources: extract and map external data into the knowledge graph
|
|
9
|
+
*
|
|
10
|
+
* Individual source definitions live in separate files for modularity.
|
|
11
|
+
*/
|
|
12
|
+
import type { EntityMapping } from '../types.js';
|
|
13
|
+
export interface SourceDefinition {
|
|
14
|
+
/** Must match a connector name in ~/.studiograph/connectors/ */
|
|
15
|
+
connector: string;
|
|
16
|
+
/** Default entity mappings applied during `source setup` */
|
|
17
|
+
defaultMappings?: EntityMapping[];
|
|
18
|
+
/** Example mappings written to a .template file */
|
|
19
|
+
exampleMappings?: EntityMapping[];
|
|
20
|
+
}
|
|
21
|
+
export declare const SOURCE_DEFINITIONS: Record<string, SourceDefinition>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync source definitions — default and example entity mappings.
|
|
3
|
+
*
|
|
4
|
+
* These define how external data maps to Studiograph entities during
|
|
5
|
+
* `studiograph source setup`. Separated from MCP connector definitions
|
|
6
|
+
* because connectors and sync sources serve different purposes:
|
|
7
|
+
* - Connectors: agent queries external tools (Figma, Slack, Linear)
|
|
8
|
+
* - Sources: extract and map external data into the knowledge graph
|
|
9
|
+
*
|
|
10
|
+
* Individual source definitions live in separate files for modularity.
|
|
11
|
+
*/
|
|
12
|
+
import { pipedrive } from './pipedrive.js';
|
|
13
|
+
import { granola } from './granola.js';
|
|
14
|
+
import { obsidian } from './obsidian.js';
|
|
15
|
+
import { linear } from './linear.js';
|
|
16
|
+
import { asana } from './asana.js';
|
|
17
|
+
import { gdrive } from './gdrive.js';
|
|
18
|
+
export const SOURCE_DEFINITIONS = {
|
|
19
|
+
pipedrive,
|
|
20
|
+
granola,
|
|
21
|
+
obsidian,
|
|
22
|
+
linear,
|
|
23
|
+
asana,
|
|
24
|
+
gdrive,
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../../src/services/sync/source-definitions/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWrC,MAAM,CAAC,MAAM,kBAAkB,GAAqC;IAClE,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;IACN,KAAK;IACL,MAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SourceDefinition } from './definitions.js';
|
|
2
|
+
/**
|
|
3
|
+
* Google Drive source definition — B+C hybrid approach.
|
|
4
|
+
*
|
|
5
|
+
* Phase 1 (this): Structured metadata + markdown content import. No LLM.
|
|
6
|
+
* - listGoogleDocs → discover documents
|
|
7
|
+
* - readGoogleDoc(format: "markdown") → fetch body content
|
|
8
|
+
* - Field map extracts title, dates, owner deterministically
|
|
9
|
+
*
|
|
10
|
+
* Phase 2 (deferred): Enrichment via enrich-entities skill fills semantic
|
|
11
|
+
* fields (client, attendees, status) using cross-graph context.
|
|
12
|
+
*
|
|
13
|
+
* Works with the google-docs-mcp server. Tool names use explicit overrides
|
|
14
|
+
* since they don't match standard list_/get_ patterns.
|
|
15
|
+
*/
|
|
16
|
+
export declare const gdrive: SourceDefinition;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Drive source definition — B+C hybrid approach.
|
|
3
|
+
*
|
|
4
|
+
* Phase 1 (this): Structured metadata + markdown content import. No LLM.
|
|
5
|
+
* - listGoogleDocs → discover documents
|
|
6
|
+
* - readGoogleDoc(format: "markdown") → fetch body content
|
|
7
|
+
* - Field map extracts title, dates, owner deterministically
|
|
8
|
+
*
|
|
9
|
+
* Phase 2 (deferred): Enrichment via enrich-entities skill fills semantic
|
|
10
|
+
* fields (client, attendees, status) using cross-graph context.
|
|
11
|
+
*
|
|
12
|
+
* Works with the google-docs-mcp server. Tool names use explicit overrides
|
|
13
|
+
* since they don't match standard list_/get_ patterns.
|
|
14
|
+
*/
|
|
15
|
+
export const gdrive = {
|
|
16
|
+
connector: 'gdrive',
|
|
17
|
+
defaultMappings: [
|
|
18
|
+
{
|
|
19
|
+
source_type: 'google-doc',
|
|
20
|
+
entity_type: 'artifact',
|
|
21
|
+
target_repo: 'artifacts',
|
|
22
|
+
extraction_mode: 'structured',
|
|
23
|
+
// google-docs-mcp uses non-standard tool names
|
|
24
|
+
list_tool: 'listGoogleDocs',
|
|
25
|
+
list_params: { maxResults: 100, format: 'json' },
|
|
26
|
+
list_limit: 100,
|
|
27
|
+
id_from: 'name',
|
|
28
|
+
field_map: {
|
|
29
|
+
'name': 'name',
|
|
30
|
+
'createdTime': { field: 'created_at', transform: 'date-iso' },
|
|
31
|
+
'modifiedTime': { field: 'updated_at', transform: 'date-iso' },
|
|
32
|
+
'owners[0].displayName': 'created_by',
|
|
33
|
+
},
|
|
34
|
+
// Fetch markdown body via readGoogleDoc per document
|
|
35
|
+
content_tool: {
|
|
36
|
+
tool: 'readGoogleDoc',
|
|
37
|
+
id_param: 'documentId',
|
|
38
|
+
id_from: 'id',
|
|
39
|
+
extra_args: { format: 'markdown' },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
exampleMappings: [
|
|
44
|
+
// Folder-scoped import: sync a specific Drive folder as meeting notes
|
|
45
|
+
{
|
|
46
|
+
source_type: 'meeting-doc',
|
|
47
|
+
entity_type: 'meeting',
|
|
48
|
+
target_repo: 'meetings',
|
|
49
|
+
extraction_mode: 'structured',
|
|
50
|
+
list_tool: 'listFolderContents',
|
|
51
|
+
// Replace FOLDER_ID with actual Google Drive folder ID
|
|
52
|
+
list_params: { folderId: 'FOLDER_ID', includeSubfolders: false, format: 'json' },
|
|
53
|
+
id_from: 'name',
|
|
54
|
+
field_map: {
|
|
55
|
+
'name': 'name',
|
|
56
|
+
'createdTime': { field: 'created_at', transform: 'date-iso' },
|
|
57
|
+
'modifiedTime': { field: 'updated_at', transform: 'date-iso' },
|
|
58
|
+
},
|
|
59
|
+
content_tool: {
|
|
60
|
+
tool: 'readGoogleDoc',
|
|
61
|
+
id_param: 'documentId',
|
|
62
|
+
id_from: 'id',
|
|
63
|
+
extra_args: { format: 'markdown' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=gdrive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gdrive.js","sourceRoot":"","sources":["../../../../src/services/sync/source-definitions/gdrive.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,MAAM,GAAqB;IACtC,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE;QACf;YACE,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,WAAW;YACxB,eAAe,EAAE,YAAY;YAE7B,+CAA+C;YAC/C,SAAS,EAAE,gBAAgB;YAC3B,WAAW,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;YAChD,UAAU,EAAE,GAAG;YAEf,OAAO,EAAE,MAAM;YACf,SAAS,EAAE;gBACT,MAAM,EAAE,MAAM;gBACd,aAAa,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;gBAC7D,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;gBAC9D,uBAAuB,EAAE,YAAY;aACtC;YAED,qDAAqD;YACrD,YAAY,EAAE;gBACZ,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;aACnC;SACF;KACF;IACD,eAAe,EAAE;QACf,sEAAsE;QACtE;YACE,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,YAAY;YAE7B,SAAS,EAAE,oBAAoB;YAC/B,uDAAuD;YACvD,WAAW,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;YAEhF,OAAO,EAAE,MAAM;YACf,SAAS,EAAE;gBACT,MAAM,EAAE,MAAM;gBACd,aAAa,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;gBAC7D,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;aAC/D;YAED,YAAY,EAAE;gBACZ,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;aACnC;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const granola = {
|
|
2
|
+
connector: 'granola',
|
|
3
|
+
defaultMappings: [
|
|
4
|
+
{
|
|
5
|
+
source_type: 'document',
|
|
6
|
+
entity_type: 'meeting',
|
|
7
|
+
target_repo: 'meetings',
|
|
8
|
+
extraction_mode: 'structured',
|
|
9
|
+
id_from: 'title',
|
|
10
|
+
content_from: 'markdown',
|
|
11
|
+
fetch_details: true,
|
|
12
|
+
list_limit: 1000,
|
|
13
|
+
field_map: {
|
|
14
|
+
'title': 'name',
|
|
15
|
+
'metadata.google_calendar_event.start.dateTime': {
|
|
16
|
+
field: 'date',
|
|
17
|
+
transform: 'date-iso',
|
|
18
|
+
},
|
|
19
|
+
'metadata.people.attendees': {
|
|
20
|
+
field: 'attendees',
|
|
21
|
+
transform: 'wikilink-array',
|
|
22
|
+
subfield: 'details.person.name.fullName',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=granola.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"granola.js","sourceRoot":"","sources":["../../../../src/services/sync/source-definitions/granola.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAqB;IACvC,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE;QACf;YACE,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,YAAY;YAE7B,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE,UAAU;YACxB,aAAa,EAAE,IAAI;YACnB,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE;gBACT,OAAO,EAAE,MAAM;gBACf,+CAA+C,EAAE;oBAC/C,KAAK,EAAE,MAAM;oBACb,SAAS,EAAE,UAAU;iBACtB;gBACD,2BAA2B,EAAE;oBAC3B,KAAK,EAAE,WAAW;oBAClB,SAAS,EAAE,gBAAgB;oBAC3B,QAAQ,EAAE,8BAA8B;iBACzC;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const linear = {
|
|
2
|
+
connector: 'linear',
|
|
3
|
+
defaultMappings: [
|
|
4
|
+
{
|
|
5
|
+
source_type: 'issue',
|
|
6
|
+
entity_type: 'task',
|
|
7
|
+
target_repo: 'projects',
|
|
8
|
+
extraction_mode: 'structured',
|
|
9
|
+
id_from: 'title',
|
|
10
|
+
content_from: 'description',
|
|
11
|
+
fetch_details: true,
|
|
12
|
+
co_locate: {
|
|
13
|
+
parent_field: 'project',
|
|
14
|
+
subfolder: 'tasks',
|
|
15
|
+
},
|
|
16
|
+
field_map: {
|
|
17
|
+
'title': 'name',
|
|
18
|
+
'assignee': { field: 'assignee', transform: 'wikilink' },
|
|
19
|
+
'dueDate': 'due_date',
|
|
20
|
+
'project': { field: 'project', transform: 'wikilink' },
|
|
21
|
+
'labels': 'tags',
|
|
22
|
+
'url': 'url',
|
|
23
|
+
'identifier': 'external_id',
|
|
24
|
+
},
|
|
25
|
+
status_map: {
|
|
26
|
+
'Backlog': 'open',
|
|
27
|
+
'Todo': 'open',
|
|
28
|
+
'In Progress': 'in-progress',
|
|
29
|
+
'In Review': 'in-progress',
|
|
30
|
+
'Done': 'done',
|
|
31
|
+
'Canceled': 'cancelled',
|
|
32
|
+
'Duplicate': 'cancelled',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
source_type: 'project',
|
|
37
|
+
entity_type: 'project',
|
|
38
|
+
target_repo: 'projects',
|
|
39
|
+
extraction_mode: 'structured',
|
|
40
|
+
id_from: 'name',
|
|
41
|
+
content_from: 'description',
|
|
42
|
+
field_map: {
|
|
43
|
+
'name': 'name',
|
|
44
|
+
'startDate': 'start_date',
|
|
45
|
+
'targetDate': 'target_completion',
|
|
46
|
+
'lead.name': { field: 'team', transform: 'wikilink-array' },
|
|
47
|
+
'url': 'url',
|
|
48
|
+
},
|
|
49
|
+
status_map: {
|
|
50
|
+
'Backlog': 'planning',
|
|
51
|
+
'Planned': 'planning',
|
|
52
|
+
'Started': 'active',
|
|
53
|
+
'Paused': 'on-hold',
|
|
54
|
+
'Completed': 'completed',
|
|
55
|
+
'Canceled': 'archived',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=linear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear.js","sourceRoot":"","sources":["../../../../src/services/sync/source-definitions/linear.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAqB;IACtC,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE;QACf;YACE,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,YAAY;YAE7B,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE,aAAa;YAC3B,aAAa,EAAE,IAAI;YACnB,SAAS,EAAE;gBACT,YAAY,EAAE,SAAS;gBACvB,SAAS,EAAE,OAAO;aACnB;YACD,SAAS,EAAE;gBACT,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;gBACxD,SAAS,EAAE,UAAU;gBACrB,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE;gBACtD,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,aAAa;aAC5B;YACD,UAAU,EAAE;gBACV,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE,MAAM;gBACd,aAAa,EAAE,aAAa;gBAC5B,WAAW,EAAE,aAAa;gBAC1B,MAAM,EAAE,MAAM;gBACd,UAAU,EAAE,WAAW;gBACvB,WAAW,EAAE,WAAW;aACzB;SACF;QACD;YACE,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,YAAY;YAE7B,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,aAAa;YAC3B,SAAS,EAAE;gBACT,MAAM,EAAE,MAAM;gBACd,WAAW,EAAE,YAAY;gBACzB,YAAY,EAAE,mBAAmB;gBACjC,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAC3D,KAAK,EAAE,KAAK;aACb;YACD,UAAU,EAAE;gBACV,SAAS,EAAE,UAAU;gBACrB,SAAS,EAAE,UAAU;gBACrB,SAAS,EAAE,QAAQ;gBACnB,QAAQ,EAAE,SAAS;gBACnB,WAAW,EAAE,WAAW;gBACxB,UAAU,EAAE,UAAU;aACvB;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const obsidian = {
|
|
2
|
+
connector: 'obsidian',
|
|
3
|
+
exampleMappings: [
|
|
4
|
+
{
|
|
5
|
+
source_type: 'project-note',
|
|
6
|
+
entity_type: 'project',
|
|
7
|
+
target_repo: 'projects',
|
|
8
|
+
extraction_mode: 'frontmatter',
|
|
9
|
+
directory_patterns: ['Projects/'],
|
|
10
|
+
list_tool: 'list_vault_files',
|
|
11
|
+
read_tool: 'get_vault_file',
|
|
12
|
+
field_map: {
|
|
13
|
+
status: 'status',
|
|
14
|
+
client: 'client',
|
|
15
|
+
start_date: 'start_date',
|
|
16
|
+
end_date: 'end_date',
|
|
17
|
+
tags: 'tags',
|
|
18
|
+
},
|
|
19
|
+
id_from: '_filename',
|
|
20
|
+
content_from: '_body',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
source_type: 'person-note',
|
|
24
|
+
entity_type: 'person',
|
|
25
|
+
target_repo: 'people',
|
|
26
|
+
extraction_mode: 'frontmatter',
|
|
27
|
+
directory_patterns: ['People/'],
|
|
28
|
+
list_tool: 'list_vault_files',
|
|
29
|
+
read_tool: 'get_vault_file',
|
|
30
|
+
field_map: {
|
|
31
|
+
title: 'role',
|
|
32
|
+
email: 'email',
|
|
33
|
+
tags: 'tags',
|
|
34
|
+
},
|
|
35
|
+
id_from: '_filename',
|
|
36
|
+
content_from: '_body',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
source_type: 'org-note',
|
|
40
|
+
entity_type: 'client',
|
|
41
|
+
target_repo: 'clients',
|
|
42
|
+
extraction_mode: 'frontmatter',
|
|
43
|
+
directory_patterns: ['Organizations/'],
|
|
44
|
+
list_tool: 'list_vault_files',
|
|
45
|
+
read_tool: 'get_vault_file',
|
|
46
|
+
field_map: {
|
|
47
|
+
related_people: 'contacts',
|
|
48
|
+
tags: 'tags',
|
|
49
|
+
},
|
|
50
|
+
id_from: '_filename',
|
|
51
|
+
content_from: '_body',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=obsidian.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obsidian.js","sourceRoot":"","sources":["../../../../src/services/sync/source-definitions/obsidian.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,SAAS,EAAE,UAAU;IACrB,eAAe,EAAE;QACf;YACE,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,aAAa;YAE9B,kBAAkB,EAAE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