planfs-core 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -0
- package/dist/ai.d.ts +1 -19
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +0 -124
- package/dist/ai.js.map +1 -1
- package/dist/entity-content.d.ts +6 -0
- package/dist/entity-content.d.ts.map +1 -0
- package/dist/entity-content.js +94 -0
- package/dist/entity-content.js.map +1 -0
- package/dist/entity-factory.d.ts +13 -0
- package/dist/entity-factory.d.ts.map +1 -0
- package/dist/entity-factory.js +109 -0
- package/dist/entity-factory.js.map +1 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +7 -0
- package/dist/files.js.map +1 -1
- package/dist/format.d.ts +19 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +73 -0
- package/dist/format.js.map +1 -0
- package/dist/history.d.ts +8 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +59 -0
- package/dist/history.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/repository.d.ts +5 -29
- package/dist/repository.d.ts.map +1 -1
- package/dist/repository.js +20 -196
- package/dist/repository.js.map +1 -1
- package/dist/search.d.ts +3 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +34 -1
- package/dist/search.js.map +1 -1
- package/dist/semantic-analyzer.d.ts +50 -0
- package/dist/semantic-analyzer.d.ts.map +1 -0
- package/dist/semantic-analyzer.js +315 -0
- package/dist/semantic-analyzer.js.map +1 -0
- package/dist/semantic-context.d.ts +67 -0
- package/dist/semantic-context.d.ts.map +1 -0
- package/dist/semantic-context.js +109 -0
- package/dist/semantic-context.js.map +1 -0
- package/dist/semantic-formatter.d.ts +52 -0
- package/dist/semantic-formatter.d.ts.map +1 -0
- package/dist/semantic-formatter.js +354 -0
- package/dist/semantic-formatter.js.map +1 -0
- package/dist/semantic-inspection.d.ts +119 -0
- package/dist/semantic-inspection.d.ts.map +1 -0
- package/dist/semantic-inspection.js +295 -0
- package/dist/semantic-inspection.js.map +1 -0
- package/dist/semantic-profiles.d.ts +5 -0
- package/dist/semantic-profiles.d.ts.map +1 -0
- package/dist/semantic-profiles.js +70 -0
- package/dist/semantic-profiles.js.map +1 -0
- package/dist/semantic-types.d.ts +199 -0
- package/dist/semantic-types.d.ts.map +1 -0
- package/dist/semantic-types.js +3 -0
- package/dist/semantic-types.js.map +1 -0
- package/dist/semantic-validator.d.ts +46 -0
- package/dist/semantic-validator.d.ts.map +1 -0
- package/dist/semantic-validator.js +313 -0
- package/dist/semantic-validator.js.map +1 -0
- package/dist/semantic.d.ts +4 -0
- package/dist/semantic.d.ts.map +1 -0
- package/dist/semantic.js +641 -0
- package/dist/semantic.js.map +1 -0
- package/dist/task-update.d.ts +26 -0
- package/dist/task-update.d.ts.map +1 -0
- package/dist/task-update.js +165 -0
- package/dist/task-update.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validator.d.ts.map +1 -1
- package/dist/validator.js +18 -1
- package/dist/validator.js.map +1 -1
- package/package.json +4 -3
package/dist/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCH,sCAgCC;AAED,oDA+BC;AAKD,4BAGC;AAKD,8BAKC;AAED,gCAEC;AAKD,sDAQC;AAKD,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCH,sCAgCC;AAED,oDA+BC;AAKD,4BAGC;AAKD,8BAKC;AAED,gCAEC;AAKD,sDAQC;AAKD,sDA2BC;AAnKD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,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAI,MAAM,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;YACxC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,MAAM,aAAE,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IACjE,IAAI,CAAC;QACH,MAAM,aAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,aAAE,CAAC,SAAS,CAAC,UAAU,EAAE,8BAA8B,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,GAAW;IACxC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,aAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const PLANFS_FORMAT_VERSION = 1;
|
|
2
|
+
export interface FormatInfo {
|
|
3
|
+
version: number;
|
|
4
|
+
explicit: boolean;
|
|
5
|
+
filePath: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MigrationPlan {
|
|
8
|
+
currentVersion: number;
|
|
9
|
+
targetVersion: number;
|
|
10
|
+
changes: Array<{
|
|
11
|
+
filePath: string;
|
|
12
|
+
action: 'create';
|
|
13
|
+
content: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export declare function getPlanfsFormat(rootPath: string): Promise<FormatInfo>;
|
|
17
|
+
export declare function planFormatMigration(rootPath: string): Promise<MigrationPlan>;
|
|
18
|
+
export declare function applyFormatMigration(rootPath: string): Promise<MigrationPlan>;
|
|
19
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAGvC,MAAM,WAAW,UAAU;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;CAAE;AACrF,MAAM,WAAW,aAAa;IAAG,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAAE;AAE1J,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAY3E;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAGlF;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAOnF"}
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PLANFS_FORMAT_VERSION = void 0;
|
|
37
|
+
exports.getPlanfsFormat = getPlanfsFormat;
|
|
38
|
+
exports.planFormatMigration = planFormatMigration;
|
|
39
|
+
exports.applyFormatMigration = applyFormatMigration;
|
|
40
|
+
const fs_1 = require("fs");
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
exports.PLANFS_FORMAT_VERSION = 1;
|
|
43
|
+
const CONFIG_FILE = path.join('.planfs', 'planfs.json');
|
|
44
|
+
async function getPlanfsFormat(rootPath) {
|
|
45
|
+
const filePath = path.join(rootPath, CONFIG_FILE);
|
|
46
|
+
try {
|
|
47
|
+
const value = JSON.parse(await fs_1.promises.readFile(filePath, 'utf8'));
|
|
48
|
+
if (!Number.isInteger(value.formatVersion) || Number(value.formatVersion) < 1)
|
|
49
|
+
throw new Error('formatVersion must be a positive integer');
|
|
50
|
+
const version = Number(value.formatVersion);
|
|
51
|
+
if (version > exports.PLANFS_FORMAT_VERSION)
|
|
52
|
+
throw new Error(`PlanFS format ${version} is newer than this CLI supports (${exports.PLANFS_FORMAT_VERSION}). Upgrade PlanFS before editing this repository.`);
|
|
53
|
+
return { version, explicit: true, filePath };
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (error.code === 'ENOENT')
|
|
57
|
+
return { version: 1, explicit: false, filePath };
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async function planFormatMigration(rootPath) {
|
|
62
|
+
const current = await getPlanfsFormat(rootPath);
|
|
63
|
+
return { currentVersion: current.version, targetVersion: exports.PLANFS_FORMAT_VERSION, changes: current.explicit ? [] : [{ filePath: current.filePath, action: 'create', content: JSON.stringify({ formatVersion: exports.PLANFS_FORMAT_VERSION }, null, 2) + '\n' }] };
|
|
64
|
+
}
|
|
65
|
+
async function applyFormatMigration(rootPath) {
|
|
66
|
+
const plan = await planFormatMigration(rootPath);
|
|
67
|
+
for (const change of plan.changes) {
|
|
68
|
+
await fs_1.promises.mkdir(path.dirname(change.filePath), { recursive: true });
|
|
69
|
+
await fs_1.promises.writeFile(change.filePath, change.content, 'utf8');
|
|
70
|
+
}
|
|
71
|
+
return plan;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings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1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getEntityHistory = getEntityHistory;
|
|
37
|
+
const child_process_1 = require("child_process");
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const util_1 = require("util");
|
|
40
|
+
const repository_1 = require("./repository");
|
|
41
|
+
const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
42
|
+
async function getEntityHistory(rootPath, id) {
|
|
43
|
+
const repository = await (0, repository_1.loadRepository)(rootPath);
|
|
44
|
+
const entity = [...(0, repository_1.getAllEntities)(repository, { includeArchived: true })].find(candidate => candidate.id === id);
|
|
45
|
+
if (!entity)
|
|
46
|
+
throw new Error(`Entity not found: ${id}`);
|
|
47
|
+
const relative = path.relative(rootPath, entity.filePath);
|
|
48
|
+
try {
|
|
49
|
+
const { stdout } = await execFileAsync('git', ['log', '--follow', '--format=%H%x09%aI%x09%an%x09%s', '--', relative], { cwd: rootPath });
|
|
50
|
+
return stdout.split('\n').filter(Boolean).map(line => {
|
|
51
|
+
const [hash, timestamp, author, subject] = line.split('\t');
|
|
52
|
+
return { hash, timestamp, author, subject };
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new Error(`Git history is unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,4CAYC;AApBD,iDAAyC;AACzC,2CAA6B;AAC7B,+BAAiC;AACjC,6CAA8D;AAE9D,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAGnC,KAAK,UAAU,gBAAgB,CAAC,QAAgB,EAAE,EAAU;IACjE,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAc,EAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,CAAC,GAAG,IAAA,2BAAc,EAAC,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACjH,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,iCAAiC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzI,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACnD,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC;AAC/H,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from './files';
|
|
|
7
7
|
export * from './loader';
|
|
8
8
|
export * from './validator';
|
|
9
9
|
export * from './repository';
|
|
10
|
+
export * from './entity-content';
|
|
11
|
+
export * from './entity-factory';
|
|
10
12
|
export * from './references';
|
|
11
13
|
export * from './graph';
|
|
12
14
|
export * from './git';
|
|
@@ -17,4 +19,15 @@ export * from './backlog';
|
|
|
17
19
|
export * from './bulk';
|
|
18
20
|
export * from './pull-request';
|
|
19
21
|
export * from './ai';
|
|
22
|
+
export * from './task-update';
|
|
23
|
+
export * from './format';
|
|
24
|
+
export * from './history';
|
|
25
|
+
export * from './semantic-types';
|
|
26
|
+
export * from './semantic-profiles';
|
|
27
|
+
export * from './semantic';
|
|
28
|
+
export * from './semantic-analyzer';
|
|
29
|
+
export * from './semantic-validator';
|
|
30
|
+
export * from './semantic-inspection';
|
|
31
|
+
export * from './semantic-formatter';
|
|
32
|
+
export * from './semantic-context';
|
|
20
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC;AACrB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,8 @@ __exportStar(require("./files"), exports);
|
|
|
23
23
|
__exportStar(require("./loader"), exports);
|
|
24
24
|
__exportStar(require("./validator"), exports);
|
|
25
25
|
__exportStar(require("./repository"), exports);
|
|
26
|
+
__exportStar(require("./entity-content"), exports);
|
|
27
|
+
__exportStar(require("./entity-factory"), exports);
|
|
26
28
|
__exportStar(require("./references"), exports);
|
|
27
29
|
__exportStar(require("./graph"), exports);
|
|
28
30
|
__exportStar(require("./git"), exports);
|
|
@@ -33,4 +35,15 @@ __exportStar(require("./backlog"), exports);
|
|
|
33
35
|
__exportStar(require("./bulk"), exports);
|
|
34
36
|
__exportStar(require("./pull-request"), exports);
|
|
35
37
|
__exportStar(require("./ai"), exports);
|
|
38
|
+
__exportStar(require("./task-update"), exports);
|
|
39
|
+
__exportStar(require("./format"), exports);
|
|
40
|
+
__exportStar(require("./history"), exports);
|
|
41
|
+
__exportStar(require("./semantic-types"), exports);
|
|
42
|
+
__exportStar(require("./semantic-profiles"), exports);
|
|
43
|
+
__exportStar(require("./semantic"), exports);
|
|
44
|
+
__exportStar(require("./semantic-analyzer"), exports);
|
|
45
|
+
__exportStar(require("./semantic-validator"), exports);
|
|
46
|
+
__exportStar(require("./semantic-inspection"), exports);
|
|
47
|
+
__exportStar(require("./semantic-formatter"), exports);
|
|
48
|
+
__exportStar(require("./semantic-context"), exports);
|
|
36
49
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B;AAC7B,0CAAwB;AACxB,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,iDAA+B;AAC/B,uCAAqB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,8CAA4B;AAC5B,+CAA6B;AAC7B,mDAAiC;AACjC,mDAAiC;AACjC,+CAA6B;AAC7B,0CAAwB;AACxB,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,iDAA+B;AAC/B,uCAAqB;AACrB,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,mDAAiC;AACjC,sDAAoC;AACpC,6CAA2B;AAC3B,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,uDAAqC;AACrC,qDAAmC"}
|
package/dist/repository.d.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* Main API for loading and querying a PlanFS repository
|
|
4
4
|
*/
|
|
5
5
|
import { PlanfsInitializationResult } from './files';
|
|
6
|
-
import { Entity, Repository, Task,
|
|
6
|
+
import { Entity, Repository, Task, ValidationResult } from './types';
|
|
7
|
+
export { generateEntityContent } from './entity-content';
|
|
8
|
+
export { createDecisionTemplate, createEpicTemplate, createMilestoneTemplate, createTaskTemplate, getNextDecisionId, getNextEpicId, getNextMilestoneId, getNextTaskId } from './entity-factory';
|
|
7
9
|
/**
|
|
8
10
|
* Load a PlanFS repository
|
|
9
11
|
*/
|
|
@@ -22,13 +24,11 @@ export declare function validateRepositoryState(repository: Repository): Validat
|
|
|
22
24
|
* Save an entity to disk
|
|
23
25
|
*/
|
|
24
26
|
export declare function saveEntity(rootPath: string, entity: Entity): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Generate file content from an entity
|
|
27
|
-
*/
|
|
28
|
-
export declare function generateEntityContent(entity: Entity): string;
|
|
29
27
|
export interface ArchiveEntityOptions {
|
|
30
28
|
includeChildren?: boolean;
|
|
31
29
|
now?: Date;
|
|
30
|
+
disposition?: NonNullable<Entity['archive']>['disposition'];
|
|
31
|
+
note?: string;
|
|
32
32
|
}
|
|
33
33
|
export interface ArchiveEntityResult {
|
|
34
34
|
archived: Entity[];
|
|
@@ -58,28 +58,4 @@ export declare function getTasksByEpic(repository: Repository, epicId: string):
|
|
|
58
58
|
* Initialize a new repository
|
|
59
59
|
*/
|
|
60
60
|
export declare function initializeRepository(rootPath: string): Promise<PlanfsInitializationResult>;
|
|
61
|
-
/**
|
|
62
|
-
* Get next task ID
|
|
63
|
-
*/
|
|
64
|
-
export declare function getNextTaskId(repository: Repository): string;
|
|
65
|
-
/**
|
|
66
|
-
* Get an available epic ID from a title
|
|
67
|
-
*/
|
|
68
|
-
export declare function getNextEpicId(repository: Repository, title: string): string;
|
|
69
|
-
/**
|
|
70
|
-
* Get an available milestone ID from a title
|
|
71
|
-
*/
|
|
72
|
-
export declare function getNextMilestoneId(repository: Repository, title: string): string;
|
|
73
|
-
/**
|
|
74
|
-
* Create a new task template
|
|
75
|
-
*/
|
|
76
|
-
export declare function createTaskTemplate(id: string, title: string): Task;
|
|
77
|
-
/**
|
|
78
|
-
* Create a new epic template
|
|
79
|
-
*/
|
|
80
|
-
export declare function createEpicTemplate(id: string, title: string): Epic;
|
|
81
|
-
/**
|
|
82
|
-
* Create a new milestone template
|
|
83
|
-
*/
|
|
84
|
-
export declare function createMilestoneTemplate(id: string, title: string, targetDate: string): Milestone;
|
|
85
61
|
//# sourceMappingURL=repository.d.ts.map
|
package/dist/repository.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAQL,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAIjB,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EAIJ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA6E1E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1C,MAAM,EAAE,CAaV;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAgBhF;AAED;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Q,EAAE,MAAM,GACf,IAAI,EAAE,CAIR;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,IAAI,EAAE,CAIR;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,0BAA0B,CAAC,CAErC"}
|
package/dist/repository.js
CHANGED
|
@@ -37,11 +37,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
};
|
|
38
38
|
})();
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.getNextTaskId = exports.getNextMilestoneId = exports.getNextEpicId = exports.getNextDecisionId = exports.createTaskTemplate = exports.createMilestoneTemplate = exports.createEpicTemplate = exports.createDecisionTemplate = exports.generateEntityContent = void 0;
|
|
40
41
|
exports.loadRepository = loadRepository;
|
|
41
42
|
exports.getAllEntities = getAllEntities;
|
|
42
43
|
exports.validateRepositoryState = validateRepositoryState;
|
|
43
44
|
exports.saveEntity = saveEntity;
|
|
44
|
-
exports.generateEntityContent = generateEntityContent;
|
|
45
45
|
exports.isArchivedEntity = isArchivedEntity;
|
|
46
46
|
exports.listArchivedEntities = listArchivedEntities;
|
|
47
47
|
exports.archiveEntity = archiveEntity;
|
|
@@ -51,18 +51,24 @@ exports.getTasksByStatus = getTasksByStatus;
|
|
|
51
51
|
exports.getTasksByAssignee = getTasksByAssignee;
|
|
52
52
|
exports.getTasksByEpic = getTasksByEpic;
|
|
53
53
|
exports.initializeRepository = initializeRepository;
|
|
54
|
-
exports.getNextTaskId = getNextTaskId;
|
|
55
|
-
exports.getNextEpicId = getNextEpicId;
|
|
56
|
-
exports.getNextMilestoneId = getNextMilestoneId;
|
|
57
|
-
exports.createTaskTemplate = createTaskTemplate;
|
|
58
|
-
exports.createEpicTemplate = createEpicTemplate;
|
|
59
|
-
exports.createMilestoneTemplate = createMilestoneTemplate;
|
|
60
54
|
const path = __importStar(require("path"));
|
|
61
|
-
const yaml_1 = require("yaml");
|
|
62
55
|
const files_1 = require("./files");
|
|
63
56
|
const loader_1 = require("./loader");
|
|
64
57
|
const references_1 = require("./references");
|
|
65
58
|
const validator_1 = require("./validator");
|
|
59
|
+
const format_1 = require("./format");
|
|
60
|
+
const entity_content_1 = require("./entity-content");
|
|
61
|
+
var entity_content_2 = require("./entity-content");
|
|
62
|
+
Object.defineProperty(exports, "generateEntityContent", { enumerable: true, get: function () { return entity_content_2.generateEntityContent; } });
|
|
63
|
+
var entity_factory_1 = require("./entity-factory");
|
|
64
|
+
Object.defineProperty(exports, "createDecisionTemplate", { enumerable: true, get: function () { return entity_factory_1.createDecisionTemplate; } });
|
|
65
|
+
Object.defineProperty(exports, "createEpicTemplate", { enumerable: true, get: function () { return entity_factory_1.createEpicTemplate; } });
|
|
66
|
+
Object.defineProperty(exports, "createMilestoneTemplate", { enumerable: true, get: function () { return entity_factory_1.createMilestoneTemplate; } });
|
|
67
|
+
Object.defineProperty(exports, "createTaskTemplate", { enumerable: true, get: function () { return entity_factory_1.createTaskTemplate; } });
|
|
68
|
+
Object.defineProperty(exports, "getNextDecisionId", { enumerable: true, get: function () { return entity_factory_1.getNextDecisionId; } });
|
|
69
|
+
Object.defineProperty(exports, "getNextEpicId", { enumerable: true, get: function () { return entity_factory_1.getNextEpicId; } });
|
|
70
|
+
Object.defineProperty(exports, "getNextMilestoneId", { enumerable: true, get: function () { return entity_factory_1.getNextMilestoneId; } });
|
|
71
|
+
Object.defineProperty(exports, "getNextTaskId", { enumerable: true, get: function () { return entity_factory_1.getNextTaskId; } });
|
|
66
72
|
/**
|
|
67
73
|
* Load a PlanFS repository
|
|
68
74
|
*/
|
|
@@ -72,6 +78,7 @@ async function loadRepository(rootPath) {
|
|
|
72
78
|
if (!exists) {
|
|
73
79
|
throw new Error(`No .planfs directory found in ${rootPath}. Initialize with ensurePlanfsStructure() first.`);
|
|
74
80
|
}
|
|
81
|
+
await (0, format_1.getPlanfsFormat)(rootPath);
|
|
75
82
|
const repository = {
|
|
76
83
|
root: rootPath,
|
|
77
84
|
tasks: new Map(),
|
|
@@ -182,7 +189,7 @@ async function saveEntity(rootPath, entity) {
|
|
|
182
189
|
: (0, loader_1.getEntityDirectory)(entity.type);
|
|
183
190
|
const filename = (0, loader_1.getFilenameFromId)(entity.id);
|
|
184
191
|
const filePath = path.join(rootPath, '.planfs', dir, filename);
|
|
185
|
-
const content = generateEntityContent(entity);
|
|
192
|
+
const content = (0, entity_content_1.generateEntityContent)(entity);
|
|
186
193
|
await (0, files_1.writeFile)(filePath, content);
|
|
187
194
|
}
|
|
188
195
|
function assertSafeSaveIdentity(entity) {
|
|
@@ -197,96 +204,6 @@ function assertSafeSaveIdentity(entity) {
|
|
|
197
204
|
throw new Error(`Refusing to save ${entity.id}: entity id does not match existing file name ${existingId}. Repair the id field or rename the file before saving.`);
|
|
198
205
|
}
|
|
199
206
|
}
|
|
200
|
-
/**
|
|
201
|
-
* Generate file content from an entity
|
|
202
|
-
*/
|
|
203
|
-
function generateEntityContent(entity) {
|
|
204
|
-
const metadata = { ...entity.metadata };
|
|
205
|
-
metadata.id = entity.id;
|
|
206
|
-
metadata.title = entity.title || '';
|
|
207
|
-
metadata.status = entity.status || '';
|
|
208
|
-
if (entity.archive)
|
|
209
|
-
metadata.archive = entity.archive;
|
|
210
|
-
// Add type-specific metadata
|
|
211
|
-
switch (entity.type) {
|
|
212
|
-
case 'task': {
|
|
213
|
-
const task = entity;
|
|
214
|
-
if (task.priority)
|
|
215
|
-
metadata.priority = task.priority;
|
|
216
|
-
if (task.assignee)
|
|
217
|
-
metadata.assignee = task.assignee;
|
|
218
|
-
if (task.epic)
|
|
219
|
-
metadata.epic = task.epic;
|
|
220
|
-
if (task.milestone)
|
|
221
|
-
metadata.milestone = task.milestone;
|
|
222
|
-
if (task.dependsOn)
|
|
223
|
-
metadata.dependsOn = task.dependsOn;
|
|
224
|
-
if (task.tags)
|
|
225
|
-
metadata.tags = task.tags;
|
|
226
|
-
if (task.dueDate)
|
|
227
|
-
metadata.dueDate = task.dueDate;
|
|
228
|
-
if (task.estimate)
|
|
229
|
-
metadata.estimate = task.estimate;
|
|
230
|
-
if (task.refinementState)
|
|
231
|
-
metadata.refinementState = task.refinementState;
|
|
232
|
-
if (task.backlogOrder !== undefined)
|
|
233
|
-
metadata.backlogOrder = task.backlogOrder;
|
|
234
|
-
if (task.links)
|
|
235
|
-
metadata.links = task.links;
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
case 'epic': {
|
|
239
|
-
const epic = entity;
|
|
240
|
-
if (epic.priority)
|
|
241
|
-
metadata.priority = epic.priority;
|
|
242
|
-
if (epic.owner)
|
|
243
|
-
metadata.owner = epic.owner;
|
|
244
|
-
if (epic.description)
|
|
245
|
-
metadata.description = epic.description;
|
|
246
|
-
if (epic.targetDate)
|
|
247
|
-
metadata.targetDate = epic.targetDate;
|
|
248
|
-
if (epic.tags)
|
|
249
|
-
metadata.tags = epic.tags;
|
|
250
|
-
if (epic.links)
|
|
251
|
-
metadata.links = epic.links;
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
254
|
-
case 'milestone': {
|
|
255
|
-
const milestone = entity;
|
|
256
|
-
metadata.targetDate = milestone.targetDate;
|
|
257
|
-
if (milestone.description)
|
|
258
|
-
metadata.description = milestone.description;
|
|
259
|
-
if (milestone.owner)
|
|
260
|
-
metadata.owner = milestone.owner;
|
|
261
|
-
if (milestone.links)
|
|
262
|
-
metadata.links = milestone.links;
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
case 'decision': {
|
|
266
|
-
const decision = entity;
|
|
267
|
-
if (decision.date)
|
|
268
|
-
metadata.date = decision.date;
|
|
269
|
-
if (decision.context)
|
|
270
|
-
metadata.context = decision.context;
|
|
271
|
-
if (decision.decision)
|
|
272
|
-
metadata.decision = decision.decision;
|
|
273
|
-
if (decision.consequences)
|
|
274
|
-
metadata.consequences = decision.consequences;
|
|
275
|
-
if (decision.author)
|
|
276
|
-
metadata.author = decision.author;
|
|
277
|
-
if (decision.supersedes)
|
|
278
|
-
metadata.supersedes = decision.supersedes;
|
|
279
|
-
if (decision.supersededBy)
|
|
280
|
-
metadata.supersededBy = decision.supersededBy;
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
if (entity.createdAt)
|
|
285
|
-
metadata.createdAt = entity.createdAt;
|
|
286
|
-
if (entity.updatedAt)
|
|
287
|
-
metadata.updatedAt = entity.updatedAt;
|
|
288
|
-
return `---\n${(0, yaml_1.stringify)(metadata).trimEnd()}\n---\n\n${entity.body}`;
|
|
289
|
-
}
|
|
290
207
|
function isArchivedEntity(entity) {
|
|
291
208
|
return Boolean(entity.archive);
|
|
292
209
|
}
|
|
@@ -302,6 +219,9 @@ async function archiveEntity(rootPath, entityId, options = {}) {
|
|
|
302
219
|
if (!entity) {
|
|
303
220
|
throw new Error(`Active task or epic not found: ${entityId}`);
|
|
304
221
|
}
|
|
222
|
+
if (entity.status !== 'done' && !options.disposition) {
|
|
223
|
+
throw new Error(`Archiving unfinished ${entity.type} ${entity.id} requires an explicit disposition`);
|
|
224
|
+
}
|
|
305
225
|
const toArchive = [entity];
|
|
306
226
|
if (entity.type === 'epic' && options.includeChildren) {
|
|
307
227
|
toArchive.push(...Array.from(repository.tasks.values()).filter(task => task.epic === entity.id));
|
|
@@ -310,7 +230,7 @@ async function archiveEntity(rootPath, entityId, options = {}) {
|
|
|
310
230
|
const archivedAt = (options.now ?? new Date()).toISOString();
|
|
311
231
|
for (const current of toArchive) {
|
|
312
232
|
const originalPath = path.relative(rootPath, current.filePath);
|
|
313
|
-
const archive = { archivedAt, originalPath };
|
|
233
|
+
const archive = { archivedAt, originalPath, ...(options.disposition ? { disposition: options.disposition } : {}), ...(options.note ? { note: options.note } : {}) };
|
|
314
234
|
const archivedEntity = {
|
|
315
235
|
...current,
|
|
316
236
|
archive,
|
|
@@ -396,100 +316,4 @@ function getTasksByEpic(repository, epicId) {
|
|
|
396
316
|
async function initializeRepository(rootPath) {
|
|
397
317
|
return (0, files_1.ensurePlanfsStructure)(rootPath);
|
|
398
318
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Get next task ID
|
|
401
|
-
*/
|
|
402
|
-
function getNextTaskId(repository) {
|
|
403
|
-
let maxNum = 0;
|
|
404
|
-
for (const id of repository.tasks.keys()) {
|
|
405
|
-
if (id.startsWith('TASK-')) {
|
|
406
|
-
const num = parseInt(id.substring(5), 10);
|
|
407
|
-
if (!isNaN(num) && num > maxNum) {
|
|
408
|
-
maxNum = num;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
return `TASK-${String(maxNum + 1).padStart(3, '0')}`;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Get an available epic ID from a title
|
|
416
|
-
*/
|
|
417
|
-
function getNextEpicId(repository, title) {
|
|
418
|
-
return getAvailableSlugId('EPIC', title, repository.epics);
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Get an available milestone ID from a title
|
|
422
|
-
*/
|
|
423
|
-
function getNextMilestoneId(repository, title) {
|
|
424
|
-
return getAvailableSlugId('MILESTONE', title, repository.milestones);
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Create a new task template
|
|
428
|
-
*/
|
|
429
|
-
function createTaskTemplate(id, title) {
|
|
430
|
-
const now = new Date().toISOString();
|
|
431
|
-
return {
|
|
432
|
-
id,
|
|
433
|
-
type: 'task',
|
|
434
|
-
title,
|
|
435
|
-
status: 'todo',
|
|
436
|
-
filePath: '',
|
|
437
|
-
metadata: {},
|
|
438
|
-
body: '',
|
|
439
|
-
createdAt: now,
|
|
440
|
-
updatedAt: now
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Create a new epic template
|
|
445
|
-
*/
|
|
446
|
-
function createEpicTemplate(id, title) {
|
|
447
|
-
const now = new Date().toISOString();
|
|
448
|
-
return {
|
|
449
|
-
id,
|
|
450
|
-
type: 'epic',
|
|
451
|
-
title,
|
|
452
|
-
status: 'active',
|
|
453
|
-
filePath: '',
|
|
454
|
-
metadata: {},
|
|
455
|
-
body: '',
|
|
456
|
-
createdAt: now,
|
|
457
|
-
updatedAt: now
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Create a new milestone template
|
|
462
|
-
*/
|
|
463
|
-
function createMilestoneTemplate(id, title, targetDate) {
|
|
464
|
-
const now = new Date().toISOString();
|
|
465
|
-
return {
|
|
466
|
-
id,
|
|
467
|
-
type: 'milestone',
|
|
468
|
-
title,
|
|
469
|
-
status: 'active',
|
|
470
|
-
targetDate,
|
|
471
|
-
filePath: '',
|
|
472
|
-
metadata: {},
|
|
473
|
-
body: '',
|
|
474
|
-
createdAt: now,
|
|
475
|
-
updatedAt: now
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
function getAvailableSlugId(prefix, title, existing) {
|
|
479
|
-
const base = `${prefix}-${slugify(title)}`;
|
|
480
|
-
let candidate = base;
|
|
481
|
-
let suffix = 2;
|
|
482
|
-
while (existing.has(candidate)) {
|
|
483
|
-
candidate = `${base}-${suffix}`;
|
|
484
|
-
suffix += 1;
|
|
485
|
-
}
|
|
486
|
-
return candidate;
|
|
487
|
-
}
|
|
488
|
-
function slugify(value) {
|
|
489
|
-
return value
|
|
490
|
-
.trim()
|
|
491
|
-
.toLowerCase()
|
|
492
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
493
|
-
.replace(/^-+|-+$/g, '') || 'untitled';
|
|
494
|
-
}
|
|
495
319
|
//# sourceMappingURL=repository.js.map
|