@north-light/api 0.3.474 → 0.3.476
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/core/config.js +5 -2
- package/dist/core/user-settings.d.ts +15 -0
- package/dist/core/user-settings.js +21 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.js +3 -0
- package/package.json +1 -1
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, MOUSE_MODE_DEFAULTS, WHIP_MESSAGE_MODES, DEFAULT_WHIP_MESSAGES, defaultScopeConfig, defaultScopeState, defaultModelLaddersConfig, defaultKindsConfig, defaultRemoteCanvasConfig } from '../types.js';
|
|
5
|
+
import { CONFIG_FILE, STATE_FILE, CONDENSED_HISTORY_MODES, DOC_LINK_OPEN_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,6 +833,9 @@ 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 doc_link_open = DOC_LINK_OPEN_MODES.includes(partial.doc_link_open)
|
|
837
|
+
? partial.doc_link_open
|
|
838
|
+
: defaults.doc_link_open;
|
|
836
839
|
const consolidate_replies = typeof partial.consolidate_replies === 'boolean' ? partial.consolidate_replies : defaults.consolidate_replies;
|
|
837
840
|
const keybindings = normalizeKeybindings(partial.keybindings);
|
|
838
841
|
const tmux_passthrough = normalizeTmuxPassthrough(partial.tmux_passthrough);
|
|
@@ -857,7 +860,7 @@ function mergeConfig(partial) {
|
|
|
857
860
|
const spawnEnv = mergeSpawnEnv(partial.spawnEnv, defaults.spawnEnv?.allow);
|
|
858
861
|
const bin = normalizeBin(partial.bin);
|
|
859
862
|
const humanActions = normalizeHumanActions(partial.humanActions);
|
|
860
|
-
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, 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 };
|
|
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, doc_link_open, 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 };
|
|
861
864
|
}
|
|
862
865
|
/** Raw (un-defaulted) partial config for one scope, or null if the scope has
|
|
863
866
|
* no root or no config.json. Used by `readMergedLaunchConfig` to layer
|
|
@@ -275,6 +275,21 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
|
|
|
275
275
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
+
doc_link_open: {
|
|
279
|
+
surface: "settings";
|
|
280
|
+
setting: {
|
|
281
|
+
key: "doc_link_open";
|
|
282
|
+
label: string;
|
|
283
|
+
description: string;
|
|
284
|
+
valueConstraint: string;
|
|
285
|
+
applies: string;
|
|
286
|
+
group: "display";
|
|
287
|
+
order: number;
|
|
288
|
+
format: (config: ScopeConfig) => "browser" | "nvim";
|
|
289
|
+
cycle: (config: ScopeConfig, delta: number) => void;
|
|
290
|
+
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
278
293
|
detailed_tool_recaps: {
|
|
279
294
|
surface: "settings";
|
|
280
295
|
setting: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONDENSED_HISTORY_MODES, MOUSE_MODE_DEFAULTS, WHIP_MESSAGE_MODES } from '../types.js';
|
|
1
|
+
import { CONDENSED_HISTORY_MODES, DOC_LINK_OPEN_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,6 +370,26 @@ export const CONFIG_SETTINGS_COVERAGE = {
|
|
|
370
370
|
},
|
|
371
371
|
},
|
|
372
372
|
},
|
|
373
|
+
doc_link_open: {
|
|
374
|
+
surface: 'settings',
|
|
375
|
+
setting: {
|
|
376
|
+
key: 'doc_link_open',
|
|
377
|
+
label: 'Document links open in',
|
|
378
|
+
description: 'Where clicking a [[document]] link in a viewer opens it: a read-only browser page with a rendered/raw toggle, or Neovim to edit it and save a new revision (needs iTerm Semantic History).',
|
|
379
|
+
valueConstraint: DOC_LINK_OPEN_MODES.join('|'),
|
|
380
|
+
applies: 'Applies on the next attach.',
|
|
381
|
+
group: 'display',
|
|
382
|
+
order: 37.5,
|
|
383
|
+
format: (config) => config.doc_link_open,
|
|
384
|
+
cycle: (config, delta) => { config.doc_link_open = cycleChoice(DOC_LINK_OPEN_MODES, config.doc_link_open, delta); },
|
|
385
|
+
setFromString: (config, raw) => {
|
|
386
|
+
if (!DOC_LINK_OPEN_MODES.includes(raw))
|
|
387
|
+
return `doc_link_open must be one of: ${DOC_LINK_OPEN_MODES.join('|')}`;
|
|
388
|
+
config.doc_link_open = raw;
|
|
389
|
+
return null;
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
373
393
|
detailed_tool_recaps: {
|
|
374
394
|
surface: 'settings',
|
|
375
395
|
setting: {
|
package/dist/types.d.ts
CHANGED
|
@@ -345,6 +345,12 @@ export interface ScopeConfig {
|
|
|
345
345
|
/** Show individual document reads and edited files in a folded tool recap.
|
|
346
346
|
* Off shows the compact activity-count line instead. Default true. */
|
|
347
347
|
detailed_tool_recaps: boolean;
|
|
348
|
+
/** Where a `[[owner/name]]` document link in the attach viewer opens.
|
|
349
|
+
* `browser` (default) points the link at a self-contained HTML page with a
|
|
350
|
+
* rendered/raw toggle, which any OSC-8-capable terminal opens without setup;
|
|
351
|
+
* `nvim` keeps the editable Markdown copy opened through iTerm Semantic
|
|
352
|
+
* History, with save-back as a new revision. */
|
|
353
|
+
doc_link_open: DocLinkOpenMode;
|
|
348
354
|
/** Experiment: show one consolidated agent reply per message the person typed.
|
|
349
355
|
* The broker rewrites a turn's prose messages into one reply with a light
|
|
350
356
|
* model; the attach viewer folds the rest of the turn behind a working row
|
|
@@ -556,6 +562,9 @@ export declare const DEFAULT_WHIP_MESSAGE_MODE: WhipMessageMode;
|
|
|
556
562
|
export declare const DEFAULT_LIVE_CYCLES = 2;
|
|
557
563
|
export declare const MOUSE_MODE_DEFAULTS: readonly ["tmux", "on", "off"];
|
|
558
564
|
export type MouseModeDefault = (typeof MOUSE_MODE_DEFAULTS)[number];
|
|
565
|
+
/** Where an attach-viewer document link opens (see `doc_link_open`). */
|
|
566
|
+
export declare const DOC_LINK_OPEN_MODES: readonly ["browser", "nvim"];
|
|
567
|
+
export type DocLinkOpenMode = (typeof DOC_LINK_OPEN_MODES)[number];
|
|
559
568
|
/** Messages kept from a condensed cycle (see `condensed_history`). */
|
|
560
569
|
export declare const CONDENSED_HISTORY_MODES: readonly ["none", "user", "agent", "both"];
|
|
561
570
|
export type CondensedHistoryMode = (typeof CONDENSED_HISTORY_MODES)[number];
|
package/dist/types.js
CHANGED
|
@@ -66,6 +66,8 @@ 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'];
|
|
69
71
|
/** Messages kept from a condensed cycle (see `condensed_history`). */
|
|
70
72
|
export const CONDENSED_HISTORY_MODES = ['none', 'user', 'agent', 'both'];
|
|
71
73
|
export const DEFAULT_CONDENSED_HISTORY = 'none';
|
|
@@ -100,6 +102,7 @@ export function defaultScopeConfig() {
|
|
|
100
102
|
fold_finished_tools: true,
|
|
101
103
|
summarize_tool_calls: true,
|
|
102
104
|
detailed_tool_recaps: true,
|
|
105
|
+
doc_link_open: 'browser',
|
|
103
106
|
consolidate_replies: false,
|
|
104
107
|
keybindings: {},
|
|
105
108
|
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.476",
|
|
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",
|