@bytetrue/byspace 0.2.0-beta.2 → 0.2.0-beta.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.
Files changed (17) hide show
  1. package/README.md +24 -8
  2. package/node_modules/@bytetrue/byspace-client/package.json +1 -1
  3. package/node_modules/@bytetrue/byspace-highlight/package.json +1 -1
  4. package/node_modules/@bytetrue/byspace-protocol/package.json +1 -1
  5. package/node_modules/@bytetrue/byspace-relay/package.json +1 -1
  6. package/node_modules/@bytetrue/byspace-server/dist/server/server/agent/agent-manager.js +13 -1
  7. package/node_modules/@bytetrue/byspace-server/dist/server/server/agent/providers/pi/agent.js +42 -8
  8. package/node_modules/@bytetrue/byspace-server/dist/server/server/agent/providers/pi/rpc-types.d.ts +2 -1
  9. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/{index-077af02e3ed8e77cf8d228d3acd2f8f2.js → index-825dafdbc68a9c9b9bf595feded77514.js} +13 -13
  10. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/index-825dafdbc68a9c9b9bf595feded77514.js.br +0 -0
  11. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/{index-077af02e3ed8e77cf8d228d3acd2f8f2.js.gz → index-825dafdbc68a9c9b9bf595feded77514.js.gz} +0 -0
  12. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/index.html +1 -1
  13. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/index.html.br +0 -0
  14. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/index.html.gz +0 -0
  15. package/node_modules/@bytetrue/byspace-server/package.json +1 -1
  16. package/package.json +6 -6
  17. package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/index-077af02e3ed8e77cf8d228d3acd2f8f2.js.br +0 -0
package/README.md CHANGED
@@ -47,25 +47,34 @@ You need at least one agent CLI installed and configured with your credentials:
47
47
 
48
48
  ### CLI / headless
49
49
 
50
- Install the CLI and start BySpace:
50
+ Install or upgrade the Stable channel:
51
51
 
52
52
  ```bash
53
- npm install -g @bytetrue/byspace
53
+ npm install -g @bytetrue/byspace@latest
54
54
  byspace
55
55
  ```
56
56
 
57
- The daemon prints a pairing link for the hosted Web app and keeps agents running after the browser closes.
57
+ Install or upgrade the newest Beta channel:
58
+
59
+ ```bash
60
+ npm install -g @bytetrue/byspace@beta
61
+ byspace
62
+ ```
63
+
64
+ If a daemon is already running, restart it after switching or upgrading channels:
65
+
66
+ ```bash
67
+ byspace daemon restart
68
+ byspace daemon status
69
+ ```
70
+
71
+ The daemon prints a pairing link for its matching hosted Web app and keeps agents running after the browser closes. Stable uses npm `latest`, [byspace.pages.dev](https://byspace.pages.dev), and `byspace-relay`; Beta uses npm `beta`, [byspace-beta.pages.dev](https://byspace-beta.pages.dev), and `byspace-relay-beta`.
58
72
 
59
73
  For full setup and configuration, see:
60
74
 
61
75
  - [Docs](https://byspace.pages.dev/docs)
62
76
  - [Configuration reference](https://byspace.pages.dev/docs/configuration)
63
77
 
64
- Release channels stay isolated end-to-end:
65
-
66
- - Stable: npm `latest`, [byspace.pages.dev](https://byspace.pages.dev), and `byspace-relay`
67
- - Beta: npm `beta`, [byspace-beta.pages.dev](https://byspace-beta.pages.dev), and `byspace-relay-beta`
68
-
69
78
  ## CLI
70
79
 
71
80
  Everything you can do in the app, you can do from the terminal.
@@ -108,6 +117,13 @@ Quick monorepo package map:
108
117
  - `packages/cli`: `byspace` CLI for daemon and agent workflows
109
118
  - `packages/relay`: Relay package for remote connectivity
110
119
 
120
+ Maintainer workflows are encoded as repo-local skills:
121
+
122
+ - `upstream-sync` — rebuild from a frozen Paseo release snapshot.
123
+ - `release-beta` — ship npm/Web/Relay Beta as one channel.
124
+ - `release-stable` — ship or promote the Stable channel.
125
+ - `harden-byspace-release` — audit packaging, CI/CD, channel isolation, or recovery.
126
+
111
127
  Common commands:
112
128
 
113
129
  ```bash
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytetrue/byspace-client",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0-beta.3",
4
4
  "private": true,
5
5
  "description": "BySpace client SDK package",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytetrue/byspace-highlight",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0-beta.3",
4
4
  "private": true,
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytetrue/byspace-protocol",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0-beta.3",
4
4
  "private": true,
5
5
  "description": "BySpace shared protocol schemas and wire types",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytetrue/byspace-relay",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0-beta.3",
4
4
  "private": true,
5
5
  "description": "BySpace relay for bridging daemon and client connections",
6
6
  "files": [
@@ -895,11 +895,23 @@ export class AgentManager {
895
895
  async setAgentModel(agentId, modelId) {
896
896
  const agent = this.requireSessionAgent(agentId);
897
897
  const normalizedModelId = typeof modelId === "string" && modelId.trim().length > 0 ? modelId : null;
898
+ let runtimeInfo;
898
899
  if (agent.session.setModel) {
899
900
  await agent.session.setModel(normalizedModelId);
901
+ runtimeInfo = await agent.session.getRuntimeInfo();
902
+ const persistence = agent.session.describePersistence();
903
+ if (persistence) {
904
+ agent.persistence = attachPersistenceCwd(persistence, agent.cwd);
905
+ }
900
906
  }
901
907
  agent.config.model = normalizedModelId ?? undefined;
902
- if (agent.runtimeInfo) {
908
+ if (runtimeInfo) {
909
+ agent.runtimeInfo = runtimeInfo;
910
+ if (Object.prototype.hasOwnProperty.call(runtimeInfo, "thinkingOptionId")) {
911
+ agent.config.thinkingOptionId = runtimeInfo.thinkingOptionId ?? undefined;
912
+ }
913
+ }
914
+ else if (agent.runtimeInfo) {
903
915
  agent.runtimeInfo = { ...agent.runtimeInfo, model: normalizedModelId };
904
916
  }
905
917
  this.touchUpdatedAt(agent);
@@ -84,9 +84,10 @@ const PI_THINKING_OPTIONS = [
84
84
  { id: "off", label: "Off", description: "No extra reasoning" },
85
85
  { id: "minimal", label: "Minimal", description: "Light reasoning" },
86
86
  { id: "low", label: "Low", description: "Faster reasoning" },
87
- { id: "medium", label: "Medium", description: "Balanced reasoning", isDefault: true },
87
+ { id: "medium", label: "Medium", description: "Balanced reasoning" },
88
88
  { id: "high", label: "High", description: "Deeper reasoning" },
89
- { id: "xhigh", label: "XHigh", description: "Maximum reasoning" },
89
+ { id: "xhigh", label: "XHigh", description: "Extra high reasoning" },
90
+ { id: "max", label: "Max", description: "Maximum reasoning" },
90
91
  ];
91
92
  function capabilitiesForClient() {
92
93
  return withPiCapabilities(false);
@@ -125,7 +126,8 @@ function isPiThinkingLevel(value) {
125
126
  value === "low" ||
126
127
  value === "medium" ||
127
128
  value === "high" ||
128
- value === "xhigh");
129
+ value === "xhigh" ||
130
+ value === "max");
129
131
  }
130
132
  function normalizePiThinkingOption(value) {
131
133
  if (!value) {
@@ -146,13 +148,36 @@ function parseAutoCompactMode(value) {
146
148
  }
147
149
  return "unknown";
148
150
  }
149
- function mapThinkingOption(option) {
151
+ function getSupportedPiThinkingOptions(model) {
152
+ if (!model.reasoning) {
153
+ return undefined;
154
+ }
155
+ return PI_THINKING_OPTIONS.filter((option) => {
156
+ const mappedLevel = model.thinkingLevelMap?.[option.id];
157
+ if (mappedLevel === null) {
158
+ return false;
159
+ }
160
+ if (option.id === "xhigh" || option.id === "max") {
161
+ return mappedLevel !== undefined;
162
+ }
163
+ return true;
164
+ });
165
+ }
166
+ function getDefaultPiThinkingLevel(options) {
167
+ if (!options?.length) {
168
+ return undefined;
169
+ }
170
+ const defaultIndex = PI_THINKING_OPTIONS.findIndex((option) => option.id === DEFAULT_PI_THINKING_LEVEL);
171
+ const defaultOrHigher = options.find((option) => PI_THINKING_OPTIONS.indexOf(option) >= defaultIndex);
172
+ return defaultOrHigher?.id ?? options.at(-1)?.id;
173
+ }
174
+ function mapThinkingOption(option, defaultLevel) {
150
175
  const mappedOption = {
151
176
  id: option.id,
152
177
  label: option.label,
153
178
  description: option.description,
154
179
  };
155
- if (option.isDefault) {
180
+ if (option.id === defaultLevel) {
156
181
  return {
157
182
  ...mappedOption,
158
183
  isDefault: true,
@@ -815,6 +840,8 @@ function buildExtensionUiResponse(request, response) {
815
840
  return { value: answer };
816
841
  }
817
842
  function mapPiModel(model, provider) {
843
+ const thinkingOptions = getSupportedPiThinkingOptions(model);
844
+ const defaultThinkingOptionId = getDefaultPiThinkingLevel(thinkingOptions);
818
845
  return {
819
846
  provider,
820
847
  id: `${model.provider}/${model.id}`,
@@ -824,8 +851,8 @@ function mapPiModel(model, provider) {
824
851
  provider: model.provider,
825
852
  modelId: model.id,
826
853
  },
827
- thinkingOptions: model.reasoning ? PI_THINKING_OPTIONS.map(mapThinkingOption) : undefined,
828
- defaultThinkingOptionId: model.reasoning ? DEFAULT_PI_THINKING_LEVEL : undefined,
854
+ thinkingOptions: thinkingOptions?.map((option) => mapThinkingOption(option, defaultThinkingOptionId)),
855
+ defaultThinkingOptionId,
829
856
  };
830
857
  }
831
858
  function createRuntime(logger, runtimeSettings) {
@@ -1104,6 +1131,10 @@ export class PiRpcAgentSession {
1104
1131
  return null;
1105
1132
  }
1106
1133
  async setModel(modelId) {
1134
+ if (!modelId?.trim()) {
1135
+ this.config.model = undefined;
1136
+ return;
1137
+ }
1107
1138
  const parsedReference = parseModelReference(modelId);
1108
1139
  if (!parsedReference) {
1109
1140
  return;
@@ -1112,11 +1143,14 @@ export class PiRpcAgentSession {
1112
1143
  throw new Error(`Pi model id must include a provider: ${modelId}`);
1113
1144
  }
1114
1145
  const model = await this.runtimeSession.setModel(parsedReference.provider, parsedReference.id);
1146
+ const state = await this.runtimeSession.getState();
1115
1147
  this.state = {
1116
- ...this.state,
1148
+ ...state,
1117
1149
  model,
1118
1150
  };
1151
+ this.lastKnownThinkingOptionId = state.thinkingLevel;
1119
1152
  this.config.model = `${model.provider}/${model.id}`;
1153
+ this.config.thinkingOptionId = state.thinkingLevel;
1120
1154
  }
1121
1155
  async setThinkingOption(thinkingOptionId) {
1122
1156
  const thinkingLevel = normalizePiThinkingOption(thinkingOptionId) ?? DEFAULT_PI_THINKING_LEVEL;
@@ -1,4 +1,4 @@
1
- export type PiThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
1
+ export type PiThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
2
2
  export interface PiImageContent {
3
3
  type: "image";
4
4
  data: string;
@@ -61,6 +61,7 @@ export interface PiModel {
61
61
  id: string;
62
62
  name?: string;
63
63
  reasoning?: boolean;
64
+ thinkingLevelMap?: Partial<Record<PiThinkingLevel, string | null>>;
64
65
  contextWindow?: number;
65
66
  maxTokens?: number;
66
67
  api?: string;