@sudocode-ai/types 0.1.11 → 0.1.13
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/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +44 -0
- package/dist/migrations.js.map +1 -1
- package/dist/schema.d.ts +2 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -1
- package/package.json +6 -1
- package/src/index.d.ts +105 -1
- package/src/integrations.d.ts +346 -0
- package/dist/claude-to-ag-ui.d.ts +0 -90
- package/dist/claude-to-ag-ui.d.ts.map +0 -1
- package/dist/claude-to-ag-ui.js +0 -153
- package/dist/claude-to-ag-ui.js.map +0 -1
- package/dist/crdt.d.ts +0 -117
- package/dist/crdt.d.ts.map +0 -1
- package/dist/crdt.js +0 -8
- package/dist/crdt.js.map +0 -1
- package/dist/history.d.ts +0 -72
- package/dist/history.d.ts.map +0 -1
- package/dist/history.js +0 -7
- package/dist/history.js.map +0 -1
package/dist/migrations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;IACpC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;IACpC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;CACxC;AAudD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,MAAM,CAaxE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,SAAS,EAAE,SAAS,GACnB,IAAI,CAMN;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAwBzD"}
|
package/dist/migrations.js
CHANGED
|
@@ -342,6 +342,50 @@ const MIGRATIONS = [
|
|
|
342
342
|
`);
|
|
343
343
|
},
|
|
344
344
|
},
|
|
345
|
+
{
|
|
346
|
+
version: 4,
|
|
347
|
+
name: "add-external-links-column",
|
|
348
|
+
up: (db) => {
|
|
349
|
+
console.log(" [migration-4] Starting add-external-links-column migration");
|
|
350
|
+
// Check if specs table exists
|
|
351
|
+
const specsTables = db
|
|
352
|
+
.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='specs'")
|
|
353
|
+
.all();
|
|
354
|
+
console.log(` [migration-4] specs table exists: ${specsTables.length > 0}`);
|
|
355
|
+
if (specsTables.length > 0) {
|
|
356
|
+
// Add external_links column to specs table if it doesn't exist
|
|
357
|
+
const specsInfo = db.pragma("table_info(specs)");
|
|
358
|
+
const specsHasColumn = specsInfo.some((col) => col.name === "external_links");
|
|
359
|
+
console.log(` [migration-4] specs.external_links column exists: ${specsHasColumn}`);
|
|
360
|
+
if (!specsHasColumn) {
|
|
361
|
+
db.exec(`ALTER TABLE specs ADD COLUMN external_links TEXT;`);
|
|
362
|
+
console.log(" ✓ Added external_links column to specs table");
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
// Check if issues table exists
|
|
366
|
+
const issuesTables = db
|
|
367
|
+
.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='issues'")
|
|
368
|
+
.all();
|
|
369
|
+
console.log(` [migration-4] issues table exists: ${issuesTables.length > 0}`);
|
|
370
|
+
if (issuesTables.length > 0) {
|
|
371
|
+
// Add external_links column to issues table if it doesn't exist
|
|
372
|
+
const issuesInfo = db.pragma("table_info(issues)");
|
|
373
|
+
const issuesHasColumn = issuesInfo.some((col) => col.name === "external_links");
|
|
374
|
+
console.log(` [migration-4] issues.external_links column exists: ${issuesHasColumn}`);
|
|
375
|
+
if (!issuesHasColumn) {
|
|
376
|
+
db.exec(`ALTER TABLE issues ADD COLUMN external_links TEXT;`);
|
|
377
|
+
console.log(" ✓ Added external_links column to issues table");
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
console.log(" [migration-4] Migration complete");
|
|
381
|
+
},
|
|
382
|
+
down: (db) => {
|
|
383
|
+
// SQLite doesn't support DROP COLUMN in older versions
|
|
384
|
+
// For rollback, we'd need to recreate the tables without the column
|
|
385
|
+
// This is a non-destructive migration, so rollback is optional
|
|
386
|
+
console.log(" Note: external_links column cannot be removed (SQLite limitation)");
|
|
387
|
+
},
|
|
388
|
+
},
|
|
345
389
|
];
|
|
346
390
|
/**
|
|
347
391
|
* Get the current migration version from the database
|
package/dist/migrations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH;;GAEG;AACH,MAAM,UAAU,GAAgB;IAC9B;QACE,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,2BAA2B;QACjC,EAAE,EAAE,CAAC,EAAqB,EAAE,EAAE;YAC5B,6BAA6B;YAC7B,MAAM,SAAS,GAAG,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAEtD,CAAC;YAC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IAED,OAAO,CAAC,GAAG,CAAC,WAAW,iBAAiB,CAAC,MAAM,0BAA0B,CAAC,CAAC;IAE3E,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,wBAAwB,SAAS,CAAC,OAAO,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5E,IAAI,CAAC;YACH,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACjB,eAAe,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,iBAAiB,SAAS,CAAC,OAAO,uBAAuB,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,iBAAiB,SAAS,CAAC,OAAO,UAAU,EAAE,KAAK,CAAC,CAAC;YACnE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export declare const DB_CONFIG = "\n-- Enable WAL mode for better concurrency\nP
|
|
|
10
10
|
/**
|
|
11
11
|
* Core table schemas
|
|
12
12
|
*/
|
|
13
|
-
export declare const SPECS_TABLE = "\nCREATE TABLE IF NOT EXISTS specs (\n id TEXT PRIMARY KEY,\n uuid TEXT NOT NULL UNIQUE,\n title TEXT NOT NULL CHECK(length(title) <= 500),\n file_path TEXT NOT NULL,\n content TEXT NOT NULL DEFAULT '',\n priority INTEGER NOT NULL DEFAULT 2 CHECK(priority >= 0 AND priority <= 4),\n archived INTEGER NOT NULL DEFAULT 0 CHECK(archived IN (0, 1)),\n archived_at DATETIME,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n parent_id TEXT,\n parent_uuid TEXT,\n FOREIGN KEY (parent_id) REFERENCES specs(id) ON DELETE SET NULL,\n FOREIGN KEY (parent_uuid) REFERENCES specs(uuid) ON DELETE SET NULL\n);\n";
|
|
14
|
-
export declare const ISSUES_TABLE = "\nCREATE TABLE IF NOT EXISTS issues (\n id TEXT PRIMARY KEY,\n uuid TEXT NOT NULL UNIQUE,\n title TEXT NOT NULL CHECK(length(title) <= 500),\n content TEXT NOT NULL DEFAULT '',\n status TEXT NOT NULL DEFAULT 'open',\n priority INTEGER NOT NULL DEFAULT 2 CHECK(priority >= 0 AND priority <= 4),\n assignee TEXT,\n archived INTEGER NOT NULL DEFAULT 0 CHECK(archived IN (0, 1)),\n archived_at DATETIME,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n closed_at DATETIME,\n parent_id TEXT,\n parent_uuid TEXT,\n FOREIGN KEY (parent_id) REFERENCES issues(id) ON DELETE SET NULL,\n FOREIGN KEY (parent_uuid) REFERENCES issues(uuid) ON DELETE SET NULL\n);\n";
|
|
13
|
+
export declare const SPECS_TABLE = "\nCREATE TABLE IF NOT EXISTS specs (\n id TEXT PRIMARY KEY,\n uuid TEXT NOT NULL UNIQUE,\n title TEXT NOT NULL CHECK(length(title) <= 500),\n file_path TEXT NOT NULL,\n content TEXT NOT NULL DEFAULT '',\n priority INTEGER NOT NULL DEFAULT 2 CHECK(priority >= 0 AND priority <= 4),\n archived INTEGER NOT NULL DEFAULT 0 CHECK(archived IN (0, 1)),\n archived_at DATETIME,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n parent_id TEXT,\n parent_uuid TEXT,\n external_links TEXT,\n FOREIGN KEY (parent_id) REFERENCES specs(id) ON DELETE SET NULL,\n FOREIGN KEY (parent_uuid) REFERENCES specs(uuid) ON DELETE SET NULL\n);\n";
|
|
14
|
+
export declare const ISSUES_TABLE = "\nCREATE TABLE IF NOT EXISTS issues (\n id TEXT PRIMARY KEY,\n uuid TEXT NOT NULL UNIQUE,\n title TEXT NOT NULL CHECK(length(title) <= 500),\n content TEXT NOT NULL DEFAULT '',\n status TEXT NOT NULL DEFAULT 'open',\n priority INTEGER NOT NULL DEFAULT 2 CHECK(priority >= 0 AND priority <= 4),\n assignee TEXT,\n archived INTEGER NOT NULL DEFAULT 0 CHECK(archived IN (0, 1)),\n archived_at DATETIME,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n closed_at DATETIME,\n parent_id TEXT,\n parent_uuid TEXT,\n external_links TEXT,\n FOREIGN KEY (parent_id) REFERENCES issues(id) ON DELETE SET NULL,\n FOREIGN KEY (parent_uuid) REFERENCES issues(uuid) ON DELETE SET NULL\n);\n";
|
|
15
15
|
export declare const RELATIONSHIPS_TABLE = "\nCREATE TABLE IF NOT EXISTS relationships (\n from_id TEXT NOT NULL,\n from_uuid TEXT NOT NULL,\n from_type TEXT NOT NULL,\n to_id TEXT NOT NULL,\n to_uuid TEXT NOT NULL,\n to_type TEXT NOT NULL,\n relationship_type TEXT NOT NULL,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata TEXT,\n PRIMARY KEY (from_id, from_type, to_id, to_type, relationship_type)\n);\n";
|
|
16
16
|
export declare const TAGS_TABLE = "\nCREATE TABLE IF NOT EXISTS tags (\n entity_id TEXT NOT NULL,\n entity_uuid TEXT NOT NULL,\n entity_type TEXT NOT NULL,\n tag TEXT NOT NULL,\n PRIMARY KEY (entity_id, entity_type, tag)\n);\n";
|
|
17
17
|
export declare const EVENTS_TABLE = "\nCREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n entity_id TEXT NOT NULL,\n entity_uuid TEXT NOT NULL,\n entity_type TEXT NOT NULL,\n event_type TEXT NOT NULL,\n actor TEXT NOT NULL,\n old_value TEXT,\n new_value TEXT,\n comment TEXT,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n git_commit_sha TEXT,\n source TEXT\n);\n";
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,SAAS,uSAarB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,SAAS,uSAarB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,WAAW,muBAkBvB,CAAC;AAEF,eAAO,MAAM,YAAY,+xBAoBxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,iaAa/B,CAAC;AAEF,eAAO,MAAM,UAAU,mNAQtB,CAAC;AAEF,eAAO,MAAM,YAAY,uZAexB,CAAC;AAEF,eAAO,MAAM,oBAAoB,2qBAiBhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,0jDAwD5B,CAAC;AAGF,eAAO,MAAM,sBAAsB,ocAYlC,CAAC;AAOF,eAAO,MAAM,oBAAoB,4eAYhC,CAAC;AAIF,eAAO,MAAM,eAAe,67BAuB3B,CAAC;AAGF,eAAO,MAAM,qBAAqB,0mBAajC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,aAAa,oeAQzB,CAAC;AAEF,eAAO,MAAM,cAAc,+rBAW1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,seAOjC,CAAC;AAEF,eAAO,MAAM,YAAY,kOAIxB,CAAC;AAEF,eAAO,MAAM,cAAc,2cAO1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,+iBAQlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,0vBAU9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,oKAGpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,gRAIlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,6ZAM7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,+kBAOnC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,iBAAiB,gqBAkB7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,ovBAmB/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,UAYtB,CAAC;AAEF,eAAO,MAAM,WAAW,UAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,UAA2C,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -37,6 +37,7 @@ CREATE TABLE IF NOT EXISTS specs (
|
|
|
37
37
|
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
38
38
|
parent_id TEXT,
|
|
39
39
|
parent_uuid TEXT,
|
|
40
|
+
external_links TEXT,
|
|
40
41
|
FOREIGN KEY (parent_id) REFERENCES specs(id) ON DELETE SET NULL,
|
|
41
42
|
FOREIGN KEY (parent_uuid) REFERENCES specs(uuid) ON DELETE SET NULL
|
|
42
43
|
);
|
|
@@ -57,6 +58,7 @@ CREATE TABLE IF NOT EXISTS issues (
|
|
|
57
58
|
closed_at DATETIME,
|
|
58
59
|
parent_id TEXT,
|
|
59
60
|
parent_uuid TEXT,
|
|
61
|
+
external_links TEXT,
|
|
60
62
|
FOREIGN KEY (parent_id) REFERENCES issues(id) ON DELETE SET NULL,
|
|
61
63
|
FOREIGN KEY (parent_uuid) REFERENCES issues(uuid) ON DELETE SET NULL
|
|
62
64
|
);
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC;;GAEG;AACH,MAAM,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AEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudocode-ai/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "TypeScript type definitions for sudocode",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"types": "./src/workflows.d.ts",
|
|
22
22
|
"default": "./src/workflows.d.ts"
|
|
23
23
|
},
|
|
24
|
+
"./integrations": {
|
|
25
|
+
"types": "./src/integrations.d.ts",
|
|
26
|
+
"default": "./src/integrations.d.ts"
|
|
27
|
+
},
|
|
24
28
|
"./schema": {
|
|
25
29
|
"types": "./dist/schema.d.ts",
|
|
26
30
|
"default": "./dist/schema.js"
|
|
@@ -60,6 +64,7 @@
|
|
|
60
64
|
"src/agents.d.ts",
|
|
61
65
|
"src/artifacts.d.ts",
|
|
62
66
|
"src/workflows.d.ts",
|
|
67
|
+
"src/integrations.d.ts",
|
|
63
68
|
"dist"
|
|
64
69
|
],
|
|
65
70
|
"devDependencies": {
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core entity types for sudocode
|
|
3
3
|
*/
|
|
4
|
+
|
|
5
|
+
import type { IntegrationsConfig } from "./integrations.js";
|
|
6
|
+
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// Integration Types (External Links)
|
|
9
|
+
// =============================================================================
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Direction of sync between sudocode and external system
|
|
13
|
+
*/
|
|
14
|
+
export type SyncDirection = "inbound" | "outbound" | "bidirectional";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Strategy for resolving conflicts during sync
|
|
18
|
+
*/
|
|
19
|
+
export type ConflictResolution =
|
|
20
|
+
| "newest-wins"
|
|
21
|
+
| "sudocode-wins"
|
|
22
|
+
| "external-wins"
|
|
23
|
+
| "manual";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Integration provider name - any string to support plugins
|
|
27
|
+
* First-party providers: "beads", "jira", "spec-kit", "openspec"
|
|
28
|
+
* Third-party plugins can use any unique name
|
|
29
|
+
*/
|
|
30
|
+
export type IntegrationProviderName = string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Represents a link between a sudocode entity (Spec/Issue) and an external system
|
|
34
|
+
*/
|
|
35
|
+
export interface ExternalLink {
|
|
36
|
+
/** The integration provider this link belongs to (plugin name) */
|
|
37
|
+
provider: string;
|
|
38
|
+
/** Unique identifier in the external system */
|
|
39
|
+
external_id: string;
|
|
40
|
+
/** URL to view/edit in external system (optional) */
|
|
41
|
+
external_url?: string;
|
|
42
|
+
/** Whether sync is enabled for this link */
|
|
43
|
+
sync_enabled: boolean;
|
|
44
|
+
/** Direction of sync */
|
|
45
|
+
sync_direction: SyncDirection;
|
|
46
|
+
/** When this entity was last synced */
|
|
47
|
+
last_synced_at?: string;
|
|
48
|
+
/** Last known update time in external system */
|
|
49
|
+
external_updated_at?: string;
|
|
50
|
+
/** Provider-specific metadata */
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// Core Entities
|
|
56
|
+
// =============================================================================
|
|
57
|
+
|
|
4
58
|
export interface Spec {
|
|
5
59
|
id: string;
|
|
6
60
|
title: string;
|
|
@@ -14,6 +68,7 @@ export interface Spec {
|
|
|
14
68
|
updated_at: string;
|
|
15
69
|
parent_id?: string;
|
|
16
70
|
parent_uuid?: string;
|
|
71
|
+
external_links?: ExternalLink[];
|
|
17
72
|
}
|
|
18
73
|
|
|
19
74
|
export interface Issue {
|
|
@@ -31,6 +86,7 @@ export interface Issue {
|
|
|
31
86
|
closed_at?: string;
|
|
32
87
|
parent_id?: string;
|
|
33
88
|
parent_uuid?: string;
|
|
89
|
+
external_links?: ExternalLink[];
|
|
34
90
|
}
|
|
35
91
|
|
|
36
92
|
export type IssueStatus =
|
|
@@ -195,6 +251,28 @@ export interface WorktreeConfig {
|
|
|
195
251
|
cleanupOrphanedWorktreesOnStartup: boolean;
|
|
196
252
|
}
|
|
197
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Supported editor types for opening worktrees
|
|
256
|
+
*/
|
|
257
|
+
export type EditorType =
|
|
258
|
+
| "vs-code"
|
|
259
|
+
| "cursor"
|
|
260
|
+
| "windsurf"
|
|
261
|
+
| "intellij"
|
|
262
|
+
| "zed"
|
|
263
|
+
| "xcode"
|
|
264
|
+
| "custom";
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Editor configuration for IDE integration
|
|
268
|
+
*/
|
|
269
|
+
export interface EditorConfig {
|
|
270
|
+
/** The editor type to use */
|
|
271
|
+
editorType: EditorType;
|
|
272
|
+
/** Custom command when editorType is 'custom' */
|
|
273
|
+
customCommand?: string;
|
|
274
|
+
}
|
|
275
|
+
|
|
198
276
|
/**
|
|
199
277
|
* Config metadata file structure (.sudocode/config.json)
|
|
200
278
|
*/
|
|
@@ -203,6 +281,10 @@ export interface Config {
|
|
|
203
281
|
version: string;
|
|
204
282
|
/** Worktree configuration (optional) */
|
|
205
283
|
worktree?: WorktreeConfig;
|
|
284
|
+
/** Integration configurations (optional) */
|
|
285
|
+
integrations?: IntegrationsConfig;
|
|
286
|
+
/** Editor configuration (optional) */
|
|
287
|
+
editor?: EditorConfig;
|
|
206
288
|
}
|
|
207
289
|
|
|
208
290
|
/**
|
|
@@ -290,7 +372,7 @@ export type {
|
|
|
290
372
|
FileChangeStat,
|
|
291
373
|
ExecutionChangesResult,
|
|
292
374
|
ChangesSnapshot,
|
|
293
|
-
} from
|
|
375
|
+
} from "./artifacts.js";
|
|
294
376
|
|
|
295
377
|
/**
|
|
296
378
|
* Workflow types for multi-issue orchestration
|
|
@@ -328,3 +410,25 @@ export type {
|
|
|
328
410
|
CreateWorkflowOptions,
|
|
329
411
|
DependencyGraph,
|
|
330
412
|
} from "./workflows.js";
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Integration types for third-party systems
|
|
416
|
+
* See integrations.d.ts for detailed integration types
|
|
417
|
+
*/
|
|
418
|
+
export type {
|
|
419
|
+
// Configuration types
|
|
420
|
+
IntegrationProviderConfig,
|
|
421
|
+
IntegrationsConfig,
|
|
422
|
+
IntegrationConfig, // Deprecated alias
|
|
423
|
+
// Plugin types
|
|
424
|
+
IntegrationPlugin,
|
|
425
|
+
IntegrationProvider,
|
|
426
|
+
PluginValidationResult,
|
|
427
|
+
PluginTestResult,
|
|
428
|
+
PluginConfigSchema,
|
|
429
|
+
// Sync types
|
|
430
|
+
ExternalEntity,
|
|
431
|
+
ExternalChange,
|
|
432
|
+
SyncResult,
|
|
433
|
+
SyncConflict,
|
|
434
|
+
} from "./integrations.js";
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration plugin types for sudocode
|
|
3
|
+
*
|
|
4
|
+
* This module defines the plugin interface for external integrations.
|
|
5
|
+
* Provider-specific implementations should be in separate packages.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
SyncDirection,
|
|
10
|
+
ConflictResolution,
|
|
11
|
+
Spec,
|
|
12
|
+
Issue,
|
|
13
|
+
} from "./index.js";
|
|
14
|
+
|
|
15
|
+
// =============================================================================
|
|
16
|
+
// Plugin Configuration
|
|
17
|
+
// =============================================================================
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Base configuration for any integration provider
|
|
21
|
+
* Provider-specific options go in the `options` field
|
|
22
|
+
*/
|
|
23
|
+
export interface IntegrationProviderConfig {
|
|
24
|
+
/** npm package name or local path to the plugin */
|
|
25
|
+
plugin?: string;
|
|
26
|
+
/** Whether this integration is enabled */
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
/** Whether to automatically sync changes (default: false) */
|
|
29
|
+
auto_sync?: boolean;
|
|
30
|
+
/** Default sync direction for new links (default: 'bidirectional') */
|
|
31
|
+
default_sync_direction?: SyncDirection;
|
|
32
|
+
/** How to resolve sync conflicts (default: 'manual') */
|
|
33
|
+
conflict_resolution?: ConflictResolution;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to auto-import new entities from external system (default: true)
|
|
36
|
+
* When true, new issues/specs in the external system are automatically
|
|
37
|
+
* created as sudocode issues/specs with an external_link.
|
|
38
|
+
*/
|
|
39
|
+
auto_import?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* What to do when an external entity is deleted (default: 'close')
|
|
42
|
+
* - 'close': Close the linked sudocode issue (set status to 'closed')
|
|
43
|
+
* - 'delete': Delete the linked sudocode issue entirely
|
|
44
|
+
* - 'ignore': Do nothing, leave sudocode issue unchanged
|
|
45
|
+
*/
|
|
46
|
+
delete_behavior?: "close" | "delete" | "ignore";
|
|
47
|
+
/** Provider-specific configuration options */
|
|
48
|
+
options?: Record<string, unknown>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Top-level integrations configuration object
|
|
53
|
+
* Maps provider names to their configurations
|
|
54
|
+
*/
|
|
55
|
+
export interface IntegrationsConfig {
|
|
56
|
+
[providerName: string]: IntegrationProviderConfig | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// =============================================================================
|
|
60
|
+
// Plugin Interface
|
|
61
|
+
// =============================================================================
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Validation result from plugin
|
|
65
|
+
*/
|
|
66
|
+
export interface PluginValidationResult {
|
|
67
|
+
/** Whether the configuration is valid (no blocking errors) */
|
|
68
|
+
valid: boolean;
|
|
69
|
+
/** Blocking errors that prevent the plugin from working */
|
|
70
|
+
errors: string[];
|
|
71
|
+
/** Non-blocking warnings about the configuration */
|
|
72
|
+
warnings: string[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Result from testing a plugin's connection/setup
|
|
77
|
+
*/
|
|
78
|
+
export interface PluginTestResult {
|
|
79
|
+
/** Whether the test passed */
|
|
80
|
+
success: boolean;
|
|
81
|
+
/** Whether the plugin is configured */
|
|
82
|
+
configured: boolean;
|
|
83
|
+
/** Whether the plugin is enabled */
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
/** Error message if test failed */
|
|
86
|
+
error?: string;
|
|
87
|
+
/** Additional details about the test */
|
|
88
|
+
details?: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* JSON Schema for UI form generation (subset of JSON Schema)
|
|
93
|
+
*/
|
|
94
|
+
export interface PluginConfigSchema {
|
|
95
|
+
type: "object";
|
|
96
|
+
properties: Record<
|
|
97
|
+
string,
|
|
98
|
+
{
|
|
99
|
+
type: "string" | "boolean" | "number" | "array";
|
|
100
|
+
title?: string;
|
|
101
|
+
description?: string;
|
|
102
|
+
default?: unknown;
|
|
103
|
+
enum?: unknown[];
|
|
104
|
+
required?: boolean;
|
|
105
|
+
}
|
|
106
|
+
>;
|
|
107
|
+
required?: string[];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Interface that all integration plugins must implement
|
|
112
|
+
*
|
|
113
|
+
* Plugins are loaded dynamically and must export an object conforming to this interface.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* // In @sudocode-ai/integration-beads/src/index.ts
|
|
118
|
+
* import type { IntegrationPlugin } from '@sudocode-ai/types';
|
|
119
|
+
*
|
|
120
|
+
* const plugin: IntegrationPlugin = {
|
|
121
|
+
* name: 'beads',
|
|
122
|
+
* displayName: 'Beads',
|
|
123
|
+
* version: '1.0.0',
|
|
124
|
+
* // ... implement required methods
|
|
125
|
+
* };
|
|
126
|
+
*
|
|
127
|
+
* export default plugin;
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export interface IntegrationPlugin {
|
|
131
|
+
/** Unique plugin identifier (used as key in config) */
|
|
132
|
+
name: string;
|
|
133
|
+
/** Human-readable display name */
|
|
134
|
+
displayName: string;
|
|
135
|
+
/** Plugin version */
|
|
136
|
+
version: string;
|
|
137
|
+
/** Plugin description */
|
|
138
|
+
description?: string;
|
|
139
|
+
|
|
140
|
+
// ===========================================================================
|
|
141
|
+
// Configuration
|
|
142
|
+
// ===========================================================================
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* JSON Schema describing the plugin's options
|
|
146
|
+
* Used by UI to generate configuration forms
|
|
147
|
+
*/
|
|
148
|
+
configSchema?: PluginConfigSchema;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Validate plugin configuration
|
|
152
|
+
* Called before saving config and before starting sync
|
|
153
|
+
*
|
|
154
|
+
* @param options - The plugin-specific options from config
|
|
155
|
+
* @returns Validation result with errors and warnings
|
|
156
|
+
*/
|
|
157
|
+
validateConfig(options: Record<string, unknown>): PluginValidationResult;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Test the plugin's connection/setup
|
|
161
|
+
* Called when user clicks "Test" button in UI
|
|
162
|
+
*
|
|
163
|
+
* @param options - The plugin-specific options from config
|
|
164
|
+
* @param projectPath - Path to the sudocode project root
|
|
165
|
+
* @returns Test result with success status and details
|
|
166
|
+
*/
|
|
167
|
+
testConnection(
|
|
168
|
+
options: Record<string, unknown>,
|
|
169
|
+
projectPath: string
|
|
170
|
+
): Promise<PluginTestResult>;
|
|
171
|
+
|
|
172
|
+
// ===========================================================================
|
|
173
|
+
// Provider Factory
|
|
174
|
+
// ===========================================================================
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Create an IntegrationProvider instance for sync operations
|
|
178
|
+
*
|
|
179
|
+
* @param options - The plugin-specific options from config
|
|
180
|
+
* @param projectPath - Path to the sudocode project root
|
|
181
|
+
* @returns Provider instance ready for sync operations
|
|
182
|
+
*/
|
|
183
|
+
createProvider(
|
|
184
|
+
options: Record<string, unknown>,
|
|
185
|
+
projectPath: string
|
|
186
|
+
): IntegrationProvider;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// =============================================================================
|
|
190
|
+
// Provider Interface (for sync operations)
|
|
191
|
+
// =============================================================================
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Represents an entity from an external system
|
|
195
|
+
* Normalized structure for cross-provider compatibility
|
|
196
|
+
*/
|
|
197
|
+
export interface ExternalEntity {
|
|
198
|
+
/** Unique identifier in the external system */
|
|
199
|
+
id: string;
|
|
200
|
+
/** Entity type (maps to sudocode spec or issue) */
|
|
201
|
+
type: "spec" | "issue";
|
|
202
|
+
/** Entity title */
|
|
203
|
+
title: string;
|
|
204
|
+
/** Entity description/content (optional) */
|
|
205
|
+
description?: string;
|
|
206
|
+
/** Status in external system (optional) */
|
|
207
|
+
status?: string;
|
|
208
|
+
/** Priority level (optional, 0-4 scale like sudocode) */
|
|
209
|
+
priority?: number;
|
|
210
|
+
/** URL to view in external system (optional) */
|
|
211
|
+
url?: string;
|
|
212
|
+
/** When created in external system (optional, ISO 8601) */
|
|
213
|
+
created_at?: string;
|
|
214
|
+
/** When last updated in external system (optional, ISO 8601) */
|
|
215
|
+
updated_at?: string;
|
|
216
|
+
/** Raw data from external system (for provider-specific handling) */
|
|
217
|
+
raw?: unknown;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Represents a change detected in an external system
|
|
222
|
+
* Used for incremental sync operations
|
|
223
|
+
*/
|
|
224
|
+
export interface ExternalChange {
|
|
225
|
+
/** Entity ID that changed */
|
|
226
|
+
entity_id: string;
|
|
227
|
+
/** Type of entity that changed */
|
|
228
|
+
entity_type: "spec" | "issue";
|
|
229
|
+
/** Type of change */
|
|
230
|
+
change_type: "created" | "updated" | "deleted";
|
|
231
|
+
/** When the change occurred (ISO 8601) */
|
|
232
|
+
timestamp: string;
|
|
233
|
+
/** The entity data (present for created/updated, absent for deleted) */
|
|
234
|
+
data?: ExternalEntity;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Result of a sync operation for a single entity
|
|
239
|
+
*/
|
|
240
|
+
export interface SyncResult {
|
|
241
|
+
/** Whether the sync operation succeeded */
|
|
242
|
+
success: boolean;
|
|
243
|
+
/** Sudocode entity ID */
|
|
244
|
+
entity_id: string;
|
|
245
|
+
/** External system entity ID */
|
|
246
|
+
external_id: string;
|
|
247
|
+
/** What action was taken */
|
|
248
|
+
action: "created" | "updated" | "skipped" | "conflict";
|
|
249
|
+
/** Error message if sync failed (optional) */
|
|
250
|
+
error?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Represents a sync conflict between sudocode and external system
|
|
255
|
+
*/
|
|
256
|
+
export interface SyncConflict {
|
|
257
|
+
/** Sudocode entity ID */
|
|
258
|
+
sudocode_entity_id: string;
|
|
259
|
+
/** External system entity ID */
|
|
260
|
+
external_id: string;
|
|
261
|
+
/** Integration provider name */
|
|
262
|
+
provider: string;
|
|
263
|
+
/** When sudocode entity was last updated (ISO 8601) */
|
|
264
|
+
sudocode_updated_at: string;
|
|
265
|
+
/** When external entity was last updated (ISO 8601) */
|
|
266
|
+
external_updated_at: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Interface for sync operations with an external system
|
|
271
|
+
*
|
|
272
|
+
* Created by IntegrationPlugin.createProvider()
|
|
273
|
+
*/
|
|
274
|
+
export interface IntegrationProvider {
|
|
275
|
+
/** Provider name (matches plugin name) */
|
|
276
|
+
readonly name: string;
|
|
277
|
+
/** Whether this provider supports real-time watching for changes */
|
|
278
|
+
readonly supportsWatch: boolean;
|
|
279
|
+
/** Whether this provider supports polling for changes */
|
|
280
|
+
readonly supportsPolling: boolean;
|
|
281
|
+
|
|
282
|
+
// ===========================================================================
|
|
283
|
+
// Lifecycle
|
|
284
|
+
// ===========================================================================
|
|
285
|
+
|
|
286
|
+
/** Initialize the provider (called once before sync operations) */
|
|
287
|
+
initialize(): Promise<void>;
|
|
288
|
+
|
|
289
|
+
/** Clean up resources when the provider is no longer needed */
|
|
290
|
+
dispose(): Promise<void>;
|
|
291
|
+
|
|
292
|
+
// ===========================================================================
|
|
293
|
+
// Entity Operations
|
|
294
|
+
// ===========================================================================
|
|
295
|
+
|
|
296
|
+
/** Fetch a single entity from the external system */
|
|
297
|
+
fetchEntity(externalId: string): Promise<ExternalEntity | null>;
|
|
298
|
+
|
|
299
|
+
/** Search for entities in the external system */
|
|
300
|
+
searchEntities(query?: string): Promise<ExternalEntity[]>;
|
|
301
|
+
|
|
302
|
+
/** Create a new entity in the external system */
|
|
303
|
+
createEntity(entity: Partial<Spec | Issue>): Promise<string>;
|
|
304
|
+
|
|
305
|
+
/** Update an existing entity in the external system */
|
|
306
|
+
updateEntity(
|
|
307
|
+
externalId: string,
|
|
308
|
+
entity: Partial<Spec | Issue>
|
|
309
|
+
): Promise<void>;
|
|
310
|
+
|
|
311
|
+
/** Delete an entity from the external system (optional) */
|
|
312
|
+
deleteEntity?(externalId: string): Promise<void>;
|
|
313
|
+
|
|
314
|
+
// ===========================================================================
|
|
315
|
+
// Change Detection
|
|
316
|
+
// ===========================================================================
|
|
317
|
+
|
|
318
|
+
/** Get changes since a timestamp (for polling) */
|
|
319
|
+
getChangesSince(timestamp: Date): Promise<ExternalChange[]>;
|
|
320
|
+
|
|
321
|
+
/** Start watching for real-time changes (optional) */
|
|
322
|
+
startWatching?(callback: (changes: ExternalChange[]) => void): void;
|
|
323
|
+
|
|
324
|
+
/** Stop watching for real-time changes (optional) */
|
|
325
|
+
stopWatching?(): void;
|
|
326
|
+
|
|
327
|
+
// ===========================================================================
|
|
328
|
+
// Field Mapping
|
|
329
|
+
// ===========================================================================
|
|
330
|
+
|
|
331
|
+
/** Map an external entity to sudocode format */
|
|
332
|
+
mapToSudocode(external: ExternalEntity): {
|
|
333
|
+
spec?: Partial<Spec>;
|
|
334
|
+
issue?: Partial<Issue>;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/** Map a sudocode entity to external format */
|
|
338
|
+
mapFromSudocode(entity: Spec | Issue): Partial<ExternalEntity>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// =============================================================================
|
|
342
|
+
// Legacy Exports (for backwards compatibility during migration)
|
|
343
|
+
// =============================================================================
|
|
344
|
+
|
|
345
|
+
/** @deprecated Use IntegrationProviderConfig instead */
|
|
346
|
+
export type IntegrationConfig = IntegrationProviderConfig;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude to AG-UI Transformation Logic
|
|
3
|
-
*
|
|
4
|
-
* Shared transformation functions for converting raw Claude stream-json messages
|
|
5
|
-
* to AG-UI events. Used by both:
|
|
6
|
-
* - Backend: Real-time transformation for SSE streaming
|
|
7
|
-
* - Frontend: Historical transformation for log replay
|
|
8
|
-
*
|
|
9
|
-
* @module claude-to-ag-ui
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Claude stream-json message format
|
|
13
|
-
* Based on Claude Code CLI output structure
|
|
14
|
-
*/
|
|
15
|
-
export interface ClaudeStreamMessage {
|
|
16
|
-
type: "assistant" | "tool_result" | "result" | "error";
|
|
17
|
-
message?: {
|
|
18
|
-
id?: string;
|
|
19
|
-
model?: string;
|
|
20
|
-
role?: string;
|
|
21
|
-
content?: Array<{
|
|
22
|
-
type: "text" | "tool_use";
|
|
23
|
-
text?: string;
|
|
24
|
-
id?: string;
|
|
25
|
-
name?: string;
|
|
26
|
-
input?: any;
|
|
27
|
-
}>;
|
|
28
|
-
stop_reason?: string;
|
|
29
|
-
stop_sequence?: string | null;
|
|
30
|
-
};
|
|
31
|
-
result?: {
|
|
32
|
-
tool_use_id?: string;
|
|
33
|
-
content?: Array<{
|
|
34
|
-
type: string;
|
|
35
|
-
text?: string;
|
|
36
|
-
}>;
|
|
37
|
-
};
|
|
38
|
-
usage?: {
|
|
39
|
-
input_tokens?: number;
|
|
40
|
-
output_tokens?: number;
|
|
41
|
-
cache_read_input_tokens?: number;
|
|
42
|
-
cache_creation_input_tokens?: number;
|
|
43
|
-
};
|
|
44
|
-
error?: {
|
|
45
|
-
message: string;
|
|
46
|
-
type?: string;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* AG-UI Event types
|
|
51
|
-
* Minimal interface needed for transformation
|
|
52
|
-
*/
|
|
53
|
-
export interface AgUiEvent {
|
|
54
|
-
type: string;
|
|
55
|
-
timestamp: number;
|
|
56
|
-
[key: string]: any;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Transform a single Claude stream-json message to AG-UI events
|
|
60
|
-
*
|
|
61
|
-
* @param message - Raw Claude message from stream-json output
|
|
62
|
-
* @param startSequence - Starting sequence number for events
|
|
63
|
-
* @returns Array of AG-UI events (may be empty for unhandled message types)
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```typescript
|
|
67
|
-
* const message = JSON.parse(line);
|
|
68
|
-
* const events = transformClaudeMessageToAgUi(message, 0);
|
|
69
|
-
* events.forEach(event => console.log(event));
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
export declare function transformClaudeMessageToAgUi(message: ClaudeStreamMessage, startSequence: number): AgUiEvent[];
|
|
73
|
-
/**
|
|
74
|
-
* Parse array of raw execution logs (NDJSON format) to AG-UI events
|
|
75
|
-
*
|
|
76
|
-
* Processes each line as a separate Claude message and transforms to AG-UI events.
|
|
77
|
-
* Handles parse errors gracefully by logging warnings and continuing.
|
|
78
|
-
*
|
|
79
|
-
* @param rawLogs - Array of NDJSON log lines
|
|
80
|
-
* @returns Promise resolving to array of AG-UI events
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```typescript
|
|
84
|
-
* const logs = await fetch('/api/executions/123/logs').then(r => r.json());
|
|
85
|
-
* const events = await parseExecutionLogs(logs.logs);
|
|
86
|
-
* console.log(`Parsed ${events.length} events`);
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
export declare function parseExecutionLogs(rawLogs: string[]): Promise<AgUiEvent[]>;
|
|
90
|
-
//# sourceMappingURL=claude-to-ag-ui.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-to-ag-ui.d.ts","sourceRoot":"","sources":["../src/claude-to-ag-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvD,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC;YACd,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,EAAE,CAAC,EAAE,MAAM,CAAC;YACZ,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,KAAK,CAAC,EAAE,GAAG,CAAC;SACb,CAAC,CAAC;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC/B,CAAC;IACF,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAClD,CAAC;IACF,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,2BAA2B,CAAC,EAAE,MAAM,CAAC;KACtC,CAAC;IACF,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,MAAM,GACpB,SAAS,EAAE,CAoGb;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,SAAS,EAAE,CAAC,CAiCtB"}
|
package/dist/claude-to-ag-ui.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude to AG-UI Transformation Logic
|
|
3
|
-
*
|
|
4
|
-
* Shared transformation functions for converting raw Claude stream-json messages
|
|
5
|
-
* to AG-UI events. Used by both:
|
|
6
|
-
* - Backend: Real-time transformation for SSE streaming
|
|
7
|
-
* - Frontend: Historical transformation for log replay
|
|
8
|
-
*
|
|
9
|
-
* @module claude-to-ag-ui
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Transform a single Claude stream-json message to AG-UI events
|
|
13
|
-
*
|
|
14
|
-
* @param message - Raw Claude message from stream-json output
|
|
15
|
-
* @param startSequence - Starting sequence number for events
|
|
16
|
-
* @returns Array of AG-UI events (may be empty for unhandled message types)
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const message = JSON.parse(line);
|
|
21
|
-
* const events = transformClaudeMessageToAgUi(message, 0);
|
|
22
|
-
* events.forEach(event => console.log(event));
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export function transformClaudeMessageToAgUi(message, startSequence) {
|
|
26
|
-
const events = [];
|
|
27
|
-
const timestamp = Date.now();
|
|
28
|
-
switch (message.type) {
|
|
29
|
-
case "assistant": {
|
|
30
|
-
// Extract content blocks from assistant message
|
|
31
|
-
const content = message.message?.content || [];
|
|
32
|
-
for (const block of content) {
|
|
33
|
-
if (block.type === "text" && block.text) {
|
|
34
|
-
// Text message → TEXT_MESSAGE_CONTENT event
|
|
35
|
-
events.push({
|
|
36
|
-
type: "CUSTOM",
|
|
37
|
-
timestamp,
|
|
38
|
-
name: "TEXT_MESSAGE_CONTENT",
|
|
39
|
-
value: {
|
|
40
|
-
content: block.text,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
else if (block.type === "tool_use") {
|
|
45
|
-
// Tool use → TOOL_CALL_START + TOOL_CALL_ARGS events
|
|
46
|
-
const toolId = block.id || `tool-${Date.now()}`;
|
|
47
|
-
events.push({
|
|
48
|
-
type: "TOOL_CALL_START",
|
|
49
|
-
timestamp,
|
|
50
|
-
toolCallId: toolId,
|
|
51
|
-
toolCallName: block.name || "unknown",
|
|
52
|
-
}, {
|
|
53
|
-
type: "TOOL_CALL_ARGS",
|
|
54
|
-
timestamp,
|
|
55
|
-
toolCallId: toolId,
|
|
56
|
-
delta: JSON.stringify(block.input || {}),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
case "tool_result": {
|
|
63
|
-
// Tool result → TOOL_CALL_END + TOOL_CALL_RESULT events
|
|
64
|
-
const toolUseId = message.result?.tool_use_id || "unknown";
|
|
65
|
-
const resultContent = message.result?.content || [];
|
|
66
|
-
const resultText = resultContent.find((c) => c.type === "text")?.text || "";
|
|
67
|
-
events.push({
|
|
68
|
-
type: "TOOL_CALL_END",
|
|
69
|
-
timestamp,
|
|
70
|
-
toolCallId: toolUseId,
|
|
71
|
-
}, {
|
|
72
|
-
type: "TOOL_CALL_RESULT",
|
|
73
|
-
timestamp,
|
|
74
|
-
messageId: `msg-${toolUseId}`,
|
|
75
|
-
toolCallId: toolUseId,
|
|
76
|
-
content: resultText,
|
|
77
|
-
});
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case "result": {
|
|
81
|
-
// Result message with usage → USAGE_UPDATE event
|
|
82
|
-
if (message.usage) {
|
|
83
|
-
const usage = message.usage;
|
|
84
|
-
events.push({
|
|
85
|
-
type: "CUSTOM",
|
|
86
|
-
timestamp,
|
|
87
|
-
name: "USAGE_UPDATE",
|
|
88
|
-
value: {
|
|
89
|
-
inputTokens: usage.input_tokens || 0,
|
|
90
|
-
outputTokens: usage.output_tokens || 0,
|
|
91
|
-
cacheTokens: usage.cache_read_input_tokens || 0,
|
|
92
|
-
totalTokens: (usage.input_tokens || 0) + (usage.output_tokens || 0),
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
case "error": {
|
|
99
|
-
// Error message → RUN_ERROR event
|
|
100
|
-
events.push({
|
|
101
|
-
type: "RUN_ERROR",
|
|
102
|
-
timestamp,
|
|
103
|
-
message: message.error?.message || "Unknown error",
|
|
104
|
-
errorType: message.error?.type,
|
|
105
|
-
});
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return events;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Parse array of raw execution logs (NDJSON format) to AG-UI events
|
|
113
|
-
*
|
|
114
|
-
* Processes each line as a separate Claude message and transforms to AG-UI events.
|
|
115
|
-
* Handles parse errors gracefully by logging warnings and continuing.
|
|
116
|
-
*
|
|
117
|
-
* @param rawLogs - Array of NDJSON log lines
|
|
118
|
-
* @returns Promise resolving to array of AG-UI events
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* const logs = await fetch('/api/executions/123/logs').then(r => r.json());
|
|
123
|
-
* const events = await parseExecutionLogs(logs.logs);
|
|
124
|
-
* console.log(`Parsed ${events.length} events`);
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
export async function parseExecutionLogs(rawLogs) {
|
|
128
|
-
const events = [];
|
|
129
|
-
let sequence = 0;
|
|
130
|
-
for (let i = 0; i < rawLogs.length; i++) {
|
|
131
|
-
const line = rawLogs[i].trim();
|
|
132
|
-
// Skip empty lines
|
|
133
|
-
if (!line) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
try {
|
|
137
|
-
// Parse JSON line
|
|
138
|
-
const message = JSON.parse(line);
|
|
139
|
-
// Transform to AG-UI events
|
|
140
|
-
const agUiEvents = transformClaudeMessageToAgUi(message, sequence);
|
|
141
|
-
// Accumulate events
|
|
142
|
-
events.push(...agUiEvents);
|
|
143
|
-
sequence += agUiEvents.length;
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
// Log warning but continue processing
|
|
147
|
-
console.warn(`[parseExecutionLogs] Failed to parse log line ${i + 1}:`, error instanceof Error ? error.message : String(error));
|
|
148
|
-
// Don't throw - continue with remaining logs
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return events;
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=claude-to-ag-ui.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-to-ag-ui.js","sourceRoot":"","sources":["../src/claude-to-ag-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgDH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAA4B,EAC5B,aAAqB;IAErB,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,gDAAgD;YAChD,MAAM,OAAO,GAAG,OAA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C,OAAiB;IAEjB,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAE/B,mBAAmB;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,SAAS;QACX,CAAC;QAED,IAAI,CAAC;YACH,kBAAkB;YAClB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAwB,CAAC;YAExD,4BAA4B;YAC5B,MAAM,UAAU,GAAG,4BAA4B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAEnE,oBAAoB;YACpB,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;YAC3B,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC;QAChC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,iDAAiD,CAAC,GAAG,CAAC,GAAG,EACzD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;YACF,6CAA6C;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/crdt.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CRDT Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* Shared type definitions for CRDT state synchronization between
|
|
5
|
-
* the coordinator and agents.
|
|
6
|
-
*/
|
|
7
|
-
import { IssueStatus } from './index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Issue state in CRDT
|
|
10
|
-
*/
|
|
11
|
-
export interface IssueState {
|
|
12
|
-
id: string;
|
|
13
|
-
title: string;
|
|
14
|
-
content: string;
|
|
15
|
-
status: IssueStatus;
|
|
16
|
-
priority: number;
|
|
17
|
-
parent?: string;
|
|
18
|
-
archived: boolean;
|
|
19
|
-
createdAt: number;
|
|
20
|
-
updatedAt: number;
|
|
21
|
-
lastModifiedBy: string;
|
|
22
|
-
version: number;
|
|
23
|
-
tempStatus?: string;
|
|
24
|
-
tempProgress?: {
|
|
25
|
-
current: number;
|
|
26
|
-
total: number;
|
|
27
|
-
message?: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Spec state in CRDT
|
|
32
|
-
*/
|
|
33
|
-
export interface SpecState {
|
|
34
|
-
id: string;
|
|
35
|
-
title: string;
|
|
36
|
-
content: string;
|
|
37
|
-
priority: number;
|
|
38
|
-
parent?: string;
|
|
39
|
-
createdAt: number;
|
|
40
|
-
updatedAt: number;
|
|
41
|
-
lastModifiedBy: string;
|
|
42
|
-
version: number;
|
|
43
|
-
tempSections?: Record<string, string>;
|
|
44
|
-
tempDiff?: string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Execution state in CRDT
|
|
48
|
-
*/
|
|
49
|
-
export interface ExecutionState {
|
|
50
|
-
id: string;
|
|
51
|
-
issueId?: string;
|
|
52
|
-
specId?: string;
|
|
53
|
-
status: 'preparing' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
|
|
54
|
-
phase?: string;
|
|
55
|
-
progress?: {
|
|
56
|
-
current: number;
|
|
57
|
-
total: number;
|
|
58
|
-
message?: string;
|
|
59
|
-
};
|
|
60
|
-
startedAt: number;
|
|
61
|
-
updatedAt: number;
|
|
62
|
-
completedAt?: number;
|
|
63
|
-
agentId: string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Agent metadata in CRDT
|
|
67
|
-
*/
|
|
68
|
-
export interface AgentMetadata {
|
|
69
|
-
id: string;
|
|
70
|
-
executionId?: string;
|
|
71
|
-
status: 'initializing' | 'idle' | 'working' | 'disconnected';
|
|
72
|
-
lastHeartbeat: number;
|
|
73
|
-
connectedAt: number;
|
|
74
|
-
disconnectedAt?: number;
|
|
75
|
-
worktreePath?: string;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Feedback state in CRDT
|
|
79
|
-
*/
|
|
80
|
-
export interface FeedbackState {
|
|
81
|
-
id: string;
|
|
82
|
-
specId: string;
|
|
83
|
-
issueId: string;
|
|
84
|
-
type: 'comment' | 'suggestion' | 'request';
|
|
85
|
-
content: string;
|
|
86
|
-
anchorLine?: number;
|
|
87
|
-
anchorText?: string;
|
|
88
|
-
createdAt: number;
|
|
89
|
-
updatedAt: number;
|
|
90
|
-
lastModifiedBy: string;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* CRDT Agent configuration
|
|
94
|
-
*/
|
|
95
|
-
export interface CRDTAgentConfig {
|
|
96
|
-
agentId: string;
|
|
97
|
-
coordinatorUrl?: string;
|
|
98
|
-
coordinatorHost?: string;
|
|
99
|
-
coordinatorPort?: number;
|
|
100
|
-
heartbeatInterval?: number;
|
|
101
|
-
maxReconnectAttempts?: number;
|
|
102
|
-
reconnectBaseDelay?: number;
|
|
103
|
-
reconnectMaxDelay?: number;
|
|
104
|
-
connectionTimeout?: number;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* CRDT Coordinator configuration
|
|
108
|
-
*/
|
|
109
|
-
export interface CRDTCoordinatorConfig {
|
|
110
|
-
port?: number;
|
|
111
|
-
host?: string;
|
|
112
|
-
persistInterval?: number;
|
|
113
|
-
gcInterval?: number;
|
|
114
|
-
executionTTL?: number;
|
|
115
|
-
agentTTL?: number;
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=crdt.d.ts.map
|
package/dist/crdt.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crdt.d.ts","sourceRoot":"","sources":["../src/crdt.ts"],"names":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C;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/crdt.js
DELETED
package/dist/crdt.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crdt.js","sourceRoot":"","sources":["../src/crdt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/history.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CRDT History Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* Types for in-memory CRDT update history tracking.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Record of a single CRDT update with metadata
|
|
8
|
-
*/
|
|
9
|
-
export interface CRDTUpdateRecord {
|
|
10
|
-
id: string;
|
|
11
|
-
entityType: 'issue' | 'spec' | 'feedback';
|
|
12
|
-
entityId: string;
|
|
13
|
-
updateData: Uint8Array;
|
|
14
|
-
clientId: string;
|
|
15
|
-
timestamp: number;
|
|
16
|
-
contentSnapshot?: {
|
|
17
|
-
title: string;
|
|
18
|
-
content: string;
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* In-memory history storage structure
|
|
24
|
-
*/
|
|
25
|
-
export interface UpdateHistory {
|
|
26
|
-
updates: CRDTUpdateRecord[];
|
|
27
|
-
entityIndex: Map<string, number[]>;
|
|
28
|
-
clientIndex: Map<string, number[]>;
|
|
29
|
-
oldestTimestamp: number;
|
|
30
|
-
newestTimestamp: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Metadata about the history state
|
|
34
|
-
*/
|
|
35
|
-
export interface HistoryMetadata {
|
|
36
|
-
oldestTimestamp: number;
|
|
37
|
-
newestTimestamp: number;
|
|
38
|
-
totalUpdates: number;
|
|
39
|
-
retentionWindowMs: number;
|
|
40
|
-
entitiesTracked: number;
|
|
41
|
-
memoryUsageMB: number;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Document version at a specific timestamp
|
|
45
|
-
*/
|
|
46
|
-
export interface VersionInfo {
|
|
47
|
-
timestamp: number;
|
|
48
|
-
title: string;
|
|
49
|
-
content: string;
|
|
50
|
-
lastModifiedBy: string;
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Diff chunk between two versions
|
|
55
|
-
*/
|
|
56
|
-
export interface DiffChunk {
|
|
57
|
-
type: 'added' | 'removed' | 'unchanged';
|
|
58
|
-
value: string;
|
|
59
|
-
count: number;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Line-by-line blame/attribution information
|
|
63
|
-
*/
|
|
64
|
-
export interface BlameInfo {
|
|
65
|
-
lines: Array<{
|
|
66
|
-
lineNumber: number;
|
|
67
|
-
author: string;
|
|
68
|
-
timestamp: number;
|
|
69
|
-
line: string;
|
|
70
|
-
}>;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=history.d.ts.map
|
package/dist/history.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,OAAO,GAAG,MAA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AAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ"}
|
package/dist/history.js
DELETED
package/dist/history.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|