orizu 0.5.31 → 0.5.32
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/app-commands.d.ts +2 -0
- package/dist/app-commands.d.ts.map +1 -1
- package/dist/app-commands.js +10 -4
- package/dist/help.js +5 -5
- package/dist/hosted-agent-prompt.d.ts +14 -0
- package/dist/hosted-agent-prompt.d.ts.map +1 -0
- package/dist/hosted-agent-prompt.js +17 -0
- package/dist/hosted-harness-opencode.d.ts.map +1 -1
- package/dist/hosted-harness-opencode.js +4 -0
- package/dist/hosted-optimization-prebaked-marker.d.ts +9 -0
- package/dist/hosted-optimization-prebaked-marker.d.ts.map +1 -0
- package/dist/hosted-optimization-prebaked-marker.js +22 -0
- package/dist/markdown-report-input.d.ts.map +1 -1
- package/dist/markdown-report-input.js +1 -1
- package/dist/preview-runtime.d.ts +7 -0
- package/dist/preview-runtime.d.ts.map +1 -1
- package/dist/preview-runtime.js +49 -5
- package/dist/provider-refusals.js +2 -2
- package/dist/report-markdown-blankness.d.ts +6 -0
- package/dist/report-markdown-blankness.d.ts.map +1 -1
- package/dist/report-markdown-blankness.js +47 -4
- package/dist/setup-and-skills-commands.d.ts.map +1 -1
- package/dist/setup-and-skills-commands.js +123 -9
- package/dist/skill-installer.d.ts +32 -0
- package/dist/skill-installer.d.ts.map +1 -1
- package/dist/skill-installer.js +228 -1
- package/package.json +1 -1
- package/src/app-commands.ts +13 -3
- package/src/help.ts +5 -5
- package/src/hosted-agent-prompt.ts +18 -0
- package/src/hosted-harness-opencode.ts +4 -0
- package/src/hosted-optimization-prebaked-marker.ts +20 -0
- package/src/markdown-report-input.ts +3 -1
- package/src/preview-runtime.ts +44 -5
- package/src/provider-refusals.ts +2 -2
- package/src/report-markdown-blankness.ts +59 -4
- package/src/setup-and-skills-commands.ts +160 -8
- package/src/skill-installer.ts +315 -0
- package/vendor/skills/orizu/SKILL.md +3 -3
- package/vendor/skills/orizu/flows/first-win.md +3 -1
- package/vendor/skills/orizu/flows/promote.md +2 -1
- package/vendor/skills/orizu/references/building-apps.md +2 -0
- package/vendor/skills/orizu/references/building-judges.md +138 -8
- package/vendor/skills/orizu/references/cli-reference.md +1 -1
- package/vendor/skills/orizu/references/optimization-with-gepa.md +21 -3
- package/vendor/skills/orizu/references/primer.md +2 -2
- package/vendor/skills/orizu/scripts/test-app.mjs +53 -4
package/dist/app-commands.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ declare function previewAppFromFile(): Promise<void>;
|
|
|
24
24
|
declare function updateAppFromFile(): Promise<void>;
|
|
25
25
|
declare function linkAppDataset(): Promise<void>;
|
|
26
26
|
declare function appDetail(): Promise<void>;
|
|
27
|
+
/** `--out` may be a file path or a directory; a directory gets the default file name. */
|
|
28
|
+
export declare function resolveAppExportPath(outPathArg: string | null | undefined, defaultFilename: string): string;
|
|
27
29
|
declare function exportAppSource(): Promise<void>;
|
|
28
30
|
export { readSourceFile, readJsonFile, readManifestFile, readPromptPrimaryText, readPromptSidecars, stringFromRecord, isRecord, safeRelativePath, writeTextFileEnsuringDir, sha256Hex, readSourceBytes, listApps, createAppFromFile, previewAppFromFile, updateAppFromFile, linkAppDataset, appDetail, exportAppSource, };
|
|
29
31
|
//# sourceMappingURL=app-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-commands.d.ts","sourceRoot":"","sources":["../src/app-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-commands.d.ts","sourceRoot":"","sources":["../src/app-commands.ts"],"names":[],"mappings":"AAiCA,iBAAe,QAAQ,kBAQtB;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAU/C;AAED,iBAAS,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY9D;AAED,iBAAS,QA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AqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,GAChB,CAAA"}
|
package/dist/app-commands.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ORI-2044: moved from index.ts to keep app commands together.
|
|
2
|
-
import { readFileSync, mkdirSync, writeFileSync, realpathSync, } from 'fs';
|
|
2
|
+
import { readFileSync, statSync, mkdirSync, writeFileSync, realpathSync, } from 'fs';
|
|
3
3
|
import { normalize, isAbsolute, join, dirname, } from 'path';
|
|
4
4
|
import { createHash } from 'crypto';
|
|
5
5
|
import { getArg, getArchiveListStatus, hasJsonFlag, expandHomePath, hasArg, } from './command-line-arguments.js';
|
|
@@ -330,6 +330,14 @@ async function appDetail() {
|
|
|
330
330
|
printLine(` Created: ${sanitizeTerminalText(detail.createdAt)}`);
|
|
331
331
|
printLine(` Updated: ${sanitizeTerminalText(detail.updatedAt)}`);
|
|
332
332
|
}
|
|
333
|
+
/** `--out` may be a file path or a directory; a directory gets the default file name. */
|
|
334
|
+
export function resolveAppExportPath(outPathArg, defaultFilename) {
|
|
335
|
+
if (!outPathArg)
|
|
336
|
+
return defaultFilename;
|
|
337
|
+
const expanded = expandHomePath(outPathArg);
|
|
338
|
+
const isDirectory = /[\\/]$/.test(outPathArg) || statSync(expanded, { throwIfNoEntry: false })?.isDirectory() === true;
|
|
339
|
+
return isDirectory ? join(expanded, defaultFilename) : expanded;
|
|
340
|
+
}
|
|
333
341
|
async function exportAppSource() {
|
|
334
342
|
const project = getArg('--project');
|
|
335
343
|
const versionArg = getArg('--version');
|
|
@@ -358,9 +366,7 @@ async function exportAppSource() {
|
|
|
358
366
|
throw new Error(`Failed to export app (${response.status}): ${await response.text()}`);
|
|
359
367
|
}
|
|
360
368
|
const data = await parseJsonResponse(response, 'App export');
|
|
361
|
-
const filename = outPathArg
|
|
362
|
-
? expandHomePath(outPathArg)
|
|
363
|
-
: defaultAppExportFilename(data.app.name, data.version.versionNum);
|
|
369
|
+
const filename = resolveAppExportPath(outPathArg, defaultAppExportFilename(data.app.name, data.version.versionNum));
|
|
364
370
|
writeTextFileEnsuringDir(filename, data.version.code);
|
|
365
371
|
if (hasJsonFlag()) {
|
|
366
372
|
printJson({
|
package/dist/help.js
CHANGED
|
@@ -280,13 +280,13 @@ export const COMMAND_DOCS = [
|
|
|
280
280
|
options: [
|
|
281
281
|
{ name: '--team <slug>', help: 'Choose an existing accessible team.' },
|
|
282
282
|
{ name: '--create-team <name>', help: 'Create and select a new team; mutually exclusive with --team.' },
|
|
283
|
-
{ name: '--project <slug>', help: 'Choose the project to
|
|
284
|
-
{ name: '--create-project <name>', help: 'Create and select a project in the chosen team; mutually exclusive with --project.' },
|
|
283
|
+
{ name: '--project <slug>', help: 'Choose the project to work in. Only that project is set up in the workspace, and the team-project checklist is skipped, interactive or not.' },
|
|
284
|
+
{ name: '--create-project <name>', help: 'Create and select a project in the chosen team, and set up only that project (no checklist); mutually exclusive with --project.' },
|
|
285
285
|
{ name: '--workspace [path]', help: 'Initialize or validate a workspace path, or the current directory when no path is provided. If provided, the value must be a filesystem path.' },
|
|
286
286
|
{ name: '--service-origin <url>', help: 'Service origin written to setup metadata. Defaults to the active CLI server.' },
|
|
287
287
|
{ name: '--attach-workspace <id>', help: 'Record an existing Orizu workspace id for future attachment.' },
|
|
288
288
|
{ name: '--validate', help: 'Inspect the workspace contract without writing files.' },
|
|
289
|
-
{ name: '--fix', help: 'Apply safe idempotent repairs only.' },
|
|
289
|
+
{ name: '--fix', help: 'Apply safe idempotent repairs only, restoring every team project.' },
|
|
290
290
|
{ name: '--no-symlinks', help: 'Write CLAUDE.md as a pointer file instead of a symlink to AGENTS.md.' },
|
|
291
291
|
{ name: '--verbose', help: 'Show per-file setup actions. Default setup output is summary-oriented.' },
|
|
292
292
|
{ name: '--agent <agent>', help: 'Non-interactive opt-in to install the shared global Orizu skill plus any applicable native target. Repeat for multiple agents.', repeatable: true, choices: ['claude', 'codex', 'pi', 'devin', 'droid', 'grok', 'windsurf', 'opencode'] },
|
|
@@ -748,8 +748,8 @@ export const COMMAND_DOCS = [
|
|
|
748
748
|
},
|
|
749
749
|
{
|
|
750
750
|
path: ['apps', 'export'],
|
|
751
|
-
usage: 'orizu apps export [--app <appId>] [--project <team/project>] [--version <n>] [--out <
|
|
752
|
-
summary: 'Export app source for the selected app version.',
|
|
751
|
+
usage: 'orizu apps export [--app <appId>] [--project <team/project>] [--version <n>] [--out <file-or-directory>]',
|
|
752
|
+
summary: 'Export app source for the selected app version. --out is a file path, or a directory (the file is named <app>.v<version>.tsx inside it).',
|
|
753
753
|
group: 'Apps',
|
|
754
754
|
},
|
|
755
755
|
{
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system prompt for the hosted agent (ORI-2207).
|
|
3
|
+
*
|
|
4
|
+
* OpenCode (the program that runs the agent in a hosted session) ships its own
|
|
5
|
+
* built-in prompt that starts "You are opencode, an interactive CLI tool…", so
|
|
6
|
+
* the agent used to introduce itself as OpenCode. We register our own "primary
|
|
7
|
+
* agent" in the OpenCode config with this text, and every prompt request picks
|
|
8
|
+
* it by name. That replaces OpenCode's built-in prompt entirely, so this text
|
|
9
|
+
* carries the working rules we still want: use the tools, keep answers short.
|
|
10
|
+
* AGENTS.md is still added after it, as before.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HOSTED_AGENT_NAME = "orizu";
|
|
13
|
+
export declare const HOSTED_AGENT_PROMPT = "You are the Orizu agent. You work in the person's repository inside an Orizu workbench, helping them with software engineering tasks. If asked who or what you are, say you are the Orizu agent. Never call yourself OpenCode.\n\n- Do the work with your tools: read files, search, edit, and run commands. Do not guess at what a file contains when you can look.\n- Keep answers short and plain. Say what you did and what the person needs to know next.\n- Follow the repository's own conventions and any instructions in its AGENTS.md.";
|
|
14
|
+
//# sourceMappingURL=hosted-agent-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-agent-prompt.d.ts","sourceRoot":"","sources":["../src/hosted-agent-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,UAAU,CAAA;AAExC,eAAO,MAAM,mBAAmB,qhBAIiD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system prompt for the hosted agent (ORI-2207).
|
|
3
|
+
*
|
|
4
|
+
* OpenCode (the program that runs the agent in a hosted session) ships its own
|
|
5
|
+
* built-in prompt that starts "You are opencode, an interactive CLI tool…", so
|
|
6
|
+
* the agent used to introduce itself as OpenCode. We register our own "primary
|
|
7
|
+
* agent" in the OpenCode config with this text, and every prompt request picks
|
|
8
|
+
* it by name. That replaces OpenCode's built-in prompt entirely, so this text
|
|
9
|
+
* carries the working rules we still want: use the tools, keep answers short.
|
|
10
|
+
* AGENTS.md is still added after it, as before.
|
|
11
|
+
*/
|
|
12
|
+
export const HOSTED_AGENT_NAME = 'orizu';
|
|
13
|
+
export const HOSTED_AGENT_PROMPT = `You are the Orizu agent. You work in the person's repository inside an Orizu workbench, helping them with software engineering tasks. If asked who or what you are, say you are the Orizu agent. Never call yourself OpenCode.
|
|
14
|
+
|
|
15
|
+
- Do the work with your tools: read files, search, edit, and run commands. Do not guess at what a file contains when you can look.
|
|
16
|
+
- Keep answers short and plain. Say what you did and what the person needs to know next.
|
|
17
|
+
- Follow the repository's own conventions and any instructions in its AGENTS.md.`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harness-opencode.d.ts","sourceRoot":"","sources":["../src/hosted-harness-opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;
|
|
1
|
+
{"version":3,"file":"hosted-harness-opencode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5D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB;8DAC0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAkBD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CA+DxF"}
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
* would break both ports and must be re-verified.
|
|
50
50
|
*/
|
|
51
51
|
import { readFileSync } from 'fs';
|
|
52
|
+
import { HOSTED_AGENT_NAME, HOSTED_AGENT_PROMPT } from './hosted-agent-prompt.js';
|
|
52
53
|
import { findProvider, parseModelIdentity } from './provider-registry.js';
|
|
53
54
|
import { HARNESS_NAMES } from './hosted-harness.js';
|
|
54
55
|
// OpenCode is HARD-PINNED to this version everywhere it is installed/launched.
|
|
@@ -150,6 +151,7 @@ export function buildPromptRequestBody(content, model, opencodeMessageId, reason
|
|
|
150
151
|
const body = {
|
|
151
152
|
parts: [{ type: 'text', text: content }],
|
|
152
153
|
messageID: opencodeMessageId,
|
|
154
|
+
agent: HOSTED_AGENT_NAME,
|
|
153
155
|
};
|
|
154
156
|
if (!model)
|
|
155
157
|
return body;
|
|
@@ -991,6 +993,8 @@ export function buildOpenCodeConfigContent(opts) {
|
|
|
991
993
|
return JSON.stringify({
|
|
992
994
|
model: opts.model,
|
|
993
995
|
permission: opts.permission ?? defaultHeadlessPermission(),
|
|
996
|
+
// Replaces OpenCode's built-in "You are opencode…" prompt (ORI-2207).
|
|
997
|
+
agent: { [HOSTED_AGENT_NAME]: { mode: 'primary', prompt: HOSTED_AGENT_PROMPT } },
|
|
994
998
|
});
|
|
995
999
|
}
|
|
996
1000
|
const OPENCODE_READY_TIMEOUT_MS = 180_000;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The check the session coordinator makes on `/opt/orizu/prebaked.json`, the
|
|
3
|
+
* first bootstrap command of a hosted optimization run. It lives here so the
|
|
4
|
+
* release bake's start check (hosted-runtime-image/check-snapshot-starts.mjs)
|
|
5
|
+
* rejects a snapshot on exactly the rules the coordinator would refuse it on.
|
|
6
|
+
* Worker code imports this module, so it must not use Node APIs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isHostedOptimizationPrebakedMarker(raw: string): boolean;
|
|
9
|
+
//# sourceMappingURL=hosted-optimization-prebaked-marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-optimization-prebaked-marker.d.ts","sourceRoot":"","sources":["../src/hosted-optimization-prebaked-marker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAYvE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The check the session coordinator makes on `/opt/orizu/prebaked.json`, the
|
|
3
|
+
* first bootstrap command of a hosted optimization run. It lives here so the
|
|
4
|
+
* release bake's start check (hosted-runtime-image/check-snapshot-starts.mjs)
|
|
5
|
+
* rejects a snapshot on exactly the rules the coordinator would refuse it on.
|
|
6
|
+
* Worker code imports this module, so it must not use Node APIs.
|
|
7
|
+
*/
|
|
8
|
+
export function isHostedOptimizationPrebakedMarker(raw) {
|
|
9
|
+
try {
|
|
10
|
+
const marker = JSON.parse(raw);
|
|
11
|
+
if (!marker || typeof marker !== 'object' || Array.isArray(marker))
|
|
12
|
+
return false;
|
|
13
|
+
const value = marker;
|
|
14
|
+
return value.builtFor === 'vercel-sandbox' &&
|
|
15
|
+
typeof value.cliVersion === 'string' && value.cliVersion.length > 0 &&
|
|
16
|
+
typeof value.opencodeVersion === 'string' && value.opencodeVersion.length > 0 &&
|
|
17
|
+
typeof value.claudeSdkVersion === 'string' && value.claudeSdkVersion.length > 0;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-report-input.d.ts","sourceRoot":"","sources":["../src/markdown-report-input.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,QAAkB,CAAA;AAsCxD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,EAAE,cAAc,GAAG,QAAQ,GAAG,MAAM,GAC9C,mBAAmB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"markdown-report-input.d.ts","sourceRoot":"","sources":["../src/markdown-report-input.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,QAAkB,CAAA;AAsCxD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,EAAE,cAAc,GAAG,QAAQ,GAAG,MAAM,GAC9C,mBAAmB,GAAG,IAAI,CAgD5B"}
|
|
@@ -72,7 +72,7 @@ export function readMarkdownReportInput(args, reportLabel) {
|
|
|
72
72
|
sourceName = 'inline';
|
|
73
73
|
}
|
|
74
74
|
if (!hasCanonicalReportMarkdownContent(markdown)) {
|
|
75
|
-
throw new Error(`${reportLabel} report
|
|
75
|
+
throw new Error(`${reportLabel} report has no visible content: it is empty or contains only whitespace`);
|
|
76
76
|
}
|
|
77
77
|
if (Buffer.byteLength(markdown, 'utf8') > MARKDOWN_REPORT_MAX_BYTES) {
|
|
78
78
|
throw new Error(`${reportLabel} report exceeds ${MARKDOWN_REPORT_MAX_BYTES} bytes`);
|
|
@@ -47,6 +47,13 @@ interface PreviewPage {
|
|
|
47
47
|
on?: (event: string, listener: () => void) => unknown;
|
|
48
48
|
off?: (event: string, listener: () => void) => unknown;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Removes line and block comments, walking left to right so a `//` or `/*`
|
|
52
|
+
* inside a quoted string or template literal is left alone. A block comment
|
|
53
|
+
* keeps its newlines, so line numbers in later messages stay true.
|
|
54
|
+
* Regex literals are not tracked; a quote inside one can hide a comment.
|
|
55
|
+
*/
|
|
56
|
+
export declare function stripComments(code: string): string;
|
|
50
57
|
export declare function validatePreviewInputs(options: AppPreviewOptions): Issue[];
|
|
51
58
|
export declare function runLocalAppPreview(options: AppPreviewOptions): Promise<AppPreviewResult>;
|
|
52
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-runtime.d.ts","sourceRoot":"","sources":["../src/preview-runtime.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,gCAAgC,IAAI,CAAA;AAGjD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CA+C5D,CAAA;AAGD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,GAAG,CAAC,EAAE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,56 @@ function isNodeError(error) {
|
|
|
57
57
|
return error instanceof Error;
|
|
58
58
|
}
|
|
59
59
|
const SUPPORTED_SCHEMA_KEYS = new Set(['type', 'required', 'properties', 'items', 'enum']);
|
|
60
|
+
/**
|
|
61
|
+
* Removes line and block comments, walking left to right so a `//` or `/*`
|
|
62
|
+
* inside a quoted string or template literal is left alone. A block comment
|
|
63
|
+
* keeps its newlines, so line numbers in later messages stay true.
|
|
64
|
+
* Regex literals are not tracked; a quote inside one can hide a comment.
|
|
65
|
+
*/
|
|
66
|
+
export function stripComments(code) {
|
|
67
|
+
let out = '';
|
|
68
|
+
let quote = '';
|
|
69
|
+
let i = 0;
|
|
70
|
+
while (i < code.length) {
|
|
71
|
+
const char = code[i];
|
|
72
|
+
const next = code[i + 1];
|
|
73
|
+
if (quote) {
|
|
74
|
+
out += char;
|
|
75
|
+
if (char === '\\' && next !== undefined) {
|
|
76
|
+
out += next;
|
|
77
|
+
i += 2;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
// Single and double quoted strings end at the line's end; templates may span lines.
|
|
81
|
+
if (char === quote || (char === '\n' && quote !== '`'))
|
|
82
|
+
quote = '';
|
|
83
|
+
i++;
|
|
84
|
+
}
|
|
85
|
+
else if (char === '"' || char === "'" || char === '`') {
|
|
86
|
+
quote = char;
|
|
87
|
+
out += char;
|
|
88
|
+
i++;
|
|
89
|
+
}
|
|
90
|
+
else if (char === '/' && next === '/' && code[i - 1] !== ':') {
|
|
91
|
+
while (i < code.length && code[i] !== '\n')
|
|
92
|
+
i++;
|
|
93
|
+
}
|
|
94
|
+
else if (char === '/' && next === '*') {
|
|
95
|
+
const close = code.indexOf('*/', i + 2);
|
|
96
|
+
const end = close === -1 ? code.length : close + 2;
|
|
97
|
+
out += code.slice(i, end).replace(/[^\n]/g, ' ');
|
|
98
|
+
i = end;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
out += char;
|
|
102
|
+
i++;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
60
107
|
export function validatePreviewInputs(options) {
|
|
61
108
|
const issues = [];
|
|
62
|
-
const source = readFileSync(options.filePath, 'utf8');
|
|
109
|
+
const source = stripComments(readFileSync(options.filePath, 'utf8'));
|
|
63
110
|
validateImports(source, issues);
|
|
64
111
|
validateDefaultExport(source, options.componentName, issues);
|
|
65
112
|
validateSchema(options.inputSchema, 'input schema', issues);
|
|
@@ -296,10 +343,7 @@ function resolveDefaultExport(source) {
|
|
|
296
343
|
return null;
|
|
297
344
|
}
|
|
298
345
|
function unwrapDefaultExportExpression(expression) {
|
|
299
|
-
const trimmed = expression
|
|
300
|
-
.replace(/\/\*[\s\S]*?\*\/\s*$/, '')
|
|
301
|
-
.replace(/\/\/.*$/, '')
|
|
302
|
-
.trim();
|
|
346
|
+
const trimmed = expression.trim();
|
|
303
347
|
if (/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(trimmed)) {
|
|
304
348
|
return trimmed;
|
|
305
349
|
}
|
|
@@ -13,11 +13,11 @@ export const RESERVED_CREDENTIAL_ENVS = new Set([
|
|
|
13
13
|
'GEMINI_API_KEY', // Historical SQL reservation; removing local forwarding does not release this name.
|
|
14
14
|
'GOOGLE_API_KEY', // Historical SQL reservation for the Google alias, independent of run providers.
|
|
15
15
|
'ALI_1505_ENDPOINT_OVERRIDE_API_KEY', // hosted-optimization.ts: runner-injected secret.
|
|
16
|
-
'BRAINTRUST_API_KEY', //
|
|
16
|
+
'BRAINTRUST_API_KEY', // lib/hosted-connectors.ts: workbench connector.
|
|
17
17
|
'CF_API_KEY', // test/with-cloudflare-env.test.ts: Cloudflare spelling.
|
|
18
18
|
'CLOUDFLARE_API_KEY', // test/with-cloudflare-env.test.ts: Cloudflare spelling.
|
|
19
19
|
'DAYTONA_API_KEY', // scripts/daytona-workbench-slice.mjs: hosted sandbox.
|
|
20
|
-
'INTERNAL_API_KEY', //
|
|
20
|
+
'INTERNAL_API_KEY', // Historical SQL reservation; the internal compile route is gone (ORI-2305).
|
|
21
21
|
'LINEAR_API_KEY', // lib/services/linear-feedback.ts: issue service.
|
|
22
22
|
'RESEND_API_KEY', // lib/services/email.ts: email delivery.
|
|
23
23
|
]);
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches any content character. `\uXXXX` names each code point, so
|
|
3
|
+
* JavaScript (with the `u` flag) and PostgreSQL's `~` read it identically and
|
|
4
|
+
* no locale is involved.
|
|
5
|
+
*/
|
|
6
|
+
export declare const REPORT_MARKDOWN_CONTENT_PATTERN: string;
|
|
1
7
|
export declare function hasCanonicalReportMarkdownContent(markdown: string): boolean;
|
|
2
8
|
//# sourceMappingURL=report-markdown-blankness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-markdown-blankness.d.ts","sourceRoot":"","sources":["../src/report-markdown-blankness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report-markdown-blankness.d.ts","sourceRoot":"","sources":["../src/report-markdown-blankness.ts"],"names":[],"mappings":"AA+CA;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,QAE/B,CAAA;AAIb,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3E"}
|
|
@@ -1,6 +1,49 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// ADR-036: the one definition of an empty report, shared by the CLI, the web
|
|
2
|
+
// app's readers and upload route, and the timeline's Data API filter. The
|
|
3
|
+
// database writer and comment trigger use private.report_markdown_has_content,
|
|
4
|
+
// whose pattern is REPORT_MARKDOWN_CONTENT_PATTERN verbatim (a database test
|
|
5
|
+
// pins that). Before ADR-036 these sites copied PostgreSQL 15's locale answer
|
|
6
|
+
// while production ran 17, so the CLI accepted reports the writer rejected.
|
|
7
|
+
/**
|
|
8
|
+
* The characters a report may consist of and still be empty: Unicode's
|
|
9
|
+
* White_Space property plus the four C0 information separators. Everything
|
|
10
|
+
* else, including invisible format characters such as U+FEFF, is content.
|
|
11
|
+
*/
|
|
12
|
+
const REPORT_BLANK_CODE_POINTS = [
|
|
13
|
+
// Tab, line feed, vertical tab, form feed, carriage return.
|
|
14
|
+
{ first: 0x0009, last: 0x000d },
|
|
15
|
+
// File, group, record and unit separators: not Unicode whitespace, but
|
|
16
|
+
// invisible, and blank in production since it has run PostgreSQL 17.
|
|
17
|
+
{ first: 0x001c, last: 0x001f },
|
|
18
|
+
// Space.
|
|
19
|
+
{ first: 0x0020, last: 0x0020 },
|
|
20
|
+
// Next line.
|
|
21
|
+
{ first: 0x0085, last: 0x0085 },
|
|
22
|
+
// No-break space.
|
|
23
|
+
{ first: 0x00a0, last: 0x00a0 },
|
|
24
|
+
// Ogham space mark.
|
|
25
|
+
{ first: 0x1680, last: 0x1680 },
|
|
26
|
+
// En quad through hair space, including figure space U+2007.
|
|
27
|
+
{ first: 0x2000, last: 0x200a },
|
|
28
|
+
// Line separator and paragraph separator.
|
|
29
|
+
{ first: 0x2028, last: 0x2029 },
|
|
30
|
+
// Narrow no-break space.
|
|
31
|
+
{ first: 0x202f, last: 0x202f },
|
|
32
|
+
// Medium mathematical space.
|
|
33
|
+
{ first: 0x205f, last: 0x205f },
|
|
34
|
+
// Ideographic space.
|
|
35
|
+
{ first: 0x3000, last: 0x3000 },
|
|
36
|
+
];
|
|
37
|
+
function escapeCodePoint(codePoint) {
|
|
38
|
+
return `\\u${codePoint.toString(16).padStart(4, '0')}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Matches any content character. `\uXXXX` names each code point, so
|
|
42
|
+
* JavaScript (with the `u` flag) and PostgreSQL's `~` read it identically and
|
|
43
|
+
* no locale is involved.
|
|
44
|
+
*/
|
|
45
|
+
export const REPORT_MARKDOWN_CONTENT_PATTERN = `[^${REPORT_BLANK_CODE_POINTS.map(({ first, last }) => first === last ? escapeCodePoint(first) : `${escapeCodePoint(first)}-${escapeCodePoint(last)}`).join('')}]`;
|
|
46
|
+
const REPORT_MARKDOWN_CONTENT = new RegExp(REPORT_MARKDOWN_CONTENT_PATTERN, 'u');
|
|
4
47
|
export function hasCanonicalReportMarkdownContent(markdown) {
|
|
5
|
-
return
|
|
48
|
+
return REPORT_MARKDOWN_CONTENT.test(markdown);
|
|
6
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-and-skills-commands.d.ts","sourceRoot":"","sources":["../src/setup-and-skills-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-and-skills-commands.d.ts","sourceRoot":"","sources":["../src/setup-and-skills-commands.ts"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAW,MAAM,wBAAwB,CAAA;AAMjF,iBAAe,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAY/E;AA0cD,iBAAe,mBAAmB,kBA+BjC;AAwFD,iBAAS,mBAAmB,SAmD3B;AAED,iBAAe,mBAAmB,kBA0DjC;AAED,iBAAS,iBAAiB,SAgBzB;AAMD,iBAAe,gBAAgB,CAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,OAAO,GAAE,oBAAkC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAiDf;AAqID,iBAAe,YAAY,kBAqX1B;AAED,iBAAS,kBAAkB,SAS1B;AAED,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,GACT,CAAA"}
|