@nexrall/code-core 1.4.76 → 1.4.77

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 (110) hide show
  1. package/dist/agent/goal.d.ts +55 -0
  2. package/dist/agent/goal.d.ts.map +1 -0
  3. package/dist/agent/goal.js +120 -0
  4. package/dist/agent/handoffBrief.d.ts +82 -0
  5. package/dist/agent/handoffBrief.d.ts.map +1 -0
  6. package/dist/agent/handoffBrief.js +121 -0
  7. package/dist/agent/modelCatalogue.d.ts +23 -0
  8. package/dist/agent/modelCatalogue.d.ts.map +1 -1
  9. package/dist/agent/modelCatalogue.js +28 -0
  10. package/dist/agent/outputStyles.d.ts +27 -0
  11. package/dist/agent/outputStyles.d.ts.map +1 -0
  12. package/dist/agent/outputStyles.js +174 -0
  13. package/dist/agent/skills.d.ts.map +1 -1
  14. package/dist/agent/skills.js +7 -0
  15. package/dist/api/billingLines.d.ts +11 -0
  16. package/dist/api/billingLines.d.ts.map +1 -0
  17. package/dist/api/billingLines.js +56 -0
  18. package/dist/api/client.d.ts +2 -0
  19. package/dist/api/client.d.ts.map +1 -1
  20. package/dist/api/scheduleLines.d.ts +53 -0
  21. package/dist/api/scheduleLines.d.ts.map +1 -0
  22. package/dist/api/scheduleLines.js +150 -0
  23. package/dist/context/contextFiles.d.ts +81 -0
  24. package/dist/context/contextFiles.d.ts.map +1 -0
  25. package/dist/context/contextFiles.js +310 -0
  26. package/dist/diff/collect.d.ts +25 -0
  27. package/dist/diff/collect.d.ts.map +1 -0
  28. package/dist/diff/collect.js +169 -0
  29. package/dist/diff/diffView.d.ts +57 -0
  30. package/dist/diff/diffView.d.ts.map +1 -0
  31. package/dist/diff/diffView.js +231 -0
  32. package/dist/diff/reviewQueue.d.ts +53 -0
  33. package/dist/diff/reviewQueue.d.ts.map +1 -0
  34. package/dist/diff/reviewQueue.js +349 -0
  35. package/dist/events/recap.d.ts +54 -0
  36. package/dist/events/recap.d.ts.map +1 -0
  37. package/dist/events/recap.js +161 -0
  38. package/dist/events/sessionEvents.d.ts +54 -0
  39. package/dist/events/sessionEvents.d.ts.map +1 -0
  40. package/dist/events/sessionEvents.js +324 -0
  41. package/dist/events/sessionStats.d.ts +89 -0
  42. package/dist/events/sessionStats.d.ts.map +1 -0
  43. package/dist/events/sessionStats.js +264 -0
  44. package/dist/import/claudeImport.d.ts +44 -0
  45. package/dist/import/claudeImport.d.ts.map +1 -0
  46. package/dist/import/claudeImport.js +337 -0
  47. package/dist/index.d.ts +33 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +33 -0
  50. package/dist/project/projectCommands.d.ts +33 -0
  51. package/dist/project/projectCommands.d.ts.map +1 -0
  52. package/dist/project/projectCommands.js +246 -0
  53. package/dist/search/conversationTurns.d.ts +53 -0
  54. package/dist/search/conversationTurns.d.ts.map +1 -0
  55. package/dist/search/conversationTurns.js +170 -0
  56. package/dist/search/globalSearch.d.ts +144 -0
  57. package/dist/search/globalSearch.d.ts.map +1 -0
  58. package/dist/search/globalSearch.js +350 -0
  59. package/dist/share/sessionChannel.d.ts +136 -0
  60. package/dist/share/sessionChannel.d.ts.map +1 -0
  61. package/dist/share/sessionChannel.js +373 -0
  62. package/dist/share/sessionShare.d.ts +104 -0
  63. package/dist/share/sessionShare.d.ts.map +1 -0
  64. package/dist/share/sessionShare.js +336 -0
  65. package/dist/ui/configCmd.d.ts +48 -0
  66. package/dist/ui/configCmd.d.ts.map +1 -0
  67. package/dist/ui/configCmd.js +146 -0
  68. package/dist/ui/deployPanel.d.ts +91 -0
  69. package/dist/ui/deployPanel.d.ts.map +1 -0
  70. package/dist/ui/deployPanel.js +442 -0
  71. package/dist/ui/mergeAssistant.d.ts +120 -0
  72. package/dist/ui/mergeAssistant.d.ts.map +1 -0
  73. package/dist/ui/mergeAssistant.js +391 -0
  74. package/dist/ui/notify.d.ts +114 -0
  75. package/dist/ui/notify.d.ts.map +1 -0
  76. package/dist/ui/notify.js +235 -0
  77. package/dist/ui/promptSuggest.d.ts +56 -0
  78. package/dist/ui/promptSuggest.d.ts.map +1 -0
  79. package/dist/ui/promptSuggest.js +160 -0
  80. package/dist/ui/taskGraph.d.ts +44 -0
  81. package/dist/ui/taskGraph.d.ts.map +1 -0
  82. package/dist/ui/taskGraph.js +289 -0
  83. package/dist/util/addDir.d.ts +31 -0
  84. package/dist/util/addDir.d.ts.map +1 -0
  85. package/dist/util/addDir.js +124 -0
  86. package/dist/util/batch.d.ts +16 -0
  87. package/dist/util/batch.d.ts.map +1 -0
  88. package/dist/util/batch.js +92 -0
  89. package/dist/util/cellWidth.d.ts +12 -0
  90. package/dist/util/cellWidth.d.ts.map +1 -0
  91. package/dist/util/cellWidth.js +161 -0
  92. package/dist/util/duration.d.ts +8 -0
  93. package/dist/util/duration.d.ts.map +1 -0
  94. package/dist/util/duration.js +50 -0
  95. package/dist/util/loopJobs.d.ts +67 -0
  96. package/dist/util/loopJobs.d.ts.map +1 -0
  97. package/dist/util/loopJobs.js +169 -0
  98. package/dist/util/settingsFile.d.ts +14 -0
  99. package/dist/util/settingsFile.d.ts.map +1 -0
  100. package/dist/util/settingsFile.js +99 -0
  101. package/dist/util/toolLabel.d.ts +2 -0
  102. package/dist/util/toolLabel.d.ts.map +1 -0
  103. package/dist/util/toolLabel.js +17 -0
  104. package/dist/verify/failureTimeline.d.ts +100 -0
  105. package/dist/verify/failureTimeline.d.ts.map +1 -0
  106. package/dist/verify/failureTimeline.js +253 -0
  107. package/dist/verify/verification.d.ts +75 -0
  108. package/dist/verify/verification.d.ts.map +1 -0
  109. package/dist/verify/verification.js +315 -0
  110. package/package.json +5 -4
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ // Output styles — a named block of instructions that changes HOW the agent answers
3
+ // (terse, teaching, ...) without changing what it can do. It rides in the same slot as
4
+ // the project brief, so it never touches the tool list or the permission rules.
5
+ //
6
+ // Sources, later wins on a name clash:
7
+ // built-in → ~/.nexrall/output-styles/<name>.md → <project>/.nexrall/output-styles/<name>.md
8
+ // A file may start with `---` front matter carrying `description:`; the rest is the style.
9
+ //
10
+ // Lives in core (moved from the CLI's ui/outputStyles.ts, 2026-10-04) so the VS Code
11
+ // panel composes the SAME styles into its brief — the CLI module is a re-export shim.
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.BUILT_IN_STYLES = exports.MAX_STYLE_CHARS = exports.DEFAULT_STYLE = void 0;
47
+ exports.parseStyleFile = parseStyleFile;
48
+ exports.listOutputStyles = listOutputStyles;
49
+ exports.findOutputStyle = findOutputStyle;
50
+ exports.readStyleSetting = readStyleSetting;
51
+ exports.styleInstructions = styleInstructions;
52
+ exports.formatStyleList = formatStyleList;
53
+ const fs = __importStar(require("fs"));
54
+ const path = __importStar(require("path"));
55
+ const os = __importStar(require("os"));
56
+ exports.DEFAULT_STYLE = 'default';
57
+ /** A style is injected into every prompt; cap it so a stray huge file cannot eat the context. */
58
+ exports.MAX_STYLE_CHARS = 4000;
59
+ exports.BUILT_IN_STYLES = [
60
+ { name: exports.DEFAULT_STYLE, description: 'The standard coding-assistant voice', prompt: '', source: 'built-in' },
61
+ {
62
+ name: 'concise',
63
+ description: 'Shortest correct answer — no preamble, no recap',
64
+ source: 'built-in',
65
+ prompt: 'Answer style: be as brief as correctness allows. No preamble, no restating the question, no closing summary of what you just did. Prefer one sentence or a short list. Show code, not prose about code. Never drop a warning the user must know to avoid breaking something.',
66
+ },
67
+ {
68
+ name: 'explanatory',
69
+ description: 'Explains the why behind each choice as it works',
70
+ source: 'built-in',
71
+ prompt: 'Answer style: while you work, add a short "Why" for each non-obvious decision (a trade-off, a pattern, a gotcha in this codebase) so the user learns the reasoning, not just the result. Keep each explanation to 1-3 sentences and tied to the code in front of you.',
72
+ },
73
+ {
74
+ name: 'learning',
75
+ description: 'Teaches: leaves small, well-marked pieces for you to write',
76
+ source: 'built-in',
77
+ prompt: 'Answer style: teach while building. Do the routine work yourself, but for a small, meaningful decision (a core function body, a design choice) stop and ask the user to write it, naming exactly where it goes and what it must do. Explain the concept first in 2-3 sentences. Never block on this for trivial code.',
78
+ },
79
+ ];
80
+ /** Splits optional `---` front matter off a style file. Unknown keys are ignored. */
81
+ function parseStyleFile(text) {
82
+ const src = String(text ?? '').replace(/^\uFEFF/, '');
83
+ const m = /^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(src);
84
+ if (!m)
85
+ return { description: '', body: src.trim() };
86
+ const desc = /^description:\s*(.*)$/m
87
+ .exec(m[1])?.[1]
88
+ ?.trim()
89
+ .replace(/^["']|["']$/g, '') ?? '';
90
+ return { description: desc, body: src.slice(m[0].length).trim() };
91
+ }
92
+ /** `Concise.md` → `concise`. Names are file stems, lower-cased, so lookup is forgiving. */
93
+ function styleName(file) {
94
+ if (!/\.md$/i.test(file))
95
+ return null;
96
+ const stem = file.slice(0, -3).trim().toLowerCase().replace(/\s+/g, '-');
97
+ return /^[a-z0-9][a-z0-9._-]*$/.test(stem) ? stem : null;
98
+ }
99
+ function readDir(dir, source) {
100
+ let files;
101
+ try {
102
+ files = fs.readdirSync(dir);
103
+ }
104
+ catch {
105
+ return [];
106
+ }
107
+ const out = [];
108
+ for (const f of files.sort()) {
109
+ const name = styleName(f);
110
+ if (!name)
111
+ continue;
112
+ let text;
113
+ try {
114
+ text = fs.readFileSync(path.join(dir, f), 'utf8');
115
+ }
116
+ catch {
117
+ continue;
118
+ }
119
+ const { description, body } = parseStyleFile(text);
120
+ if (!body)
121
+ continue;
122
+ out.push({
123
+ name,
124
+ description: description || `Custom style (${source})`,
125
+ prompt: body.length > exports.MAX_STYLE_CHARS ? body.slice(0, exports.MAX_STYLE_CHARS) : body,
126
+ source,
127
+ });
128
+ }
129
+ return out;
130
+ }
131
+ function listOutputStyles(workDir, home = os.homedir()) {
132
+ const byName = new Map();
133
+ for (const s of exports.BUILT_IN_STYLES)
134
+ byName.set(s.name, s);
135
+ for (const s of readDir(path.join(home, '.nexrall', 'output-styles'), 'user'))
136
+ byName.set(s.name, s);
137
+ for (const s of readDir(path.join(workDir, '.nexrall', 'output-styles'), 'project'))
138
+ byName.set(s.name, s);
139
+ // The default style is always the empty one: a file named default.md must not be able
140
+ // to hide the way back to "no style".
141
+ byName.set(exports.DEFAULT_STYLE, exports.BUILT_IN_STYLES[0]);
142
+ return [...byName.values()];
143
+ }
144
+ function findOutputStyle(styles, name) {
145
+ const n = String(name ?? '')
146
+ .trim()
147
+ .toLowerCase();
148
+ return styles.find((s) => s.name === n);
149
+ }
150
+ /** The settings value → a style name, defaulting safely for anything unusable. */
151
+ function readStyleSetting(raw) {
152
+ const v = (raw ?? {}).outputStyle;
153
+ return typeof v === 'string' && v.trim() ? v.trim().toLowerCase() : exports.DEFAULT_STYLE;
154
+ }
155
+ /**
156
+ * The text to add to the system prompt for the chosen style, or undefined for none.
157
+ * A style that no longer exists (file deleted) resolves to none rather than failing the session.
158
+ */
159
+ function styleInstructions(styles, name) {
160
+ const s = findOutputStyle(styles, name);
161
+ if (!s || !s.prompt)
162
+ return undefined;
163
+ return `[Output style: ${s.name}]\n${s.prompt}`;
164
+ }
165
+ function formatStyleList(styles, current) {
166
+ const width = Math.max(...styles.map((s) => s.name.length));
167
+ const lines = ['Output styles:', ''];
168
+ for (const s of styles) {
169
+ lines.push(` ${s.name === current ? '●' : ' '} ${s.name.padEnd(width)} ${s.description}${s.source === 'built-in' ? '' : ` [${s.source}]`}`);
170
+ }
171
+ lines.push('', 'Switch: /output-style <name> Add your own: .nexrall/output-styles/<name>.md');
172
+ return lines;
173
+ }
174
+ //# sourceMappingURL=outputStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/agent/skills.ts"],"names":[],"mappings":"AA2EA,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;IACrE,0IAA0I;IAC1I,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kHAAkH;IAClH,sBAAsB,EAAE,OAAO,CAAC;IAChC,iGAAiG;IACjG,aAAa,EAAE,OAAO,CAAC;IACvB,2GAA2G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CA4BlF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAcpF"}
@@ -507,12 +507,19 @@ function watchSkills(workDir, onChange, opts = {}) {
507
507
  try {
508
508
  const w = fs.watch(root, { recursive: true }, fire);
509
509
  w.on('error', () => { });
510
+ // A background convenience watcher must never be the handle that pins a
511
+ // process open at exit. Events still fire while anything else keeps the
512
+ // loop alive (the CLI's readline, the VS Code host, a test runner); but a
513
+ // host that answers 'dispose' by simply letting the loop drain — or a
514
+ // test embedding this panel — is not held hostage by the watcher it armed.
515
+ w.unref();
510
516
  watchers.push(w);
511
517
  }
512
518
  catch {
513
519
  try {
514
520
  const w = fs.watch(root, fire);
515
521
  w.on('error', () => { });
522
+ w.unref();
516
523
  watchers.push(w);
517
524
  }
518
525
  catch {
@@ -0,0 +1,11 @@
1
+ import type { OrgsResult } from './client';
2
+ export declare function formatMoney(usd: number): string;
3
+ /** Parse the argument of `/team use <x>`: `personal` → null, digits → team id, else undefined. */
4
+ export declare function parseTeamTarget(raw: string): number | null | undefined;
5
+ /**
6
+ * Plain-text lines describing what is paying for usage right now, and which teams
7
+ * could. Shared by `/team` and `/balance` so the two can never disagree.
8
+ * `pinned` is the NEXRALL_BILLING_TEAM override (undefined when unset).
9
+ */
10
+ export declare function billingLines(orgs: OrgsResult, pinned?: number | null): string[];
11
+ //# sourceMappingURL=billingLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billingLines.d.ts","sourceRoot":"","sources":["../../src/api/billingLines.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAKtE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE,CA6B/E"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatMoney = formatMoney;
4
+ exports.parseTeamTarget = parseTeamTarget;
5
+ exports.billingLines = billingLines;
6
+ function formatMoney(usd) {
7
+ // Sub-cent spend is the common case for a short turn; "$0.00" would hide it.
8
+ if (usd > 0 && usd < 0.01)
9
+ return '$' + usd.toFixed(4);
10
+ return '$' + usd.toFixed(2);
11
+ }
12
+ /** Parse the argument of `/team use <x>`: `personal` → null, digits → team id, else undefined. */
13
+ function parseTeamTarget(raw) {
14
+ const s = raw.trim();
15
+ if (/^(personal|null|0)$/i.test(s))
16
+ return null;
17
+ if (/^\d+$/.test(s))
18
+ return Number(s);
19
+ return undefined;
20
+ }
21
+ /**
22
+ * Plain-text lines describing what is paying for usage right now, and which teams
23
+ * could. Shared by `/team` and `/balance` so the two can never disagree.
24
+ * `pinned` is the NEXRALL_BILLING_TEAM override (undefined when unset).
25
+ */
26
+ function billingLines(orgs, pinned) {
27
+ const targetId = orgs.billingTargetTeamId ?? null;
28
+ const team = targetId == null ? null : (orgs.teams.find((t) => t.id === targetId) ?? null);
29
+ const lines = [];
30
+ if (team) {
31
+ lines.push(`Billing to team "${team.name}" — ${formatMoney(team.remainingUsd)} left this month`);
32
+ if (team.remainingUsd <= 0)
33
+ lines.push('! This team has no budget left — ask a team admin to add funds.');
34
+ }
35
+ else if (targetId != null) {
36
+ lines.push(`Billing to team ${targetId} — not available to this account, usage falls back to your wallet`);
37
+ }
38
+ else {
39
+ lines.push('Billing to your personal wallet');
40
+ }
41
+ lines.push(`Personal wallet: ${formatMoney(orgs.personal.balance)}`);
42
+ if (orgs.teams.length) {
43
+ lines.push('', 'Teams you can bill to:');
44
+ for (const t of orgs.teams) {
45
+ const cur = t.id === targetId ? ' <- current' : '';
46
+ const left = t.remainingUsd > 0 ? `${formatMoney(t.remainingUsd)} left` : 'no budget left';
47
+ lines.push(` ${t.id} ${t.name} ${left}${cur}`);
48
+ }
49
+ lines.push('', 'Switch with /team use <id> or /team use personal.');
50
+ }
51
+ if (pinned !== undefined) {
52
+ lines.push('', `Note: NEXRALL_BILLING_TEAM pins this run to ${pinned === null ? 'your personal wallet' : `team ${pinned}`}, ignoring the account setting.`);
53
+ }
54
+ return lines;
55
+ }
56
+ //# sourceMappingURL=billingLines.js.map
@@ -236,6 +236,8 @@ export interface CodeModelInfo {
236
236
  vendor: string;
237
237
  blurb: string;
238
238
  costMultiplier?: number;
239
+ inputPrice?: number;
240
+ outputPrice?: number;
239
241
  contextWindow: number;
240
242
  maxOutputTokens: number;
241
243
  supportsImageInput: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA8B,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiErH,eAAO,MAAM,QAAQ,QAAmB,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5D,OAAO,EAAE,CAAC,EAAE,EACZ,UAAU,EAAE,KAAK,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GACtD,CAAC,EAAE,CAaL;AA8BD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CA+B3D;AA4BD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,aAAa,C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YzB;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE;IACL,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GACA,OAAO,CAAC,aAAa,CAAC,CAYxB;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAI5E;AAED,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAGlF"}
@@ -0,0 +1,53 @@
1
+ import type { CloudSchedule, CloudScheduleRun } from './client';
2
+ /** Same units as /loop (s, m, h, d) so one syntax covers both commands. */
3
+ export declare function parseScheduleEvery(raw: string): {
4
+ minutes: number;
5
+ } | {
6
+ error: string;
7
+ };
8
+ /** Minutes → the same human spelling /loop uses: 90 → "90m", 120 → "2h", 1440 → "1d". */
9
+ export declare function formatEvery(minutes: number): string;
10
+ /** Local wall-clock, always absolute — for things that already happened. */
11
+ export declare function fmtLocal(iso: string | null): string;
12
+ /** For "next run": relative while it is near, absolute once it is far away. */
13
+ export declare function fmtScheduleWhen(iso: string | null, now?: number): string;
14
+ /**
15
+ * The list rendered by `nex schedule list` and `/schedule` (no colour — callers
16
+ * decide). Columns are fixed-width so rows scan; the task takes what's left.
17
+ */
18
+ export declare function scheduleListLines(list: CloudSchedule[], opts?: {
19
+ now?: number;
20
+ cols?: number;
21
+ }): string[];
22
+ /** Run history for `nex schedule runs <id>` and `/schedule runs <id>`. */
23
+ export declare function scheduleRunsLines(runs: CloudScheduleRun[], opts?: {
24
+ cols?: number;
25
+ }): string[];
26
+ export declare const SCHEDULE_USAGE: string;
27
+ export type ScheduleChatAction = {
28
+ kind: 'list';
29
+ } | {
30
+ kind: 'add';
31
+ intervalMinutes: number;
32
+ task: string;
33
+ } | {
34
+ kind: 'pause';
35
+ id: string;
36
+ } | {
37
+ kind: 'resume';
38
+ id: string;
39
+ } | {
40
+ kind: 'run';
41
+ id: string;
42
+ } | {
43
+ kind: 'rm';
44
+ id: string;
45
+ } | {
46
+ kind: 'runs';
47
+ id: string;
48
+ } | {
49
+ kind: 'error';
50
+ message: string;
51
+ };
52
+ export declare function parseScheduleChatArg(arg: string): ScheduleChatAction;
53
+ //# sourceMappingURL=scheduleLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduleLines.d.ts","sourceRoot":"","sources":["../../src/api/scheduleLines.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIhE,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAgBvF;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAMD,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAMnD;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,SAAa,GAAG,MAAM,CAS5E;AAOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,EAAE,CAuB7G;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,EAAE,CAYlG;AAID,eAAO,MAAM,cAAc,QAEkB,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CA0BpE"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SCHEDULE_USAGE = void 0;
4
+ exports.parseScheduleEvery = parseScheduleEvery;
5
+ exports.formatEvery = formatEvery;
6
+ exports.fmtLocal = fmtLocal;
7
+ exports.fmtScheduleWhen = fmtScheduleWhen;
8
+ exports.scheduleListLines = scheduleListLines;
9
+ exports.scheduleRunsLines = scheduleRunsLines;
10
+ exports.parseScheduleChatArg = parseScheduleChatArg;
11
+ const client_1 = require("./client");
12
+ const loopJobs_1 = require("../util/loopJobs");
13
+ /** Same units as /loop (s, m, h, d) so one syntax covers both commands. */
14
+ function parseScheduleEvery(raw) {
15
+ const tok = String(raw ?? '').trim();
16
+ const ms = (0, loopJobs_1.parseInterval)(tok);
17
+ if (ms === null) {
18
+ return { error: `Not an interval: "${tok}". Units s, m, h, d — e.g. 90m, 2h, 1d.` };
19
+ }
20
+ const minutes = ms / 60000;
21
+ if (!Number.isInteger(minutes)) {
22
+ return { error: `Intervals must be whole minutes, at least ${client_1.SCHEDULE_MIN_MINUTES}m (the server's floor).` };
23
+ }
24
+ if (minutes < client_1.SCHEDULE_MIN_MINUTES || minutes > client_1.SCHEDULE_MAX_MINUTES) {
25
+ return {
26
+ error: `Interval ${tok} is outside the server's range (${client_1.SCHEDULE_MIN_MINUTES} minutes – ${client_1.SCHEDULE_MAX_MINUTES / (24 * 60)} days).`,
27
+ };
28
+ }
29
+ return { minutes };
30
+ }
31
+ /** Minutes → the same human spelling /loop uses: 90 → "90m", 120 → "2h", 1440 → "1d". */
32
+ function formatEvery(minutes) {
33
+ return (0, loopJobs_1.formatInterval)(Math.round(minutes) * 60000);
34
+ }
35
+ function pad2(n) {
36
+ return String(n).padStart(2, '0');
37
+ }
38
+ /** Local wall-clock, always absolute — for things that already happened. */
39
+ function fmtLocal(iso) {
40
+ if (!iso)
41
+ return '-';
42
+ const t = Date.parse(iso);
43
+ if (!Number.isFinite(t))
44
+ return '-';
45
+ const d = new Date(t);
46
+ return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())} ${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
47
+ }
48
+ /** For "next run": relative while it is near, absolute once it is far away. */
49
+ function fmtScheduleWhen(iso, now = Date.now()) {
50
+ if (!iso)
51
+ return '-';
52
+ const t = Date.parse(iso);
53
+ if (!Number.isFinite(t))
54
+ return '-';
55
+ const delta = t - now;
56
+ if (delta <= 0)
57
+ return 'due now';
58
+ if (delta < 60 * 60000)
59
+ return `in ${Math.max(1, Math.round(delta / 60000))}m`;
60
+ if (delta < 24 * 3600000)
61
+ return `in ${Math.round(delta / 3600000)}h`;
62
+ return fmtLocal(iso);
63
+ }
64
+ function truncate(text, width) {
65
+ if (width <= 1)
66
+ return '';
67
+ return text.length > width ? text.slice(0, width - 1) + '…' : text;
68
+ }
69
+ /**
70
+ * The list rendered by `nex schedule list` and `/schedule` (no colour — callers
71
+ * decide). Columns are fixed-width so rows scan; the task takes what's left.
72
+ */
73
+ function scheduleListLines(list, opts = {}) {
74
+ if (!list.length) {
75
+ return [
76
+ 'No cloud schedules.',
77
+ "Create one with: /schedule add 1d <task> (runs on Nexrall's servers, not this laptop)",
78
+ ];
79
+ }
80
+ const now = opts.now ?? Date.now();
81
+ const cols = opts.cols ?? 100;
82
+ // 16, not 15: an absolute next-run is "YYYY-MM-DD HH:mm" — one cell wider.
83
+ // The rows pad NEXT RUN to the same 16, or a relative value sits a cell short of the header.
84
+ const head = `${'ID'.padEnd(20)}${'STATE'.padEnd(7)}${'EVERY'.padEnd(7)}${'NEXT RUN'.padEnd(16)}${'LAST'.padEnd(8)}TASK`;
85
+ const taskWidth = Math.max(12, cols - 60);
86
+ const lines = [head];
87
+ for (const s of list) {
88
+ const state = s.enabled ? 'on' : 'off';
89
+ const last = s.lastStatus ?? '-';
90
+ lines.push(`${s.id.padEnd(20)}${state.padEnd(7)}${formatEvery(s.intervalMinutes).padEnd(7)}` +
91
+ `${fmtScheduleWhen(s.nextRunAt, now).padEnd(16)}${last.padEnd(8)}${truncate(s.task, taskWidth)}`);
92
+ }
93
+ return lines;
94
+ }
95
+ /** Run history for `nex schedule runs <id>` and `/schedule runs <id>`. */
96
+ function scheduleRunsLines(runs, opts = {}) {
97
+ if (!runs.length)
98
+ return ['No runs yet — the first one happens at the "next run" time on the schedule.'];
99
+ const cols = opts.cols ?? 100;
100
+ const lines = [`${'WHEN'.padEnd(19)}${'STATUS'.padEnd(8)}${'STEPS'.padEnd(7)}SUMMARY`];
101
+ const summaryWidth = Math.max(12, cols - 34);
102
+ for (const r of runs) {
103
+ lines.push(`${fmtLocal(r.createdAt).padEnd(19)}${r.status.padEnd(8)}${String(r.steps).padEnd(7)}` +
104
+ truncate(r.summary ?? '-', summaryWidth));
105
+ }
106
+ return lines;
107
+ }
108
+ // ─── The /schedule chat command's argument grammar ───────────────────────────
109
+ exports.SCHEDULE_USAGE = 'Usage: /schedule [list | add <interval> <task> | pause|resume|run|rm|runs <id>]' +
110
+ ' — e.g. /schedule add 1d triage the repo';
111
+ function parseScheduleChatArg(arg) {
112
+ const text = String(arg ?? '').trim();
113
+ if (!text || /^(list|ls)$/i.test(text))
114
+ return { kind: 'list' };
115
+ const head = /^(\S+)\s+([\s\S]*)$/.exec(text);
116
+ if (head) {
117
+ const verb = head[1].toLowerCase();
118
+ const rest = head[2].trim();
119
+ if (verb === 'add')
120
+ return parseScheduleAdd(rest);
121
+ if (verb === 'pause' || verb === 'resume' || verb === 'run' || verb === 'runs') {
122
+ if (!/^\d+$/.test(rest)) {
123
+ return { kind: 'error', message: `Which schedule? /schedule ${verb} takes the digit id from /schedule list.` };
124
+ }
125
+ return { kind: verb, id: rest };
126
+ }
127
+ if (verb === 'rm' || verb === 'remove') {
128
+ if (!/^\d+$/.test(rest)) {
129
+ return { kind: 'error', message: 'Which schedule? /schedule rm takes the digit id from /schedule list.' };
130
+ }
131
+ return { kind: 'rm', id: rest };
132
+ }
133
+ }
134
+ // Bare form: "/schedule 2h triage the repo" — the same leading-interval shape
135
+ // /loop accepts, so muscle memory carries over.
136
+ return parseScheduleAdd(text);
137
+ }
138
+ function parseScheduleAdd(rest) {
139
+ const lead = /^(\S+)\s+([\s\S]+)$/.exec(rest.trim());
140
+ if (!lead)
141
+ return { kind: 'error', message: exports.SCHEDULE_USAGE };
142
+ const interval = parseScheduleEvery(lead[1]);
143
+ if ('error' in interval)
144
+ return { kind: 'error', message: interval.error };
145
+ const task = lead[2].trim();
146
+ if (!task)
147
+ return { kind: 'error', message: 'Nothing to run — add a task after the interval.' };
148
+ return { kind: 'add', intervalMinutes: interval.minutes, task };
149
+ }
150
+ //# sourceMappingURL=scheduleLines.js.map
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Structurally identical to the CLI's fileMention.Attachment (kept local so
3
+ * core does not import from the CLI). TS is structural, so a CLI Attachment
4
+ * passes here unchanged.
5
+ */
6
+ export interface Attachment {
7
+ /** Path relative to the working directory, as shown to the model. */
8
+ rel: string;
9
+ kind: 'file' | 'dir';
10
+ content: string;
11
+ truncated: boolean;
12
+ lines: number;
13
+ }
14
+ export interface ContextSet {
15
+ /** Project-relative POSIX paths, in the order they were pinned. */
16
+ pinned: string[];
17
+ /** `/exclude` glob patterns. */
18
+ excluded: string[];
19
+ }
20
+ export declare const EMPTY_CONTEXT_SET: ContextSet;
21
+ /**
22
+ * One file per project directory. The hash is of the resolved path, so two
23
+ * projects that happen to share a folder name ("api", "app") cannot read each
24
+ * other's list; the readable prefix is there for a human poking at the folder.
25
+ */
26
+ export declare function contextSetPath(workDir: string): string;
27
+ /** Missing or corrupt file → an empty set: a bad file must not stop the CLI. */
28
+ export declare function loadContextSet(workDir: string): ContextSet;
29
+ export declare function saveContextSet(workDir: string, set: ContextSet): void;
30
+ /**
31
+ * `@src/a.ts` / `src/a.ts` / `./src/a.ts` → `src/a.ts`. Null when the path is
32
+ * empty, IS the project root, or escapes it (`../secrets`, `/etc/passwd`) — a
33
+ * pin is fed back to the model, so it may only ever name something inside.
34
+ * Purely lexical (no fs): a not-yet-created file can still be pinned.
35
+ */
36
+ export declare function relInProject(input: string, workDir: string): string | null;
37
+ /**
38
+ * Glob for an `/exclude` pattern:
39
+ * • a trailing "/" is decoration — "generated/" and "generated" mean the same
40
+ * thing here, because a match on the directory already covers its contents;
41
+ * • a pattern WITHOUT a "/" matches a path segment at any depth
42
+ * ("node_modules" hides every one of them, exactly like .gitignore);
43
+ * • a pattern WITH a "/" is anchored to the project root
44
+ * ("src/generated" does not hide "vendor/src/generated");
45
+ * • either way the match ends at a path boundary, so a pattern naming a
46
+ * DIRECTORY hides everything inside it ("src/generated" hides
47
+ * "src/generated/x.ts"), while "node_modules" still never matches
48
+ * "node_modules_backup";
49
+ * • "*" stops at a "/", "**" crosses them, "?" is one character.
50
+ */
51
+ export declare function globToRegExp(pattern: string): RegExp;
52
+ /** True when `rel` (project-relative, POSIX) is hidden by any of `patterns`. */
53
+ export declare function isExcluded(rel: string, patterns: string[]): boolean;
54
+ export interface ContextEdit {
55
+ ok: boolean;
56
+ /** One line for the user, without colour — the caller decides how to print it. */
57
+ message: string;
58
+ set: ContextSet;
59
+ }
60
+ export declare function addPinned(set: ContextSet, rel: string): ContextEdit;
61
+ export declare function removePinned(set: ContextSet, rel: string): ContextEdit;
62
+ export declare function addExcluded(set: ContextSet, pattern: string): ContextEdit;
63
+ export declare function removeExcluded(set: ContextSet, pattern: string): ContextEdit;
64
+ /** Bare `/unpin` / `/unexclude` clear the matching list. */
65
+ export declare function clearPinned(set: ContextSet): ContextEdit;
66
+ export declare function clearExcluded(set: ContextSet): ContextEdit;
67
+ export interface PinnedRead {
68
+ attachments: Attachment[];
69
+ /** One line per file that could not be attached (missing, binary, too big). */
70
+ notes: string[];
71
+ }
72
+ /**
73
+ * Contents of the pinned files, shaped like an `@` attachment so the model sees
74
+ * the same framing it already knows. Budgets mirror expandMentions': per file,
75
+ * and for the batch, because pinned paths accumulate over weeks and a runaway
76
+ * 200 KB JSON would otherwise be re-sent on every compaction.
77
+ */
78
+ export declare function readPinned(workDir: string, pinned: string[], maxBytes?: number, maxTotal?: number): PinnedRead;
79
+ /** Human-facing summary of what each list currently holds. */
80
+ export declare function describeContextSet(set: ContextSet): string[];
81
+ //# sourceMappingURL=contextFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextFiles.d.ts","sourceRoot":"","sources":["../../src/context/contextFiles.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,GA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