orizu 0.5.33 → 0.5.34

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.
@@ -1 +1 @@
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,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElE;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1F;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUjE;AAED,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAEjD;AAED,iBAAS,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG;IACpF,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CAeA;AAED,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM;;;;;IAoB/E;AAED,iBAAS,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAGjE;AAED,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'./accou
7
7
  import { printJson, printLine, getErrorMessage } from './cli-console-output.js';
8
8
  import { printAppSummaries } from './archive-artifacts-cli.js';
9
9
  import { isNodeError, formatTerminalLink } from './auth-commands.js';
10
- import { authedFetch } from './http.js';
11
- import { parseJsonResponse, sanitizeTerminalText } from './json-response.js';
10
+ import { authedFetch, getBaseUrl } from './http.js';
11
+ import { appPageUrl } from './app-page-url.js';
12
+ import { parseJsonResponse, sanitizeHumanInlineText, sanitizeTerminalText } from './json-response.js';
12
13
  import { runLocalAppPreview } from './preview-runtime.js';
13
14
  async function listApps() {
14
15
  const project = getArg('--project') || await resolveProjectSlug(null);
15
- const apps = await fetchApps(project, getArchiveListStatus('apps'));
16
+ const baseUrl = getBaseUrl();
17
+ const apps = (await fetchApps(project, getArchiveListStatus('apps')))
18
+ .map(app => ({ ...app, pageUrl: appPageUrl(baseUrl, app.id) }));
16
19
  if (hasJsonFlag()) {
17
20
  printJson({ apps });
18
21
  return;
19
22
  }
20
23
  printAppSummaries(apps, printLine);
24
+ // An archived app's page still renders as if live, so it gets no link line.
25
+ apps
26
+ .filter(app => app.status !== 'archived')
27
+ .forEach(app => printLine(`Link: ${sanitizeHumanInlineText(sanitizeTerminalText, app.name || app.id)} ${formatTerminalLink(app.pageUrl)}`));
21
28
  }
22
29
  function readSourceFile(pathArg) {
23
30
  const expandedPath = expandHomePath(pathArg);
@@ -152,7 +159,7 @@ async function createAppFromFile() {
152
159
  }
153
160
  const data = await parseJsonResponse(response, 'App create');
154
161
  if (hasJsonFlag()) {
155
- printJson({ app: data.app, warnings: data.warnings || [] });
162
+ printJson({ app: { ...data.app, pageUrl: data.app.url || appPageUrl(getBaseUrl(), data.app.id) }, warnings: data.warnings || [] });
156
163
  return;
157
164
  }
158
165
  printLine(`Created app ${sanitizeTerminalText(data.app.name)} (${sanitizeTerminalText(data.app.id)}) v${data.app.versionNum}`);
@@ -240,11 +247,13 @@ async function updateAppFromFile() {
240
247
  throw new Error(`Failed to update app: ${await response.text()}`);
241
248
  }
242
249
  const data = await parseJsonResponse(response, 'App update');
250
+ const pageUrl = appPageUrl(getBaseUrl(), data.app.id);
243
251
  if (hasJsonFlag()) {
244
- printJson({ app: data.app, warnings: data.warnings || [] });
252
+ printJson({ app: { ...data.app, pageUrl }, warnings: data.warnings || [] });
245
253
  return;
246
254
  }
247
255
  printLine(`Updated app ${sanitizeTerminalText(data.app.name)} (${sanitizeTerminalText(data.app.id)}) to v${data.app.versionNum}`);
256
+ printLine(`View app: ${formatTerminalLink(pageUrl)}`);
248
257
  if (data.warnings?.length) {
249
258
  printLine(`Warnings: ${sanitizeTerminalText(data.warnings.join('; '))}`);
250
259
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Where an app's page lives in the web app (ORI-2342): `/preview/<app id>`,
3
+ * the route in apps/web/app/preview/[id]/page.tsx. `orizu apps list`,
4
+ * `orizu apps update` and the hosted agent's prompt build their links from
5
+ * here. `orizu apps create` prints the link the server returns instead.
6
+ */
7
+ export declare function appPagePath(appId: string): string;
8
+ export declare function appPageUrl(baseUrl: string, appId: string): string;
9
+ //# sourceMappingURL=app-page-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-page-url.d.ts","sourceRoot":"","sources":["../src/app-page-url.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Where an app's page lives in the web app (ORI-2342): `/preview/<app id>`,
3
+ * the route in apps/web/app/preview/[id]/page.tsx. `orizu apps list`,
4
+ * `orizu apps update` and the hosted agent's prompt build their links from
5
+ * here. `orizu apps create` prints the link the server returns instead.
6
+ */
7
+ export function appPagePath(appId) {
8
+ return `/preview/${appId}`;
9
+ }
10
+ export function appPageUrl(baseUrl, appId) {
11
+ return `${baseUrl.replace(/\/+$/, '')}${appPagePath(encodeURIComponent(appId))}`;
12
+ }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { authedFetch } from './http.js';
9
9
  import { extractErrorMessage } from './error-response.js';
10
- import { sanitizeTerminalText } from './json-response.js';
10
+ import { sanitizeHumanInlineText, sanitizeTerminalText } from './json-response.js';
11
11
  const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
12
12
  const ARTIFACT_TYPES = {
13
13
  app: 'app',
@@ -61,7 +61,7 @@ export function printAppSummaries(items, print) {
61
61
  return print('No apps found.');
62
62
  printTable(['APP ID', 'APP NAME', 'VERSION', 'ARCHIVE'], items.map(item => [
63
63
  sanitizeTerminalText(item.id),
64
- sanitizeTerminalText(item.name || '-'),
64
+ sanitizeHumanInlineText(sanitizeTerminalText, item.name || '-'),
65
65
  `v${item.currentVersionNum || 1}`,
66
66
  sanitizeTerminalText(item.status || 'active'),
67
67
  ]), print);
@@ -1,14 +1,3 @@
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
1
  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.";
2
+ export declare const HOSTED_AGENT_PROMPT: string;
14
3
  //# sourceMappingURL=hosted-agent-prompt.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"hosted-agent-prompt.d.ts","sourceRoot":"","sources":["../src/hosted-agent-prompt.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,iBAAiB,UAAU,CAAA;AAExC,eAAO,MAAM,mBAAmB,QAK4Z,CAAA"}
@@ -9,9 +9,11 @@
9
9
  * carries the working rules we still want: use the tools, keep answers short.
10
10
  * AGENTS.md is still added after it, as before.
11
11
  */
12
+ import { appPagePath } from './app-page-url.js';
12
13
  export const HOSTED_AGENT_NAME = 'orizu';
13
14
  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
 
15
16
  - 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
17
  - 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.`;
18
+ - Follow the repository's own conventions and any instructions in its AGENTS.md.
19
+ - An Orizu app's page link is <Orizu server>${appPagePath('<app id>')}, where <Orizu server> is the server the orizu CLI talks to (https://app.orizu.ai by default). To give someone an app's link, run \`orizu projects list\` to get the \`<team>/<project>\` slug, then \`orizu apps list --project <team>/<project>\`: it prints each app's full link. The --project flag is required here: prompts cannot run in this environment. Never guess a link.`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orizu",
3
- "version": "0.5.33",
3
+ "version": "0.5.34",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,20 +25,27 @@ import { resolveProjectSlug, fetchApps, selectAppIdInteractively } from './accou
25
25
  import { printJson, printLine, getErrorMessage } from './cli-console-output.js'
26
26
  import { printAppSummaries } from './archive-artifacts-cli.js'
27
27
  import { isNodeError, formatTerminalLink } from './auth-commands.js'
28
- import { authedFetch } from './http.js'
29
- import { parseJsonResponse, sanitizeTerminalText } from './json-response.js'
28
+ import { authedFetch, getBaseUrl } from './http.js'
29
+ import { appPageUrl } from './app-page-url.js'
30
+ import { parseJsonResponse, sanitizeHumanInlineText, sanitizeTerminalText } from './json-response.js'
30
31
  import { runLocalAppPreview } from './preview-runtime.js'
31
32
 
32
33
 
33
34
 
34
35
  async function listApps() {
35
36
  const project = getArg('--project') || await resolveProjectSlug(null)
36
- const apps = await fetchApps(project, getArchiveListStatus('apps'))
37
+ const baseUrl = getBaseUrl()
38
+ const apps = (await fetchApps(project, getArchiveListStatus('apps')))
39
+ .map(app => ({ ...app, pageUrl: appPageUrl(baseUrl, app.id) }))
37
40
  if (hasJsonFlag()) {
38
41
  printJson({ apps })
39
42
  return
40
43
  }
41
44
  printAppSummaries(apps, printLine)
45
+ // An archived app's page still renders as if live, so it gets no link line.
46
+ apps
47
+ .filter(app => app.status !== 'archived')
48
+ .forEach(app => printLine(`Link: ${sanitizeHumanInlineText(sanitizeTerminalText, app.name || app.id)} ${formatTerminalLink(app.pageUrl)}`))
42
49
  }
43
50
 
44
51
  function readSourceFile(pathArg: string): string {
@@ -195,7 +202,7 @@ async function createAppFromFile() {
195
202
  warnings?: string[]
196
203
  }>(response, 'App create')
197
204
  if (hasJsonFlag()) {
198
- printJson({ app: data.app, warnings: data.warnings || [] })
205
+ printJson({ app: { ...data.app, pageUrl: data.app.url || appPageUrl(getBaseUrl(), data.app.id) }, warnings: data.warnings || [] })
199
206
  return
200
207
  }
201
208
  printLine(`Created app ${sanitizeTerminalText(data.app.name)} (${sanitizeTerminalText(data.app.id)}) v${data.app.versionNum}`)
@@ -297,11 +304,13 @@ async function updateAppFromFile() {
297
304
  app: { id: string; name: string; versionNum: number; componentName?: string }
298
305
  warnings?: string[]
299
306
  }>(response, 'App update')
307
+ const pageUrl = appPageUrl(getBaseUrl(), data.app.id)
300
308
  if (hasJsonFlag()) {
301
- printJson({ app: data.app, warnings: data.warnings || [] })
309
+ printJson({ app: { ...data.app, pageUrl }, warnings: data.warnings || [] })
302
310
  return
303
311
  }
304
312
  printLine(`Updated app ${sanitizeTerminalText(data.app.name)} (${sanitizeTerminalText(data.app.id)}) to v${data.app.versionNum}`)
313
+ printLine(`View app: ${formatTerminalLink(pageUrl)}`)
305
314
  if (data.warnings?.length) {
306
315
  printLine(`Warnings: ${sanitizeTerminalText(data.warnings.join('; '))}`)
307
316
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Where an app's page lives in the web app (ORI-2342): `/preview/<app id>`,
3
+ * the route in apps/web/app/preview/[id]/page.tsx. `orizu apps list`,
4
+ * `orizu apps update` and the hosted agent's prompt build their links from
5
+ * here. `orizu apps create` prints the link the server returns instead.
6
+ */
7
+ export function appPagePath(appId: string): string {
8
+ return `/preview/${appId}`
9
+ }
10
+
11
+ export function appPageUrl(baseUrl: string, appId: string): string {
12
+ return `${baseUrl.replace(/\/+$/, '')}${appPagePath(encodeURIComponent(appId))}`
13
+ }
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { authedFetch } from './http.js'
10
10
  import { extractErrorMessage } from './error-response.js'
11
- import { sanitizeTerminalText } from './json-response.js'
11
+ import { sanitizeHumanInlineText, sanitizeTerminalText } from './json-response.js'
12
12
 
13
13
  type ArchiveStatus = 'active' | 'archived' | 'all'
14
14
  type ArchiveAction = 'archive' | 'restore'
@@ -148,7 +148,7 @@ export function printAppSummaries(items: AppSummary[], print: PrintLine) {
148
148
  ['APP ID', 'APP NAME', 'VERSION', 'ARCHIVE'],
149
149
  items.map(item => [
150
150
  sanitizeTerminalText(item.id),
151
- sanitizeTerminalText(item.name || '-'),
151
+ sanitizeHumanInlineText(sanitizeTerminalText, item.name || '-'),
152
152
  `v${item.currentVersionNum || 1}`,
153
153
  sanitizeTerminalText(item.status || 'active'),
154
154
  ]),
@@ -9,10 +9,13 @@
9
9
  * carries the working rules we still want: use the tools, keep answers short.
10
10
  * AGENTS.md is still added after it, as before.
11
11
  */
12
+ import { appPagePath } from './app-page-url.js'
13
+
12
14
  export const HOSTED_AGENT_NAME = 'orizu'
13
15
 
14
16
  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.
15
17
 
16
18
  - 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.
17
19
  - Keep answers short and plain. Say what you did and what the person needs to know next.
18
- - Follow the repository's own conventions and any instructions in its AGENTS.md.`
20
+ - Follow the repository's own conventions and any instructions in its AGENTS.md.
21
+ - An Orizu app's page link is <Orizu server>${appPagePath('<app id>')}, where <Orizu server> is the server the orizu CLI talks to (https://app.orizu.ai by default). To give someone an app's link, run \`orizu projects list\` to get the \`<team>/<project>\` slug, then \`orizu apps list --project <team>/<project>\`: it prints each app's full link. The --project flag is required here: prompts cannot run in this environment. Never guess a link.`
@@ -272,6 +272,8 @@ orizu apps archive <app-id> --project my-team/quality-eval
272
272
  orizu apps restore <app-id> --project my-team/quality-eval
273
273
  ```
274
274
 
275
+ An app's page link is `<server>/preview/<app-id>` (`https://app.orizu.ai` by default). `apps list` prints a `Link: <app> <link>` line under the table for each app that is not archived; `apps list --json` has `pageUrl` for each app. `apps create` and `apps update` print it after `View app:`; `apps create --json` and `apps update --json` both have it as `app.pageUrl`. Get `<team>/<project>` from `orizu projects list`. Give that link; never guess one.
276
+
275
277
  Create from file:
276
278
 
277
279
  ```bash