@aibyzero/byz 0.1.2 → 0.1.3
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 +10 -0
- package/README.md +22 -0
- package/dist/cli.js +19 -2
- package/dist/fast.js +64 -0
- package/dist/runtime/bundle/chunks/{chunk-Q4KIHSRR.js → chunk-QY7DJQRI.js} +2 -2
- package/dist/runtime/bundle/cli.js +1 -1
- package/dist/runtime/bundle/index.js +1 -1
- package/dist/runtime/bundle/rpc-entry.js +1 -1
- package/dist/runtime/core/resource-loader.d.ts +1 -0
- package/dist/runtime/core/resource-loader.d.ts.map +1 -1
- package/dist/runtime/core/resource-loader.js +8 -3
- package/dist/runtime/core/resource-loader.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.3 - 2026-08-27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added opt-in Fast Mode with the complete selected workflow, `thinking=low` by default, optional `BYZ_FAST_MODEL`, and explicit model or thinking options taking precedence ([#15](https://github.com/kingxiaozhe/byz/pull/15)).
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Made BYZ's bundled workflow skills and prompts win same-name host collisions while continuing to load unrelated host resources ([#16](https://github.com/kingxiaozhe/byz/pull/16)).
|
|
14
|
+
|
|
5
15
|
## 0.1.2 - 2026-08-27
|
|
6
16
|
|
|
7
17
|
### Added
|
package/README.md
CHANGED
|
@@ -34,6 +34,28 @@ Workflows do not have an end-user update or rollback command. Every BYZ release
|
|
|
34
34
|
selects one CM version and one compatible CM Plugin version; users run the
|
|
35
35
|
versions selected by their installed BYZ release.
|
|
36
36
|
|
|
37
|
+
## Fast mode
|
|
38
|
+
|
|
39
|
+
Use Fast mode for lower-latency, lower-token everyday work without removing the
|
|
40
|
+
selected workflow's skills, prompts, context, or quality gates:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
byz --fast
|
|
44
|
+
byz --fast --workflow cm-plugin
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Fast mode uses Pi's existing runtime controls and defaults thinking to `low`.
|
|
48
|
+
Set an optional model once when a separate fast model is available:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export BYZ_FAST_MODEL="provider/model"
|
|
52
|
+
byz --fast
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
An explicit `--model` or `--thinking` option always wins. Continuing or resuming
|
|
56
|
+
an existing session keeps that session's model and applies the Fast thinking
|
|
57
|
+
default. Normal `byz` runs ignore `BYZ_FAST_MODEL` and remain unchanged.
|
|
58
|
+
|
|
37
59
|
## Workflows
|
|
38
60
|
|
|
39
61
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { prepareFastRuntimeArgs } from "./fast.js";
|
|
3
4
|
import { main } from "./runtime/bundle/index.js";
|
|
4
5
|
import { handleByzUpdate } from "./update.js";
|
|
5
6
|
import { handleWorkflowCommand, parseWorkflowOption, prepareWorkflowRuntimeArgs } from "./workflows.js";
|
|
@@ -23,11 +24,13 @@ function shouldLoadWorkflow(runtimeArgs) {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
try {
|
|
26
|
-
const
|
|
27
|
+
const fastRuntime = prepareFastRuntimeArgs(args);
|
|
28
|
+
const parsedWorkflow = parseWorkflowOption(fastRuntime.commandArgs);
|
|
27
29
|
const commandArgs = parsedWorkflow.forwardedArgs;
|
|
28
30
|
const isRootHelp = commandArgs.length === 1 && (commandArgs[0] === "--help" || commandArgs[0] === "-h");
|
|
29
31
|
if (isRootHelp) {
|
|
30
32
|
console.error("BYZ updates: byz update (npm-managed global installations only)");
|
|
33
|
+
console.error("BYZ Fast: --fast (thinking=low; optional model: BYZ_FAST_MODEL)");
|
|
31
34
|
console.error("BYZ workflows: --workflow <cm|cm-plugin|none> (default: BYZ_WORKFLOW or cm)");
|
|
32
35
|
console.error("Commands: byz workflow <list|status|check> [cm|cm-plugin]");
|
|
33
36
|
}
|
|
@@ -37,7 +40,21 @@ try {
|
|
|
37
40
|
} else if (await handleByzUpdate(commandArgs)) {
|
|
38
41
|
// BYZ release metadata and package target stay independent from Pi.
|
|
39
42
|
} else {
|
|
40
|
-
const
|
|
43
|
+
const loadWorkflow = shouldLoadWorkflow(commandArgs);
|
|
44
|
+
const runtimeArgs = loadWorkflow ? fastRuntime.args : fastRuntime.commandArgs;
|
|
45
|
+
const prepared = await prepareWorkflowRuntimeArgs(runtimeArgs, { load: loadWorkflow });
|
|
46
|
+
const optionArgs = commandArgs.slice(
|
|
47
|
+
0,
|
|
48
|
+
commandArgs.indexOf("--") === -1 ? commandArgs.length : commandArgs.indexOf("--"),
|
|
49
|
+
);
|
|
50
|
+
const isInteractive = !optionArgs.some((arg) =>
|
|
51
|
+
["--help", "-h", "--version", "-v", "--export", "--list-models", "--print", "-p", "--mode"].includes(arg),
|
|
52
|
+
);
|
|
53
|
+
if (fastRuntime.enabled && loadWorkflow && isInteractive) {
|
|
54
|
+
console.error(
|
|
55
|
+
`BYZ Fast: model=${fastRuntime.model}, thinking=${fastRuntime.thinking}, workflow=${prepared.workflowId}`,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
41
58
|
await main(prepared.args);
|
|
42
59
|
}
|
|
43
60
|
} catch (error) {
|
package/dist/fast.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const SESSION_OPTIONS = new Set(["--continue", "-c", "--resume", "-r", "--session", "--session-id", "--fork"]);
|
|
2
|
+
const THINKING_SUFFIX_PATTERN = /:(off|minimal|low|medium|high|xhigh|max)$/;
|
|
3
|
+
|
|
4
|
+
function getOptionArgs(args) {
|
|
5
|
+
const terminatorIndex = args.indexOf("--");
|
|
6
|
+
return args.slice(0, terminatorIndex === -1 ? args.length : terminatorIndex);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function findOptionValue(args, option) {
|
|
10
|
+
let value;
|
|
11
|
+
for (let index = 0; index < args.length; index++) {
|
|
12
|
+
if (args[index] === option) value = args[index + 1];
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function prepareFastRuntimeArgs(args, env = process.env) {
|
|
18
|
+
const forwardedArgs = [];
|
|
19
|
+
let enabled = false;
|
|
20
|
+
for (let index = 0; index < args.length; index++) {
|
|
21
|
+
const arg = args[index];
|
|
22
|
+
if (arg === "--") {
|
|
23
|
+
forwardedArgs.push(...args.slice(index));
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
if (arg === "--fast") {
|
|
27
|
+
if (enabled) throw new Error("--fast may only be specified once.");
|
|
28
|
+
enabled = true;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (arg.startsWith("--fast=")) {
|
|
32
|
+
throw new Error("--fast does not accept a value.");
|
|
33
|
+
}
|
|
34
|
+
forwardedArgs.push(arg);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!enabled) {
|
|
38
|
+
return { args: forwardedArgs, commandArgs: forwardedArgs, enabled: false };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const optionArgs = getOptionArgs(forwardedArgs);
|
|
42
|
+
const hasModelOption = optionArgs.includes("--model");
|
|
43
|
+
const hasThinkingOption = optionArgs.includes("--thinking");
|
|
44
|
+
const resumesSession = optionArgs.some((arg) => SESSION_OPTIONS.has(arg));
|
|
45
|
+
const configuredModel = env.BYZ_FAST_MODEL?.trim();
|
|
46
|
+
const explicitModel = findOptionValue(optionArgs, "--model");
|
|
47
|
+
const modelThinking = explicitModel?.match(THINKING_SUFFIX_PATTERN)?.[1];
|
|
48
|
+
const presetArgs = [];
|
|
49
|
+
if (!hasModelOption && !resumesSession && configuredModel) {
|
|
50
|
+
presetArgs.push("--model", configuredModel);
|
|
51
|
+
}
|
|
52
|
+
if (!hasThinkingOption && !modelThinking) {
|
|
53
|
+
presetArgs.push("--thinking", "low");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const explicitThinking = findOptionValue(optionArgs, "--thinking");
|
|
57
|
+
return {
|
|
58
|
+
args: [...presetArgs, ...forwardedArgs],
|
|
59
|
+
commandArgs: forwardedArgs,
|
|
60
|
+
enabled: true,
|
|
61
|
+
model: explicitModel ?? (resumesSession ? "session" : configuredModel || "default"),
|
|
62
|
+
thinking: explicitThinking ?? modelThinking ?? "low",
|
|
63
|
+
};
|
|
64
|
+
}
|