@timurproko/a1 0.1.8-dev.151 → 0.1.8-dev.157
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 +21 -9
- package/bin/cli.js +1 -0
- package/dist/cli/dispatch.d.ts +6 -0
- package/dist/cli/dispatch.js +107 -81
- package/dist/cli/version-stats.js +7 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/ui/components/text.js +24 -2
- package/docs/ci-release-runbook.md +6 -5
- package/docs/features/launch-profiles.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,20 +23,28 @@ npm install -g @timurproko/a1@0.1.8-dev.107
|
|
|
23
23
|
## Use
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
a1
|
|
27
|
-
a1
|
|
28
|
-
a1
|
|
29
|
-
a1 update
|
|
30
|
-
a1 update
|
|
31
|
-
a1 update --
|
|
26
|
+
a1 # launch A1 (profile: ~/.a1/agent)
|
|
27
|
+
a1 --help # show all commands (short form: a1 -h)
|
|
28
|
+
a1 --version # show the version (short form: a1 -v)
|
|
29
|
+
a1 update # install the newest stable release
|
|
30
|
+
a1 update --develop # install the current development preview
|
|
31
|
+
a1 update --develop 107 # install numbered preview 107
|
|
32
|
+
a1 update --develop 0.1.8-dev.107 # install that exact preview
|
|
33
|
+
a1 update --models # refresh A1's model catalogs
|
|
32
34
|
```
|
|
33
35
|
|
|
36
|
+
Stable builds print only their installed version. Development builds also show the
|
|
37
|
+
current development and stable channel versions.
|
|
38
|
+
|
|
34
39
|
Development previews add the Pi comparison profile; release builds do not carry it.
|
|
35
40
|
|
|
36
41
|
```sh
|
|
37
|
-
a1 pi
|
|
42
|
+
a1 pi # vanilla Pi oracle: ~/.pi/agent
|
|
38
43
|
```
|
|
39
44
|
|
|
45
|
+
Unsupported commands exit quietly without launching anything. The removed
|
|
46
|
+
`update:<preview>` forms are not aliases; use `update --develop`.
|
|
47
|
+
|
|
40
48
|
## Extensions
|
|
41
49
|
|
|
42
50
|
Pi extension packages install into A1's own profile (`~/.a1/agent`), so bare `a1`
|
|
@@ -49,8 +57,12 @@ a1 pi remove npm:pi-mcp-adapter # remove it (alias: a1 pi uninstall)
|
|
|
49
57
|
a1 pi list # list installed packages
|
|
50
58
|
a1 pi update --extensions # update every installed package
|
|
51
59
|
a1 pi update npm:pi-mcp-adapter # update one
|
|
60
|
+
a1 pi update --models # refresh A1's model catalogs
|
|
52
61
|
```
|
|
53
62
|
|
|
63
|
+
A1 pins the Pi runtime carried by each release, so Pi self-update forms are refused.
|
|
64
|
+
Update A1 itself with `a1 update` or `a1 update --develop`.
|
|
65
|
+
|
|
54
66
|
A running session picks up a newly installed package after a restart.
|
|
55
67
|
Configuration is isolated the same way: bare `a1` reads `~/.a1/agent` (or the
|
|
56
68
|
project), never `~/.pi/agent`. Configure MCP with `/mcp setup` inside bare `a1`.
|
|
@@ -88,8 +100,8 @@ npm run develop # request the preview publish run and wait for it
|
|
|
88
100
|
Install:
|
|
89
101
|
|
|
90
102
|
```sh
|
|
91
|
-
a1 update
|
|
92
|
-
a1 update
|
|
103
|
+
a1 update --develop 107 # install preview 107
|
|
104
|
+
a1 update --develop 0.1.8-dev.107 # install that exact full preview version
|
|
93
105
|
```
|
|
94
106
|
|
|
95
107
|
### Stable
|
package/bin/cli.js
CHANGED
|
@@ -45,5 +45,6 @@ process.exitCode = await dispatchCli(process.argv.slice(2), {
|
|
|
45
45
|
return await runPackageCommand(request, { createPort: createPiPackagesPort });
|
|
46
46
|
},
|
|
47
47
|
}, {
|
|
48
|
+
stdout: message => process.stdout.write(message),
|
|
48
49
|
stderr: message => process.stderr.write(message),
|
|
49
50
|
}, capabilities);
|
package/dist/cli/dispatch.d.ts
CHANGED
|
@@ -9,11 +9,17 @@ export interface CliHandlers {
|
|
|
9
9
|
readonly packages: (request: PackageCommandRequest) => Promise<number>;
|
|
10
10
|
}
|
|
11
11
|
export interface CliOutput {
|
|
12
|
+
readonly stdout: (message: string) => void;
|
|
12
13
|
readonly stderr: (message: string) => void;
|
|
13
14
|
}
|
|
14
15
|
export declare function cliUsage(capabilities: CliCapabilities): string;
|
|
16
|
+
export declare function cliHelp(capabilities: CliCapabilities): string;
|
|
15
17
|
export declare function dispatchCli(arguments_: readonly string[], handlers: CliHandlers, output: CliOutput, capabilities: CliCapabilities): Promise<number>;
|
|
16
18
|
export type CliCommand = {
|
|
19
|
+
readonly kind: "noop";
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "help";
|
|
22
|
+
} | {
|
|
17
23
|
readonly kind: "launch";
|
|
18
24
|
readonly profileId: LaunchProfileId;
|
|
19
25
|
} | {
|
package/dist/cli/dispatch.js
CHANGED
|
@@ -4,21 +4,60 @@ export function cliUsage(capabilities) {
|
|
|
4
4
|
return PRODUCT_TEXT.usage([
|
|
5
5
|
"",
|
|
6
6
|
...(capabilities.developmentComparison ? ["pi"] : []),
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"--help",
|
|
8
|
+
"-h",
|
|
9
|
+
"--version",
|
|
10
|
+
"-v",
|
|
11
|
+
"update",
|
|
12
|
+
"update --develop [preview-or-version]",
|
|
13
|
+
"update --models",
|
|
11
14
|
"pi install <source>",
|
|
12
15
|
"pi remove <source>",
|
|
16
|
+
"pi uninstall <source>",
|
|
13
17
|
"pi list",
|
|
14
|
-
"pi update
|
|
18
|
+
"pi update --extensions",
|
|
19
|
+
"pi update --models",
|
|
20
|
+
"pi update <source>",
|
|
15
21
|
]);
|
|
16
22
|
}
|
|
23
|
+
export function cliHelp(capabilities) {
|
|
24
|
+
const command = PRODUCT_TEXT.commandName;
|
|
25
|
+
return [
|
|
26
|
+
"Common:",
|
|
27
|
+
` ${command}`,
|
|
28
|
+
...(capabilities.developmentComparison ? [` ${command} pi`] : []),
|
|
29
|
+
` ${command} --help`,
|
|
30
|
+
` ${command} -h`,
|
|
31
|
+
` ${command} --version`,
|
|
32
|
+
` ${command} -v`,
|
|
33
|
+
"",
|
|
34
|
+
"Update:",
|
|
35
|
+
` ${command} update`,
|
|
36
|
+
` ${command} update --develop [preview-or-version]`,
|
|
37
|
+
` ${command} update --models`,
|
|
38
|
+
"",
|
|
39
|
+
"Pi-compatible packages:",
|
|
40
|
+
` ${command} pi install <source>`,
|
|
41
|
+
` ${command} pi remove <source>`,
|
|
42
|
+
` ${command} pi uninstall <source>`,
|
|
43
|
+
` ${command} pi list`,
|
|
44
|
+
` ${command} pi update --extensions`,
|
|
45
|
+
` ${command} pi update --models`,
|
|
46
|
+
` ${command} pi update <source>`,
|
|
47
|
+
"",
|
|
48
|
+
].join("\n");
|
|
49
|
+
}
|
|
17
50
|
const PROFILE_WORDS = new Set(["pi"]);
|
|
18
51
|
export async function dispatchCli(arguments_, handlers, output, capabilities) {
|
|
19
52
|
const command = parseCliCommand(arguments_, capabilities);
|
|
53
|
+
if (command.kind === "noop")
|
|
54
|
+
return 0;
|
|
55
|
+
if (command.kind === "help") {
|
|
56
|
+
output.stdout(cliHelp(capabilities));
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
20
59
|
if (command.kind === "error") {
|
|
21
|
-
output.stderr(`${command.message}\n
|
|
60
|
+
output.stderr(`${command.message}\n`);
|
|
22
61
|
return 2;
|
|
23
62
|
}
|
|
24
63
|
if (command.kind === "launch")
|
|
@@ -33,76 +72,63 @@ export function parseCliCommand(arguments_, capabilities) {
|
|
|
33
72
|
if (arguments_.length === 0)
|
|
34
73
|
return { kind: "launch", profileId: "a1" };
|
|
35
74
|
const [command, ...rest] = arguments_;
|
|
75
|
+
if (command === "--help" || command === "-h")
|
|
76
|
+
return withoutArguments(rest, { kind: "help" });
|
|
77
|
+
if (command === "--version" || command === "-v")
|
|
78
|
+
return withoutArguments(rest, { kind: "version" });
|
|
36
79
|
if (command === "pi") {
|
|
37
80
|
if (rest.length > 0)
|
|
38
81
|
return parsePiPackageCommand(rest);
|
|
39
|
-
|
|
40
|
-
return { kind: "launch", profileId: "pi" };
|
|
82
|
+
return capabilities.developmentComparison ? { kind: "launch", profileId: "pi" } : { kind: "noop" };
|
|
41
83
|
}
|
|
42
|
-
if (command === "version")
|
|
43
|
-
return withoutArguments(rest, { kind: "version" });
|
|
44
|
-
if (command !== undefined && command.startsWith("update:"))
|
|
45
|
-
return parseColonUpdate(command.slice("update:".length), rest);
|
|
46
84
|
if (command === "update")
|
|
47
85
|
return parseUpdate(rest);
|
|
48
|
-
if (command
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (command === "agent")
|
|
54
|
-
return { kind: "error", message: `Bare ${PRODUCT_TEXT.commandName} is the ${PRODUCT_TEXT.displayName} agent experience; there is no agent subcommand.` };
|
|
55
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`received an unknown command: ${command ?? ""}`) };
|
|
86
|
+
if (command?.startsWith("update:"))
|
|
87
|
+
return { kind: "noop" };
|
|
88
|
+
// Unsupported and reserved command spaces are deliberately quiet. Help is
|
|
89
|
+
// explicit, and a typo must never start an interactive or maintenance path.
|
|
90
|
+
return { kind: "noop" };
|
|
56
91
|
}
|
|
57
92
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
function parseColonUpdate(suffix, rest) {
|
|
63
|
-
if (rest.length > 0)
|
|
64
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic("update takes what to move to after the colon, and nothing else.") };
|
|
65
|
-
if (suffix === "next") {
|
|
66
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`renamed its development channel; run ${PRODUCT_TEXT.commandName} update:develop.`) };
|
|
67
|
-
}
|
|
68
|
-
if (suffix === "develop")
|
|
69
|
-
return { kind: "update", channel: "next" };
|
|
70
|
-
if (suffix.length === 0)
|
|
71
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`update: needs a preview after the colon, as in ${PRODUCT_TEXT.commandName} update:develop.`) };
|
|
72
|
-
if (!/^[1-9]\d*$/.test(suffix) && !/^\d+\.\d+\.\d+-dev\.[1-9]\d*$/.test(suffix)) {
|
|
73
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`received an unusable numbered preview: ${suffix}`) };
|
|
74
|
-
}
|
|
75
|
-
return { kind: "update", channel: "next", target: suffix };
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Top-level `update` owns A1 itself and A1's model catalogs. Extension package
|
|
79
|
-
* maintenance lives under the `pi` compatibility namespace, while updating the
|
|
80
|
-
* pinned Pi runtime remains impossible.
|
|
93
|
+
* Stable update is the empty form. `--develop` selects the moving development
|
|
94
|
+
* head or one immutable numbered preview, while model refresh remains a separate
|
|
95
|
+
* operation that cannot be combined with either update channel.
|
|
81
96
|
*/
|
|
82
97
|
function parseUpdate(rest) {
|
|
83
98
|
if (rest.length === 0)
|
|
84
99
|
return { kind: "update", channel: "stable" };
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return { kind: "
|
|
100
|
+
const [selector, ...values] = rest;
|
|
101
|
+
// Removed compatibility notation is unsupported rather than deprecated.
|
|
102
|
+
if (selector === "self")
|
|
103
|
+
return { kind: "noop" };
|
|
104
|
+
if (selector === "--develop") {
|
|
105
|
+
if (values.length === 0)
|
|
106
|
+
return { kind: "update", channel: "next" };
|
|
107
|
+
if (values.length > 1)
|
|
108
|
+
return updateGrammarError("--develop accepts at most one preview number or version.");
|
|
109
|
+
const [target] = values;
|
|
110
|
+
if (target === undefined || !isDevelopmentTarget(target)) {
|
|
111
|
+
return updateGrammarError(`--develop received an unusable preview: ${target ?? ""}`);
|
|
112
|
+
}
|
|
113
|
+
return { kind: "update", channel: "next", target };
|
|
99
114
|
}
|
|
100
|
-
if (
|
|
115
|
+
if (selector === "--models") {
|
|
116
|
+
if (values.length > 0)
|
|
117
|
+
return updateGrammarError("--models cannot be combined with another update selector.");
|
|
101
118
|
return { kind: "packages", request: { verb: "refresh-models", source: null } };
|
|
102
|
-
if (target === "--extensions" || (target !== undefined && !target.startsWith("-"))) {
|
|
103
|
-
return packageNamespaceRejection("update", target === "--extensions" ? "--extensions" : target);
|
|
104
119
|
}
|
|
105
|
-
|
|
120
|
+
if (selector === "pi")
|
|
121
|
+
return pinnedPiUpdateError();
|
|
122
|
+
if (selector !== undefined && selector.startsWith("-"))
|
|
123
|
+
return unknownOption(selector, "update");
|
|
124
|
+
// Positional update targets are reserved for a future A1-native plugin model.
|
|
125
|
+
return { kind: "noop" };
|
|
126
|
+
}
|
|
127
|
+
function isDevelopmentTarget(target) {
|
|
128
|
+
return /^[1-9]\d*$/.test(target) || /^\d+\.\d+\.\d+-dev\.[1-9]\d*$/.test(target);
|
|
129
|
+
}
|
|
130
|
+
function updateGrammarError(detail) {
|
|
131
|
+
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`could not parse update: ${detail}`) };
|
|
106
132
|
}
|
|
107
133
|
function parsePiPackageCommand(arguments_) {
|
|
108
134
|
const [verb, ...rest] = arguments_;
|
|
@@ -113,30 +139,40 @@ function parsePiPackageCommand(arguments_) {
|
|
|
113
139
|
return withoutArguments(rest, { kind: "packages", request: { verb: "list", source: null } });
|
|
114
140
|
if (verb === "update")
|
|
115
141
|
return parsePiPackageUpdate(rest);
|
|
116
|
-
return { kind: "
|
|
142
|
+
return { kind: "noop" };
|
|
117
143
|
}
|
|
118
144
|
function parsePiPackageUpdate(rest) {
|
|
119
|
-
if (rest.length === 0)
|
|
120
|
-
return
|
|
121
|
-
}
|
|
145
|
+
if (rest.length === 0)
|
|
146
|
+
return pinnedPiUpdateError();
|
|
122
147
|
if (rest.length > 1)
|
|
123
148
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic("pi update accepts one target.") };
|
|
124
149
|
const [target] = rest;
|
|
125
150
|
if (target === "--extensions")
|
|
126
151
|
return { kind: "packages", request: { verb: "update", source: null } };
|
|
127
|
-
if (target === "--models")
|
|
128
|
-
return { kind: "
|
|
129
|
-
|
|
152
|
+
if (target === "--models")
|
|
153
|
+
return { kind: "packages", request: { verb: "refresh-models", source: null } };
|
|
154
|
+
if (target === "--self" || target === "--all" || target === "self" || target === "pi")
|
|
155
|
+
return pinnedPiUpdateError();
|
|
130
156
|
if (target === undefined || target.startsWith("-"))
|
|
131
157
|
return unknownOption(target ?? "", "pi update");
|
|
132
|
-
if (PROFILE_WORDS.has(target))
|
|
133
|
-
return profileRejection("update");
|
|
134
158
|
return { kind: "packages", request: { verb: "update", source: target } };
|
|
135
159
|
}
|
|
160
|
+
function pinnedPiUpdateError() {
|
|
161
|
+
return {
|
|
162
|
+
kind: "error",
|
|
163
|
+
message: [
|
|
164
|
+
PRODUCT_TEXT.diagnostic("pins its certified Pi runtime and cannot update it independently."),
|
|
165
|
+
"Use:",
|
|
166
|
+
` ${PRODUCT_TEXT.commandName} update Update A1`,
|
|
167
|
+
` ${PRODUCT_TEXT.commandName} pi update --extensions Update Pi-compatible packages`,
|
|
168
|
+
` ${PRODUCT_TEXT.commandName} pi update --models Refresh model catalogs`,
|
|
169
|
+
].join("\n"),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
136
172
|
function parseSourceCommand(verb, rest) {
|
|
137
173
|
const flag = rest.find(argument => argument.startsWith("-"));
|
|
138
174
|
if (flag !== undefined)
|
|
139
|
-
return unknownOption(flag, verb);
|
|
175
|
+
return unknownOption(flag, `pi ${verb}`);
|
|
140
176
|
if (rest.length === 0)
|
|
141
177
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`${verb} requires a package source.`) };
|
|
142
178
|
if (rest.length > 1)
|
|
@@ -151,18 +187,8 @@ function parseSourceCommand(verb, rest) {
|
|
|
151
187
|
function withoutArguments(rest, command) {
|
|
152
188
|
if (rest.length === 0)
|
|
153
189
|
return command;
|
|
154
|
-
const [argument] = rest;
|
|
155
|
-
if (argument !== undefined && (PROFILE_WORDS.has(argument) || argument.startsWith("--profile")))
|
|
156
|
-
return profileRejection("list");
|
|
157
190
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic("commands do not accept additional arguments.") };
|
|
158
191
|
}
|
|
159
|
-
function packageNamespaceRejection(verb, target) {
|
|
160
|
-
const suffix = target === undefined ? "" : ` ${target}`;
|
|
161
|
-
return {
|
|
162
|
-
kind: "error",
|
|
163
|
-
message: PRODUCT_TEXT.diagnostic(`manages extension packages under its pi namespace; run ${PRODUCT_TEXT.commandName} pi ${verb}${suffix}.`),
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
192
|
function profileRejection(verb) {
|
|
167
193
|
return {
|
|
168
194
|
kind: "error",
|
|
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import crossSpawn from "cross-spawn";
|
|
5
|
-
import { valid as validSemver } from "semver";
|
|
5
|
+
import { prerelease, valid as validSemver } from "semver";
|
|
6
6
|
import { PRODUCT_TEXT } from "../product-identity.js";
|
|
7
7
|
const defaultOutput = {
|
|
8
8
|
stdout(message) { process.stdout.write(message); },
|
|
@@ -20,6 +20,12 @@ export async function runVersionStats(options) {
|
|
|
20
20
|
output.stderr(`${PRODUCT_TEXT.diagnostic(`could not read its installed version: ${message(error)}`)}\n`);
|
|
21
21
|
return 1;
|
|
22
22
|
}
|
|
23
|
+
// Match Pi's release behavior: stable builds print only their installed version.
|
|
24
|
+
// Development builds retain channel visibility for preview comparison and updates.
|
|
25
|
+
if (prerelease(installed) === null) {
|
|
26
|
+
output.stdout(`${installed}\n`);
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
23
29
|
const remote = await queryDistTags(runner, options.fetcher ?? defaultRegistryFetcher);
|
|
24
30
|
output.stdout(`Current: ${installed}\nDevelop: ${remote.develop ?? "unavailable"}\nRelease: ${remote.release ?? "unavailable"}\n`);
|
|
25
31
|
if (remote.error)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"platform": "darwin",
|
|
6
6
|
"architecture": "arm64",
|
|
7
7
|
"capability": "unsupported",
|
|
8
|
-
"builtAt": "2026-08-
|
|
8
|
+
"builtAt": "2026-08-28T12:29:51.254Z",
|
|
9
9
|
"artifact": {
|
|
10
10
|
"filename": "process-guardian",
|
|
11
11
|
"sha256": "7524bf568992517f50ed53196c861c5edeba0d7275633bb4735ab45bd5963a28",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"platform": "linux",
|
|
6
6
|
"architecture": "x64",
|
|
7
7
|
"capability": "supported",
|
|
8
|
-
"builtAt": "2026-08-
|
|
8
|
+
"builtAt": "2026-08-28T12:30:02.835Z",
|
|
9
9
|
"artifact": {
|
|
10
10
|
"filename": "process-guardian",
|
|
11
11
|
"sha256": "ee8a00eaaf79c707459bbbfb52518e9739314967049fbe5fa625f36ce33db9ee",
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"platform": "win32",
|
|
6
6
|
"architecture": "x64",
|
|
7
7
|
"capability": "supported",
|
|
8
|
-
"builtAt": "2026-08-
|
|
8
|
+
"builtAt": "2026-08-28T12:30:44.840Z",
|
|
9
9
|
"artifact": {
|
|
10
10
|
"filename": "process-guardian.exe",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "ba7b712f918bc77cdf847bcb7b2473ded2aaf10b057bd12360ac3fa654b5f36c",
|
|
12
12
|
"size": 177664
|
|
13
13
|
},
|
|
14
14
|
"provenance": {
|
|
Binary file
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
const ANSI_PATTERN = /\[[0-9;:?]*[ -/]*[@-~]|\][^]*(?:|\\)|[@-Z\\-_]/g;
|
|
8
8
|
const SEGMENTER = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
9
9
|
const WORD_SEGMENTER = new Intl.Segmenter(undefined, { granularity: "word" });
|
|
10
|
+
/**
|
|
11
|
+
* Recommended-for-general-interchange emoji. Terminals give every one of these
|
|
12
|
+
* two columns wherever its code points sit, so the wide blocks in
|
|
13
|
+
* `codePointWidth` cannot carry the measurement alone: a lone U+26A1 or any
|
|
14
|
+
* U+FE0F presentation sequence escapes them and would measure one column short.
|
|
15
|
+
*/
|
|
16
|
+
const RGI_EMOJI_PATTERN = /^\p{RGI_Emoji}$/v;
|
|
17
|
+
/** Columns a terminal advances for a tab, matching the host runtime. */
|
|
18
|
+
const TAB_WIDTH = 3;
|
|
10
19
|
/** Removes styling sequences so only visible characters remain. */
|
|
11
20
|
export function stripAnsi(text) {
|
|
12
21
|
return text.replace(ANSI_PATTERN, "");
|
|
@@ -50,13 +59,26 @@ function codePointWidth(codePoint) {
|
|
|
50
59
|
return 2;
|
|
51
60
|
if (codePoint >= 0x20000 && codePoint <= 0x3fffd)
|
|
52
61
|
return 2;
|
|
53
|
-
//
|
|
62
|
+
// A tab advances to the host runtime's stop; other control characters occupy nothing.
|
|
63
|
+
if (codePoint === 0x09)
|
|
64
|
+
return TAB_WIDTH;
|
|
54
65
|
if (codePoint < 0x20 || (codePoint >= 0x7f && codePoint < 0xa0))
|
|
55
66
|
return 0;
|
|
56
67
|
return 1;
|
|
57
68
|
}
|
|
58
|
-
/**
|
|
69
|
+
/** Cheap pre-filter: only clusters that could be emoji pay for the RGI test. */
|
|
70
|
+
function couldBeEmoji(grapheme) {
|
|
71
|
+
const codePoint = grapheme.codePointAt(0) ?? 0;
|
|
72
|
+
return ((codePoint >= 0x1f000 && codePoint <= 0x1fbff) ||
|
|
73
|
+
(codePoint >= 0x2300 && codePoint <= 0x23ff) ||
|
|
74
|
+
(codePoint >= 0x2600 && codePoint <= 0x27bf) ||
|
|
75
|
+
(codePoint >= 0x2b00 && codePoint <= 0x2bff) ||
|
|
76
|
+
grapheme.length > 1);
|
|
77
|
+
}
|
|
78
|
+
/** Width of one grapheme cluster: two for emoji, else the widest code point it contains. */
|
|
59
79
|
function graphemeWidth(grapheme) {
|
|
80
|
+
if (couldBeEmoji(grapheme) && RGI_EMOJI_PATTERN.test(grapheme))
|
|
81
|
+
return 2;
|
|
60
82
|
let width = 0;
|
|
61
83
|
for (const character of grapheme) {
|
|
62
84
|
width = Math.max(width, codePointWidth(character.codePointAt(0) ?? 0));
|
|
@@ -56,13 +56,14 @@ internal `next` dist-tag and never moves `latest`.
|
|
|
56
56
|
Users install previews with public `develop` terminology:
|
|
57
57
|
|
|
58
58
|
```sh
|
|
59
|
-
a1 update
|
|
60
|
-
a1 update
|
|
61
|
-
a1 update
|
|
59
|
+
a1 update --develop # current development channel
|
|
60
|
+
a1 update --develop 107 # numbered preview
|
|
61
|
+
a1 update --develop 0.1.8-dev.107 # exact full preview version
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
`a1 update
|
|
65
|
-
or runtime
|
|
64
|
+
The former `a1 update:<selector>` commands are removed without compatibility
|
|
65
|
+
aliases or redirects. Unsupported forms exit quietly without registry or runtime
|
|
66
|
+
work.
|
|
66
67
|
|
|
67
68
|
## Cutting a stable release
|
|
68
69
|
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
| `a1` | A1-owned Pi-compatible UI | `~/.a1/agent` |
|
|
8
8
|
| `a1 pi` | Pi-compatible comparison surface using the ordinary Pi profile | ordinary `~/.pi/agent` |
|
|
9
9
|
|
|
10
|
-
`a1 pi` is a development instrument for comparing A1 against pinned Pi. Prerelease builds — what `a1 update
|
|
10
|
+
`a1 pi` is a development instrument for comparing A1 against pinned Pi. Prerelease builds — what `a1 update --develop` or `a1 update --develop <number>` installs — expose it. A release build does not recognize the launch form. Repository development can run the comparison directly with `npm start:pi`.
|
|
11
11
|
|
|
12
|
-
There is no `a1 agent` command. The former `a1 ui` subcommand is removed. Bare `a1` is the owned agent product surface and remains the entry point when multi-agent UX is introduced.
|
|
12
|
+
There is no `a1 agent` command. The former `a1 ui` subcommand is removed. Unsupported commands return quietly without selecting another runtime. Bare `a1` is the owned agent product surface and remains the entry point when multi-agent UX is introduced.
|
|
13
13
|
|
|
14
14
|
## First launch
|
|
15
15
|
|
|
@@ -46,4 +46,4 @@ Normal root exit, terminal closure, guardian failure, and verified update shutdo
|
|
|
46
46
|
|
|
47
47
|
## Recovery and comparison
|
|
48
48
|
|
|
49
|
-
If bare `a1` cannot start or a UI workflow diverges, run `a1 pi` from the same working directory and compare the behavior. Profile data is intentionally separate, so authentication or settings may need to be configured independently. Use `a1 version` to record the installed A1 release before reporting a difference.
|
|
49
|
+
If bare `a1` cannot start or a UI workflow diverges, run `a1 pi` from the same working directory and compare the behavior. Profile data is intentionally separate, so authentication or settings may need to be configured independently. Use `a1 --version` to record the installed A1 release before reporting a difference.
|