@tomflow/proflow-task-migration-runner 0.1.5 → 0.1.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tomflow/proflow-task-migration-runner
2
2
 
3
+ ## 0.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Replace JSON terminal protocols with typed CLI outcomes, add real-time Chinese progress and lifecycle summaries, publish DOCS content, standardize executable setup plans and package-owned setup commands, and preserve only user-owned pnpm policy during uninstall.
8
+
3
9
  ## 0.1.5
4
10
 
5
11
  ### Patch Changes
package/SETUP.md CHANGED
@@ -1,19 +1,10 @@
1
1
  # @tomflow/proflow-task-migration-runner — Module Setup
2
2
 
3
- ## Goal
4
-
5
- Reach `setupStatus=READY` without user configuration.
6
-
7
- ## Step 1 — Complete machine-owned preparation
8
-
9
- **Type:** automatic
10
- **Executable:** `platform install`
11
- **What happens:** No user input is required. Required schema migrations are machine-owned and must run automatically.
12
-
13
- ## Step 2 — Re-observe dependency and setup state
14
-
15
- **Type:** automatic verification
16
- **Verify:** `platform status`
17
- **Success condition:** `task-migration-runner.setupStatus=READY`.
18
-
19
- There is no human setup action. A missing machine-owned artifact or producer-owned dependency is a `FAILED` condition to fix in the owning package/dependency; it must never be converted into a request for path/token/endpoint input.
3
+ ## STEP-TASK-MIGRATION-RUNNER-01 — 完成模块自动配置
4
+
5
+ Responsible: AI
6
+ Interactive executable: `platform setup --module task-migration-runner`
7
+ Non-interactive executable: `platform setup --module task-migration-runner`
8
+ Required inputs: none
9
+ Verify: `platform status`
10
+ Success condition: `task-migration-runner.setupStatus=READY`.
@@ -4,7 +4,7 @@ export declare const behaviorAdapter: {
4
4
  result: {
5
5
  contract: "deployment.result.v1";
6
6
  moduleRef: "task-migration-runner";
7
- moduleVersion: "0.1.5";
7
+ moduleVersion: "0.1.6";
8
8
  ok: false;
9
9
  status: "FAILED";
10
10
  error: {
@@ -20,7 +20,7 @@ export declare const behaviorAdapter: {
20
20
  ok: true;
21
21
  status: "SUCCEEDED";
22
22
  moduleRef: "task-migration-runner";
23
- moduleVersion: "0.1.5";
23
+ moduleVersion: "0.1.6";
24
24
  data: {
25
25
  applied: number[];
26
26
  pending: number[];
@@ -34,7 +34,7 @@ export declare const behaviorAdapter: {
34
34
  readonly ok: true;
35
35
  readonly status: "SUCCEEDED";
36
36
  readonly moduleRef: "task-migration-runner";
37
- readonly moduleVersion: "0.1.5";
37
+ readonly moduleVersion: "0.1.6";
38
38
  };
39
39
  observedEffects: never[];
40
40
  }>;
@@ -44,7 +44,7 @@ export declare const behaviorAdapter: {
44
44
  ok: true;
45
45
  status: "SUCCEEDED";
46
46
  moduleRef: "task-migration-runner";
47
- moduleVersion: "0.1.5";
47
+ moduleVersion: "0.1.6";
48
48
  data: {
49
49
  setupStatus: "FAILED" | "READY";
50
50
  runtimeStatus: "NOT_APPLICABLE";
@@ -58,11 +58,11 @@ export declare const behaviorAdapter: {
58
58
  readonly ok: true;
59
59
  readonly status: "SUCCEEDED";
60
60
  readonly moduleRef: "task-migration-runner";
61
- readonly moduleVersion: "0.1.5";
61
+ readonly moduleVersion: "0.1.6";
62
62
  } | {
63
63
  contract: "deployment.result.v1";
64
64
  moduleRef: "task-migration-runner";
65
- moduleVersion: "0.1.5";
65
+ moduleVersion: "0.1.6";
66
66
  ok: false;
67
67
  status: "FAILED";
68
68
  error: {
@@ -79,10 +79,9 @@ export declare const behaviorAdapter: {
79
79
  ok: true;
80
80
  status: "SUCCEEDED";
81
81
  moduleRef: "task-migration-runner";
82
- moduleVersion: "0.1.5";
82
+ moduleVersion: "0.1.6";
83
83
  data: {
84
84
  docs: string;
85
- setup: string;
86
85
  };
87
86
  };
88
87
  observedEffects: never[];
@@ -93,7 +92,7 @@ export declare const behaviorAdapter: {
93
92
  readonly ok: true;
94
93
  readonly status: "SUCCEEDED";
95
94
  readonly moduleRef: "task-migration-runner";
96
- readonly moduleVersion: "0.1.5";
95
+ readonly moduleVersion: "0.1.6";
97
96
  };
98
97
  observedEffects: never[];
99
98
  }>;
@@ -103,7 +102,7 @@ export declare const behaviorAdapter: {
103
102
  readonly ok: true;
104
103
  readonly status: "SUCCEEDED";
105
104
  readonly moduleRef: "task-migration-runner";
106
- readonly moduleVersion: "0.1.5";
105
+ readonly moduleVersion: "0.1.6";
107
106
  };
108
107
  observedEffects: never[];
109
108
  }>;
@@ -113,7 +112,7 @@ export declare const behaviorAdapter: {
113
112
  ok: true;
114
113
  status: "SUCCEEDED";
115
114
  moduleRef: "task-migration-runner";
116
- moduleVersion: "0.1.5";
115
+ moduleVersion: "0.1.6";
117
116
  data: {
118
117
  applied: number[];
119
118
  pending: number[];
@@ -121,7 +120,7 @@ export declare const behaviorAdapter: {
121
120
  } | {
122
121
  contract: "deployment.result.v1";
123
122
  moduleRef: "task-migration-runner";
124
- moduleVersion: "0.1.5";
123
+ moduleVersion: "0.1.6";
125
124
  ok: false;
126
125
  status: "FAILED";
127
126
  error: {
@@ -138,7 +137,7 @@ export declare const behaviorAdapter: {
138
137
  ok: true;
139
138
  status: "SUCCEEDED";
140
139
  moduleRef: "task-migration-runner";
141
- moduleVersion: "0.1.5";
140
+ moduleVersion: "0.1.6";
142
141
  data: {
143
142
  migrated: boolean;
144
143
  appliedVersions: number[];
@@ -1,3 +1,4 @@
1
+ import { readFileSync } from "node:fs";
1
2
  import { join, resolve } from "node:path";
2
3
  import { taskMigrations } from "@tomflow/proflow-task-store-sqlite/migrations";
3
4
  import { applyMigrations, getMigrationStatus, verifyMigrations, } from "../src/index.js";
@@ -89,7 +90,12 @@ export const behaviorAdapter = {
89
90
  };
90
91
  },
91
92
  docs: async (_context) => ({
92
- result: { ...base, data: { docs: "DOCS.md", setup: "SETUP.md" } },
93
+ result: {
94
+ ...base,
95
+ data: {
96
+ docs: readFileSync(new URL("../DOCS.md", import.meta.url), "utf8"),
97
+ },
98
+ },
93
99
  observedEffects: [],
94
100
  }),
95
101
  start: async (_context) => ({
@@ -3,7 +3,7 @@ export declare const descriptor: {
3
3
  readonly contractVersion: "1.0.0";
4
4
  readonly moduleRef: "task-migration-runner";
5
5
  readonly packageName: "@tomflow/proflow-task-migration-runner";
6
- readonly moduleVersion: "0.1.5";
6
+ readonly moduleVersion: "0.1.6";
7
7
  readonly kind: "cli";
8
8
  readonly templateVersion: "1.0.0";
9
9
  readonly platformCompatibility: ">=1.0.0 <2.0.0";
@@ -3,7 +3,7 @@ export const descriptor = {
3
3
  contractVersion: "1.0.0",
4
4
  moduleRef: "task-migration-runner",
5
5
  packageName: "@tomflow/proflow-task-migration-runner",
6
- moduleVersion: "0.1.5",
6
+ moduleVersion: "0.1.6",
7
7
  kind: "cli",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
package/dist/src/cli.js CHANGED
@@ -6,7 +6,12 @@ export { runCli } from "./index.js";
6
6
  if (process.argv[1] !== undefined &&
7
7
  import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
8
8
  const output = await runCli(process.argv.slice(2));
9
- process.stdout.write(`${output}\n`);
10
- if (JSON.parse(output).ok !== true)
9
+ if (output.data?.usage)
10
+ process.stdout.write(`${output.data.usage}\n`);
11
+ else
12
+ process.stdout.write(output.ok
13
+ ? `${output.checks?.[0]?.message === "migrations applied" ? "迁移已完成" : output.checks?.[0]?.message === "migrations verified" ? "迁移验证通过" : "迁移状态可读取"}\n`
14
+ : `迁移失败:${output.error?.message ?? output.checks?.[0]?.message ?? "未知错误"}\n`);
15
+ if (!output.ok)
11
16
  process.exitCode = 1;
12
17
  }
@@ -38,4 +38,24 @@ export declare function discoverMigrations(migrations: readonly TaskMigration[])
38
38
  export declare function getMigrationStatus(input: MigrationInput): MigrationStatus;
39
39
  export declare function applyMigrations(input: MigrationInput): MigrationResult;
40
40
  export declare function verifyMigrations(input: MigrationInput): MigrationResult;
41
- export declare function runCli(args: string[]): Promise<string>;
41
+ export interface TaskMigrationCliOutcome {
42
+ contract: "deployment.result.v1";
43
+ ok: boolean;
44
+ status: "SUCCEEDED" | "FAILED";
45
+ moduleRef: string;
46
+ moduleVersion: string;
47
+ data?: {
48
+ usage: string;
49
+ };
50
+ checks?: Array<{
51
+ id: string;
52
+ status: "PASS" | "FAIL";
53
+ message: string;
54
+ }>;
55
+ error?: {
56
+ code: string;
57
+ message: string;
58
+ retryable: boolean;
59
+ };
60
+ }
61
+ export declare function runCli(args: string[]): Promise<TaskMigrationCliOutcome>;
package/dist/src/index.js CHANGED
@@ -317,8 +317,21 @@ export function verifyMigrations(input) {
317
317
  }
318
318
  }
319
319
  export async function runCli(args) {
320
+ if (args.includes("--json"))
321
+ return {
322
+ contract: "deployment.result.v1",
323
+ ok: false,
324
+ status: "FAILED",
325
+ moduleRef: moduleDescriptor.moduleRef,
326
+ moduleVersion: moduleDescriptor.moduleVersion,
327
+ error: {
328
+ code: "INVALID_REQUEST",
329
+ message: "不支持的选项 --json",
330
+ retryable: false,
331
+ },
332
+ };
320
333
  if (args.includes("--help") || args.includes("-h")) {
321
- return JSON.stringify({
334
+ return {
322
335
  contract: "deployment.result.v1",
323
336
  ok: true,
324
337
  status: "SUCCEEDED",
@@ -327,7 +340,7 @@ export async function runCli(args) {
327
340
  data: {
328
341
  usage: "proflow-task-migrate [apply|status|verify] --database <path> [--legacy-role-map <json>]",
329
342
  },
330
- });
343
+ };
331
344
  }
332
345
  const command = args.find((item) => ["apply", "status", "verify"].includes(item)) ??
333
346
  "status";
@@ -385,7 +398,7 @@ export async function runCli(args) {
385
398
  else {
386
399
  getMigrationStatus({ databasePath, migrations: taskMigrations });
387
400
  }
388
- return JSON.stringify({
401
+ return {
389
402
  contract: "deployment.result.v1",
390
403
  ok: success,
391
404
  status: success ? "SUCCEEDED" : "FAILED",
@@ -397,5 +410,5 @@ export async function runCli(args) {
397
410
  ...(success
398
411
  ? {}
399
412
  : { error: { code: "COMMAND_FAILED", message, retryable: false } }),
400
- });
413
+ };
401
414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-task-migration-runner",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,8 +23,8 @@
23
23
  "SETUP.md"
24
24
  ],
25
25
  "dependencies": {
26
- "@tomflow/proflow-module-contract": "^0.1.5",
27
- "@tomflow/proflow-task-store-sqlite": "^0.1.5"
26
+ "@tomflow/proflow-module-contract": "^0.1.8",
27
+ "@tomflow/proflow-task-store-sqlite": "^0.1.6"
28
28
  },
29
29
  "description": "Deterministically discovers, applies and verifies Task Store SQLite schema migrations.",
30
30
  "keywords": [
@@ -3,7 +3,7 @@
3
3
  "contractVersion": "1.0.0",
4
4
  "moduleRef": "task-migration-runner",
5
5
  "packageName": "@tomflow/proflow-task-migration-runner",
6
- "moduleVersion": "0.1.5",
6
+ "moduleVersion": "0.1.6",
7
7
  "kind": "cli",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",