sneakoscope 10.5.0 → 10.5.1

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 CHANGED
@@ -16,7 +16,7 @@
16
16
  Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
17
17
  <!-- END SKS SEARCH VISIBILITY MARKETING -->
18
18
 
19
- Current package: **SKS 10.5.0**. Install the latest stable release from npm.
19
+ Current package: **SKS 10.5.1**. Install the latest stable release from npm.
20
20
 
21
21
  [Quick start](#install-in-one-command) · [Commands](#everyday-commands) · [SKS Center](#sks-center-macos) · [Documentation](#documentation) · [Changelog](CHANGELOG.md)
22
22
 
@@ -259,7 +259,7 @@ dependencies = [
259
259
 
260
260
  [[package]]
261
261
  name = "sks-core"
262
- version = "10.5.0"
262
+ version = "10.5.1"
263
263
  dependencies = [
264
264
  "globset",
265
265
  "grep-matcher",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "10.5.0"
3
+ version = "10.5.1"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "sks.skills-manifest.v1",
3
- "package_version": "10.5.0",
3
+ "package_version": "10.5.1",
4
4
  "skills": [
5
5
  {
6
6
  "canonical_name": "sks",
@@ -21,6 +21,8 @@ export const DEFAULT_DESKTOP_BRIDGE_HOST = '127.0.0.1';
21
21
  export const DEFAULT_DESKTOP_BRIDGE_PORT = 49_152;
22
22
  export const DESKTOP_BRIDGE_SETTINGS_SCHEMA = 'sks.desktop-bridge-settings.v2';
23
23
  export const DESKTOP_BRIDGE_SERVICE_SCHEMA = 'sks.desktop-bridge-service.v2';
24
+ export const DESKTOP_BRIDGE_SETTINGS_MAX_BYTES = 256 * 1024;
25
+ const DESKTOP_BRIDGE_SETTINGS_RECOVERY_MAX_BYTES = 2 * 1024 * 1024;
24
26
  const DEFAULT_ALLOWED_ORIGINS = ['app://codex'];
25
27
  const OPENROUTER_BASE_URL = 'https://openrouter.ai/api/v1';
26
28
  export function desktopBridgeServicePaths(home = process.env.HOME || os.homedir()) {
@@ -147,8 +149,11 @@ export async function readDesktopBridgeServiceSettings(file) {
147
149
  throw new Error('desktop_bridge_settings_not_regular_file');
148
150
  if ((stat.mode & 0o077) !== 0)
149
151
  throw new Error('desktop_bridge_settings_permissions_unsafe');
152
+ if (stat.size > DESKTOP_BRIDGE_SETTINGS_RECOVERY_MAX_BYTES)
153
+ throw new Error('desktop_bridge_settings_too_large');
150
154
  const raw = await fsp.readFile(file, 'utf8');
151
- if (Buffer.byteLength(raw) > 256 * 1024)
155
+ const rawBytes = Buffer.byteLength(raw);
156
+ if (rawBytes > DESKTOP_BRIDGE_SETTINGS_RECOVERY_MAX_BYTES)
152
157
  throw new Error('desktop_bridge_settings_too_large');
153
158
  let parsed;
154
159
  try {
@@ -157,17 +162,58 @@ export async function readDesktopBridgeServiceSettings(file) {
157
162
  catch {
158
163
  throw new Error('desktop_bridge_settings_invalid_json');
159
164
  }
160
- return validateDesktopBridgeServiceSettings(parsed);
165
+ const validated = validateDesktopBridgeServiceSettings(parsed);
166
+ return rawBytes <= DESKTOP_BRIDGE_SETTINGS_MAX_BYTES ? validated : sessionPinsThatFit(validated);
161
167
  }
162
168
  export async function writeDesktopBridgeServiceSettings(file, settings) {
163
169
  await withFileLock(settingsLockOptions(file), async () => {
164
170
  await writeDesktopBridgeServiceSettingsUnlocked(file, settings);
165
171
  });
166
172
  }
173
+ function desktopBridgeSettingsDocument(settings) {
174
+ return {
175
+ schema: settings.schema,
176
+ listen_host: settings.listen_host,
177
+ listen_port: settings.listen_port,
178
+ provider_registry: settings.provider_registry,
179
+ route_policy: settings.route_policy,
180
+ provider_session_pins: settings.provider_session_pins,
181
+ client_capability_sha256: settings.client_capability_sha256,
182
+ allowed_origins: settings.allowed_origins,
183
+ connect_timeout_ms: settings.connect_timeout_ms,
184
+ idle_timeout_ms: settings.idle_timeout_ms,
185
+ official_passthrough: settings.official_passthrough,
186
+ auth_priority_enabled: settings.auth_priority_enabled ?? false
187
+ };
188
+ }
189
+ function desktopBridgeSettingsText(settings) {
190
+ return `${JSON.stringify(desktopBridgeSettingsDocument(settings), null, 2)}\n`;
191
+ }
192
+ export function sessionPinsThatFit(settings, maxBytes = DESKTOP_BRIDGE_SETTINGS_MAX_BYTES) {
193
+ if (Buffer.byteLength(desktopBridgeSettingsText(settings)) <= maxBytes)
194
+ return settings;
195
+ const pins = settings.provider_session_pins
196
+ .map((pin, index) => ({ pin, index }))
197
+ .sort((left, right) => Date.parse(right.pin.created_at) - Date.parse(left.pin.created_at) || left.index - right.index)
198
+ .map((row) => row.pin);
199
+ let lo = 0;
200
+ let hi = pins.length;
201
+ while (lo < hi) {
202
+ const mid = Math.ceil((lo + hi) / 2);
203
+ const size = Buffer.byteLength(desktopBridgeSettingsText({ ...settings, provider_session_pins: pins.slice(0, mid) }));
204
+ if (size <= maxBytes)
205
+ lo = mid;
206
+ else
207
+ hi = mid - 1;
208
+ }
209
+ const fitted = { ...settings, provider_session_pins: pins.slice(0, lo) };
210
+ if (Buffer.byteLength(desktopBridgeSettingsText(fitted)) > maxBytes)
211
+ throw new Error('desktop_bridge_settings_too_large');
212
+ return fitted;
213
+ }
167
214
  async function writeDesktopBridgeServiceSettingsUnlocked(file, settings) {
168
- const validated = validateDesktopBridgeServiceSettings(settings);
169
- const persisted = { schema: validated.schema, listen_host: validated.listen_host, listen_port: validated.listen_port, provider_registry: validated.provider_registry, route_policy: validated.route_policy, provider_session_pins: validated.provider_session_pins, client_capability_sha256: validated.client_capability_sha256, allowed_origins: validated.allowed_origins, connect_timeout_ms: validated.connect_timeout_ms, idle_timeout_ms: validated.idle_timeout_ms, official_passthrough: validated.official_passthrough, auth_priority_enabled: validated.auth_priority_enabled ?? false };
170
- await writeTextAtomic(file, `${JSON.stringify(persisted, null, 2)}\n`, { mode: 0o600 });
215
+ const validated = sessionPinsThatFit(validateDesktopBridgeServiceSettings(settings));
216
+ await writeTextAtomic(file, desktopBridgeSettingsText(validated), { mode: 0o600 });
171
217
  await fsp.chmod(file, 0o600);
172
218
  }
173
219
  async function runtimeCredentials(settings, options) {
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '10.5.0';
1
+ export const PACKAGE_VERSION = '10.5.1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "ㅅㅋㅅ",
4
- "version": "10.5.0",
4
+ "version": "10.5.1",
5
5
  "description": "Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.",
6
6
  "type": "module",
7
7
  "homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",
@@ -191,7 +191,7 @@
191
191
  "@modelcontextprotocol/client": "2.0.0",
192
192
  "@modelcontextprotocol/server": "2.0.0",
193
193
  "@openai/codex-sdk": "0.153.4",
194
- "smol-toml": "^1.7.0",
194
+ "smol-toml": "^1.7.1",
195
195
  "typescript": "^5.9.3",
196
196
  "ws": "^8.21.3"
197
197
  },