clawvault 2.6.0 → 3.0.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/bin/command-registration.test.js +1 -3
- package/bin/register-core-commands.js +10 -23
- package/bin/register-maintenance-commands.js +3 -20
- package/bin/register-query-commands.js +23 -0
- package/bin/register-task-commands.js +1 -18
- package/bin/register-task-commands.test.js +0 -16
- package/bin/register-vault-operations-commands.js +1 -29
- package/dist/{chunk-QVMXF7FY.js → chunk-3D6BCTP6.js} +39 -1
- package/dist/{chunk-R2MIW5G7.js → chunk-3DHXQHYG.js} +1 -1
- package/dist/{chunk-Q2J5YTUF.js → chunk-3NSBOUT3.js} +73 -36
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-AZYOKJYC.js → chunk-62YTUT6J.js} +2 -2
- package/dist/chunk-6U6MK36V.js +205 -0
- package/dist/{chunk-4QYGFWRM.js → chunk-7R7O6STJ.js} +4 -4
- package/dist/{chunk-VXEOHTSL.js → chunk-C7OK5WKP.js} +4 -4
- package/dist/chunk-CMB7UL7C.js +327 -0
- package/dist/chunk-DEFFDRVP.js +938 -0
- package/dist/{chunk-K3CDT7IH.js → chunk-E7MFQB6D.js} +61 -20
- package/dist/{chunk-ME37YNW3.js → chunk-F2JEUD4J.js} +6 -4
- package/dist/chunk-GAJV4IGR.js +82 -0
- package/dist/chunk-GQSLDZTS.js +560 -0
- package/dist/{chunk-4OXMU5S2.js → chunk-GUKMRGM7.js} +1 -1
- package/dist/{chunk-YOSEUUNB.js → chunk-H34S76MB.js} +6 -6
- package/dist/{chunk-4TE4JMLA.js → chunk-JY6FYXIT.js} +10 -5
- package/dist/chunk-K234IDRJ.js +1073 -0
- package/dist/{chunk-IEVLHNLU.js → chunk-LNJA2UGL.js} +86 -9
- package/dist/{chunk-MFAWT5O5.js → chunk-LYHGEHXG.js} +1 -0
- package/dist/chunk-MFM6K7PU.js +374 -0
- package/dist/{chunk-QWQ3TIKS.js → chunk-N2AXRYLC.js} +1 -1
- package/dist/chunk-PAH27GSN.js +108 -0
- package/dist/{chunk-OIWVQYQF.js → chunk-QBLMXKF2.js} +1 -1
- package/dist/{chunk-FHFUXL6G.js → chunk-QK3UCXWL.js} +2 -2
- package/dist/{chunk-2YDBJS7M.js → chunk-SJSFRIYS.js} +1 -1
- package/dist/{chunk-GSD4ALSI.js → chunk-U55BGUAU.js} +2 -2
- package/dist/{chunk-PBEE567J.js → chunk-VGLOTGAS.js} +1 -1
- package/dist/{chunk-F55HGNU4.js → chunk-WAZ3NLWL.js} +47 -0
- package/dist/{chunk-KL4NAOMO.js → chunk-WGRQ6HDV.js} +1 -1
- package/dist/{chunk-UEOUADMO.js → chunk-YKTA5JOJ.js} +13 -10
- package/dist/{chunk-XAVB4GB4.js → chunk-ZVVFWOLW.js} +4 -4
- package/dist/cli/index.cjs +10033 -0
- package/dist/cli/index.d.cts +5 -0
- package/dist/cli/index.js +20 -18
- package/dist/commands/archive.cjs +287 -0
- package/dist/commands/archive.d.cts +11 -0
- package/dist/commands/archive.js +1 -0
- package/dist/commands/backlog.cjs +721 -0
- package/dist/commands/backlog.d.cts +53 -0
- package/dist/commands/backlog.js +3 -2
- package/dist/commands/blocked.cjs +204 -0
- package/dist/commands/blocked.d.cts +26 -0
- package/dist/commands/blocked.js +3 -2
- package/dist/commands/checkpoint.cjs +244 -0
- package/dist/commands/checkpoint.d.cts +41 -0
- package/dist/commands/checkpoint.js +2 -1
- package/dist/commands/compat.cjs +369 -0
- package/dist/commands/compat.d.cts +28 -0
- package/dist/commands/compat.js +2 -1
- package/dist/commands/context.cjs +2989 -0
- package/dist/commands/context.d.cts +2 -0
- package/dist/commands/context.js +5 -4
- package/dist/commands/doctor.cjs +3062 -0
- package/dist/commands/doctor.d.cts +21 -0
- package/dist/commands/doctor.d.ts +6 -1
- package/dist/commands/doctor.js +13 -11
- package/dist/commands/embed.cjs +232 -0
- package/dist/commands/embed.d.cts +17 -0
- package/dist/commands/embed.js +5 -2
- package/dist/commands/entities.cjs +141 -0
- package/dist/commands/entities.d.cts +7 -0
- package/dist/commands/entities.js +1 -0
- package/dist/commands/graph.cjs +501 -0
- package/dist/commands/graph.d.cts +21 -0
- package/dist/commands/graph.js +1 -0
- package/dist/commands/inject.cjs +1636 -0
- package/dist/commands/inject.d.cts +2 -0
- package/dist/commands/inject.d.ts +1 -1
- package/dist/commands/inject.js +4 -2
- package/dist/commands/kanban.cjs +884 -0
- package/dist/commands/kanban.d.cts +63 -0
- package/dist/commands/kanban.js +4 -3
- package/dist/commands/link.cjs +965 -0
- package/dist/commands/link.d.cts +11 -0
- package/dist/commands/link.js +1 -0
- package/dist/commands/migrate-observations.cjs +362 -0
- package/dist/commands/migrate-observations.d.cts +19 -0
- package/dist/commands/migrate-observations.js +3 -2
- package/dist/commands/observe.cjs +4099 -0
- package/dist/commands/observe.d.cts +23 -0
- package/dist/commands/observe.d.ts +1 -0
- package/dist/commands/observe.js +11 -9
- package/dist/commands/project.cjs +1341 -0
- package/dist/commands/project.d.cts +85 -0
- package/dist/commands/project.js +5 -4
- package/dist/commands/rebuild.cjs +3136 -0
- package/dist/commands/rebuild.d.cts +11 -0
- package/dist/commands/rebuild.js +10 -8
- package/dist/commands/recover.cjs +361 -0
- package/dist/commands/recover.d.cts +38 -0
- package/dist/commands/recover.js +3 -2
- package/dist/commands/reflect.cjs +1008 -0
- package/dist/commands/reflect.d.cts +11 -0
- package/dist/commands/reflect.js +6 -4
- package/dist/commands/repair-session.cjs +457 -0
- package/dist/commands/repair-session.d.cts +38 -0
- package/dist/commands/repair-session.js +1 -0
- package/dist/commands/replay.cjs +4103 -0
- package/dist/commands/replay.d.cts +16 -0
- package/dist/commands/replay.js +12 -10
- package/dist/commands/session-recap.cjs +353 -0
- package/dist/commands/session-recap.d.cts +27 -0
- package/dist/commands/session-recap.js +1 -0
- package/dist/commands/setup.cjs +1345 -0
- package/dist/commands/setup.d.cts +100 -0
- package/dist/commands/setup.d.ts +90 -2
- package/dist/commands/setup.js +21 -2
- package/dist/commands/shell-init.cjs +75 -0
- package/dist/commands/shell-init.d.cts +7 -0
- package/dist/commands/shell-init.js +2 -0
- package/dist/commands/sleep.cjs +6028 -0
- package/dist/commands/sleep.d.cts +36 -0
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +17 -15
- package/dist/commands/status.cjs +2736 -0
- package/dist/commands/status.d.cts +52 -0
- package/dist/commands/status.js +12 -10
- package/dist/commands/tailscale.cjs +1532 -0
- package/dist/commands/tailscale.d.cts +52 -0
- package/dist/commands/tailscale.js +1 -0
- package/dist/commands/task.cjs +1236 -0
- package/dist/commands/task.d.cts +97 -0
- package/dist/commands/task.js +4 -3
- package/dist/commands/template.cjs +457 -0
- package/dist/commands/template.d.cts +36 -0
- package/dist/commands/template.js +2 -1
- package/dist/commands/wake.cjs +2626 -0
- package/dist/commands/wake.d.cts +22 -0
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +12 -11
- package/dist/context-BUGaWpyL.d.cts +46 -0
- package/dist/index.cjs +14526 -0
- package/dist/index.d.cts +858 -0
- package/dist/index.d.ts +192 -7
- package/dist/index.js +101 -75
- package/dist/{inject-x65KXWPk.d.ts → inject-Bzi5E-By.d.cts} +1 -1
- package/dist/inject-Bzi5E-By.d.ts +137 -0
- package/dist/lib/auto-linker.cjs +176 -0
- package/dist/lib/auto-linker.d.cts +26 -0
- package/dist/lib/auto-linker.js +1 -0
- package/dist/lib/canvas-layout.cjs +136 -0
- package/dist/lib/canvas-layout.d.cts +31 -0
- package/dist/lib/canvas-layout.d.ts +16 -100
- package/dist/lib/canvas-layout.js +78 -20
- package/dist/lib/config.cjs +78 -0
- package/dist/lib/config.d.cts +11 -0
- package/dist/lib/config.js +1 -0
- package/dist/lib/entity-index.cjs +84 -0
- package/dist/lib/entity-index.d.cts +26 -0
- package/dist/lib/entity-index.js +1 -0
- package/dist/lib/project-utils.cjs +864 -0
- package/dist/lib/project-utils.d.cts +97 -0
- package/dist/lib/project-utils.js +4 -3
- package/dist/lib/session-repair.cjs +239 -0
- package/dist/lib/session-repair.d.cts +110 -0
- package/dist/lib/session-repair.js +1 -0
- package/dist/lib/session-utils.cjs +209 -0
- package/dist/lib/session-utils.d.cts +63 -0
- package/dist/lib/session-utils.js +1 -0
- package/dist/lib/tailscale.cjs +1183 -0
- package/dist/lib/tailscale.d.cts +225 -0
- package/dist/lib/tailscale.js +1 -0
- package/dist/lib/task-utils.cjs +1137 -0
- package/dist/lib/task-utils.d.cts +208 -0
- package/dist/lib/task-utils.js +3 -2
- package/dist/lib/template-engine.cjs +47 -0
- package/dist/lib/template-engine.d.cts +11 -0
- package/dist/lib/template-engine.js +1 -0
- package/dist/lib/webdav.cjs +568 -0
- package/dist/lib/webdav.d.cts +109 -0
- package/dist/lib/webdav.js +1 -0
- package/dist/plugin/index.cjs +1907 -0
- package/dist/plugin/index.d.cts +36 -0
- package/dist/plugin/index.d.ts +36 -0
- package/dist/plugin/index.js +572 -0
- package/dist/plugin/inject.cjs +356 -0
- package/dist/plugin/inject.d.cts +54 -0
- package/dist/plugin/inject.d.ts +54 -0
- package/dist/plugin/inject.js +17 -0
- package/dist/plugin/observe.cjs +631 -0
- package/dist/plugin/observe.d.cts +39 -0
- package/dist/plugin/observe.d.ts +39 -0
- package/dist/plugin/observe.js +18 -0
- package/dist/plugin/templates.cjs +593 -0
- package/dist/plugin/templates.d.cts +52 -0
- package/dist/plugin/templates.d.ts +52 -0
- package/dist/plugin/templates.js +25 -0
- package/dist/plugin/types.cjs +18 -0
- package/dist/plugin/types.d.cts +209 -0
- package/dist/plugin/types.d.ts +209 -0
- package/dist/plugin/types.js +0 -0
- package/dist/plugin/vault.cjs +927 -0
- package/dist/plugin/vault.d.cts +68 -0
- package/dist/plugin/vault.d.ts +68 -0
- package/dist/plugin/vault.js +22 -0
- package/dist/{types-C74wgGL1.d.ts → types-Y2_Um2Ls.d.cts} +44 -1
- package/dist/types-Y2_Um2Ls.d.ts +205 -0
- package/hooks/clawvault/handler.js +70 -7
- package/hooks/clawvault/handler.test.js +91 -0
- package/openclaw.plugin.json +56 -0
- package/package.json +17 -7
- package/templates/memory-event.md +67 -0
- package/templates/party.md +63 -0
- package/templates/primitive-registry.yaml +551 -0
- package/templates/run.md +68 -0
- package/templates/trigger.md +68 -0
- package/templates/workspace.md +50 -0
- package/dashboard/lib/graph-diff.js +0 -104
- package/dashboard/lib/graph-diff.test.js +0 -75
- package/dashboard/lib/vault-parser.js +0 -556
- package/dashboard/lib/vault-parser.test.js +0 -254
- package/dashboard/public/app.js +0 -796
- package/dashboard/public/index.html +0 -52
- package/dashboard/public/styles.css +0 -221
- package/dashboard/server.js +0 -374
- package/dist/chunk-HA5M6KJB.js +0 -33
- package/dist/chunk-MAKNAHAW.js +0 -375
- package/dist/chunk-MDIH26GC.js +0 -183
- package/dist/chunk-MGDEINGP.js +0 -99
- package/dist/chunk-RVYA52PY.js +0 -363
- package/dist/commands/canvas.d.ts +0 -15
- package/dist/commands/canvas.js +0 -199
- package/dist/commands/sync-bd.d.ts +0 -10
- package/dist/commands/sync-bd.js +0 -9
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
declare const MEMORY_GRAPH_SCHEMA_VERSION = 1;
|
|
4
|
+
type NodeCategory = 'note' | 'daily' | 'observation' | 'handoff' | 'decision' | 'lesson' | 'project' | 'person' | 'commitment' | 'tag' | 'unresolved';
|
|
5
|
+
type MemoryGraphNodeType = NodeCategory;
|
|
6
|
+
type MemoryGraphEdgeType = 'wiki_link' | 'tag' | 'frontmatter_relation';
|
|
7
|
+
interface MemoryGraphNode {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
type: MemoryGraphNodeType;
|
|
11
|
+
category: string;
|
|
12
|
+
path: string | null;
|
|
13
|
+
tags: string[];
|
|
14
|
+
missing: boolean;
|
|
15
|
+
degree: number;
|
|
16
|
+
modifiedAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
interface MemoryGraphEdge {
|
|
19
|
+
id: string;
|
|
20
|
+
source: string;
|
|
21
|
+
target: string;
|
|
22
|
+
type: MemoryGraphEdgeType;
|
|
23
|
+
label?: string;
|
|
24
|
+
}
|
|
25
|
+
interface MemoryGraphStats {
|
|
26
|
+
generatedAt: string;
|
|
27
|
+
nodeCount: number;
|
|
28
|
+
edgeCount: number;
|
|
29
|
+
nodeTypeCounts: Record<string, number>;
|
|
30
|
+
edgeTypeCounts: Record<string, number>;
|
|
31
|
+
}
|
|
32
|
+
interface MemoryGraph {
|
|
33
|
+
schemaVersion: number;
|
|
34
|
+
nodes: MemoryGraphNode[];
|
|
35
|
+
edges: MemoryGraphEdge[];
|
|
36
|
+
stats: MemoryGraphStats;
|
|
37
|
+
}
|
|
38
|
+
interface MemoryGraphFileFragment {
|
|
39
|
+
relativePath: string;
|
|
40
|
+
mtimeMs: number;
|
|
41
|
+
nodes: MemoryGraphNode[];
|
|
42
|
+
edges: MemoryGraphEdge[];
|
|
43
|
+
}
|
|
44
|
+
interface MemoryGraphIndex {
|
|
45
|
+
schemaVersion: number;
|
|
46
|
+
vaultPath: string;
|
|
47
|
+
generatedAt: string;
|
|
48
|
+
files: Record<string, MemoryGraphFileFragment>;
|
|
49
|
+
graph: MemoryGraph;
|
|
50
|
+
}
|
|
51
|
+
interface BuildGraphIndexOptions {
|
|
52
|
+
forceFull?: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare function loadMemoryGraphIndex(vaultPath: string): MemoryGraphIndex | null;
|
|
55
|
+
declare function buildOrUpdateMemoryGraphIndex(vaultPathInput: string, options?: BuildGraphIndexOptions): Promise<MemoryGraphIndex>;
|
|
56
|
+
declare function getMemoryGraph(vaultPath: string, options?: {
|
|
57
|
+
refresh?: boolean;
|
|
58
|
+
}): Promise<MemoryGraph>;
|
|
59
|
+
|
|
60
|
+
type LlmProvider = 'anthropic' | 'openai' | 'gemini';
|
|
61
|
+
interface LlmCompletionOptions {
|
|
62
|
+
prompt: string;
|
|
63
|
+
provider?: LlmProvider | null;
|
|
64
|
+
model?: string;
|
|
65
|
+
systemPrompt?: string;
|
|
66
|
+
temperature?: number;
|
|
67
|
+
maxTokens?: number;
|
|
68
|
+
fetchImpl?: typeof fetch;
|
|
69
|
+
}
|
|
70
|
+
declare function resolveLlmProvider(fetchImpl?: typeof fetch): Promise<LlmProvider | null>;
|
|
71
|
+
declare function requestLlmCompletion(options: LlmCompletionOptions): Promise<string>;
|
|
72
|
+
|
|
73
|
+
declare const INJECTABLE_CATEGORIES: readonly ["rules", "decisions", "preferences"];
|
|
74
|
+
type InjectSourceCategory = (typeof INJECTABLE_CATEGORIES)[number];
|
|
75
|
+
type InjectMatchSource = 'trigger' | 'keyword' | 'entity' | 'graph_1hop' | 'llm_intent';
|
|
76
|
+
interface InjectableItem {
|
|
77
|
+
id: string;
|
|
78
|
+
category: InjectSourceCategory;
|
|
79
|
+
relativePath: string;
|
|
80
|
+
title: string;
|
|
81
|
+
content: string;
|
|
82
|
+
triggers: string[];
|
|
83
|
+
scope: string[];
|
|
84
|
+
priority: number;
|
|
85
|
+
searchKeywords: string[];
|
|
86
|
+
noteNodeId: string;
|
|
87
|
+
}
|
|
88
|
+
interface InjectMatchReason {
|
|
89
|
+
source: InjectMatchSource;
|
|
90
|
+
value: string;
|
|
91
|
+
weight: number;
|
|
92
|
+
}
|
|
93
|
+
interface InjectMatch {
|
|
94
|
+
item: InjectableItem;
|
|
95
|
+
score: number;
|
|
96
|
+
deterministicScore: number;
|
|
97
|
+
llmScore: number | null;
|
|
98
|
+
reasons: InjectMatchReason[];
|
|
99
|
+
}
|
|
100
|
+
interface InjectResult {
|
|
101
|
+
message: string;
|
|
102
|
+
generatedAt: string;
|
|
103
|
+
deterministicMs: number;
|
|
104
|
+
llmProvider: LlmProvider | null;
|
|
105
|
+
usedLlm: boolean;
|
|
106
|
+
matches: InjectMatch[];
|
|
107
|
+
}
|
|
108
|
+
interface InjectRuntimeOptions {
|
|
109
|
+
maxResults?: number;
|
|
110
|
+
useLlm?: boolean;
|
|
111
|
+
scope?: string | string[];
|
|
112
|
+
model?: string;
|
|
113
|
+
fetchImpl?: typeof fetch;
|
|
114
|
+
}
|
|
115
|
+
declare function indexInjectableItems(vaultPathInput: string): InjectableItem[];
|
|
116
|
+
declare function deterministicInjectMatches(params: {
|
|
117
|
+
message: string;
|
|
118
|
+
items: InjectableItem[];
|
|
119
|
+
graph: MemoryGraph;
|
|
120
|
+
scope?: string | string[];
|
|
121
|
+
}): InjectMatch[];
|
|
122
|
+
declare function runPromptInjection(vaultPathInput: string, message: string, options?: InjectRuntimeOptions): Promise<InjectResult>;
|
|
123
|
+
|
|
124
|
+
type InjectFormat = 'markdown' | 'json';
|
|
125
|
+
interface InjectCommandOptions {
|
|
126
|
+
vaultPath: string;
|
|
127
|
+
maxResults?: number;
|
|
128
|
+
useLlm?: boolean;
|
|
129
|
+
scope?: string | string[];
|
|
130
|
+
format?: InjectFormat;
|
|
131
|
+
model?: string;
|
|
132
|
+
}
|
|
133
|
+
declare function buildInjectionResult(message: string, options: InjectCommandOptions): Promise<InjectResult>;
|
|
134
|
+
declare function injectCommand(message: string, options: InjectCommandOptions): Promise<void>;
|
|
135
|
+
declare function registerInjectCommand(program: Command): void;
|
|
136
|
+
|
|
137
|
+
export { runPromptInjection as A, type InjectCommandOptions as I, type LlmCompletionOptions as L, MEMORY_GRAPH_SCHEMA_VERSION as M, type InjectFormat as a, type InjectMatch as b, type InjectMatchReason as c, type InjectMatchSource as d, type InjectResult as e, type InjectRuntimeOptions as f, type InjectSourceCategory as g, type InjectableItem as h, type LlmProvider as i, type MemoryGraph as j, type MemoryGraphEdge as k, type MemoryGraphEdgeType as l, type MemoryGraphIndex as m, type MemoryGraphNode as n, type MemoryGraphNodeType as o, type MemoryGraphStats as p, buildInjectionResult as q, buildOrUpdateMemoryGraphIndex as r, deterministicInjectMatches as s, getMemoryGraph as t, indexInjectableItems as u, injectCommand as v, loadMemoryGraphIndex as w, registerInjectCommand as x, requestLlmCompletion as y, resolveLlmProvider as z };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/lib/auto-linker.ts
|
|
31
|
+
var auto_linker_exports = {};
|
|
32
|
+
__export(auto_linker_exports, {
|
|
33
|
+
autoLink: () => autoLink,
|
|
34
|
+
dryRunLink: () => dryRunLink,
|
|
35
|
+
findUnlinkedMentions: () => findUnlinkedMentions
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(auto_linker_exports);
|
|
38
|
+
|
|
39
|
+
// src/lib/entity-index.ts
|
|
40
|
+
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
41
|
+
function getSortedAliases(index) {
|
|
42
|
+
const result = [];
|
|
43
|
+
for (const [alias, path] of index.entries) {
|
|
44
|
+
result.push({ alias, path });
|
|
45
|
+
}
|
|
46
|
+
result.sort((a, b) => b.alias.length - a.alias.length);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/lib/auto-linker.ts
|
|
51
|
+
function findProtectedRanges(content) {
|
|
52
|
+
const ranges = [];
|
|
53
|
+
const fmMatch = content.match(/^---\n[\s\S]*?\n---/);
|
|
54
|
+
if (fmMatch) {
|
|
55
|
+
ranges.push({ start: 0, end: fmMatch[0].length });
|
|
56
|
+
}
|
|
57
|
+
const codeBlockRegex = /```[\s\S]*?```|~~~[\s\S]*?~~~/g;
|
|
58
|
+
let match;
|
|
59
|
+
while ((match = codeBlockRegex.exec(content)) !== null) {
|
|
60
|
+
ranges.push({ start: match.index, end: match.index + match[0].length });
|
|
61
|
+
}
|
|
62
|
+
const inlineCodeRegex = /`[^`]+`/g;
|
|
63
|
+
while ((match = inlineCodeRegex.exec(content)) !== null) {
|
|
64
|
+
ranges.push({ start: match.index, end: match.index + match[0].length });
|
|
65
|
+
}
|
|
66
|
+
const wikiLinkRegex = /\[\[[^\]]+\]\]/g;
|
|
67
|
+
while ((match = wikiLinkRegex.exec(content)) !== null) {
|
|
68
|
+
ranges.push({ start: match.index, end: match.index + match[0].length });
|
|
69
|
+
}
|
|
70
|
+
const urlRegex = /https?:\/\/[^\s)>\]]+/g;
|
|
71
|
+
while ((match = urlRegex.exec(content)) !== null) {
|
|
72
|
+
ranges.push({ start: match.index, end: match.index + match[0].length });
|
|
73
|
+
}
|
|
74
|
+
return ranges;
|
|
75
|
+
}
|
|
76
|
+
function isProtected(pos, ranges) {
|
|
77
|
+
return ranges.some((r) => pos >= r.start && pos < r.end);
|
|
78
|
+
}
|
|
79
|
+
function createLineLookup(content) {
|
|
80
|
+
const lines = content.split("\n");
|
|
81
|
+
let charPos = 0;
|
|
82
|
+
const lineStarts = [];
|
|
83
|
+
for (const line of lines) {
|
|
84
|
+
lineStarts.push(charPos);
|
|
85
|
+
charPos += line.length + 1;
|
|
86
|
+
}
|
|
87
|
+
return (pos) => {
|
|
88
|
+
for (let i = lineStarts.length - 1; i >= 0; i--) {
|
|
89
|
+
if (pos >= lineStarts[i]) return i + 1;
|
|
90
|
+
}
|
|
91
|
+
return 1;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function autoLink(content, index) {
|
|
95
|
+
const protectedRanges = findProtectedRanges(content);
|
|
96
|
+
const sortedAliases = getSortedAliases(index);
|
|
97
|
+
const linkedEntities = /* @__PURE__ */ new Set();
|
|
98
|
+
let result = content;
|
|
99
|
+
let offset = 0;
|
|
100
|
+
for (const { alias, path } of sortedAliases) {
|
|
101
|
+
if (linkedEntities.has(path)) continue;
|
|
102
|
+
const escapedAlias = alias.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
103
|
+
const regex = new RegExp(`\\b${escapedAlias}\\b`, "gi");
|
|
104
|
+
let match;
|
|
105
|
+
while ((match = regex.exec(content)) !== null) {
|
|
106
|
+
const originalPos = match.index;
|
|
107
|
+
const adjustedPos = originalPos + offset;
|
|
108
|
+
if (isProtected(originalPos, protectedRanges)) continue;
|
|
109
|
+
const beforeMatch = result.substring(0, adjustedPos);
|
|
110
|
+
const openBrackets = (beforeMatch.match(/\[\[/g) || []).length;
|
|
111
|
+
const closeBrackets = (beforeMatch.match(/\]\]/g) || []).length;
|
|
112
|
+
if (openBrackets > closeBrackets) continue;
|
|
113
|
+
const originalText = match[0];
|
|
114
|
+
const replacement = originalText.toLowerCase() === path.split("/").pop()?.toLowerCase() ? `[[${path}]]` : `[[${path}|${originalText}]]`;
|
|
115
|
+
result = result.substring(0, adjustedPos) + replacement + result.substring(adjustedPos + originalText.length);
|
|
116
|
+
offset += replacement.length - originalText.length;
|
|
117
|
+
linkedEntities.add(path);
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
function dryRunLink(content, index) {
|
|
124
|
+
const protectedRanges = findProtectedRanges(content);
|
|
125
|
+
const sortedAliases = getSortedAliases(index);
|
|
126
|
+
const linkedEntities = /* @__PURE__ */ new Set();
|
|
127
|
+
const matches = [];
|
|
128
|
+
const getLineNumber = createLineLookup(content);
|
|
129
|
+
for (const { alias, path } of sortedAliases) {
|
|
130
|
+
if (linkedEntities.has(path)) continue;
|
|
131
|
+
const escapedAlias = alias.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
132
|
+
const regex = new RegExp(`\\b${escapedAlias}\\b`, "gi");
|
|
133
|
+
let match;
|
|
134
|
+
while ((match = regex.exec(content)) !== null) {
|
|
135
|
+
if (isProtected(match.index, protectedRanges)) continue;
|
|
136
|
+
matches.push({
|
|
137
|
+
alias: match[0],
|
|
138
|
+
path,
|
|
139
|
+
line: getLineNumber(match.index)
|
|
140
|
+
});
|
|
141
|
+
linkedEntities.add(path);
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return matches;
|
|
146
|
+
}
|
|
147
|
+
function findUnlinkedMentions(content, index) {
|
|
148
|
+
const protectedRanges = findProtectedRanges(content);
|
|
149
|
+
const sortedAliases = getSortedAliases(index);
|
|
150
|
+
const matches = [];
|
|
151
|
+
const seen = /* @__PURE__ */ new Set();
|
|
152
|
+
const getLineNumber = createLineLookup(content);
|
|
153
|
+
for (const { alias, path } of sortedAliases) {
|
|
154
|
+
if (seen.has(path)) continue;
|
|
155
|
+
const escapedAlias = alias.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
156
|
+
const regex = new RegExp(`\\b${escapedAlias}\\b`, "gi");
|
|
157
|
+
let match;
|
|
158
|
+
while ((match = regex.exec(content)) !== null) {
|
|
159
|
+
if (isProtected(match.index, protectedRanges)) continue;
|
|
160
|
+
matches.push({
|
|
161
|
+
alias: match[0],
|
|
162
|
+
path,
|
|
163
|
+
line: getLineNumber(match.index)
|
|
164
|
+
});
|
|
165
|
+
seen.add(path);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return matches;
|
|
170
|
+
}
|
|
171
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
172
|
+
0 && (module.exports = {
|
|
173
|
+
autoLink,
|
|
174
|
+
dryRunLink,
|
|
175
|
+
findUnlinkedMentions
|
|
176
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EntityIndex } from './entity-index.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Auto-link entities in markdown content.
|
|
5
|
+
* Only links first occurrence of each entity.
|
|
6
|
+
* Skips protected ranges (frontmatter, code, existing links, URLs).
|
|
7
|
+
*/
|
|
8
|
+
declare function autoLink(content: string, index: EntityIndex): string;
|
|
9
|
+
/**
|
|
10
|
+
* Show what would be linked (dry run)
|
|
11
|
+
*/
|
|
12
|
+
declare function dryRunLink(content: string, index: EntityIndex): Array<{
|
|
13
|
+
alias: string;
|
|
14
|
+
path: string;
|
|
15
|
+
line: number;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Find unlinked mentions of entities (suggested links).
|
|
19
|
+
*/
|
|
20
|
+
declare function findUnlinkedMentions(content: string, index: EntityIndex): Array<{
|
|
21
|
+
alias: string;
|
|
22
|
+
path: string;
|
|
23
|
+
line: number;
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
export { autoLink, dryRunLink, findUnlinkedMentions };
|
package/dist/lib/auto-linker.js
CHANGED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/lib/canvas-layout.ts
|
|
31
|
+
var canvas_layout_exports = {};
|
|
32
|
+
__export(canvas_layout_exports, {
|
|
33
|
+
CANVAS_COLORS: () => CANVAS_COLORS,
|
|
34
|
+
LAYOUT: () => LAYOUT,
|
|
35
|
+
createEdge: () => createEdge,
|
|
36
|
+
createFileNode: () => createFileNode,
|
|
37
|
+
createGroupNode: () => createGroupNode,
|
|
38
|
+
createGroupWithNodes: () => createGroupWithNodes,
|
|
39
|
+
createTextNode: () => createTextNode,
|
|
40
|
+
formatCanvasText: () => formatCanvasText,
|
|
41
|
+
generateId: () => generateId,
|
|
42
|
+
getPriorityColor: () => getPriorityColor,
|
|
43
|
+
stackNodesVertically: () => stackNodesVertically,
|
|
44
|
+
truncateText: () => truncateText
|
|
45
|
+
});
|
|
46
|
+
module.exports = __toCommonJS(canvas_layout_exports);
|
|
47
|
+
var crypto = __toESM(require("crypto"), 1);
|
|
48
|
+
var CANVAS_COLORS = {
|
|
49
|
+
RED: "1",
|
|
50
|
+
ORANGE: "2",
|
|
51
|
+
YELLOW: "3",
|
|
52
|
+
GREEN: "4",
|
|
53
|
+
CYAN: "5",
|
|
54
|
+
PURPLE: "6"
|
|
55
|
+
};
|
|
56
|
+
var LAYOUT = {
|
|
57
|
+
GROUP_PADDING: 20,
|
|
58
|
+
NODE_SPACING: 10,
|
|
59
|
+
HEADER_HEIGHT: 40
|
|
60
|
+
};
|
|
61
|
+
function generateId() {
|
|
62
|
+
return crypto.randomBytes(8).toString("hex");
|
|
63
|
+
}
|
|
64
|
+
function createTextNode(x, y, width, height, text, color) {
|
|
65
|
+
const node = { id: generateId(), type: "text", x, y, width, height, text };
|
|
66
|
+
if (color !== void 0) node.color = color;
|
|
67
|
+
return node;
|
|
68
|
+
}
|
|
69
|
+
function createFileNode(x, y, width, height, file, color) {
|
|
70
|
+
const node = { id: generateId(), type: "file", x, y, width, height, file };
|
|
71
|
+
if (color !== void 0) node.color = color;
|
|
72
|
+
return node;
|
|
73
|
+
}
|
|
74
|
+
function createGroupNode(x, y, width, height, label, color) {
|
|
75
|
+
const node = { id: generateId(), type: "group", x, y, width, height, label };
|
|
76
|
+
if (color !== void 0) node.color = color;
|
|
77
|
+
return node;
|
|
78
|
+
}
|
|
79
|
+
function createEdge(fromNode, fromSide, toNode, toSide, label, color) {
|
|
80
|
+
const edge = { id: generateId(), fromNode, fromSide, toNode, toSide };
|
|
81
|
+
if (label !== void 0) edge.label = label;
|
|
82
|
+
if (color !== void 0) edge.color = color;
|
|
83
|
+
return edge;
|
|
84
|
+
}
|
|
85
|
+
function stackNodesVertically(nodes, startX, startY, spacing) {
|
|
86
|
+
let currentY = startY;
|
|
87
|
+
const positioned = nodes.map((node) => {
|
|
88
|
+
const n = { ...node, x: startX, y: currentY };
|
|
89
|
+
currentY += node.height + spacing;
|
|
90
|
+
return n;
|
|
91
|
+
});
|
|
92
|
+
return { nodes: positioned, totalHeight: currentY - startY - spacing };
|
|
93
|
+
}
|
|
94
|
+
function createGroupWithNodes(x, y, width, label, childNodes, color) {
|
|
95
|
+
const padding = LAYOUT.GROUP_PADDING;
|
|
96
|
+
const headerHeight = LAYOUT.HEADER_HEIGHT;
|
|
97
|
+
const spacing = LAYOUT.NODE_SPACING;
|
|
98
|
+
const { nodes, totalHeight } = stackNodesVertically(childNodes, x + padding, y + headerHeight, spacing);
|
|
99
|
+
const groupHeight = headerHeight + totalHeight + padding;
|
|
100
|
+
const group = createGroupNode(x, y, width, Math.max(groupHeight, 100), label, color);
|
|
101
|
+
return { group, nodes };
|
|
102
|
+
}
|
|
103
|
+
function getPriorityColor(priority) {
|
|
104
|
+
switch (priority) {
|
|
105
|
+
case "critical":
|
|
106
|
+
return CANVAS_COLORS.RED;
|
|
107
|
+
case "high":
|
|
108
|
+
return CANVAS_COLORS.ORANGE;
|
|
109
|
+
case "medium":
|
|
110
|
+
return CANVAS_COLORS.YELLOW;
|
|
111
|
+
default:
|
|
112
|
+
return void 0;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function truncateText(text, maxLength) {
|
|
116
|
+
if (text.length <= maxLength) return text;
|
|
117
|
+
return text.slice(0, maxLength - 3) + "...";
|
|
118
|
+
}
|
|
119
|
+
function formatCanvasText(lines) {
|
|
120
|
+
return lines.join("\n");
|
|
121
|
+
}
|
|
122
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
123
|
+
0 && (module.exports = {
|
|
124
|
+
CANVAS_COLORS,
|
|
125
|
+
LAYOUT,
|
|
126
|
+
createEdge,
|
|
127
|
+
createFileNode,
|
|
128
|
+
createGroupNode,
|
|
129
|
+
createGroupWithNodes,
|
|
130
|
+
createTextNode,
|
|
131
|
+
formatCanvasText,
|
|
132
|
+
generateId,
|
|
133
|
+
getPriorityColor,
|
|
134
|
+
stackNodesVertically,
|
|
135
|
+
truncateText
|
|
136
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const CANVAS_COLORS: {
|
|
2
|
+
readonly RED: "1";
|
|
3
|
+
readonly ORANGE: "2";
|
|
4
|
+
readonly YELLOW: "3";
|
|
5
|
+
readonly GREEN: "4";
|
|
6
|
+
readonly CYAN: "5";
|
|
7
|
+
readonly PURPLE: "6";
|
|
8
|
+
};
|
|
9
|
+
declare const LAYOUT: {
|
|
10
|
+
readonly GROUP_PADDING: 20;
|
|
11
|
+
readonly NODE_SPACING: 10;
|
|
12
|
+
readonly HEADER_HEIGHT: 40;
|
|
13
|
+
};
|
|
14
|
+
declare function generateId(): string;
|
|
15
|
+
declare function createTextNode(x: number, y: number, width: number, height: number, text: string, color?: string): any;
|
|
16
|
+
declare function createFileNode(x: number, y: number, width: number, height: number, file: string, color?: string): any;
|
|
17
|
+
declare function createGroupNode(x: number, y: number, width: number, height: number, label: string, color?: string): any;
|
|
18
|
+
declare function createEdge(fromNode: string, fromSide: string, toNode: string, toSide: string, label?: string, color?: string): any;
|
|
19
|
+
declare function stackNodesVertically(nodes: any[], startX: number, startY: number, spacing: number): {
|
|
20
|
+
nodes: any[];
|
|
21
|
+
totalHeight: number;
|
|
22
|
+
};
|
|
23
|
+
declare function createGroupWithNodes(x: number, y: number, width: number, label: string, childNodes: any[], color?: string): {
|
|
24
|
+
group: any;
|
|
25
|
+
nodes: any[];
|
|
26
|
+
};
|
|
27
|
+
declare function getPriorityColor(priority: string | undefined): string | undefined;
|
|
28
|
+
declare function truncateText(text: string, maxLength: number): string;
|
|
29
|
+
declare function formatCanvasText(lines: string[]): string;
|
|
30
|
+
|
|
31
|
+
export { CANVAS_COLORS, LAYOUT, createEdge, createFileNode, createGroupNode, createGroupWithNodes, createTextNode, formatCanvasText, generateId, getPriorityColor, stackNodesVertically, truncateText };
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canvas layout utilities for ClawVault
|
|
3
|
-
* Handles JSON Canvas generation with proper positioning and grouping
|
|
4
|
-
*/
|
|
5
|
-
interface CanvasNode {
|
|
6
|
-
id: string;
|
|
7
|
-
type: 'text' | 'file' | 'group';
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
text?: string;
|
|
13
|
-
file?: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
color?: string;
|
|
16
|
-
}
|
|
17
|
-
interface CanvasEdge {
|
|
18
|
-
id: string;
|
|
19
|
-
fromNode: string;
|
|
20
|
-
fromSide: 'top' | 'right' | 'bottom' | 'left';
|
|
21
|
-
toNode: string;
|
|
22
|
-
toSide: 'top' | 'right' | 'bottom' | 'left';
|
|
23
|
-
label?: string;
|
|
24
|
-
color?: string;
|
|
25
|
-
}
|
|
26
|
-
interface Canvas {
|
|
27
|
-
nodes: CanvasNode[];
|
|
28
|
-
edges: CanvasEdge[];
|
|
29
|
-
}
|
|
30
1
|
declare const CANVAS_COLORS: {
|
|
31
2
|
readonly RED: "1";
|
|
32
3
|
readonly ORANGE: "2";
|
|
@@ -36,80 +7,25 @@ declare const CANVAS_COLORS: {
|
|
|
36
7
|
readonly PURPLE: "6";
|
|
37
8
|
};
|
|
38
9
|
declare const LAYOUT: {
|
|
39
|
-
readonly LEFT_COLUMN_X: 0;
|
|
40
|
-
readonly LEFT_COLUMN_WIDTH: 500;
|
|
41
|
-
readonly RIGHT_COLUMN_X: 550;
|
|
42
|
-
readonly RIGHT_COLUMN_WIDTH: 450;
|
|
43
10
|
readonly GROUP_PADDING: 20;
|
|
44
|
-
readonly NODE_SPACING:
|
|
45
|
-
readonly
|
|
46
|
-
readonly DEFAULT_NODE_WIDTH: 280;
|
|
47
|
-
readonly DEFAULT_NODE_HEIGHT: 80;
|
|
48
|
-
readonly FILE_NODE_HEIGHT: 60;
|
|
49
|
-
readonly SMALL_NODE_HEIGHT: 50;
|
|
50
|
-
readonly GROUP_HEADER_HEIGHT: 40;
|
|
11
|
+
readonly NODE_SPACING: 10;
|
|
12
|
+
readonly HEADER_HEIGHT: 40;
|
|
51
13
|
};
|
|
52
|
-
/**
|
|
53
|
-
* Generate a 16-character lowercase hex ID
|
|
54
|
-
*/
|
|
55
14
|
declare function generateId(): string;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
declare function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*/
|
|
63
|
-
declare function createFileNode(x: number, y: number, width: number, height: number, file: string, color?: string): CanvasNode;
|
|
64
|
-
/**
|
|
65
|
-
* Create a group node
|
|
66
|
-
*/
|
|
67
|
-
declare function createGroupNode(x: number, y: number, width: number, height: number, label: string, color?: string): CanvasNode;
|
|
68
|
-
/**
|
|
69
|
-
* Create an edge between nodes
|
|
70
|
-
*/
|
|
71
|
-
declare function createEdge(fromNode: string, fromSide: 'top' | 'right' | 'bottom' | 'left', toNode: string, toSide: 'top' | 'right' | 'bottom' | 'left', label?: string, color?: string): CanvasEdge;
|
|
72
|
-
/**
|
|
73
|
-
* Layout helper for vertical stacking of nodes within a group
|
|
74
|
-
*/
|
|
75
|
-
interface StackedLayout {
|
|
76
|
-
nodes: CanvasNode[];
|
|
15
|
+
declare function createTextNode(x: number, y: number, width: number, height: number, text: string, color?: string): any;
|
|
16
|
+
declare function createFileNode(x: number, y: number, width: number, height: number, file: string, color?: string): any;
|
|
17
|
+
declare function createGroupNode(x: number, y: number, width: number, height: number, label: string, color?: string): any;
|
|
18
|
+
declare function createEdge(fromNode: string, fromSide: string, toNode: string, toSide: string, label?: string, color?: string): any;
|
|
19
|
+
declare function stackNodesVertically(nodes: any[], startX: number, startY: number, spacing: number): {
|
|
20
|
+
nodes: any[];
|
|
77
21
|
totalHeight: number;
|
|
78
|
-
}
|
|
79
|
-
declare function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
group: CanvasNode;
|
|
86
|
-
nodes: CanvasNode[];
|
|
87
|
-
}
|
|
88
|
-
declare function createGroupWithNodes(groupX: number, groupY: number, groupWidth: number, label: string, childNodes: CanvasNode[], color?: string): GroupWithNodes;
|
|
89
|
-
/**
|
|
90
|
-
* Get priority color for a task
|
|
91
|
-
*/
|
|
92
|
-
declare function getPriorityColor(priority?: string): string | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* Truncate text to fit within a certain width (approximate)
|
|
95
|
-
*/
|
|
96
|
-
declare function truncateText(text: string, maxChars: number): string;
|
|
97
|
-
/**
|
|
98
|
-
* Format markdown text for canvas node
|
|
99
|
-
* Replaces newlines with \n for JSON Canvas spec
|
|
100
|
-
*/
|
|
22
|
+
};
|
|
23
|
+
declare function createGroupWithNodes(x: number, y: number, width: number, label: string, childNodes: any[], color?: string): {
|
|
24
|
+
group: any;
|
|
25
|
+
nodes: any[];
|
|
26
|
+
};
|
|
27
|
+
declare function getPriorityColor(priority: string | undefined): string | undefined;
|
|
28
|
+
declare function truncateText(text: string, maxLength: number): string;
|
|
101
29
|
declare function formatCanvasText(lines: string[]): string;
|
|
102
|
-
/**
|
|
103
|
-
* Calculate the total height needed for a column of groups
|
|
104
|
-
*/
|
|
105
|
-
declare function calculateColumnHeight(groups: GroupWithNodes[]): number;
|
|
106
|
-
/**
|
|
107
|
-
* Position groups vertically in a column
|
|
108
|
-
*/
|
|
109
|
-
declare function positionGroupsVertically(groups: GroupWithNodes[], startY?: number): GroupWithNodes[];
|
|
110
|
-
/**
|
|
111
|
-
* Flatten groups and nodes into a single array
|
|
112
|
-
*/
|
|
113
|
-
declare function flattenGroups(groups: GroupWithNodes[]): CanvasNode[];
|
|
114
30
|
|
|
115
|
-
export { CANVAS_COLORS,
|
|
31
|
+
export { CANVAS_COLORS, LAYOUT, createEdge, createFileNode, createGroupNode, createGroupWithNodes, createTextNode, formatCanvasText, generateId, getPriorityColor, stackNodesVertically, truncateText };
|