@versatly/workgraph 0.1.0 → 0.2.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 +66 -11
- package/SKILL.md +10 -10
- package/bin/workgraph.js +0 -0
- package/dist/chunk-XUMA4O2Z.js +2817 -0
- package/dist/cli.js +574 -23
- package/dist/index.d.ts +402 -7
- package/dist/index.js +19 -1
- package/package.json +15 -6
- package/dist/chunk-CRQXDCPR.js +0 -1443
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,27 @@ interface FieldDefinition {
|
|
|
6
6
|
required?: boolean;
|
|
7
7
|
default?: unknown;
|
|
8
8
|
description?: string;
|
|
9
|
+
/** Allowed values when type is scalar/string-like. */
|
|
10
|
+
enum?: Array<string | number | boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Optional semantic template used for additional validation.
|
|
13
|
+
* - slug: lowercase kebab-case token
|
|
14
|
+
* - semver: semantic version (x.y.z)
|
|
15
|
+
* - email: simple email shape
|
|
16
|
+
* - url: absolute http(s) URL
|
|
17
|
+
* - iso-date: ISO-8601 date/time string
|
|
18
|
+
*/
|
|
19
|
+
template?: 'slug' | 'semver' | 'email' | 'url' | 'iso-date';
|
|
20
|
+
/**
|
|
21
|
+
* Optional regex pattern constraint for string/ref/date fields.
|
|
22
|
+
* Uses JavaScript regular expression syntax (without delimiters).
|
|
23
|
+
*/
|
|
24
|
+
pattern?: string;
|
|
25
|
+
/**
|
|
26
|
+
* For ref fields, constrain references to one or more primitive types.
|
|
27
|
+
* Example: refTypes: ['thread', 'space']
|
|
28
|
+
*/
|
|
29
|
+
refTypes?: string[];
|
|
9
30
|
}
|
|
10
31
|
interface PrimitiveTypeDefinition {
|
|
11
32
|
name: string;
|
|
@@ -66,6 +87,83 @@ interface WorkgraphWorkspaceConfig {
|
|
|
66
87
|
createdAt: string;
|
|
67
88
|
updatedAt: string;
|
|
68
89
|
}
|
|
90
|
+
interface PrimitiveQueryFilters {
|
|
91
|
+
type?: string;
|
|
92
|
+
status?: string;
|
|
93
|
+
owner?: string;
|
|
94
|
+
tag?: string;
|
|
95
|
+
text?: string;
|
|
96
|
+
pathIncludes?: string;
|
|
97
|
+
updatedAfter?: string;
|
|
98
|
+
updatedBefore?: string;
|
|
99
|
+
createdAfter?: string;
|
|
100
|
+
createdBefore?: string;
|
|
101
|
+
limit?: number;
|
|
102
|
+
offset?: number;
|
|
103
|
+
}
|
|
104
|
+
interface WorkgraphStatusSnapshot {
|
|
105
|
+
generatedAt: string;
|
|
106
|
+
threads: {
|
|
107
|
+
total: number;
|
|
108
|
+
open: number;
|
|
109
|
+
active: number;
|
|
110
|
+
blocked: number;
|
|
111
|
+
done: number;
|
|
112
|
+
cancelled: number;
|
|
113
|
+
ready: number;
|
|
114
|
+
};
|
|
115
|
+
claims: {
|
|
116
|
+
active: number;
|
|
117
|
+
};
|
|
118
|
+
primitives: {
|
|
119
|
+
total: number;
|
|
120
|
+
byType: Record<string, number>;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
interface WorkgraphBrief {
|
|
124
|
+
generatedAt: string;
|
|
125
|
+
actor: string;
|
|
126
|
+
myClaims: PrimitiveInstance[];
|
|
127
|
+
myOpenThreads: PrimitiveInstance[];
|
|
128
|
+
blockedThreads: PrimitiveInstance[];
|
|
129
|
+
nextReadyThreads: PrimitiveInstance[];
|
|
130
|
+
recentActivity: LedgerEntry[];
|
|
131
|
+
}
|
|
132
|
+
interface PolicyParty {
|
|
133
|
+
id: string;
|
|
134
|
+
roles: string[];
|
|
135
|
+
capabilities: string[];
|
|
136
|
+
createdAt: string;
|
|
137
|
+
updatedAt: string;
|
|
138
|
+
}
|
|
139
|
+
interface PolicyRegistry {
|
|
140
|
+
version: number;
|
|
141
|
+
parties: Record<string, PolicyParty>;
|
|
142
|
+
}
|
|
143
|
+
type RunStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
144
|
+
interface DispatchRun {
|
|
145
|
+
id: string;
|
|
146
|
+
createdAt: string;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
actor: string;
|
|
149
|
+
adapter: string;
|
|
150
|
+
objective: string;
|
|
151
|
+
status: RunStatus;
|
|
152
|
+
idempotencyKey?: string;
|
|
153
|
+
context?: Record<string, unknown>;
|
|
154
|
+
output?: string;
|
|
155
|
+
error?: string;
|
|
156
|
+
followups: Array<{
|
|
157
|
+
ts: string;
|
|
158
|
+
actor: string;
|
|
159
|
+
input: string;
|
|
160
|
+
}>;
|
|
161
|
+
logs: Array<{
|
|
162
|
+
ts: string;
|
|
163
|
+
level: 'info' | 'warn' | 'error';
|
|
164
|
+
message: string;
|
|
165
|
+
}>;
|
|
166
|
+
}
|
|
69
167
|
|
|
70
168
|
/**
|
|
71
169
|
* Dynamic primitive type registry.
|
|
@@ -93,7 +191,7 @@ declare namespace registry {
|
|
|
93
191
|
/**
|
|
94
192
|
* Append-only event ledger.
|
|
95
193
|
*
|
|
96
|
-
* Format: one JSON object per line (.jsonl) in `.
|
|
194
|
+
* Format: one JSON object per line (.jsonl) in `.workgraph/ledger.jsonl`.
|
|
97
195
|
*/
|
|
98
196
|
|
|
99
197
|
declare function ledgerPath(workspacePath: string): string;
|
|
@@ -118,7 +216,7 @@ interface LedgerQueryOptions {
|
|
|
118
216
|
limit?: number;
|
|
119
217
|
offset?: number;
|
|
120
218
|
}
|
|
121
|
-
declare function query(workspacePath: string, options?: LedgerQueryOptions): LedgerEntry[];
|
|
219
|
+
declare function query$1(workspacePath: string, options?: LedgerQueryOptions): LedgerEntry[];
|
|
122
220
|
interface LedgerBlameActorSummary {
|
|
123
221
|
actor: string;
|
|
124
222
|
count: number;
|
|
@@ -175,7 +273,6 @@ declare const ledger_ledgerIndexPath: typeof ledgerIndexPath;
|
|
|
175
273
|
declare const ledger_ledgerPath: typeof ledgerPath;
|
|
176
274
|
declare const ledger_loadChainState: typeof loadChainState;
|
|
177
275
|
declare const ledger_loadIndex: typeof loadIndex;
|
|
178
|
-
declare const ledger_query: typeof query;
|
|
179
276
|
declare const ledger_readAll: typeof readAll;
|
|
180
277
|
declare const ledger_readSince: typeof readSince;
|
|
181
278
|
declare const ledger_rebuildHashChainState: typeof rebuildHashChainState;
|
|
@@ -183,14 +280,16 @@ declare const ledger_rebuildIndex: typeof rebuildIndex;
|
|
|
183
280
|
declare const ledger_recent: typeof recent;
|
|
184
281
|
declare const ledger_verifyHashChain: typeof verifyHashChain;
|
|
185
282
|
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,
|
|
283
|
+
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
284
|
}
|
|
188
285
|
|
|
189
286
|
/**
|
|
190
287
|
* Workgraph store — CRUD for primitive instances.
|
|
191
288
|
*/
|
|
192
289
|
|
|
193
|
-
declare function create(workspacePath: string, typeName: string, fields: Record<string, unknown>, body: string, actor: string
|
|
290
|
+
declare function create(workspacePath: string, typeName: string, fields: Record<string, unknown>, body: string, actor: string, options?: {
|
|
291
|
+
pathOverride?: string;
|
|
292
|
+
}): PrimitiveInstance;
|
|
194
293
|
declare function read(workspacePath: string, relPath: string): PrimitiveInstance | null;
|
|
195
294
|
declare function list(workspacePath: string, typeName: string): PrimitiveInstance[];
|
|
196
295
|
declare function update(workspacePath: string, relPath: string, fieldUpdates: Record<string, unknown>, bodyUpdate: string | undefined, actor: string): PrimitiveInstance;
|
|
@@ -386,6 +485,8 @@ interface WriteSkillOptions {
|
|
|
386
485
|
tailscalePath?: string;
|
|
387
486
|
reviewers?: string[];
|
|
388
487
|
tags?: string[];
|
|
488
|
+
dependsOn?: string[];
|
|
489
|
+
expectedUpdatedAt?: string;
|
|
389
490
|
}
|
|
390
491
|
interface ProposeSkillOptions {
|
|
391
492
|
proposalThread?: string;
|
|
@@ -400,8 +501,18 @@ declare function writeSkill(workspacePath: string, title: string, body: string,
|
|
|
400
501
|
declare function loadSkill(workspacePath: string, skillRef: string): PrimitiveInstance;
|
|
401
502
|
declare function listSkills(workspacePath: string, options?: {
|
|
402
503
|
status?: string;
|
|
504
|
+
updatedSince?: string;
|
|
403
505
|
}): PrimitiveInstance[];
|
|
404
506
|
declare function proposeSkill(workspacePath: string, skillRef: string, actor: string, options?: ProposeSkillOptions): PrimitiveInstance;
|
|
507
|
+
declare function skillHistory(workspacePath: string, skillRef: string, options?: {
|
|
508
|
+
limit?: number;
|
|
509
|
+
}): LedgerEntry[];
|
|
510
|
+
declare function skillDiff(workspacePath: string, skillRef: string): {
|
|
511
|
+
path: string;
|
|
512
|
+
latestEntryTs: string | null;
|
|
513
|
+
previousEntryTs: string | null;
|
|
514
|
+
changedFields: string[];
|
|
515
|
+
};
|
|
405
516
|
declare function promoteSkill(workspacePath: string, skillRef: string, actor: string, options?: PromoteSkillOptions): PrimitiveInstance;
|
|
406
517
|
|
|
407
518
|
type skill_PromoteSkillOptions = PromoteSkillOptions;
|
|
@@ -411,9 +522,293 @@ declare const skill_listSkills: typeof listSkills;
|
|
|
411
522
|
declare const skill_loadSkill: typeof loadSkill;
|
|
412
523
|
declare const skill_promoteSkill: typeof promoteSkill;
|
|
413
524
|
declare const skill_proposeSkill: typeof proposeSkill;
|
|
525
|
+
declare const skill_skillDiff: typeof skillDiff;
|
|
526
|
+
declare const skill_skillHistory: typeof skillHistory;
|
|
414
527
|
declare const skill_writeSkill: typeof writeSkill;
|
|
415
528
|
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 };
|
|
529
|
+
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 };
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Cross-primitive query and keyword search helpers.
|
|
534
|
+
*/
|
|
535
|
+
|
|
536
|
+
declare function queryPrimitives(workspacePath: string, filters?: PrimitiveQueryFilters): PrimitiveInstance[];
|
|
537
|
+
declare function keywordSearch(workspacePath: string, text: string, filters?: Omit<PrimitiveQueryFilters, 'text'>): PrimitiveInstance[];
|
|
538
|
+
|
|
539
|
+
declare const query_keywordSearch: typeof keywordSearch;
|
|
540
|
+
declare const query_queryPrimitives: typeof queryPrimitives;
|
|
541
|
+
declare namespace query {
|
|
542
|
+
export { query_keywordSearch as keywordSearch, query_queryPrimitives as queryPrimitives };
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Orientation helpers: status, brief, checkpoint/intake.
|
|
547
|
+
*/
|
|
548
|
+
|
|
549
|
+
declare function statusSnapshot(workspacePath: string): WorkgraphStatusSnapshot;
|
|
550
|
+
declare function brief(workspacePath: string, actor: string, options?: {
|
|
551
|
+
recentCount?: number;
|
|
552
|
+
nextCount?: number;
|
|
553
|
+
}): WorkgraphBrief;
|
|
554
|
+
declare function checkpoint(workspacePath: string, actor: string, summary: string, options?: {
|
|
555
|
+
next?: string[];
|
|
556
|
+
blocked?: string[];
|
|
557
|
+
tags?: string[];
|
|
558
|
+
}): PrimitiveInstance;
|
|
559
|
+
declare function intake(workspacePath: string, actor: string, observation: string, options?: {
|
|
560
|
+
tags?: string[];
|
|
561
|
+
}): PrimitiveInstance;
|
|
562
|
+
|
|
563
|
+
declare const orientation_brief: typeof brief;
|
|
564
|
+
declare const orientation_checkpoint: typeof checkpoint;
|
|
565
|
+
declare const orientation_intake: typeof intake;
|
|
566
|
+
declare const orientation_statusSnapshot: typeof statusSnapshot;
|
|
567
|
+
declare namespace orientation {
|
|
568
|
+
export { orientation_brief as brief, orientation_checkpoint as checkpoint, orientation_intake as intake, orientation_statusSnapshot as statusSnapshot };
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Wiki-link graph indexing and hygiene reports.
|
|
573
|
+
*/
|
|
574
|
+
interface WikiGraphEdge {
|
|
575
|
+
from: string;
|
|
576
|
+
to: string;
|
|
577
|
+
}
|
|
578
|
+
interface WikiGraphIndex {
|
|
579
|
+
generatedAt: string;
|
|
580
|
+
nodes: string[];
|
|
581
|
+
edges: WikiGraphEdge[];
|
|
582
|
+
backlinks: Record<string, string[]>;
|
|
583
|
+
orphans: string[];
|
|
584
|
+
brokenLinks: Array<{
|
|
585
|
+
from: string;
|
|
586
|
+
to: string;
|
|
587
|
+
}>;
|
|
588
|
+
hubs: Array<{
|
|
589
|
+
node: string;
|
|
590
|
+
degree: number;
|
|
591
|
+
}>;
|
|
592
|
+
}
|
|
593
|
+
interface WikiGraphNeighborhood {
|
|
594
|
+
node: string;
|
|
595
|
+
exists: boolean;
|
|
596
|
+
outgoing: string[];
|
|
597
|
+
incoming: string[];
|
|
598
|
+
}
|
|
599
|
+
declare function graphIndexPath(workspacePath: string): string;
|
|
600
|
+
declare function buildWikiLinkGraph(workspacePath: string): WikiGraphIndex;
|
|
601
|
+
declare function refreshWikiLinkGraphIndex(workspacePath: string): WikiGraphIndex;
|
|
602
|
+
declare function readWikiLinkGraphIndex(workspacePath: string): WikiGraphIndex | null;
|
|
603
|
+
declare function graphHygieneReport(workspacePath: string): {
|
|
604
|
+
generatedAt: string;
|
|
605
|
+
nodeCount: number;
|
|
606
|
+
edgeCount: number;
|
|
607
|
+
orphanCount: number;
|
|
608
|
+
brokenLinkCount: number;
|
|
609
|
+
hubs: Array<{
|
|
610
|
+
node: string;
|
|
611
|
+
degree: number;
|
|
612
|
+
}>;
|
|
613
|
+
orphans: string[];
|
|
614
|
+
brokenLinks: Array<{
|
|
615
|
+
from: string;
|
|
616
|
+
to: string;
|
|
617
|
+
}>;
|
|
618
|
+
};
|
|
619
|
+
declare function graphNeighborhood(workspacePath: string, nodeRef: string, options?: {
|
|
620
|
+
refresh?: boolean;
|
|
621
|
+
}): WikiGraphNeighborhood;
|
|
622
|
+
|
|
623
|
+
type graph_WikiGraphEdge = WikiGraphEdge;
|
|
624
|
+
type graph_WikiGraphIndex = WikiGraphIndex;
|
|
625
|
+
type graph_WikiGraphNeighborhood = WikiGraphNeighborhood;
|
|
626
|
+
declare const graph_buildWikiLinkGraph: typeof buildWikiLinkGraph;
|
|
627
|
+
declare const graph_graphHygieneReport: typeof graphHygieneReport;
|
|
628
|
+
declare const graph_graphIndexPath: typeof graphIndexPath;
|
|
629
|
+
declare const graph_graphNeighborhood: typeof graphNeighborhood;
|
|
630
|
+
declare const graph_readWikiLinkGraphIndex: typeof readWikiLinkGraphIndex;
|
|
631
|
+
declare const graph_refreshWikiLinkGraphIndex: typeof refreshWikiLinkGraphIndex;
|
|
632
|
+
declare namespace graph {
|
|
633
|
+
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 };
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Obsidian Kanban board generation and sync helpers.
|
|
638
|
+
*/
|
|
639
|
+
interface BoardOptions {
|
|
640
|
+
outputPath?: string;
|
|
641
|
+
includeCancelled?: boolean;
|
|
642
|
+
}
|
|
643
|
+
interface BoardResult {
|
|
644
|
+
outputPath: string;
|
|
645
|
+
generatedAt: string;
|
|
646
|
+
counts: {
|
|
647
|
+
backlog: number;
|
|
648
|
+
inProgress: number;
|
|
649
|
+
blocked: number;
|
|
650
|
+
done: number;
|
|
651
|
+
cancelled: number;
|
|
652
|
+
};
|
|
653
|
+
content: string;
|
|
654
|
+
}
|
|
655
|
+
declare function generateKanbanBoard(workspacePath: string, options?: BoardOptions): BoardResult;
|
|
656
|
+
declare function syncKanbanBoard(workspacePath: string, options?: BoardOptions): BoardResult;
|
|
657
|
+
|
|
658
|
+
type board_BoardOptions = BoardOptions;
|
|
659
|
+
type board_BoardResult = BoardResult;
|
|
660
|
+
declare const board_generateKanbanBoard: typeof generateKanbanBoard;
|
|
661
|
+
declare const board_syncKanbanBoard: typeof syncKanbanBoard;
|
|
662
|
+
declare namespace board {
|
|
663
|
+
export { type board_BoardOptions as BoardOptions, type board_BoardResult as BoardResult, board_generateKanbanBoard as generateKanbanBoard, board_syncKanbanBoard as syncKanbanBoard };
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Policy registry and status transition gates.
|
|
668
|
+
*/
|
|
669
|
+
|
|
670
|
+
interface PolicyDecision {
|
|
671
|
+
allowed: boolean;
|
|
672
|
+
reason?: string;
|
|
673
|
+
}
|
|
674
|
+
declare function policyPath(workspacePath: string): string;
|
|
675
|
+
declare function loadPolicyRegistry(workspacePath: string): PolicyRegistry;
|
|
676
|
+
declare function savePolicyRegistry(workspacePath: string, registry: PolicyRegistry): void;
|
|
677
|
+
declare function upsertParty(workspacePath: string, partyId: string, updates: {
|
|
678
|
+
roles?: string[];
|
|
679
|
+
capabilities?: string[];
|
|
680
|
+
}): PolicyParty;
|
|
681
|
+
declare function getParty(workspacePath: string, partyId: string): PolicyParty | null;
|
|
682
|
+
declare function canTransitionStatus(workspacePath: string, actor: string, primitiveType: string, fromStatus: string | undefined, toStatus: string | undefined): PolicyDecision;
|
|
683
|
+
|
|
684
|
+
type policy_PolicyDecision = PolicyDecision;
|
|
685
|
+
declare const policy_canTransitionStatus: typeof canTransitionStatus;
|
|
686
|
+
declare const policy_getParty: typeof getParty;
|
|
687
|
+
declare const policy_loadPolicyRegistry: typeof loadPolicyRegistry;
|
|
688
|
+
declare const policy_policyPath: typeof policyPath;
|
|
689
|
+
declare const policy_savePolicyRegistry: typeof savePolicyRegistry;
|
|
690
|
+
declare const policy_upsertParty: typeof upsertParty;
|
|
691
|
+
declare namespace policy {
|
|
692
|
+
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 };
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Runtime dispatch contract (MVP local adapter).
|
|
697
|
+
*/
|
|
698
|
+
|
|
699
|
+
interface DispatchCreateInput {
|
|
700
|
+
actor: string;
|
|
701
|
+
adapter?: string;
|
|
702
|
+
objective: string;
|
|
703
|
+
context?: Record<string, unknown>;
|
|
704
|
+
idempotencyKey?: string;
|
|
705
|
+
}
|
|
706
|
+
declare function createRun(workspacePath: string, input: DispatchCreateInput): DispatchRun;
|
|
707
|
+
declare function status(workspacePath: string, runId: string): DispatchRun;
|
|
708
|
+
declare function followup(workspacePath: string, runId: string, actor: string, input: string): DispatchRun;
|
|
709
|
+
declare function stop(workspacePath: string, runId: string, actor: string): DispatchRun;
|
|
710
|
+
declare function markRun(workspacePath: string, runId: string, actor: string, nextStatus: Exclude<RunStatus, 'queued'>, options?: {
|
|
711
|
+
output?: string;
|
|
712
|
+
error?: string;
|
|
713
|
+
}): DispatchRun;
|
|
714
|
+
declare function logs(workspacePath: string, runId: string): DispatchRun['logs'];
|
|
715
|
+
declare function listRuns(workspacePath: string, options?: {
|
|
716
|
+
status?: RunStatus;
|
|
717
|
+
limit?: number;
|
|
718
|
+
}): DispatchRun[];
|
|
719
|
+
|
|
720
|
+
type dispatch_DispatchCreateInput = DispatchCreateInput;
|
|
721
|
+
declare const dispatch_createRun: typeof createRun;
|
|
722
|
+
declare const dispatch_followup: typeof followup;
|
|
723
|
+
declare const dispatch_listRuns: typeof listRuns;
|
|
724
|
+
declare const dispatch_logs: typeof logs;
|
|
725
|
+
declare const dispatch_markRun: typeof markRun;
|
|
726
|
+
declare const dispatch_status: typeof status;
|
|
727
|
+
declare const dispatch_stop: typeof stop;
|
|
728
|
+
declare namespace dispatch {
|
|
729
|
+
export { type dispatch_DispatchCreateInput as DispatchCreateInput, dispatch_createRun as createRun, dispatch_followup as followup, dispatch_listRuns as listRuns, dispatch_logs as logs, dispatch_markRun as markRun, dispatch_status as status, dispatch_stop as stop };
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Agent-first onboarding flow for new workgraph workspaces.
|
|
734
|
+
*/
|
|
735
|
+
|
|
736
|
+
interface OnboardOptions {
|
|
737
|
+
actor: string;
|
|
738
|
+
spaces?: string[];
|
|
739
|
+
createDemoThreads?: boolean;
|
|
740
|
+
}
|
|
741
|
+
interface OnboardResult {
|
|
742
|
+
actor: string;
|
|
743
|
+
spacesCreated: string[];
|
|
744
|
+
threadsCreated: string[];
|
|
745
|
+
boardPath: string;
|
|
746
|
+
commandCenterPath: string;
|
|
747
|
+
checkpointPath: string;
|
|
748
|
+
onboardingPath: string;
|
|
749
|
+
}
|
|
750
|
+
type OnboardingStatus = 'active' | 'completed' | 'paused';
|
|
751
|
+
declare function onboardWorkspace(workspacePath: string, options: OnboardOptions): OnboardResult;
|
|
752
|
+
declare function updateOnboardingStatus(workspacePath: string, onboardingPath: string, status: OnboardingStatus, actor: string): PrimitiveInstance;
|
|
753
|
+
|
|
754
|
+
type onboard_OnboardOptions = OnboardOptions;
|
|
755
|
+
type onboard_OnboardResult = OnboardResult;
|
|
756
|
+
type onboard_OnboardingStatus = OnboardingStatus;
|
|
757
|
+
declare const onboard_onboardWorkspace: typeof onboardWorkspace;
|
|
758
|
+
declare const onboard_updateOnboardingStatus: typeof updateOnboardingStatus;
|
|
759
|
+
declare namespace onboard {
|
|
760
|
+
export { type onboard_OnboardOptions as OnboardOptions, type onboard_OnboardResult as OnboardResult, type onboard_OnboardingStatus as OnboardingStatus, onboard_onboardWorkspace as onboardWorkspace, onboard_updateOnboardingStatus as updateOnboardingStatus };
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* QMD-compatible search adapter.
|
|
765
|
+
*
|
|
766
|
+
* This package intentionally degrades gracefully to core keyword search when
|
|
767
|
+
* a QMD backend is not configured.
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
interface QmdSearchOptions {
|
|
771
|
+
mode?: 'auto' | 'core' | 'qmd';
|
|
772
|
+
type?: string;
|
|
773
|
+
limit?: number;
|
|
774
|
+
}
|
|
775
|
+
interface QmdSearchResult {
|
|
776
|
+
mode: 'core' | 'qmd';
|
|
777
|
+
query: string;
|
|
778
|
+
results: PrimitiveInstance[];
|
|
779
|
+
fallbackReason?: string;
|
|
780
|
+
}
|
|
781
|
+
declare function search(workspacePath: string, text: string, options?: QmdSearchOptions): QmdSearchResult;
|
|
782
|
+
|
|
783
|
+
type searchQmdAdapter_QmdSearchOptions = QmdSearchOptions;
|
|
784
|
+
type searchQmdAdapter_QmdSearchResult = QmdSearchResult;
|
|
785
|
+
declare const searchQmdAdapter_search: typeof search;
|
|
786
|
+
declare namespace searchQmdAdapter {
|
|
787
|
+
export { type searchQmdAdapter_QmdSearchOptions as QmdSearchOptions, type searchQmdAdapter_QmdSearchResult as QmdSearchResult, searchQmdAdapter_search as search };
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Trigger-to-run dispatch helpers.
|
|
792
|
+
*/
|
|
793
|
+
|
|
794
|
+
interface FireTriggerOptions {
|
|
795
|
+
actor: string;
|
|
796
|
+
eventKey?: string;
|
|
797
|
+
objective?: string;
|
|
798
|
+
context?: Record<string, unknown>;
|
|
799
|
+
}
|
|
800
|
+
interface FireTriggerResult {
|
|
801
|
+
triggerPath: string;
|
|
802
|
+
run: DispatchRun;
|
|
803
|
+
idempotencyKey: string;
|
|
804
|
+
}
|
|
805
|
+
declare function fireTrigger(workspacePath: string, triggerPath: string, options: FireTriggerOptions): FireTriggerResult;
|
|
806
|
+
|
|
807
|
+
type trigger_FireTriggerOptions = FireTriggerOptions;
|
|
808
|
+
type trigger_FireTriggerResult = FireTriggerResult;
|
|
809
|
+
declare const trigger_fireTrigger: typeof fireTrigger;
|
|
810
|
+
declare namespace trigger {
|
|
811
|
+
export { type trigger_FireTriggerOptions as FireTriggerOptions, type trigger_FireTriggerResult as FireTriggerResult, trigger_fireTrigger as fireTrigger };
|
|
417
812
|
}
|
|
418
813
|
|
|
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 };
|
|
814
|
+
export { type DispatchRun, type FieldDefinition, type LedgerChainState, type LedgerEntry, type LedgerIndex, type LedgerOp, type PolicyParty, type PolicyRegistry, type PrimitiveInstance, type PrimitiveQueryFilters, type PrimitiveTypeDefinition, type Registry, type RunStatus, THREAD_STATUS_TRANSITIONS, type ThreadStatus, type WorkgraphBrief, type WorkgraphStatusSnapshot, type WorkgraphWorkspaceConfig, bases, board, commandCenter, dispatch, graph, ledger, onboard, orientation, policy, query, registry, searchQmdAdapter, skill, store, thread, trigger, workspace };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
THREAD_STATUS_TRANSITIONS,
|
|
3
3
|
bases_exports,
|
|
4
|
+
board_exports,
|
|
4
5
|
command_center_exports,
|
|
6
|
+
dispatch_exports,
|
|
7
|
+
graph_exports,
|
|
5
8
|
ledger_exports,
|
|
9
|
+
onboard_exports,
|
|
10
|
+
orientation_exports,
|
|
11
|
+
policy_exports,
|
|
12
|
+
query_exports,
|
|
6
13
|
registry_exports,
|
|
14
|
+
search_qmd_adapter_exports,
|
|
7
15
|
skill_exports,
|
|
8
16
|
store_exports,
|
|
9
17
|
thread_exports,
|
|
18
|
+
trigger_exports,
|
|
10
19
|
workspace_exports
|
|
11
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XUMA4O2Z.js";
|
|
12
21
|
export {
|
|
13
22
|
THREAD_STATUS_TRANSITIONS,
|
|
14
23
|
bases_exports as bases,
|
|
24
|
+
board_exports as board,
|
|
15
25
|
command_center_exports as commandCenter,
|
|
26
|
+
dispatch_exports as dispatch,
|
|
27
|
+
graph_exports as graph,
|
|
16
28
|
ledger_exports as ledger,
|
|
29
|
+
onboard_exports as onboard,
|
|
30
|
+
orientation_exports as orientation,
|
|
31
|
+
policy_exports as policy,
|
|
32
|
+
query_exports as query,
|
|
17
33
|
registry_exports as registry,
|
|
34
|
+
search_qmd_adapter_exports as searchQmdAdapter,
|
|
18
35
|
skill_exports as skill,
|
|
19
36
|
store_exports as store,
|
|
20
37
|
thread_exports as thread,
|
|
38
|
+
trigger_exports as trigger,
|
|
21
39
|
workspace_exports as workspace
|
|
22
40
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versatly/workgraph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Agent-first workgraph workspace for multi-agent coordination with dynamic primitives, append-only ledger, and markdown-native storage.",
|
|
5
|
+
"workspaces": [
|
|
6
|
+
"packages/*"
|
|
7
|
+
],
|
|
5
8
|
"type": "module",
|
|
6
9
|
"main": "dist/index.js",
|
|
7
10
|
"module": "dist/index.js",
|
|
@@ -28,9 +31,14 @@
|
|
|
28
31
|
],
|
|
29
32
|
"scripts": {
|
|
30
33
|
"build": "tsup src/index.ts src/cli.ts --format esm --dts --clean",
|
|
34
|
+
"build:packages": "npm run build --workspaces --if-present",
|
|
31
35
|
"typecheck": "tsc --noEmit",
|
|
36
|
+
"typecheck:packages": "npm run typecheck --workspaces --if-present",
|
|
32
37
|
"test": "vitest run --config vitest.config.ts",
|
|
33
|
-
"
|
|
38
|
+
"test:packages": "npm run test --workspaces --if-present",
|
|
39
|
+
"demo:workspace": "npm run build --silent && node scripts/generate-demo-workspace.mjs /tmp/workgraph-obsidian-demo",
|
|
40
|
+
"demo:obsidian-setup": "npm run build --silent && node scripts/setup-obsidian-demo.mjs /tmp/workgraph-obsidian-demo",
|
|
41
|
+
"ci": "npm run typecheck && npm run typecheck:packages && npm run test && npm run build",
|
|
34
42
|
"prepublishOnly": "npm run ci"
|
|
35
43
|
},
|
|
36
44
|
"keywords": [
|
|
@@ -45,12 +53,11 @@
|
|
|
45
53
|
"license": "MIT",
|
|
46
54
|
"repository": {
|
|
47
55
|
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/Versatly/
|
|
49
|
-
"directory": "packages/workgraph"
|
|
56
|
+
"url": "git+https://github.com/Versatly/workgraph.git"
|
|
50
57
|
},
|
|
51
|
-
"homepage": "https://github.com/Versatly/
|
|
58
|
+
"homepage": "https://github.com/Versatly/workgraph",
|
|
52
59
|
"bugs": {
|
|
53
|
-
"url": "https://github.com/Versatly/
|
|
60
|
+
"url": "https://github.com/Versatly/workgraph/issues"
|
|
54
61
|
},
|
|
55
62
|
"engines": {
|
|
56
63
|
"node": ">=18"
|
|
@@ -62,6 +69,8 @@
|
|
|
62
69
|
},
|
|
63
70
|
"devDependencies": {
|
|
64
71
|
"@types/node": "^20.11.0",
|
|
72
|
+
"ajv": "^8.18.0",
|
|
73
|
+
"ajv-formats": "^3.0.1",
|
|
65
74
|
"tsup": "^8.5.1",
|
|
66
75
|
"typescript": "^5.3.3",
|
|
67
76
|
"vitest": "^1.6.1"
|