@north-light/api 0.3.508 → 0.3.509
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/dist/api/client.d.ts +2 -1
- package/dist/api/client.js +1 -0
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/docs.d.ts +4 -0
- package/dist/api/routes.d.ts +1 -0
- package/dist/api/routes.js +1 -0
- package/dist/core/config.js +4 -5
- package/dist/core/user-settings.d.ts +4 -4
- package/dist/core/user-settings.js +13 -12
- package/dist/types.d.ts +2 -9
- package/dist/types.js +1 -3
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { CreateProfileRequest, DeleteProfileRequest, DeleteProfileResultDTO
|
|
|
21
21
|
import type { FileEncoding, FileListDTO, FilePeekDTO, FileWriteDTO } from './dto/files.js';
|
|
22
22
|
import type { BashRunDTO, BashRunParams } from './dto/bash.js';
|
|
23
23
|
import type { EdgesDTO, EdgesQuery, ObjectListDTO, ObjectListRequest, ObjectReadDTO, ObjectReadQuery, ObjectSearchDTO, ObjectSearchRequest, UnwatchQuery, UnwatchResultDTO, WatchRequest, WatchResultDTO } from './dto/objects.js';
|
|
24
|
-
import type { DocDeletedDTO, DocEditRequest, DocEditedDTO, DocHistoryDTO, DocHistoryQuery, DocLintDTO, DocLintRequest, DocMoveRequest, DocMovedDTO, DocWriteRequest, DocWrittenDTO, ReconcilePackagesDTO } from './dto/docs.js';
|
|
24
|
+
import type { DocDeletedDTO, DocEditRequest, DocEditedDTO, DocHistoryDTO, DocHistoryQuery, DocLintDTO, DocLintRequest, DocMoveRequest, DocMovedDTO, DocWriteRequest, DocWrittenDTO, ReconcilePackagesDTO, DocumentAccessDTO } from './dto/docs.js';
|
|
25
25
|
import type { PluginAppTokenDTO, PluginCallHeadersDTO, PluginCallHeadersRequestDTO } from './dto/plugins.js';
|
|
26
26
|
import type { BackgroundedJobDTO, BackgroundedJobRequest, DeliveryDryRunRequest, DeliveryRequest, DeliveryResponse } from './dto/delivery.js';
|
|
27
27
|
import type { ChatInventoryDTO, ProspectiveChatInventoryDTO, ProspectiveChatInventoryQuery } from './dto/chat-inventory.js';
|
|
@@ -299,6 +299,7 @@ export declare class CrtrClient {
|
|
|
299
299
|
};
|
|
300
300
|
/** Package (builtin and plugin) documents. */
|
|
301
301
|
readonly documents: {
|
|
302
|
+
browserAccess: () => Promise<DocumentAccessDTO>;
|
|
302
303
|
reconcilePackages: () => Promise<ReconcilePackagesDTO>;
|
|
303
304
|
};
|
|
304
305
|
/** A plugin's `crtr_app_` credential and the headers crtrd adds to its local HTTP calls. */
|
package/dist/api/client.js
CHANGED
|
@@ -530,6 +530,7 @@ export class CrtrClient {
|
|
|
530
530
|
};
|
|
531
531
|
/** Package (builtin and plugin) documents. */
|
|
532
532
|
documents = {
|
|
533
|
+
browserAccess: () => this.request('GET', routes.documentsBrowserAccess()),
|
|
533
534
|
reconcilePackages: () => this.request('POST', routes.documentsReconcilePackages()),
|
|
534
535
|
};
|
|
535
536
|
/** A plugin's `crtr_app_` credential and the headers crtrd adds to its local HTTP calls. */
|
package/dist/api/contract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
2
|
-
export declare const CONTRACT_LEVEL = "1.
|
|
2
|
+
export declare const CONTRACT_LEVEL = "1.19";
|
|
3
3
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
4
4
|
export declare const REQUIRED_CONTRACT_HEADER = "Crouter-Required-Contract";
|
|
5
5
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
package/dist/api/contract.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
//
|
|
13
13
|
// PURITY (spec §3.1): Node built-ins + `src/api/*` only.
|
|
14
14
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
15
|
-
export const CONTRACT_LEVEL = '1.
|
|
15
|
+
export const CONTRACT_LEVEL = '1.19';
|
|
16
16
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
17
17
|
export const REQUIRED_CONTRACT_HEADER = 'Crouter-Required-Contract';
|
|
18
18
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
package/dist/api/dto/docs.d.ts
CHANGED
|
@@ -118,6 +118,10 @@ export interface DocLintFindingDTO {
|
|
|
118
118
|
export interface DocLintDTO {
|
|
119
119
|
findings: DocLintFindingDTO[];
|
|
120
120
|
}
|
|
121
|
+
/** `GET /v1/documents/browser-access`: the secret that opens the localhost document listener (put in a link as `?t=`). */
|
|
122
|
+
export interface DocumentAccessDTO {
|
|
123
|
+
secret: string;
|
|
124
|
+
}
|
|
121
125
|
export interface ReconcilePackagesDTO {
|
|
122
126
|
created: number;
|
|
123
127
|
updated: number;
|
package/dist/api/routes.d.ts
CHANGED
|
@@ -164,5 +164,6 @@ export declare const routes: {
|
|
|
164
164
|
readonly docsLint: () => string;
|
|
165
165
|
readonly pluginAppToken: (name: string) => string;
|
|
166
166
|
readonly pluginCallHeaders: (name: string) => string;
|
|
167
|
+
readonly documentsBrowserAccess: () => string;
|
|
167
168
|
readonly documentsReconcilePackages: () => string;
|
|
168
169
|
};
|
package/dist/api/routes.js
CHANGED
|
@@ -197,5 +197,6 @@ export const routes = {
|
|
|
197
197
|
docsLint: () => `${V}/docs/lint`,
|
|
198
198
|
pluginAppToken: (name) => `${V}/plugins/${encodeURIComponent(name)}/app-token`,
|
|
199
199
|
pluginCallHeaders: (name) => `${V}/plugins/${encodeURIComponent(name)}/call-headers`,
|
|
200
|
+
documentsBrowserAccess: () => `${V}/documents/browser-access`,
|
|
200
201
|
documentsReconcilePackages: () => `${V}/documents/reconcile-packages`,
|
|
201
202
|
};
|
package/dist/core/config.js
CHANGED
|
@@ -2,7 +2,7 @@ import { envProfileId } from '../shared/env.js';
|
|
|
2
2
|
import { basename, join } from 'node:path';
|
|
3
3
|
import { existsSync, mkdirSync, statSync } from 'node:fs';
|
|
4
4
|
import { isDeepStrictEqual } from 'node:util';
|
|
5
|
-
import { CONFIG_FILE, STATE_FILE, CONDENSED_HISTORY_MODES,
|
|
5
|
+
import { CONFIG_FILE, STATE_FILE, CONDENSED_HISTORY_MODES, MOUSE_MODE_DEFAULTS, WHIP_MESSAGE_MODES, DEFAULT_WHIP_MESSAGES, defaultScopeConfig, defaultScopeState, defaultModelLaddersConfig, defaultKindsConfig, defaultRemoteCanvasConfig } from '../types.js';
|
|
6
6
|
import { BINDING_CATALOG, BINDING_IDS, isAttachPaneBinding } from './keybindings/catalog.js';
|
|
7
7
|
import { notFound } from './errors.js';
|
|
8
8
|
import { emitEvent } from './events/emit.js';
|
|
@@ -833,9 +833,8 @@ function mergeConfig(partial) {
|
|
|
833
833
|
const fold_finished_tools = typeof partial.fold_finished_tools === 'boolean' ? partial.fold_finished_tools : defaults.fold_finished_tools;
|
|
834
834
|
const summarize_tool_calls = typeof partial.summarize_tool_calls === 'boolean' ? partial.summarize_tool_calls : defaults.summarize_tool_calls;
|
|
835
835
|
const detailed_tool_recaps = typeof partial.detailed_tool_recaps === 'boolean' ? partial.detailed_tool_recaps : defaults.detailed_tool_recaps;
|
|
836
|
-
const
|
|
837
|
-
? partial.
|
|
838
|
-
: defaults.doc_link_open;
|
|
836
|
+
const document_port = Number.isInteger(partial.document_port) && partial.document_port >= 1 && partial.document_port <= 65535
|
|
837
|
+
? partial.document_port : defaults.document_port;
|
|
839
838
|
const consolidate_replies = typeof partial.consolidate_replies === 'boolean' ? partial.consolidate_replies : defaults.consolidate_replies;
|
|
840
839
|
const keybindings = normalizeKeybindings(partial.keybindings);
|
|
841
840
|
const tmux_passthrough = normalizeTmuxPassthrough(partial.tmux_passthrough);
|
|
@@ -860,7 +859,7 @@ function mergeConfig(partial) {
|
|
|
860
859
|
const spawnEnv = mergeSpawnEnv(partial.spawnEnv, defaults.spawnEnv?.allow);
|
|
861
860
|
const bin = normalizeBin(partial.bin);
|
|
862
861
|
const humanActions = normalizeHumanActions(partial.humanActions);
|
|
863
|
-
return { bin, humanActions, schema_version, marketplaces, plugins, auto_update, max_panes_per_window, auto_open_child_viewers, brokerThresholds, lifecycle, completion_bell, working_gerunds, whip_mode, page_components, page_surface, whip_messages, whip_message_mode, mouse_mode_default, live_cycles, condensed_history, bash_tool_purpose, fold_finished_tools, summarize_tool_calls, detailed_tool_recaps,
|
|
862
|
+
return { bin, humanActions, schema_version, marketplaces, plugins, auto_update, max_panes_per_window, auto_open_child_viewers, brokerThresholds, lifecycle, completion_bell, working_gerunds, whip_mode, page_components, page_surface, whip_messages, whip_message_mode, mouse_mode_default, live_cycles, condensed_history, bash_tool_purpose, fold_finished_tools, summarize_tool_calls, detailed_tool_recaps, document_port, consolidate_replies, keybindings, tmux_passthrough, modelLadders, providerOptions, ...(Object.keys(modelRoutes).length > 0 ? { modelRoutes } : {}), ...(Object.keys(routes.legacy).length > 0 ? { legacyModelRoutes: routes.legacy } : {}), ...(modelRouting !== undefined ? { modelRouting } : {}), kinds, remoteCanvas, api, ...(paths ? { paths } : {}), ...(store ? { store } : {}), ...(runtime ? { runtime } : {}), spawnEnv };
|
|
864
863
|
}
|
|
865
864
|
/** Raw (un-defaulted) partial config for one scope, or null if the scope has
|
|
866
865
|
* no root or no config.json. Used by `readMergedLaunchConfig` to layer
|
|
@@ -275,19 +275,19 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
|
|
|
275
275
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
-
|
|
278
|
+
document_port: {
|
|
279
279
|
surface: "settings";
|
|
280
280
|
setting: {
|
|
281
|
-
key: "
|
|
281
|
+
key: "document_port";
|
|
282
282
|
label: string;
|
|
283
283
|
description: string;
|
|
284
284
|
valueConstraint: string;
|
|
285
285
|
applies: string;
|
|
286
286
|
group: "display";
|
|
287
287
|
order: number;
|
|
288
|
-
format: (config: ScopeConfig) =>
|
|
288
|
+
format: (config: ScopeConfig) => string;
|
|
289
289
|
cycle: (config: ScopeConfig, delta: number) => void;
|
|
290
|
-
setFromString: (config: ScopeConfig, raw: string) =>
|
|
290
|
+
setFromString: (config: ScopeConfig, raw: string) => "document_port must be an integer from 1 to 65535" | null;
|
|
291
291
|
};
|
|
292
292
|
};
|
|
293
293
|
detailed_tool_recaps: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONDENSED_HISTORY_MODES,
|
|
1
|
+
import { CONDENSED_HISTORY_MODES, MOUSE_MODE_DEFAULTS, WHIP_MESSAGE_MODES } from '../types.js';
|
|
2
2
|
function cycleChoice(choices, current, delta) {
|
|
3
3
|
const index = choices.indexOf(current);
|
|
4
4
|
const start = index >= 0 ? index : 0;
|
|
@@ -370,22 +370,23 @@ export const CONFIG_SETTINGS_COVERAGE = {
|
|
|
370
370
|
},
|
|
371
371
|
},
|
|
372
372
|
},
|
|
373
|
-
|
|
373
|
+
document_port: {
|
|
374
374
|
surface: 'settings',
|
|
375
375
|
setting: {
|
|
376
|
-
key: '
|
|
377
|
-
label: 'Document
|
|
378
|
-
description: '
|
|
379
|
-
valueConstraint:
|
|
380
|
-
applies: 'Applies on the next attach.',
|
|
376
|
+
key: 'document_port',
|
|
377
|
+
label: 'Document browser port',
|
|
378
|
+
description: 'Fixed localhost port where crtrd serves editable document pages.',
|
|
379
|
+
valueConstraint: '1-65535',
|
|
380
|
+
applies: 'Applies after daemon handover and on the next attach.',
|
|
381
381
|
group: 'display',
|
|
382
382
|
order: 37.5,
|
|
383
|
-
format: (config) => config.
|
|
384
|
-
cycle: (config, delta) => { config.
|
|
383
|
+
format: (config) => String(config.document_port),
|
|
384
|
+
cycle: (config, delta) => { config.document_port = Math.max(1, Math.min(65535, config.document_port + delta)); },
|
|
385
385
|
setFromString: (config, raw) => {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
const port = Number(raw);
|
|
387
|
+
if (!/^\d+$/.test(raw) || !Number.isInteger(port) || port < 1 || port > 65535)
|
|
388
|
+
return 'document_port must be an integer from 1 to 65535';
|
|
389
|
+
config.document_port = port;
|
|
389
390
|
return null;
|
|
390
391
|
},
|
|
391
392
|
},
|
package/dist/types.d.ts
CHANGED
|
@@ -361,12 +361,8 @@ export interface ScopeConfig {
|
|
|
361
361
|
/** Show individual document reads and edited files in a folded tool recap.
|
|
362
362
|
* Off shows the compact activity-count line instead. Default true. */
|
|
363
363
|
detailed_tool_recaps: boolean;
|
|
364
|
-
/**
|
|
365
|
-
|
|
366
|
-
* rendered/raw toggle, which any OSC-8-capable terminal opens without setup;
|
|
367
|
-
* `nvim` keeps the editable Markdown copy opened through iTerm Semantic
|
|
368
|
-
* History, with save-back as a new revision. */
|
|
369
|
-
doc_link_open: DocLinkOpenMode;
|
|
364
|
+
/** Port of the localhost-only document browser listener. */
|
|
365
|
+
document_port: number;
|
|
370
366
|
/** Experiment: show one consolidated agent reply per message the person typed.
|
|
371
367
|
* The broker rewrites a turn's prose messages into one reply with a light
|
|
372
368
|
* model; the attach viewer folds the rest of the turn behind a working row
|
|
@@ -578,9 +574,6 @@ export declare const DEFAULT_WHIP_MESSAGE_MODE: WhipMessageMode;
|
|
|
578
574
|
export declare const DEFAULT_LIVE_CYCLES = 2;
|
|
579
575
|
export declare const MOUSE_MODE_DEFAULTS: readonly ["tmux", "on", "off"];
|
|
580
576
|
export type MouseModeDefault = (typeof MOUSE_MODE_DEFAULTS)[number];
|
|
581
|
-
/** Where an attach-viewer document link opens (see `doc_link_open`). */
|
|
582
|
-
export declare const DOC_LINK_OPEN_MODES: readonly ["browser", "nvim"];
|
|
583
|
-
export type DocLinkOpenMode = (typeof DOC_LINK_OPEN_MODES)[number];
|
|
584
577
|
/** Messages kept from a condensed cycle (see `condensed_history`). */
|
|
585
578
|
export declare const CONDENSED_HISTORY_MODES: readonly ["none", "user", "agent", "both"];
|
|
586
579
|
export type CondensedHistoryMode = (typeof CONDENSED_HISTORY_MODES)[number];
|
package/dist/types.js
CHANGED
|
@@ -66,8 +66,6 @@ export const WHIP_MESSAGE_MODES = ['random', 'go-faster'];
|
|
|
66
66
|
export const DEFAULT_WHIP_MESSAGE_MODE = 'random';
|
|
67
67
|
export const DEFAULT_LIVE_CYCLES = 2;
|
|
68
68
|
export const MOUSE_MODE_DEFAULTS = ['tmux', 'on', 'off'];
|
|
69
|
-
/** Where an attach-viewer document link opens (see `doc_link_open`). */
|
|
70
|
-
export const DOC_LINK_OPEN_MODES = ['browser', 'nvim'];
|
|
71
69
|
/** Messages kept from a condensed cycle (see `condensed_history`). */
|
|
72
70
|
export const CONDENSED_HISTORY_MODES = ['none', 'user', 'agent', 'both'];
|
|
73
71
|
export const DEFAULT_CONDENSED_HISTORY = 'none';
|
|
@@ -102,7 +100,7 @@ export function defaultScopeConfig() {
|
|
|
102
100
|
fold_finished_tools: true,
|
|
103
101
|
summarize_tool_calls: true,
|
|
104
102
|
detailed_tool_recaps: true,
|
|
105
|
-
|
|
103
|
+
document_port: 7472,
|
|
106
104
|
consolidate_replies: false,
|
|
107
105
|
keybindings: {},
|
|
108
106
|
tmux_passthrough: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.509",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|