centralu 0.1.0-beta.84 → 0.1.0-beta.85

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/bin/platform.mjs CHANGED
@@ -261,7 +261,7 @@ export function npmCommand(platform, args) {
261
261
 
262
262
  export const WEBVIEW2_DOWNLOAD = 'https://developer.microsoft.com/microsoft-edge/webview2/'
263
263
  /** Microsoft's link to the Evergreen Bootstrapper itself, for someone who wants one click. */
264
- export const WEBVIEW2_BOOTSTRAPPER = 'https://go.microsoft.com/fwlink/p/?LinkId=2124703'
264
+ const WEBVIEW2_BOOTSTRAPPER = 'https://go.microsoft.com/fwlink/p/?LinkId=2124703'
265
265
 
266
266
  /** The Evergreen WebView2 Runtime's client id, the same under every registry hive. */
267
267
  const WEBVIEW2_CLIENT = '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
package/bin/semver.mjs CHANGED
@@ -86,7 +86,7 @@ function split(raw) {
86
86
  const LOCAL_BUILD = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*\.local\.[1-9]\d*$/
87
87
 
88
88
  /** A maintainer's local build: `<base>.local.N`, strict SemVer, with a prerelease base and a positive N (`scripts/local-manifest.mjs`). */
89
- export function isLocalBuildVersion(v) {
89
+ function isLocalBuildVersion(v) {
90
90
  return typeof v === 'string' && v.length <= 64 && LOCAL_BUILD.test(v)
91
91
  }
92
92
 
@@ -65,7 +65,7 @@ export const CHILD_FLAG = '--detached-child='
65
65
  * What `--from` takes (#1223): a hub's name, short and of characters that cannot break the sentence a refused host says
66
66
  * it in, nor a command line. The hub sends its own host name, cleaned the same way (`hubNameForRemote`, links/tunnel.ts)
67
67
  */
68
- export const FROM_RE = /^[A-Za-z0-9._-]{1,64}$/
68
+ const FROM_RE = /^[A-Za-z0-9._-]{1,64}$/
69
69
 
70
70
  /**
71
71
  * What the arguments after `serve` ask for: `{ mode, port }` (plus `child` for a detached launcher,
@@ -84,7 +84,7 @@ export function autostartName(how, { dataDir, home, env, platform = process.plat
84
84
  }
85
85
 
86
86
  /** The task's name before the user was part of it: an earlier version's entry, removed when this user's (`taskScript`) */
87
- export function legacyTaskName({ dataDir, home, env, platform = process.platform }) {
87
+ function legacyTaskName({ dataDir, home, env, platform = process.platform }) {
88
88
  return autostartName('task', { dataDir, home, env, platform })
89
89
  }
90
90
 
@@ -19,9 +19,11 @@ import { clockOf } from './serve-switch.mjs'
19
19
  /**
20
20
  * What a detached launcher needs from the `--detach` that started it. A process created through WMI
21
21
  * does not inherit this environment: it gets the account's default one. Everything else it needs
22
- * (the token, the port) is in the data folder. Never a secret.
22
+ * (the token, the port) is in the data folder. Never a secret. `CC_UPDATES_OFFLINE`: a host a test started this way reaches
23
+ * neither the registry nor npm (#2301). Not `CI`: what it decides in a host (installing by itself, following the hub) is
24
+ * already off for this one, which neither the app nor the keeper started and which does not run from a hub's install.
23
25
  */
24
- export const CARRIED_ENV = ['CC_DATA_DIR', 'CENTRALU_HOST_ENTRY', 'CENTRALU_MANAGED', 'CENTRALU_STARTED_FROM']
26
+ export const CARRIED_ENV = ['CC_DATA_DIR', 'CENTRALU_HOST_ENTRY', 'CENTRALU_MANAGED', 'CENTRALU_STARTED_FROM', 'CC_UPDATES_OFFLINE']
25
27
 
26
28
  /**
27
29
  * `start` is how the launcher was started and why (`through WMI: <reason>`), which it writes into its first serve.log
@@ -272,7 +274,7 @@ export async function runDetach({
272
274
  export const DETACH_WORK_CAP_MS = 90_000
273
275
 
274
276
  /** Why the host was not started in the Windows sign-in, from `startInSignIn`'s answer, for serve.log and stderr */
275
- export function signInMissed(s) {
277
+ function signInMissed(s) {
276
278
  if (s.reason === 'nosession') {
277
279
  const n = s.desktops
278
280
  const unread = s.unreadable ? `, ${s.unreadable} of them with an owner WMI would not tell` : ''
@@ -37,7 +37,7 @@ import { windowsPowershell } from './serve-windows.mjs'
37
37
  export const SERVE_STATE_FILE = 'serve.json'
38
38
 
39
39
  /** The label of the full credential a version 1 file's token became; removed by the next pairing */
40
- export const LEGACY_LABEL = 'legacy'
40
+ const LEGACY_LABEL = 'legacy'
41
41
 
42
42
  /** A full credential's verifier: the SHA-256 of it, as hex (the host's `serve-credentials.ts` compares the same) */
43
43
  export function verifierOf(credential) {
@@ -253,12 +253,12 @@ function parseServeState(raw) {
253
253
  }
254
254
 
255
255
  /** An entry the launcher lists, `--revoke` takes and the host accepts: an 8-hex id, a label `--pair` takes, a hex verifier */
256
- export function isListedEntry(e) {
256
+ function isListedEntry(e) {
257
257
  return typeof e?.id === 'string' && CREDENTIAL_ID_RE.test(e.id) && typeof e.label === 'string' && PAIR_LABEL_RE.test(e.label) && typeof e.verifier === 'string' && /^[0-9a-f]{64}$/.test(e.verifier)
258
258
  }
259
259
 
260
260
  /** A hub's key entry the launcher lists, `--revoke` takes and the host accepts (#1711): an 8-hex id, a label `--pair` takes, a public key the host takes (§4.1) */
261
- export function isKeyEntry(e) {
261
+ function isKeyEntry(e) {
262
262
  return typeof e?.id === 'string' && CREDENTIAL_ID_RE.test(e.id) && typeof e.label === 'string' && PAIR_LABEL_RE.test(e.label) && parseLinkPublicKey(e.publicKey) !== null
263
263
  }
264
264
 
@@ -419,7 +419,7 @@ export function changeServeState(dataDir, change, platform = process.platform, {
419
419
  * is what is removed, and put back when it was another writer's. Reading it and then removing it by name could remove
420
420
  * a lock another writer took over in between. Never throws: a lock left behind goes stale and is taken over.
421
421
  */
422
- export function releaseLock(lock, mine, { read = readFileSync, rename = renameSync, link = linkSync, rm = rmSync } = {}) {
422
+ function releaseLock(lock, mine, { read = readFileSync, rename = renameSync, link = linkSync, rm = rmSync } = {}) {
423
423
  const aside = `${lock}.${mine}.release`
424
424
  try {
425
425
  renameRetrying(lock, aside, { rename, budgetMs: 1_000 })
@@ -472,7 +472,7 @@ function putBack(aside, lock, link) {
472
472
  * hub's at each link or any program's), `window` (`--window`, the person's window on Windows at each start), `handover`
473
473
  * (the launcher's own, for one `host.handover` call and withdrawn right after)
474
474
  */
475
- export const PAIRED_VIA = ['pair', 'window', 'handover']
475
+ const PAIRED_VIA = ['pair', 'window', 'handover']
476
476
 
477
477
  /**
478
478
  * A new full credential for `label` (#1405): written as its verifier only, and returned once. One label holds one
@@ -119,7 +119,7 @@ export function parsePointer(text) {
119
119
  * there from a git commit (`pnpm remote-dev`, #1036), null for a release (or anything unreadable). The hub shows it
120
120
  * on the machine's row, so a build no release produced is never mistaken for one.
121
121
  */
122
- export function installSource(versionDir) {
122
+ function installSource(versionDir) {
123
123
  try {
124
124
  const s = JSON.parse(readFileSync(join(versionDir, 'install.json'), 'utf8')).source
125
125
  if (s?.kind === 'dev' && typeof s.commit === 'string' && /^[0-9a-f]{7,64}$/.test(s.commit)) return { kind: 'dev', commit: s.commit, dirty: s.dirty === true }
@@ -8,8 +8,8 @@ import { createHmac, createPrivateKey, createPublicKey, verify } from 'node:cryp
8
8
 
9
9
  /** Bytes of a nonce, a public key and a signature (`@cc/protocol` `link-wire.ts`) */
10
10
  export const LINK_NONCE_BYTES = 24
11
- export const LINK_PUBLIC_KEY_BYTES = 32
12
- export const LINK_SIGNATURE_BYTES = 64
11
+ const LINK_PUBLIC_KEY_BYTES = 32
12
+ const LINK_SIGNATURE_BYTES = 64
13
13
 
14
14
  const CONTEXT_LABEL = 'centralu link v1'
15
15
  const HOST_ROLE_LABEL = 'centralu link host v1'
@@ -19,7 +19,7 @@ const PKCS8_PREFIX = Buffer.from('302e020100300506032b657004220420', 'hex')
19
19
  const P = 2n ** 255n - 19n
20
20
 
21
21
  /** The bytes of `text` when it is exactly the base64url (no padding) of `bytes` bytes: encoding them again gives the same string */
22
- export function decodeBase64url(text, bytes) {
22
+ function decodeBase64url(text, bytes) {
23
23
  if (typeof text !== 'string') return null
24
24
  const raw = Buffer.from(text, 'base64url')
25
25
  if (raw.length !== bytes || raw.toString('base64url') !== text) return null
@@ -76,7 +76,7 @@ export function hostLinkPublicKey(key) {
76
76
  }
77
77
 
78
78
  /** `u32be(len) ‖ bytes` for each part; a string as ASCII, and one with another character throws */
79
- export function encodeFields(parts) {
79
+ function encodeFields(parts) {
80
80
  const out = []
81
81
  for (const part of parts) {
82
82
  if (typeof part === 'string' && Array.from(part).some((c) => c.codePointAt(0) > 0x7f)) throw new Error('A field string is ASCII')
@@ -89,7 +89,7 @@ export function encodeFields(parts) {
89
89
  }
90
90
 
91
91
  /** `127.0.0.1:<port>` for a port 1 to 65535, null otherwise (the host's `linkAddress`) */
92
- export function linkAddress(port) {
92
+ function linkAddress(port) {
93
93
  return Number.isInteger(port) && port >= 1 && port <= 65535 ? `127.0.0.1:${port}` : null
94
94
  }
95
95
 
@@ -550,7 +550,7 @@ export async function beforeHostStart({ dataDir, env, version, platform = proces
550
550
  }
551
551
 
552
552
  /** What `--detach` and `serve` say while a switch is under way there */
553
- export function switchingMessage(gate) {
553
+ function switchingMessage(gate) {
554
554
  return `an update from ${gate.by} started at ${clockOf(gate.startedAt)} is switching versions here; no host starts until it ends`
555
555
  }
556
556
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centralu",
3
- "version": "0.1.0-beta.84",
3
+ "version": "0.1.0-beta.85",
4
4
  "description": "Run, watch and steer Claude Code, Codex and other coding agents from one window",
5
5
  "license": "MIT",
6
6
  "author": "ijun17",
@@ -21,7 +21,7 @@
21
21
  "windows",
22
22
  "desktop"
23
23
  ],
24
- "protocolVersion": 1,
24
+ "protocolVersion": 2,
25
25
  "type": "module",
26
26
  "bin": {
27
27
  "centralu": "bin/centralu.mjs"
@@ -38,9 +38,9 @@
38
38
  "win32"
39
39
  ],
40
40
  "optionalDependencies": {
41
- "@centralu/darwin-arm64": "0.1.0-beta.84",
42
- "@centralu/linux-arm64": "0.1.0-beta.84",
43
- "@centralu/linux-x64": "0.1.0-beta.84",
44
- "@centralu/win32-x64": "0.1.0-beta.84"
41
+ "@centralu/darwin-arm64": "0.1.0-beta.85",
42
+ "@centralu/linux-arm64": "0.1.0-beta.85",
43
+ "@centralu/linux-x64": "0.1.0-beta.85",
44
+ "@centralu/win32-x64": "0.1.0-beta.85"
45
45
  }
46
46
  }