@versatly/workgraph 0.1.0 → 0.3.0
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 +94 -11
- package/SKILL.md +10 -10
- package/bin/workgraph.js +0 -0
- package/dist/chunk-65ZMX2WM.js +2846 -0
- package/dist/chunk-E3QU5Y53.js +1062 -0
- package/dist/cli.js +705 -29
- package/dist/index.d.ts +535 -7
- package/dist/index.js +37 -5
- package/dist/mcp-server-fU6U6ht8.d.ts +20 -0
- package/dist/mcp-server.d.ts +2 -0
- package/dist/mcp-server.js +8 -0
- package/package.json +23 -8
- package/dist/chunk-CRQXDCPR.js +0 -1443
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { m as mcpServer } from './mcp-server-fU6U6ht8.js';
|
|
2
|
+
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Workgraph type definitions.
|
|
3
6
|
*/
|
|
@@ -6,6 +9,27 @@ interface FieldDefinition {
|
|
|
6
9
|
required?: boolean;
|
|
7
10
|
default?: unknown;
|
|
8
11
|
description?: string;
|
|
12
|
+
/** Allowed values when type is scalar/string-like. */
|
|
13
|
+
enum?: Array<string | number | boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Optional semantic template used for additional validation.
|
|
16
|
+
* - slug: lowercase kebab-case token
|
|
17
|
+
* - semver: semantic version (x.y.z)
|
|
18
|
+
* - email: simple email shape
|
|
19
|
+
* - url: absolute http(s) URL
|
|
20
|
+
* - iso-date: ISO-8601 date/time string
|
|
21
|
+
*/
|
|
22
|
+
template?: 'slug' | 'semver' | 'email' | 'url' | 'iso-date';
|
|
23
|
+
/**
|
|
24
|
+
* Optional regex pattern constraint for string/ref/date fields.
|
|
25
|
+
* Uses JavaScript regular expression syntax (without delimiters).
|
|
26
|
+
*/
|
|
27
|
+
pattern?: string;
|
|
28
|
+
/**
|
|
29
|
+
* For ref fields, constrain references to one or more primitive types.
|
|
30
|
+
* Example: refTypes: ['thread', 'space']
|
|
31
|
+
*/
|
|
32
|
+
refTypes?: string[];
|
|
9
33
|
}
|
|
10
34
|
interface PrimitiveTypeDefinition {
|
|
11
35
|
name: string;
|
|
@@ -66,6 +90,83 @@ interface WorkgraphWorkspaceConfig {
|
|
|
66
90
|
createdAt: string;
|
|
67
91
|
updatedAt: string;
|
|
68
92
|
}
|
|
93
|
+
interface PrimitiveQueryFilters {
|
|
94
|
+
type?: string;
|
|
95
|
+
status?: string;
|
|
96
|
+
owner?: string;
|
|
97
|
+
tag?: string;
|
|
98
|
+
text?: string;
|
|
99
|
+
pathIncludes?: string;
|
|
100
|
+
updatedAfter?: string;
|
|
101
|
+
updatedBefore?: string;
|
|
102
|
+
createdAfter?: string;
|
|
103
|
+
createdBefore?: string;
|
|
104
|
+
limit?: number;
|
|
105
|
+
offset?: number;
|
|
106
|
+
}
|
|
107
|
+
interface WorkgraphStatusSnapshot {
|
|
108
|
+
generatedAt: string;
|
|
109
|
+
threads: {
|
|
110
|
+
total: number;
|
|
111
|
+
open: number;
|
|
112
|
+
active: number;
|
|
113
|
+
blocked: number;
|
|
114
|
+
done: number;
|
|
115
|
+
cancelled: number;
|
|
116
|
+
ready: number;
|
|
117
|
+
};
|
|
118
|
+
claims: {
|
|
119
|
+
active: number;
|
|
120
|
+
};
|
|
121
|
+
primitives: {
|
|
122
|
+
total: number;
|
|
123
|
+
byType: Record<string, number>;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
interface WorkgraphBrief {
|
|
127
|
+
generatedAt: string;
|
|
128
|
+
actor: string;
|
|
129
|
+
myClaims: PrimitiveInstance[];
|
|
130
|
+
myOpenThreads: PrimitiveInstance[];
|
|
131
|
+
blockedThreads: PrimitiveInstance[];
|
|
132
|
+
nextReadyThreads: PrimitiveInstance[];
|
|
133
|
+
recentActivity: LedgerEntry[];
|
|
134
|
+
}
|
|
135
|
+
interface PolicyParty {
|
|
136
|
+
id: string;
|
|
137
|
+
roles: string[];
|
|
138
|
+
capabilities: string[];
|
|
139
|
+
createdAt: string;
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
}
|
|
142
|
+
interface PolicyRegistry {
|
|
143
|
+
version: number;
|
|
144
|
+
parties: Record<string, PolicyParty>;
|
|
145
|
+
}
|
|
146
|
+
type RunStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
147
|
+
interface DispatchRun {
|
|
148
|
+
id: string;
|
|
149
|
+
createdAt: string;
|
|
150
|
+
updatedAt: string;
|
|
151
|
+
actor: string;
|
|
152
|
+
adapter: string;
|
|
153
|
+
objective: string;
|
|
154
|
+
status: RunStatus;
|
|
155
|
+
idempotencyKey?: string;
|
|
156
|
+
context?: Record<string, unknown>;
|
|
157
|
+
output?: string;
|
|
158
|
+
error?: string;
|
|
159
|
+
followups: Array<{
|
|
160
|
+
ts: string;
|
|
161
|
+
actor: string;
|
|
162
|
+
input: string;
|
|
163
|
+
}>;
|
|
164
|
+
logs: Array<{
|
|
165
|
+
ts: string;
|
|
166
|
+
level: 'info' | 'warn' | 'error';
|
|
167
|
+
message: string;
|
|
168
|
+
}>;
|
|
169
|
+
}
|
|
69
170
|
|
|
70
171
|
/**
|
|
71
172
|
* Dynamic primitive type registry.
|
|
@@ -93,7 +194,7 @@ declare namespace registry {
|
|
|
93
194
|
/**
|
|
94
195
|
* Append-only event ledger.
|
|
95
196
|
*
|
|
96
|
-
* Format: one JSON object per line (.jsonl) in `.
|
|
197
|
+
* Format: one JSON object per line (.jsonl) in `.workgraph/ledger.jsonl`.
|
|
97
198
|
*/
|
|
98
199
|
|
|
99
200
|
declare function ledgerPath(workspacePath: string): string;
|
|
@@ -118,7 +219,7 @@ interface LedgerQueryOptions {
|
|
|
118
219
|
limit?: number;
|
|
119
220
|
offset?: number;
|
|
120
221
|
}
|
|
121
|
-
declare function query(workspacePath: string, options?: LedgerQueryOptions): LedgerEntry[];
|
|
222
|
+
declare function query$1(workspacePath: string, options?: LedgerQueryOptions): LedgerEntry[];
|
|
122
223
|
interface LedgerBlameActorSummary {
|
|
123
224
|
actor: string;
|
|
124
225
|
count: number;
|
|
@@ -175,7 +276,6 @@ declare const ledger_ledgerIndexPath: typeof ledgerIndexPath;
|
|
|
175
276
|
declare const ledger_ledgerPath: typeof ledgerPath;
|
|
176
277
|
declare const ledger_loadChainState: typeof loadChainState;
|
|
177
278
|
declare const ledger_loadIndex: typeof loadIndex;
|
|
178
|
-
declare const ledger_query: typeof query;
|
|
179
279
|
declare const ledger_readAll: typeof readAll;
|
|
180
280
|
declare const ledger_readSince: typeof readSince;
|
|
181
281
|
declare const ledger_rebuildHashChainState: typeof rebuildHashChainState;
|
|
@@ -183,14 +283,16 @@ declare const ledger_rebuildIndex: typeof rebuildIndex;
|
|
|
183
283
|
declare const ledger_recent: typeof recent;
|
|
184
284
|
declare const ledger_verifyHashChain: typeof verifyHashChain;
|
|
185
285
|
declare namespace ledger {
|
|
186
|
-
export { type ledger_LedgerBlameActorSummary as LedgerBlameActorSummary, type ledger_LedgerBlameResult as LedgerBlameResult, type ledger_LedgerQueryOptions as LedgerQueryOptions, type ledger_LedgerVerifyOptions as LedgerVerifyOptions, type ledger_LedgerVerifyResult as LedgerVerifyResult, ledger_activityOf as activityOf, ledger_allClaims as allClaims, ledger_append as append, ledger_blame as blame, ledger_claimsFromIndex as claimsFromIndex, ledger_currentOwner as currentOwner, ledger_historyOf as historyOf, ledger_isClaimed as isClaimed, ledger_ledgerChainStatePath as ledgerChainStatePath, ledger_ledgerIndexPath as ledgerIndexPath, ledger_ledgerPath as ledgerPath, ledger_loadChainState as loadChainState, ledger_loadIndex as loadIndex,
|
|
286
|
+
export { type ledger_LedgerBlameActorSummary as LedgerBlameActorSummary, type ledger_LedgerBlameResult as LedgerBlameResult, type ledger_LedgerQueryOptions as LedgerQueryOptions, type ledger_LedgerVerifyOptions as LedgerVerifyOptions, type ledger_LedgerVerifyResult as LedgerVerifyResult, ledger_activityOf as activityOf, ledger_allClaims as allClaims, ledger_append as append, ledger_blame as blame, ledger_claimsFromIndex as claimsFromIndex, ledger_currentOwner as currentOwner, ledger_historyOf as historyOf, ledger_isClaimed as isClaimed, ledger_ledgerChainStatePath as ledgerChainStatePath, ledger_ledgerIndexPath as ledgerIndexPath, ledger_ledgerPath as ledgerPath, ledger_loadChainState as loadChainState, ledger_loadIndex as loadIndex, query$1 as query, ledger_readAll as readAll, ledger_readSince as readSince, ledger_rebuildHashChainState as rebuildHashChainState, ledger_rebuildIndex as rebuildIndex, ledger_recent as recent, ledger_verifyHashChain as verifyHashChain };
|
|
187
287
|
}
|
|
188
288
|
|
|
189
289
|
/**
|
|
190
290
|
* Workgraph store — CRUD for primitive instances.
|
|
191
291
|
*/
|
|
192
292
|
|
|
193
|
-
declare function create(workspacePath: string, typeName: string, fields: Record<string, unknown>, body: string, actor: string
|
|
293
|
+
declare function create(workspacePath: string, typeName: string, fields: Record<string, unknown>, body: string, actor: string, options?: {
|
|
294
|
+
pathOverride?: string;
|
|
295
|
+
}): PrimitiveInstance;
|
|
194
296
|
declare function read(workspacePath: string, relPath: string): PrimitiveInstance | null;
|
|
195
297
|
declare function list(workspacePath: string, typeName: string): PrimitiveInstance[];
|
|
196
298
|
declare function update(workspacePath: string, relPath: string, fieldUpdates: Record<string, unknown>, bodyUpdate: string | undefined, actor: string): PrimitiveInstance;
|
|
@@ -386,6 +488,8 @@ interface WriteSkillOptions {
|
|
|
386
488
|
tailscalePath?: string;
|
|
387
489
|
reviewers?: string[];
|
|
388
490
|
tags?: string[];
|
|
491
|
+
dependsOn?: string[];
|
|
492
|
+
expectedUpdatedAt?: string;
|
|
389
493
|
}
|
|
390
494
|
interface ProposeSkillOptions {
|
|
391
495
|
proposalThread?: string;
|
|
@@ -400,8 +504,18 @@ declare function writeSkill(workspacePath: string, title: string, body: string,
|
|
|
400
504
|
declare function loadSkill(workspacePath: string, skillRef: string): PrimitiveInstance;
|
|
401
505
|
declare function listSkills(workspacePath: string, options?: {
|
|
402
506
|
status?: string;
|
|
507
|
+
updatedSince?: string;
|
|
403
508
|
}): PrimitiveInstance[];
|
|
404
509
|
declare function proposeSkill(workspacePath: string, skillRef: string, actor: string, options?: ProposeSkillOptions): PrimitiveInstance;
|
|
510
|
+
declare function skillHistory(workspacePath: string, skillRef: string, options?: {
|
|
511
|
+
limit?: number;
|
|
512
|
+
}): LedgerEntry[];
|
|
513
|
+
declare function skillDiff(workspacePath: string, skillRef: string): {
|
|
514
|
+
path: string;
|
|
515
|
+
latestEntryTs: string | null;
|
|
516
|
+
previousEntryTs: string | null;
|
|
517
|
+
changedFields: string[];
|
|
518
|
+
};
|
|
405
519
|
declare function promoteSkill(workspacePath: string, skillRef: string, actor: string, options?: PromoteSkillOptions): PrimitiveInstance;
|
|
406
520
|
|
|
407
521
|
type skill_PromoteSkillOptions = PromoteSkillOptions;
|
|
@@ -411,9 +525,423 @@ declare const skill_listSkills: typeof listSkills;
|
|
|
411
525
|
declare const skill_loadSkill: typeof loadSkill;
|
|
412
526
|
declare const skill_promoteSkill: typeof promoteSkill;
|
|
413
527
|
declare const skill_proposeSkill: typeof proposeSkill;
|
|
528
|
+
declare const skill_skillDiff: typeof skillDiff;
|
|
529
|
+
declare const skill_skillHistory: typeof skillHistory;
|
|
414
530
|
declare const skill_writeSkill: typeof writeSkill;
|
|
415
531
|
declare namespace skill {
|
|
416
|
-
export { type skill_PromoteSkillOptions as PromoteSkillOptions, type skill_ProposeSkillOptions as ProposeSkillOptions, type skill_WriteSkillOptions as WriteSkillOptions, skill_listSkills as listSkills, skill_loadSkill as loadSkill, skill_promoteSkill as promoteSkill, skill_proposeSkill as proposeSkill, skill_writeSkill as writeSkill };
|
|
532
|
+
export { type skill_PromoteSkillOptions as PromoteSkillOptions, type skill_ProposeSkillOptions as ProposeSkillOptions, type skill_WriteSkillOptions as WriteSkillOptions, skill_listSkills as listSkills, skill_loadSkill as loadSkill, skill_promoteSkill as promoteSkill, skill_proposeSkill as proposeSkill, skill_skillDiff as skillDiff, skill_skillHistory as skillHistory, skill_writeSkill as writeSkill };
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Cross-primitive query and keyword search helpers.
|
|
537
|
+
*/
|
|
538
|
+
|
|
539
|
+
declare function queryPrimitives(workspacePath: string, filters?: PrimitiveQueryFilters): PrimitiveInstance[];
|
|
540
|
+
declare function keywordSearch(workspacePath: string, text: string, filters?: Omit<PrimitiveQueryFilters, 'text'>): PrimitiveInstance[];
|
|
541
|
+
|
|
542
|
+
declare const query_keywordSearch: typeof keywordSearch;
|
|
543
|
+
declare const query_queryPrimitives: typeof queryPrimitives;
|
|
544
|
+
declare namespace query {
|
|
545
|
+
export { query_keywordSearch as keywordSearch, query_queryPrimitives as queryPrimitives };
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Orientation helpers: status, brief, checkpoint/intake.
|
|
550
|
+
*/
|
|
551
|
+
|
|
552
|
+
declare function statusSnapshot(workspacePath: string): WorkgraphStatusSnapshot;
|
|
553
|
+
declare function brief(workspacePath: string, actor: string, options?: {
|
|
554
|
+
recentCount?: number;
|
|
555
|
+
nextCount?: number;
|
|
556
|
+
}): WorkgraphBrief;
|
|
557
|
+
declare function checkpoint(workspacePath: string, actor: string, summary: string, options?: {
|
|
558
|
+
next?: string[];
|
|
559
|
+
blocked?: string[];
|
|
560
|
+
tags?: string[];
|
|
561
|
+
}): PrimitiveInstance;
|
|
562
|
+
declare function intake(workspacePath: string, actor: string, observation: string, options?: {
|
|
563
|
+
tags?: string[];
|
|
564
|
+
}): PrimitiveInstance;
|
|
565
|
+
|
|
566
|
+
declare const orientation_brief: typeof brief;
|
|
567
|
+
declare const orientation_checkpoint: typeof checkpoint;
|
|
568
|
+
declare const orientation_intake: typeof intake;
|
|
569
|
+
declare const orientation_statusSnapshot: typeof statusSnapshot;
|
|
570
|
+
declare namespace orientation {
|
|
571
|
+
export { orientation_brief as brief, orientation_checkpoint as checkpoint, orientation_intake as intake, orientation_statusSnapshot as statusSnapshot };
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Wiki-link graph indexing and hygiene reports.
|
|
576
|
+
*/
|
|
577
|
+
interface WikiGraphEdge {
|
|
578
|
+
from: string;
|
|
579
|
+
to: string;
|
|
580
|
+
}
|
|
581
|
+
interface WikiGraphIndex {
|
|
582
|
+
generatedAt: string;
|
|
583
|
+
nodes: string[];
|
|
584
|
+
edges: WikiGraphEdge[];
|
|
585
|
+
backlinks: Record<string, string[]>;
|
|
586
|
+
orphans: string[];
|
|
587
|
+
brokenLinks: Array<{
|
|
588
|
+
from: string;
|
|
589
|
+
to: string;
|
|
590
|
+
}>;
|
|
591
|
+
hubs: Array<{
|
|
592
|
+
node: string;
|
|
593
|
+
degree: number;
|
|
594
|
+
}>;
|
|
595
|
+
}
|
|
596
|
+
interface WikiGraphNeighborhood {
|
|
597
|
+
node: string;
|
|
598
|
+
exists: boolean;
|
|
599
|
+
outgoing: string[];
|
|
600
|
+
incoming: string[];
|
|
601
|
+
}
|
|
602
|
+
declare function graphIndexPath(workspacePath: string): string;
|
|
603
|
+
declare function buildWikiLinkGraph(workspacePath: string): WikiGraphIndex;
|
|
604
|
+
declare function refreshWikiLinkGraphIndex(workspacePath: string): WikiGraphIndex;
|
|
605
|
+
declare function readWikiLinkGraphIndex(workspacePath: string): WikiGraphIndex | null;
|
|
606
|
+
declare function graphHygieneReport(workspacePath: string): {
|
|
607
|
+
generatedAt: string;
|
|
608
|
+
nodeCount: number;
|
|
609
|
+
edgeCount: number;
|
|
610
|
+
orphanCount: number;
|
|
611
|
+
brokenLinkCount: number;
|
|
612
|
+
hubs: Array<{
|
|
613
|
+
node: string;
|
|
614
|
+
degree: number;
|
|
615
|
+
}>;
|
|
616
|
+
orphans: string[];
|
|
617
|
+
brokenLinks: Array<{
|
|
618
|
+
from: string;
|
|
619
|
+
to: string;
|
|
620
|
+
}>;
|
|
621
|
+
};
|
|
622
|
+
declare function graphNeighborhood(workspacePath: string, nodeRef: string, options?: {
|
|
623
|
+
refresh?: boolean;
|
|
624
|
+
}): WikiGraphNeighborhood;
|
|
625
|
+
|
|
626
|
+
type graph_WikiGraphEdge = WikiGraphEdge;
|
|
627
|
+
type graph_WikiGraphIndex = WikiGraphIndex;
|
|
628
|
+
type graph_WikiGraphNeighborhood = WikiGraphNeighborhood;
|
|
629
|
+
declare const graph_buildWikiLinkGraph: typeof buildWikiLinkGraph;
|
|
630
|
+
declare const graph_graphHygieneReport: typeof graphHygieneReport;
|
|
631
|
+
declare const graph_graphIndexPath: typeof graphIndexPath;
|
|
632
|
+
declare const graph_graphNeighborhood: typeof graphNeighborhood;
|
|
633
|
+
declare const graph_readWikiLinkGraphIndex: typeof readWikiLinkGraphIndex;
|
|
634
|
+
declare const graph_refreshWikiLinkGraphIndex: typeof refreshWikiLinkGraphIndex;
|
|
635
|
+
declare namespace graph {
|
|
636
|
+
export { type graph_WikiGraphEdge as WikiGraphEdge, type graph_WikiGraphIndex as WikiGraphIndex, type graph_WikiGraphNeighborhood as WikiGraphNeighborhood, graph_buildWikiLinkGraph as buildWikiLinkGraph, graph_graphHygieneReport as graphHygieneReport, graph_graphIndexPath as graphIndexPath, graph_graphNeighborhood as graphNeighborhood, graph_readWikiLinkGraphIndex as readWikiLinkGraphIndex, graph_refreshWikiLinkGraphIndex as refreshWikiLinkGraphIndex };
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Obsidian Kanban board generation and sync helpers.
|
|
641
|
+
*/
|
|
642
|
+
interface BoardOptions {
|
|
643
|
+
outputPath?: string;
|
|
644
|
+
includeCancelled?: boolean;
|
|
645
|
+
}
|
|
646
|
+
interface BoardResult {
|
|
647
|
+
outputPath: string;
|
|
648
|
+
generatedAt: string;
|
|
649
|
+
counts: {
|
|
650
|
+
backlog: number;
|
|
651
|
+
inProgress: number;
|
|
652
|
+
blocked: number;
|
|
653
|
+
done: number;
|
|
654
|
+
cancelled: number;
|
|
655
|
+
};
|
|
656
|
+
content: string;
|
|
657
|
+
}
|
|
658
|
+
declare function generateKanbanBoard(workspacePath: string, options?: BoardOptions): BoardResult;
|
|
659
|
+
declare function syncKanbanBoard(workspacePath: string, options?: BoardOptions): BoardResult;
|
|
660
|
+
|
|
661
|
+
type board_BoardOptions = BoardOptions;
|
|
662
|
+
type board_BoardResult = BoardResult;
|
|
663
|
+
declare const board_generateKanbanBoard: typeof generateKanbanBoard;
|
|
664
|
+
declare const board_syncKanbanBoard: typeof syncKanbanBoard;
|
|
665
|
+
declare namespace board {
|
|
666
|
+
export { type board_BoardOptions as BoardOptions, type board_BoardResult as BoardResult, board_generateKanbanBoard as generateKanbanBoard, board_syncKanbanBoard as syncKanbanBoard };
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Policy registry and status transition gates.
|
|
671
|
+
*/
|
|
672
|
+
|
|
673
|
+
interface PolicyDecision {
|
|
674
|
+
allowed: boolean;
|
|
675
|
+
reason?: string;
|
|
676
|
+
}
|
|
677
|
+
declare function policyPath(workspacePath: string): string;
|
|
678
|
+
declare function loadPolicyRegistry(workspacePath: string): PolicyRegistry;
|
|
679
|
+
declare function savePolicyRegistry(workspacePath: string, registry: PolicyRegistry): void;
|
|
680
|
+
declare function upsertParty(workspacePath: string, partyId: string, updates: {
|
|
681
|
+
roles?: string[];
|
|
682
|
+
capabilities?: string[];
|
|
683
|
+
}): PolicyParty;
|
|
684
|
+
declare function getParty(workspacePath: string, partyId: string): PolicyParty | null;
|
|
685
|
+
declare function canTransitionStatus(workspacePath: string, actor: string, primitiveType: string, fromStatus: string | undefined, toStatus: string | undefined): PolicyDecision;
|
|
686
|
+
|
|
687
|
+
type policy_PolicyDecision = PolicyDecision;
|
|
688
|
+
declare const policy_canTransitionStatus: typeof canTransitionStatus;
|
|
689
|
+
declare const policy_getParty: typeof getParty;
|
|
690
|
+
declare const policy_loadPolicyRegistry: typeof loadPolicyRegistry;
|
|
691
|
+
declare const policy_policyPath: typeof policyPath;
|
|
692
|
+
declare const policy_savePolicyRegistry: typeof savePolicyRegistry;
|
|
693
|
+
declare const policy_upsertParty: typeof upsertParty;
|
|
694
|
+
declare namespace policy {
|
|
695
|
+
export { type policy_PolicyDecision as PolicyDecision, policy_canTransitionStatus as canTransitionStatus, policy_getParty as getParty, policy_loadPolicyRegistry as loadPolicyRegistry, policy_policyPath as policyPath, policy_savePolicyRegistry as savePolicyRegistry, policy_upsertParty as upsertParty };
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Runtime dispatch contract with adapter-backed execution.
|
|
700
|
+
*/
|
|
701
|
+
|
|
702
|
+
interface DispatchCreateInput {
|
|
703
|
+
actor: string;
|
|
704
|
+
adapter?: string;
|
|
705
|
+
objective: string;
|
|
706
|
+
context?: Record<string, unknown>;
|
|
707
|
+
idempotencyKey?: string;
|
|
708
|
+
}
|
|
709
|
+
interface DispatchExecuteInput {
|
|
710
|
+
actor: string;
|
|
711
|
+
agents?: string[];
|
|
712
|
+
maxSteps?: number;
|
|
713
|
+
stepDelayMs?: number;
|
|
714
|
+
space?: string;
|
|
715
|
+
createCheckpoint?: boolean;
|
|
716
|
+
}
|
|
717
|
+
declare function createRun(workspacePath: string, input: DispatchCreateInput): DispatchRun;
|
|
718
|
+
declare function status(workspacePath: string, runId: string): DispatchRun;
|
|
719
|
+
declare function followup(workspacePath: string, runId: string, actor: string, input: string): DispatchRun;
|
|
720
|
+
declare function stop(workspacePath: string, runId: string, actor: string): DispatchRun;
|
|
721
|
+
declare function markRun(workspacePath: string, runId: string, actor: string, nextStatus: Exclude<RunStatus, 'queued'>, options?: {
|
|
722
|
+
output?: string;
|
|
723
|
+
error?: string;
|
|
724
|
+
contextPatch?: Record<string, unknown>;
|
|
725
|
+
}): DispatchRun;
|
|
726
|
+
declare function logs(workspacePath: string, runId: string): DispatchRun['logs'];
|
|
727
|
+
declare function listRuns(workspacePath: string, options?: {
|
|
728
|
+
status?: RunStatus;
|
|
729
|
+
limit?: number;
|
|
730
|
+
}): DispatchRun[];
|
|
731
|
+
declare function executeRun(workspacePath: string, runId: string, input: DispatchExecuteInput): Promise<DispatchRun>;
|
|
732
|
+
declare function createAndExecuteRun(workspacePath: string, createInput: DispatchCreateInput, executeInput?: Omit<DispatchExecuteInput, 'actor'>): Promise<DispatchRun>;
|
|
733
|
+
|
|
734
|
+
type dispatch_DispatchCreateInput = DispatchCreateInput;
|
|
735
|
+
type dispatch_DispatchExecuteInput = DispatchExecuteInput;
|
|
736
|
+
declare const dispatch_createAndExecuteRun: typeof createAndExecuteRun;
|
|
737
|
+
declare const dispatch_createRun: typeof createRun;
|
|
738
|
+
declare const dispatch_executeRun: typeof executeRun;
|
|
739
|
+
declare const dispatch_followup: typeof followup;
|
|
740
|
+
declare const dispatch_listRuns: typeof listRuns;
|
|
741
|
+
declare const dispatch_logs: typeof logs;
|
|
742
|
+
declare const dispatch_markRun: typeof markRun;
|
|
743
|
+
declare const dispatch_status: typeof status;
|
|
744
|
+
declare const dispatch_stop: typeof stop;
|
|
745
|
+
declare namespace dispatch {
|
|
746
|
+
export { type dispatch_DispatchCreateInput as DispatchCreateInput, type dispatch_DispatchExecuteInput as DispatchExecuteInput, dispatch_createAndExecuteRun as createAndExecuteRun, dispatch_createRun as createRun, dispatch_executeRun as executeRun, dispatch_followup as followup, dispatch_listRuns as listRuns, dispatch_logs as logs, dispatch_markRun as markRun, dispatch_status as status, dispatch_stop as stop };
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Agent-first onboarding flow for new workgraph workspaces.
|
|
751
|
+
*/
|
|
752
|
+
|
|
753
|
+
interface OnboardOptions {
|
|
754
|
+
actor: string;
|
|
755
|
+
spaces?: string[];
|
|
756
|
+
createDemoThreads?: boolean;
|
|
757
|
+
}
|
|
758
|
+
interface OnboardResult {
|
|
759
|
+
actor: string;
|
|
760
|
+
spacesCreated: string[];
|
|
761
|
+
threadsCreated: string[];
|
|
762
|
+
boardPath: string;
|
|
763
|
+
commandCenterPath: string;
|
|
764
|
+
checkpointPath: string;
|
|
765
|
+
onboardingPath: string;
|
|
766
|
+
}
|
|
767
|
+
type OnboardingStatus = 'active' | 'completed' | 'paused';
|
|
768
|
+
declare function onboardWorkspace(workspacePath: string, options: OnboardOptions): OnboardResult;
|
|
769
|
+
declare function updateOnboardingStatus(workspacePath: string, onboardingPath: string, status: OnboardingStatus, actor: string): PrimitiveInstance;
|
|
770
|
+
|
|
771
|
+
type onboard_OnboardOptions = OnboardOptions;
|
|
772
|
+
type onboard_OnboardResult = OnboardResult;
|
|
773
|
+
type onboard_OnboardingStatus = OnboardingStatus;
|
|
774
|
+
declare const onboard_onboardWorkspace: typeof onboardWorkspace;
|
|
775
|
+
declare const onboard_updateOnboardingStatus: typeof updateOnboardingStatus;
|
|
776
|
+
declare namespace onboard {
|
|
777
|
+
export { type onboard_OnboardOptions as OnboardOptions, type onboard_OnboardResult as OnboardResult, type onboard_OnboardingStatus as OnboardingStatus, onboard_onboardWorkspace as onboardWorkspace, onboard_updateOnboardingStatus as updateOnboardingStatus };
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* QMD-compatible search adapter.
|
|
782
|
+
*
|
|
783
|
+
* This package intentionally degrades gracefully to core keyword search when
|
|
784
|
+
* a QMD backend is not configured.
|
|
785
|
+
*/
|
|
786
|
+
|
|
787
|
+
interface QmdSearchOptions {
|
|
788
|
+
mode?: 'auto' | 'core' | 'qmd';
|
|
789
|
+
type?: string;
|
|
790
|
+
limit?: number;
|
|
791
|
+
}
|
|
792
|
+
interface QmdSearchResult {
|
|
793
|
+
mode: 'core' | 'qmd';
|
|
794
|
+
query: string;
|
|
795
|
+
results: PrimitiveInstance[];
|
|
796
|
+
fallbackReason?: string;
|
|
797
|
+
}
|
|
798
|
+
declare function search(workspacePath: string, text: string, options?: QmdSearchOptions): QmdSearchResult;
|
|
799
|
+
|
|
800
|
+
type searchQmdAdapter_QmdSearchOptions = QmdSearchOptions;
|
|
801
|
+
type searchQmdAdapter_QmdSearchResult = QmdSearchResult;
|
|
802
|
+
declare const searchQmdAdapter_search: typeof search;
|
|
803
|
+
declare namespace searchQmdAdapter {
|
|
804
|
+
export { type searchQmdAdapter_QmdSearchOptions as QmdSearchOptions, type searchQmdAdapter_QmdSearchResult as QmdSearchResult, searchQmdAdapter_search as search };
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Trigger-to-run dispatch helpers.
|
|
809
|
+
*/
|
|
810
|
+
|
|
811
|
+
interface FireTriggerOptions {
|
|
812
|
+
actor: string;
|
|
813
|
+
eventKey?: string;
|
|
814
|
+
objective?: string;
|
|
815
|
+
context?: Record<string, unknown>;
|
|
816
|
+
}
|
|
817
|
+
interface FireTriggerResult {
|
|
818
|
+
triggerPath: string;
|
|
819
|
+
run: DispatchRun;
|
|
820
|
+
idempotencyKey: string;
|
|
821
|
+
}
|
|
822
|
+
declare function fireTrigger(workspacePath: string, triggerPath: string, options: FireTriggerOptions): FireTriggerResult;
|
|
823
|
+
|
|
824
|
+
type trigger_FireTriggerOptions = FireTriggerOptions;
|
|
825
|
+
type trigger_FireTriggerResult = FireTriggerResult;
|
|
826
|
+
declare const trigger_fireTrigger: typeof fireTrigger;
|
|
827
|
+
declare namespace trigger {
|
|
828
|
+
export { type trigger_FireTriggerOptions as FireTriggerOptions, type trigger_FireTriggerResult as FireTriggerResult, trigger_fireTrigger as fireTrigger };
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
interface SkillIntegrationProvider {
|
|
832
|
+
id: string;
|
|
833
|
+
defaultTitle: string;
|
|
834
|
+
defaultSourceUrl: string;
|
|
835
|
+
distribution: string;
|
|
836
|
+
defaultTags: string[];
|
|
837
|
+
userAgent?: string;
|
|
838
|
+
}
|
|
839
|
+
interface InstallSkillIntegrationOptions {
|
|
840
|
+
actor: string;
|
|
841
|
+
owner?: string;
|
|
842
|
+
title?: string;
|
|
843
|
+
sourceUrl?: string;
|
|
844
|
+
force?: boolean;
|
|
845
|
+
status?: WriteSkillOptions['status'];
|
|
846
|
+
tags?: string[];
|
|
847
|
+
fetchSkillMarkdown?: (sourceUrl: string) => Promise<string>;
|
|
848
|
+
}
|
|
849
|
+
interface InstallSkillIntegrationResult {
|
|
850
|
+
provider: string;
|
|
851
|
+
skill: PrimitiveInstance;
|
|
852
|
+
sourceUrl: string;
|
|
853
|
+
importedAt: string;
|
|
854
|
+
replacedExisting: boolean;
|
|
855
|
+
}
|
|
856
|
+
declare function installSkillIntegration(workspacePath: string, provider: SkillIntegrationProvider, options: InstallSkillIntegrationOptions): Promise<InstallSkillIntegrationResult>;
|
|
857
|
+
declare function fetchSkillMarkdownFromUrl(sourceUrl: string, userAgent?: string): Promise<string>;
|
|
858
|
+
|
|
859
|
+
declare const DEFAULT_CLAWDAPUS_SKILL_URL = "https://raw.githubusercontent.com/mostlydev/clawdapus/master/skills/clawdapus/SKILL.md";
|
|
860
|
+
declare const CLAWDAPUS_INTEGRATION_PROVIDER: SkillIntegrationProvider;
|
|
861
|
+
type InstallClawdapusSkillOptions = InstallSkillIntegrationOptions;
|
|
862
|
+
type InstallClawdapusSkillResult = InstallSkillIntegrationResult;
|
|
863
|
+
declare function installClawdapusSkill(workspacePath: string, options: InstallClawdapusSkillOptions): Promise<InstallClawdapusSkillResult>;
|
|
864
|
+
declare function fetchClawdapusSkillMarkdown(sourceUrl: string): Promise<string>;
|
|
865
|
+
|
|
866
|
+
declare const clawdapus_CLAWDAPUS_INTEGRATION_PROVIDER: typeof CLAWDAPUS_INTEGRATION_PROVIDER;
|
|
867
|
+
declare const clawdapus_DEFAULT_CLAWDAPUS_SKILL_URL: typeof DEFAULT_CLAWDAPUS_SKILL_URL;
|
|
868
|
+
type clawdapus_InstallClawdapusSkillOptions = InstallClawdapusSkillOptions;
|
|
869
|
+
type clawdapus_InstallClawdapusSkillResult = InstallClawdapusSkillResult;
|
|
870
|
+
declare const clawdapus_fetchClawdapusSkillMarkdown: typeof fetchClawdapusSkillMarkdown;
|
|
871
|
+
declare const clawdapus_installClawdapusSkill: typeof installClawdapusSkill;
|
|
872
|
+
declare namespace clawdapus {
|
|
873
|
+
export { clawdapus_CLAWDAPUS_INTEGRATION_PROVIDER as CLAWDAPUS_INTEGRATION_PROVIDER, clawdapus_DEFAULT_CLAWDAPUS_SKILL_URL as DEFAULT_CLAWDAPUS_SKILL_URL, type clawdapus_InstallClawdapusSkillOptions as InstallClawdapusSkillOptions, type clawdapus_InstallClawdapusSkillResult as InstallClawdapusSkillResult, clawdapus_fetchClawdapusSkillMarkdown as fetchClawdapusSkillMarkdown, clawdapus_installClawdapusSkill as installClawdapusSkill };
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
interface IntegrationDescriptor {
|
|
877
|
+
id: string;
|
|
878
|
+
description: string;
|
|
879
|
+
defaultTitle: string;
|
|
880
|
+
defaultSourceUrl: string;
|
|
881
|
+
}
|
|
882
|
+
declare function listIntegrations(): IntegrationDescriptor[];
|
|
883
|
+
declare function installIntegration(workspacePath: string, integrationId: string, options: InstallSkillIntegrationOptions): Promise<InstallSkillIntegrationResult>;
|
|
884
|
+
|
|
885
|
+
type integration_IntegrationDescriptor = IntegrationDescriptor;
|
|
886
|
+
declare const integration_installIntegration: typeof installIntegration;
|
|
887
|
+
declare const integration_listIntegrations: typeof listIntegrations;
|
|
888
|
+
declare namespace integration {
|
|
889
|
+
export { type integration_IntegrationDescriptor as IntegrationDescriptor, integration_installIntegration as installIntegration, integration_listIntegrations as listIntegrations };
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
interface DispatchAdapterCreateInput {
|
|
893
|
+
actor: string;
|
|
894
|
+
objective: string;
|
|
895
|
+
idempotencyKey?: string;
|
|
896
|
+
context?: Record<string, unknown>;
|
|
897
|
+
}
|
|
898
|
+
interface DispatchAdapterRunStatus {
|
|
899
|
+
runId: string;
|
|
900
|
+
status: RunStatus;
|
|
901
|
+
}
|
|
902
|
+
interface DispatchAdapterLogEntry {
|
|
903
|
+
ts: string;
|
|
904
|
+
level: 'info' | 'warn' | 'error';
|
|
905
|
+
message: string;
|
|
906
|
+
}
|
|
907
|
+
interface DispatchAdapterExecutionInput {
|
|
908
|
+
workspacePath: string;
|
|
909
|
+
runId: string;
|
|
910
|
+
actor: string;
|
|
911
|
+
objective: string;
|
|
912
|
+
context?: Record<string, unknown>;
|
|
913
|
+
agents?: string[];
|
|
914
|
+
maxSteps?: number;
|
|
915
|
+
stepDelayMs?: number;
|
|
916
|
+
space?: string;
|
|
917
|
+
createCheckpoint?: boolean;
|
|
918
|
+
isCancelled?: () => boolean;
|
|
919
|
+
}
|
|
920
|
+
interface DispatchAdapterExecutionResult {
|
|
921
|
+
status: RunStatus;
|
|
922
|
+
output?: string;
|
|
923
|
+
error?: string;
|
|
924
|
+
logs: DispatchAdapterLogEntry[];
|
|
925
|
+
metrics?: Record<string, unknown>;
|
|
926
|
+
}
|
|
927
|
+
interface DispatchAdapter {
|
|
928
|
+
name: string;
|
|
929
|
+
create(input: DispatchAdapterCreateInput): Promise<DispatchAdapterRunStatus>;
|
|
930
|
+
status(runId: string): Promise<DispatchAdapterRunStatus>;
|
|
931
|
+
followup(runId: string, actor: string, input: string): Promise<DispatchAdapterRunStatus>;
|
|
932
|
+
stop(runId: string, actor: string): Promise<DispatchAdapterRunStatus>;
|
|
933
|
+
logs(runId: string): Promise<DispatchAdapterLogEntry[]>;
|
|
934
|
+
execute?(input: DispatchAdapterExecutionInput): Promise<DispatchAdapterExecutionResult>;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
declare class CursorCloudAdapter implements DispatchAdapter {
|
|
938
|
+
name: string;
|
|
939
|
+
create(_input: DispatchAdapterCreateInput): Promise<DispatchAdapterRunStatus>;
|
|
940
|
+
status(runId: string): Promise<DispatchAdapterRunStatus>;
|
|
941
|
+
followup(runId: string, _actor: string, _input: string): Promise<DispatchAdapterRunStatus>;
|
|
942
|
+
stop(runId: string, _actor: string): Promise<DispatchAdapterRunStatus>;
|
|
943
|
+
logs(_runId: string): Promise<DispatchAdapterLogEntry[]>;
|
|
944
|
+
execute(input: DispatchAdapterExecutionInput): Promise<DispatchAdapterExecutionResult>;
|
|
417
945
|
}
|
|
418
946
|
|
|
419
|
-
export { type FieldDefinition, type LedgerChainState, type LedgerEntry, type LedgerIndex, type LedgerOp, type PrimitiveInstance, type PrimitiveTypeDefinition, type Registry, THREAD_STATUS_TRANSITIONS, type ThreadStatus, type WorkgraphWorkspaceConfig, bases, commandCenter, ledger, registry, skill, store, thread, workspace };
|
|
947
|
+
export { CursorCloudAdapter, type DispatchAdapter, type DispatchAdapterCreateInput, type DispatchAdapterExecutionInput, type DispatchAdapterExecutionResult, type DispatchAdapterLogEntry, type DispatchAdapterRunStatus, type DispatchRun, type FieldDefinition, type InstallSkillIntegrationOptions, type InstallSkillIntegrationResult, type LedgerChainState, type LedgerEntry, type LedgerIndex, type LedgerOp, type PolicyParty, type PolicyRegistry, type PrimitiveInstance, type PrimitiveQueryFilters, type PrimitiveTypeDefinition, type Registry, type RunStatus, type SkillIntegrationProvider, THREAD_STATUS_TRANSITIONS, type ThreadStatus, type WorkgraphBrief, type WorkgraphStatusSnapshot, type WorkgraphWorkspaceConfig, bases, board, clawdapus, commandCenter, dispatch, fetchSkillMarkdownFromUrl, graph, installSkillIntegration, integration, ledger, onboard, orientation, policy, query, registry, searchQmdAdapter, skill, store, thread, trigger, workspace };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,54 @@
|
|
|
1
1
|
import {
|
|
2
|
-
THREAD_STATUS_TRANSITIONS,
|
|
3
2
|
bases_exports,
|
|
3
|
+
board_exports,
|
|
4
|
+
clawdapus_exports,
|
|
4
5
|
command_center_exports,
|
|
6
|
+
fetchSkillMarkdownFromUrl,
|
|
7
|
+
installSkillIntegration,
|
|
8
|
+
integration_exports,
|
|
9
|
+
onboard_exports,
|
|
10
|
+
search_qmd_adapter_exports,
|
|
11
|
+
skill_exports,
|
|
12
|
+
trigger_exports,
|
|
13
|
+
workspace_exports
|
|
14
|
+
} from "./chunk-E3QU5Y53.js";
|
|
15
|
+
import {
|
|
16
|
+
CursorCloudAdapter,
|
|
17
|
+
THREAD_STATUS_TRANSITIONS,
|
|
18
|
+
dispatch_exports,
|
|
19
|
+
graph_exports,
|
|
5
20
|
ledger_exports,
|
|
21
|
+
mcp_server_exports,
|
|
22
|
+
orientation_exports,
|
|
23
|
+
policy_exports,
|
|
24
|
+
query_exports,
|
|
6
25
|
registry_exports,
|
|
7
|
-
skill_exports,
|
|
8
26
|
store_exports,
|
|
9
|
-
thread_exports
|
|
10
|
-
|
|
11
|
-
} from "./chunk-CRQXDCPR.js";
|
|
27
|
+
thread_exports
|
|
28
|
+
} from "./chunk-65ZMX2WM.js";
|
|
12
29
|
export {
|
|
30
|
+
CursorCloudAdapter,
|
|
13
31
|
THREAD_STATUS_TRANSITIONS,
|
|
14
32
|
bases_exports as bases,
|
|
33
|
+
board_exports as board,
|
|
34
|
+
clawdapus_exports as clawdapus,
|
|
15
35
|
command_center_exports as commandCenter,
|
|
36
|
+
dispatch_exports as dispatch,
|
|
37
|
+
fetchSkillMarkdownFromUrl,
|
|
38
|
+
graph_exports as graph,
|
|
39
|
+
installSkillIntegration,
|
|
40
|
+
integration_exports as integration,
|
|
16
41
|
ledger_exports as ledger,
|
|
42
|
+
mcp_server_exports as mcpServer,
|
|
43
|
+
onboard_exports as onboard,
|
|
44
|
+
orientation_exports as orientation,
|
|
45
|
+
policy_exports as policy,
|
|
46
|
+
query_exports as query,
|
|
17
47
|
registry_exports as registry,
|
|
48
|
+
search_qmd_adapter_exports as searchQmdAdapter,
|
|
18
49
|
skill_exports as skill,
|
|
19
50
|
store_exports as store,
|
|
20
51
|
thread_exports as thread,
|
|
52
|
+
trigger_exports as trigger,
|
|
21
53
|
workspace_exports as workspace
|
|
22
54
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
|
|
3
|
+
interface WorkgraphMcpServerOptions {
|
|
4
|
+
workspacePath: string;
|
|
5
|
+
defaultActor?: string;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function createWorkgraphMcpServer(options: WorkgraphMcpServerOptions): McpServer;
|
|
11
|
+
declare function startWorkgraphMcpServer(options: WorkgraphMcpServerOptions): Promise<McpServer>;
|
|
12
|
+
|
|
13
|
+
type mcpServer_WorkgraphMcpServerOptions = WorkgraphMcpServerOptions;
|
|
14
|
+
declare const mcpServer_createWorkgraphMcpServer: typeof createWorkgraphMcpServer;
|
|
15
|
+
declare const mcpServer_startWorkgraphMcpServer: typeof startWorkgraphMcpServer;
|
|
16
|
+
declare namespace mcpServer {
|
|
17
|
+
export { type mcpServer_WorkgraphMcpServerOptions as WorkgraphMcpServerOptions, mcpServer_createWorkgraphMcpServer as createWorkgraphMcpServer, mcpServer_startWorkgraphMcpServer as startWorkgraphMcpServer };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { type WorkgraphMcpServerOptions as W, createWorkgraphMcpServer as c, mcpServer as m, startWorkgraphMcpServer as s };
|