@tomflow/proflow-task-orchestration 0.1.12 → 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.
@@ -0,0 +1,2 @@
1
+ /** Only owner-generated, flat Markdown files under the workspace are accepted. */
2
+ export declare function productDocumentAbsolute(workspaceRoot: string, filePath: string): string;
@@ -0,0 +1,24 @@
1
+ import { lstatSync, realpathSync } from "node:fs";
2
+ import { resolve, sep } from "node:path";
3
+ /** Only owner-generated, flat Markdown files under the workspace are accepted. */
4
+ export function productDocumentAbsolute(workspaceRoot, filePath) {
5
+ if (!/^product-requirements\/[a-f0-9]{24}\.md$/.test(filePath))
6
+ throw new Error("PRODUCT_DOCUMENT_PATH_INVALID");
7
+ const workspace = realpathSync(workspaceRoot);
8
+ const directory = resolve(workspace, "product-requirements");
9
+ const absolute = resolve(workspace, filePath);
10
+ for (const path of [directory, absolute]) {
11
+ try {
12
+ const stat = lstatSync(path);
13
+ if (stat.isSymbolicLink() || (path === directory ? !stat.isDirectory() : !stat.isFile()))
14
+ throw new Error("PRODUCT_DOCUMENT_PATH_INVALID");
15
+ if (!realpathSync(path).startsWith(`${workspace}${sep}`))
16
+ throw new Error("PRODUCT_DOCUMENT_PATH_INVALID");
17
+ }
18
+ catch (error) {
19
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
20
+ throw error;
21
+ }
22
+ }
23
+ return absolute;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-task-orchestration",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@tomflow/proflow-deployment-conformance": "^0.1.13",
27
- "@tomflow/proflow-task-migration-runner": "^0.1.11",
28
- "@tomflow/proflow-task-store-sqlite": "^0.1.12"
27
+ "@tomflow/proflow-task-store-sqlite": "^0.1.12",
28
+ "@tomflow/proflow-task-migration-runner": "^0.1.11"
29
29
  },
30
30
  "description": "Owns the Task & Orchestration public contract, domain rules and application services.",
31
31
  "keywords": [
@@ -3,7 +3,7 @@
3
3
  "contractVersion": "1.0.0",
4
4
  "moduleRef": "task-orchestration",
5
5
  "packageName": "@tomflow/proflow-task-orchestration",
6
- "moduleVersion": "0.1.12",
6
+ "moduleVersion": "0.1.13",
7
7
  "kind": "library",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",