@aliou/pi-processes 0.10.5 → 0.10.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/extensions/processes/config/index.ts +0 -1
- package/extensions/processes/config/loader.ts +1 -24
- package/extensions/processes/config/migrations/001-v0-9-4-to-v0-10-0-config.ts +25 -1
- package/extensions/processes/config/migrations/002-stamp-config-version.ts +24 -0
- package/extensions/processes/config/migrations/index.ts +2 -4
- package/extensions/processes/config/types.ts +6 -5
- package/extensions/processes/settings/index.ts +5 -2
- package/extensions/processes/tools/index.ts +25 -3
- package/package.json +4 -4
- package/schema.json +94 -86
- package/extensions/processes/config/migrations/002-stamp-v0-10-0-config-version.ts +0 -21
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConfigLoader,
|
|
3
|
-
type ConfigStore,
|
|
4
|
-
type Scope,
|
|
5
|
-
} from "@aliou/pi-utils-settings";
|
|
1
|
+
import { ConfigLoader } from "@aliou/pi-utils-settings";
|
|
6
2
|
import { DEFAULT_CONFIG } from "./defaults";
|
|
7
3
|
import { importLegacyProcessConfig, migrations } from "./migrations";
|
|
8
4
|
import { PROCESS_CONFIG_SCHEMA_URL } from "./schema";
|
|
@@ -41,22 +37,3 @@ export const configLoader = new ConfigLoader<
|
|
|
41
37
|
migrations,
|
|
42
38
|
schemaUrl: PROCESS_CONFIG_SCHEMA_URL,
|
|
43
39
|
});
|
|
44
|
-
|
|
45
|
-
export function createSettingsConfigStore(): ConfigStore<
|
|
46
|
-
ProcessConfig,
|
|
47
|
-
ProcessProtocolConfig
|
|
48
|
-
> {
|
|
49
|
-
return {
|
|
50
|
-
save: (scope, config) => configLoader.save(scope, config),
|
|
51
|
-
getConfig: () => configLoader.getConfig(),
|
|
52
|
-
getRawConfig: (scope) => configLoader.getRawConfig(scope),
|
|
53
|
-
hasScope: (scope) => configLoader.hasScope(scope),
|
|
54
|
-
hasConfig: (scope) => configLoader.hasConfig(scope),
|
|
55
|
-
getEnabledScopes: () => {
|
|
56
|
-
const enabled = new Set(configLoader.getEnabledScopes());
|
|
57
|
-
return (["global", "local", "memory"] as Scope[]).filter((scope) =>
|
|
58
|
-
enabled.has(scope),
|
|
59
|
-
);
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
@@ -95,9 +95,31 @@ function migrateDockDefaultState(
|
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
/** Config version this migration brings the config to. */
|
|
99
|
+
export const CONFIG_VERSION_V0100 = "0.10.0";
|
|
100
|
+
|
|
101
|
+
function compareSemver(a: string, b: string): number {
|
|
102
|
+
const left = a.split(".");
|
|
103
|
+
const right = b.split(".");
|
|
104
|
+
|
|
105
|
+
for (let i = 0; i < 3; i++) {
|
|
106
|
+
const diff = (Number(left[i]) || 0) - (Number(right[i]) || 0);
|
|
107
|
+
if (diff !== 0) return diff;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
98
113
|
export function needsConfigV094ToV0100Migration(
|
|
99
114
|
config: ProcessConfig,
|
|
115
|
+
fromVersion: number | string = "0.0.0",
|
|
100
116
|
): boolean {
|
|
117
|
+
// Gate on content and version: the v0.9.4 projection drops keys added
|
|
118
|
+
// after v0.10.0, so it must never touch an already-stamped config.
|
|
119
|
+
if (compareSemver(String(fromVersion), CONFIG_VERSION_V0100) >= 0) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
|
|
101
123
|
const root = config as Record<string, unknown>;
|
|
102
124
|
const widget = isRecord(root.widget) ? root.widget : undefined;
|
|
103
125
|
|
|
@@ -177,7 +199,9 @@ function setNonEmpty<K extends keyof ConfigV0100>(
|
|
|
177
199
|
|
|
178
200
|
export const configV094ToV0100Migration: Migration<ProcessConfig> = {
|
|
179
201
|
name: "001-v0-9-4-to-v0-10-0-config",
|
|
180
|
-
|
|
202
|
+
version: CONFIG_VERSION_V0100,
|
|
203
|
+
shouldRun: (config, ctx) =>
|
|
204
|
+
needsConfigV094ToV0100Migration(config, ctx.fromVersion),
|
|
181
205
|
run: (config) => migrateConfigV094ToV0100(config as ConfigV094),
|
|
182
206
|
message:
|
|
183
207
|
"Migrated pi-processes settings to the current schema. Mapped the dock hidden state to closed.",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Migration } from "@aliou/pi-utils-settings";
|
|
2
|
+
|
|
3
|
+
import type { ProcessConfig } from "../types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Current config version stamped on every settings file.
|
|
7
|
+
*
|
|
8
|
+
* Keep this in sync with the `--version` flag of the `gen:schema` and
|
|
9
|
+
* `check:schema` scripts in package.json.
|
|
10
|
+
*/
|
|
11
|
+
export const PROCESS_CONFIG_VERSION = "0.10.6";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Terminal migration: converge every config on the current version.
|
|
15
|
+
*
|
|
16
|
+
* The config is left untouched; the loader stamps `version` after the run.
|
|
17
|
+
* Configs stamped by earlier migrations (or already current) are skipped by
|
|
18
|
+
* the default version comparison.
|
|
19
|
+
*/
|
|
20
|
+
export const configVersionStampMigration: Migration<ProcessConfig> = {
|
|
21
|
+
name: "002-stamp-config-version",
|
|
22
|
+
version: PROCESS_CONFIG_VERSION,
|
|
23
|
+
run: (config) => config,
|
|
24
|
+
};
|
|
@@ -2,7 +2,7 @@ import type { Migration } from "@aliou/pi-utils-settings";
|
|
|
2
2
|
|
|
3
3
|
import type { ProcessConfig } from "../types";
|
|
4
4
|
import { configV094ToV0100Migration } from "./001-v0-9-4-to-v0-10-0-config";
|
|
5
|
-
import { configVersionStampMigration } from "./002-stamp-
|
|
5
|
+
import { configVersionStampMigration } from "./002-stamp-config-version";
|
|
6
6
|
|
|
7
7
|
export { importLegacyProcessConfig } from "./000-import-legacy-process-config";
|
|
8
8
|
export {
|
|
@@ -14,10 +14,8 @@ export {
|
|
|
14
14
|
} from "./001-v0-9-4-to-v0-10-0-config";
|
|
15
15
|
export {
|
|
16
16
|
configVersionStampMigration,
|
|
17
|
-
needsConfigVersionStamp,
|
|
18
17
|
PROCESS_CONFIG_VERSION,
|
|
19
|
-
|
|
20
|
-
} from "./002-stamp-v0-10-0-config-version";
|
|
18
|
+
} from "./002-stamp-config-version";
|
|
21
19
|
|
|
22
20
|
export const migrations: Migration<ProcessConfig>[] = [
|
|
23
21
|
configV094ToV0100Migration,
|
|
@@ -49,12 +49,13 @@ export interface WidgetConfig {
|
|
|
49
49
|
dockHeight?: number;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* User-facing pi-processes settings stored on disk.
|
|
54
|
+
*
|
|
55
|
+
* The reserved `$schema` and `version` keys are owned by the config loader
|
|
56
|
+
* and injected into schema.json by `pi-settings-schema`.
|
|
57
|
+
*/
|
|
53
58
|
export interface ProcessConfig {
|
|
54
|
-
/** JSON Schema URL used by editors for validation and autocomplete. */
|
|
55
|
-
$schema?: string;
|
|
56
|
-
/** Config migration marker written after v0.10.0 settings migration. */
|
|
57
|
-
version?: string;
|
|
58
59
|
/** Process execution settings. */
|
|
59
60
|
execution?: ExecutionConfig;
|
|
60
61
|
/** Shell-command interception settings. */
|
|
@@ -6,18 +6,21 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
+
createConfigStore,
|
|
9
10
|
registerSettingsCommand,
|
|
10
11
|
type SettingsSection,
|
|
11
12
|
} from "@aliou/pi-utils-settings";
|
|
12
13
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
13
14
|
|
|
14
15
|
import type { ProcessConfig, ProcessProtocolConfig } from "../config";
|
|
15
|
-
import {
|
|
16
|
+
import { configLoader } from "../config";
|
|
16
17
|
import { applySettingChange } from "./apply-setting-change";
|
|
17
18
|
import { buildSections } from "./build-sections";
|
|
18
19
|
|
|
19
20
|
export function registerProcessSettings(pi: ExtensionAPI): void {
|
|
20
|
-
const configStore =
|
|
21
|
+
const configStore = createConfigStore(configLoader, {
|
|
22
|
+
scopes: ["global", "local", "memory"],
|
|
23
|
+
});
|
|
21
24
|
|
|
22
25
|
registerSettingsCommand<ProcessConfig, ProcessProtocolConfig>(pi, {
|
|
23
26
|
commandName: "ps:settings",
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
defineTool,
|
|
4
4
|
type ExtensionAPI,
|
|
5
5
|
type ExtensionContext,
|
|
6
|
-
|
|
6
|
+
Theme,
|
|
7
|
+
type ToolDefinition,
|
|
7
8
|
} from "@earendil-works/pi-coding-agent";
|
|
8
9
|
import { type Component, Container, Text } from "@earendil-works/pi-tui";
|
|
9
10
|
|
|
@@ -105,11 +106,32 @@ async function execute(
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
|
|
109
|
+
/** pi's declared renderCall signature, per its public ToolDefinition type. */
|
|
110
|
+
type RenderCallFn = NonNullable<ToolDefinition["renderCall"]>;
|
|
111
|
+
/** pi's third renderCall argument (ToolRenderContext — not root-exported). */
|
|
112
|
+
type RenderCallFnContext = Parameters<RenderCallFn>[2];
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* pi invokes renderCall as (args, theme, context) where theme is pi's Theme
|
|
116
|
+
* class instance. Detecting that exact class distinguishes pi's argument
|
|
117
|
+
* order from OMP's (args, options, theme), where the second argument is a
|
|
118
|
+
* plain options object.
|
|
119
|
+
*/
|
|
120
|
+
function isPiTheme(value: unknown): value is Theme {
|
|
121
|
+
return value instanceof Theme;
|
|
122
|
+
}
|
|
123
|
+
|
|
108
124
|
function renderProcessCall(
|
|
109
125
|
args: ProcessesParamsType,
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
second: Theme | RenderCallFnContext,
|
|
127
|
+
third?: RenderCallFnContext | Theme,
|
|
112
128
|
): Component {
|
|
129
|
+
const usesPiOrder = isPiTheme(second);
|
|
130
|
+
const theme = usesPiOrder ? second : (third as Theme);
|
|
131
|
+
const context = (usesPiOrder ? third : second) as
|
|
132
|
+
| RenderCallFnContext
|
|
133
|
+
| undefined;
|
|
134
|
+
|
|
113
135
|
switch (args.action) {
|
|
114
136
|
case "start":
|
|
115
137
|
return new ToolLayout().setHeader(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliou/pi-processes",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"CONTRIBUTING.md"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aliou/pi-utils-settings": "^0.
|
|
46
|
+
"@aliou/pi-utils-settings": "^0.19.1",
|
|
47
47
|
"@aliou/pi-utils-ui": "^0.5.0",
|
|
48
48
|
"@aliou/sh": "^0.1.0"
|
|
49
49
|
},
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"typecheck:evals": "tsc --noEmit -p tests/evals/tsconfig.json",
|
|
76
76
|
"lint": "biome check",
|
|
77
77
|
"format": "biome check --write",
|
|
78
|
-
"gen:schema": "
|
|
79
|
-
"check:schema": "
|
|
78
|
+
"gen:schema": "pi-settings-schema -p extensions/processes/config/types.ts -t ProcessConfig -o schema.json --version 0.10.6",
|
|
79
|
+
"check:schema": "pi-settings-schema -p extensions/processes/config/types.ts -t ProcessConfig -o schema.json --version 0.10.6 --check",
|
|
80
80
|
"check:changesets": "node scripts/check-changesets.ts",
|
|
81
81
|
"check:lockfile": "pnpm install --frozen-lockfile --ignore-scripts",
|
|
82
82
|
"prepare": "[ -d .git ] && husky || true",
|
package/schema.json
CHANGED
|
@@ -1,134 +1,142 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$ref": "#/definitions/ProcessConfig",
|
|
3
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$ref": "#/definitions/ProcessConfig",
|
|
4
4
|
"definitions": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"ProcessConfig": {
|
|
6
|
+
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"execution": {
|
|
9
|
+
"$ref": "#/definitions/ExecutionConfig",
|
|
10
|
+
"description": "Process execution settings."
|
|
11
|
+
},
|
|
12
|
+
"interception": {
|
|
13
|
+
"$ref": "#/definitions/InterceptionConfig",
|
|
14
|
+
"description": "Shell-command interception settings."
|
|
15
|
+
},
|
|
16
|
+
"processList": {
|
|
17
|
+
"$ref": "#/definitions/ProcessListConfig",
|
|
18
|
+
"description": "Process overview and log viewport settings."
|
|
19
|
+
},
|
|
20
|
+
"output": {
|
|
21
|
+
"$ref": "#/definitions/OutputConfig",
|
|
22
|
+
"description": "Process output retention settings."
|
|
23
|
+
},
|
|
24
|
+
"follow": {
|
|
25
|
+
"$ref": "#/definitions/FollowConfig",
|
|
26
|
+
"description": "Live log follow behavior."
|
|
27
|
+
},
|
|
28
|
+
"widget": {
|
|
29
|
+
"$ref": "#/definitions/WidgetConfig",
|
|
30
|
+
"description": "Dock and status widget settings."
|
|
31
|
+
},
|
|
32
|
+
"$schema": {
|
|
10
33
|
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"version": {
|
|
36
|
+
"anyOf": [
|
|
37
|
+
{
|
|
38
|
+
"type": "integer",
|
|
39
|
+
"minimum": 0
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "string",
|
|
43
|
+
"pattern": "^\\d{1,15}(\\.\\d{1,15})?(\\.\\d{1,15})?$"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"description": "Config schema version, stamped by migrations. Current version: 0.10.6."
|
|
11
47
|
}
|
|
12
48
|
},
|
|
13
|
-
"type": "object"
|
|
14
|
-
},
|
|
15
|
-
"FollowConfig": {
|
|
16
49
|
"additionalProperties": false,
|
|
50
|
+
"description": "User-facing pi-processes settings stored on disk.\n\nThe reserved `$schema` and `version` keys are owned by the config loader and injected into schema.json by `pi-settings-schema`."
|
|
51
|
+
},
|
|
52
|
+
"ExecutionConfig": {
|
|
53
|
+
"type": "object",
|
|
17
54
|
"properties": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
},
|
|
22
|
-
"enabledByDefault": {
|
|
23
|
-
"description": "Open process log interfaces in follow mode by default.",
|
|
24
|
-
"type": "boolean"
|
|
55
|
+
"shellPath": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Absolute shell executable used to run process commands."
|
|
25
58
|
}
|
|
26
59
|
},
|
|
27
|
-
"
|
|
60
|
+
"additionalProperties": false
|
|
28
61
|
},
|
|
29
62
|
"InterceptionConfig": {
|
|
30
|
-
"
|
|
63
|
+
"type": "object",
|
|
31
64
|
"properties": {
|
|
32
65
|
"blockBackgroundCommands": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"description": "Block shell background patterns and redirect the agent to the process tool."
|
|
35
68
|
}
|
|
36
69
|
},
|
|
37
|
-
"
|
|
70
|
+
"additionalProperties": false
|
|
38
71
|
},
|
|
39
|
-
"
|
|
40
|
-
"
|
|
72
|
+
"ProcessListConfig": {
|
|
73
|
+
"type": "object",
|
|
41
74
|
"properties": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
},
|
|
46
|
-
"maxOutputBytes": {
|
|
47
|
-
"description": "Maximum bytes retained by each process log interface.",
|
|
48
|
-
"type": "number"
|
|
75
|
+
"maxPreviewLines": {
|
|
76
|
+
"type": "number",
|
|
77
|
+
"description": "Maximum log rows displayed in the overview preview and logs overlay."
|
|
49
78
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
79
|
+
"maxVisibleProcesses": {
|
|
80
|
+
"type": "number",
|
|
81
|
+
"description": "Maximum process rows displayed in the overview before scrolling."
|
|
53
82
|
}
|
|
54
83
|
},
|
|
55
|
-
"
|
|
84
|
+
"additionalProperties": false
|
|
56
85
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"description": "User-facing pi-processes settings stored on disk.",
|
|
86
|
+
"OutputConfig": {
|
|
87
|
+
"type": "object",
|
|
60
88
|
"properties": {
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
},
|
|
65
|
-
"execution": {
|
|
66
|
-
"$ref": "#/definitions/ExecutionConfig",
|
|
67
|
-
"description": "Process execution settings."
|
|
68
|
-
},
|
|
69
|
-
"follow": {
|
|
70
|
-
"$ref": "#/definitions/FollowConfig",
|
|
71
|
-
"description": "Live log follow behavior."
|
|
72
|
-
},
|
|
73
|
-
"interception": {
|
|
74
|
-
"$ref": "#/definitions/InterceptionConfig",
|
|
75
|
-
"description": "Shell-command interception settings."
|
|
76
|
-
},
|
|
77
|
-
"output": {
|
|
78
|
-
"$ref": "#/definitions/OutputConfig",
|
|
79
|
-
"description": "Process output retention settings."
|
|
80
|
-
},
|
|
81
|
-
"processList": {
|
|
82
|
-
"$ref": "#/definitions/ProcessListConfig",
|
|
83
|
-
"description": "Process overview and log viewport settings."
|
|
89
|
+
"defaultTailLines": {
|
|
90
|
+
"type": "number",
|
|
91
|
+
"description": "Default number of recent lines returned by the process output action."
|
|
84
92
|
},
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
93
|
+
"maxOutputLines": {
|
|
94
|
+
"type": "number",
|
|
95
|
+
"description": "Maximum lines retained by process log interfaces."
|
|
88
96
|
},
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"description": "
|
|
97
|
+
"maxOutputBytes": {
|
|
98
|
+
"type": "number",
|
|
99
|
+
"description": "Maximum bytes retained by each process log interface."
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
|
-
"
|
|
102
|
+
"additionalProperties": false
|
|
95
103
|
},
|
|
96
|
-
"
|
|
97
|
-
"
|
|
104
|
+
"FollowConfig": {
|
|
105
|
+
"type": "object",
|
|
98
106
|
"properties": {
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
107
|
+
"enabledByDefault": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"description": "Open process log interfaces in follow mode by default."
|
|
102
110
|
},
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
111
|
+
"autoHideOnFinish": {
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"description": "Hide process log interfaces when all managed processes finish."
|
|
106
114
|
}
|
|
107
115
|
},
|
|
108
|
-
"
|
|
116
|
+
"additionalProperties": false
|
|
109
117
|
},
|
|
110
118
|
"WidgetConfig": {
|
|
111
|
-
"
|
|
119
|
+
"type": "object",
|
|
112
120
|
"properties": {
|
|
121
|
+
"showStatusWidget": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"description": "Show a one-line process summary below the editor."
|
|
124
|
+
},
|
|
113
125
|
"dockDefaultState": {
|
|
114
|
-
"
|
|
126
|
+
"type": "string",
|
|
115
127
|
"enum": [
|
|
116
128
|
"closed",
|
|
117
129
|
"collapsed",
|
|
118
130
|
"expanded"
|
|
119
131
|
],
|
|
120
|
-
"
|
|
132
|
+
"description": "Initial visibility of the process dock."
|
|
121
133
|
},
|
|
122
134
|
"dockHeight": {
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
},
|
|
126
|
-
"showStatusWidget": {
|
|
127
|
-
"description": "Show a one-line process summary below the editor.",
|
|
128
|
-
"type": "boolean"
|
|
135
|
+
"type": "number",
|
|
136
|
+
"description": "Number of log rows displayed in the expanded process dock."
|
|
129
137
|
}
|
|
130
138
|
},
|
|
131
|
-
"
|
|
139
|
+
"additionalProperties": false
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
|
-
}
|
|
142
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Migration } from "@aliou/pi-utils-settings";
|
|
2
|
-
|
|
3
|
-
import type { ProcessConfig } from "../types";
|
|
4
|
-
|
|
5
|
-
export const PROCESS_CONFIG_VERSION = "0.10.0";
|
|
6
|
-
|
|
7
|
-
export function needsConfigVersionStamp(config: ProcessConfig): boolean {
|
|
8
|
-
return (config.version ?? "") < PROCESS_CONFIG_VERSION;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function stampConfigVersion(config: ProcessConfig): ProcessConfig {
|
|
12
|
-
return { ...config, version: PROCESS_CONFIG_VERSION };
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const configVersionStampMigration: Migration<ProcessConfig> = {
|
|
16
|
-
name: "002-stamp-v0-10-0-config-version",
|
|
17
|
-
shouldRun: needsConfigVersionStamp,
|
|
18
|
-
run: (config) => stampConfigVersion(config),
|
|
19
|
-
message:
|
|
20
|
-
"Updated pi-processes settings for v0.10.0. This release rewrites the package into separate process, logs, and dock extensions while preserving your existing settings. Release notes are available at https://github.com/aliou/pi-processes/releases/tag/v0.10.0.",
|
|
21
|
-
};
|