@parall/cli 1.75.0 → 1.76.0

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 (61) hide show
  1. package/dist/commands/approvals.d.ts.map +1 -1
  2. package/dist/commands/approvals.js +40 -13
  3. package/dist/commands/apps-action-local.d.ts +6 -1
  4. package/dist/commands/apps-action-local.d.ts.map +1 -1
  5. package/dist/commands/apps-action-local.js +11 -2
  6. package/dist/commands/apps-actions-sdk.generated.d.ts +1 -1
  7. package/dist/commands/apps-actions-sdk.generated.d.ts.map +1 -1
  8. package/dist/commands/apps-actions-sdk.generated.js +1 -1
  9. package/dist/commands/apps-actions.d.ts.map +1 -1
  10. package/dist/commands/apps-actions.js +13 -15
  11. package/dist/commands/apps-add.js +2 -2
  12. package/dist/commands/apps-args.d.ts +22 -0
  13. package/dist/commands/apps-args.d.ts.map +1 -0
  14. package/dist/commands/apps-args.js +62 -0
  15. package/dist/commands/apps-check.d.ts.map +1 -1
  16. package/dist/commands/apps-check.js +8 -3
  17. package/dist/commands/apps-db.d.ts +3 -1
  18. package/dist/commands/apps-db.d.ts.map +1 -1
  19. package/dist/commands/apps-db.js +4 -7
  20. package/dist/commands/apps-dev-server.d.ts +3 -0
  21. package/dist/commands/apps-dev-server.d.ts.map +1 -1
  22. package/dist/commands/apps-dev-server.js +4 -0
  23. package/dist/commands/apps-dev-vars.d.ts +38 -0
  24. package/dist/commands/apps-dev-vars.d.ts.map +1 -0
  25. package/dist/commands/apps-dev-vars.js +107 -0
  26. package/dist/commands/apps-dev.d.ts.map +1 -1
  27. package/dist/commands/apps-dev.js +2 -1
  28. package/dist/commands/apps-local-runner.generated.d.ts +2 -1
  29. package/dist/commands/apps-local-runner.generated.d.ts.map +1 -1
  30. package/dist/commands/apps-local-runner.generated.js +2 -1
  31. package/dist/commands/apps-publish.d.ts +3 -1
  32. package/dist/commands/apps-publish.d.ts.map +1 -1
  33. package/dist/commands/apps-publish.js +27 -23
  34. package/dist/commands/apps-templates.gen.js +3 -3
  35. package/dist/commands/apps.d.ts.map +1 -1
  36. package/dist/commands/apps.js +35 -40
  37. package/dist/commands/comments.d.ts.map +1 -1
  38. package/dist/commands/comments.js +3 -2
  39. package/dist/commands/db-plane.d.ts +5 -14
  40. package/dist/commands/db-plane.d.ts.map +1 -1
  41. package/dist/commands/db-plane.js +63 -32
  42. package/dist/commands/db-target.d.ts +22 -0
  43. package/dist/commands/db-target.d.ts.map +1 -0
  44. package/dist/commands/db-target.js +43 -0
  45. package/dist/commands/dbs.d.ts +3 -6
  46. package/dist/commands/dbs.d.ts.map +1 -1
  47. package/dist/commands/dbs.js +28 -34
  48. package/dist/commands/secrets.d.ts +3 -0
  49. package/dist/commands/secrets.d.ts.map +1 -0
  50. package/dist/commands/secrets.js +66 -0
  51. package/dist/index.js +18 -2
  52. package/dist/lib/approvers.d.ts +12 -0
  53. package/dist/lib/approvers.d.ts.map +1 -0
  54. package/dist/lib/approvers.js +48 -0
  55. package/dist/lib/output.d.ts +19 -0
  56. package/dist/lib/output.d.ts.map +1 -1
  57. package/dist/lib/output.js +59 -2
  58. package/dist/lib/update-check.d.ts +4 -0
  59. package/dist/lib/update-check.d.ts.map +1 -1
  60. package/dist/lib/update-check.js +3 -1
  61. package/package.json +4 -4
@@ -3,7 +3,9 @@ import type { Command } from 'commander';
3
3
  * agent's machine builds, the platform accepts. publish = tar the dist and
4
4
  * the source, reserve a seq, PUT both content-addressed tarballs, finalize
5
5
  * (server-side acceptance). Versions are immutable; rollback only moves
6
- * the served pointer. */
6
+ * the served pointer. stdout carries only the result; progress goes to
7
+ * stderr, and not at all when stderr is merged into stdout (printProgress),
8
+ * so `parall app publish … 2>&1 | <json parser>` reads one document. */
7
9
  export declare function registerAppPublishCommands(app: Command): void;
8
10
  interface Packed {
9
11
  tarPath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"apps-publish.d.ts","sourceRoot":"","sources":["../../src/commands/apps-publish.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC;;;;yBAIyB;AACzB,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,QAiJtD;AAgCD,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;yBAEyB;AACzB,iBAAe,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA8D7F;AA4BD,iBAAe,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCrE;AAGD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"apps-publish.d.ts","sourceRoot":"","sources":["../../src/commands/apps-publish.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC;;;;;;wEAMwE;AACxE,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,QAiJtD;AAgCD,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;yBAEyB;AACzB,iBAAe,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA8D7F;AA4BD,iBAAe,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCrE;AAGD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -7,13 +7,16 @@ import { pipeline } from 'node:stream/promises';
7
7
  import { createGunzip, createGzip } from 'node:zlib';
8
8
  import * as tar from 'tar-stream';
9
9
  import { resolveCredentials } from '../lib/client.js';
10
- import { printError, printJson, stripPrllScheme } from '../lib/output.js';
10
+ import { printError, printJson, printProgress, stripPrllScheme } from '../lib/output.js';
11
+ import { appIdFrom, outputPath, withApp } from './apps-args.js';
11
12
  import { checkActions } from './apps-check.js';
12
13
  /** `parall app publish / versions / rollback / pull` (design §7.3): the
13
14
  * agent's machine builds, the platform accepts. publish = tar the dist and
14
15
  * the source, reserve a seq, PUT both content-addressed tarballs, finalize
15
16
  * (server-side acceptance). Versions are immutable; rollback only moves
16
- * the served pointer. */
17
+ * the served pointer. stdout carries only the result; progress goes to
18
+ * stderr, and not at all when stderr is merged into stdout (printProgress),
19
+ * so `parall app publish … 2>&1 | <json parser>` reads one document. */
17
20
  export function registerAppPublishCommands(app) {
18
21
  app
19
22
  .command('publish')
@@ -32,7 +35,7 @@ export function registerAppPublishCommands(app) {
32
35
  // A module that cannot run fails here rather than at its first call.
33
36
  const actions = await checkActions(dist);
34
37
  if (actions.module) {
35
- console.error(`Actions: ${actions.actions.join(', ')} (${actions.module})`);
38
+ printProgress(`Actions: ${actions.actions.join(', ')} (${actions.module})`);
36
39
  }
37
40
  const srcDir = resolve(opts.source ?? dir);
38
41
  const bundle = await packDirectory(dist, { excludeDefaults: false });
@@ -54,12 +57,12 @@ export function registerAppPublishCommands(app) {
54
57
  notes: opts.notes,
55
58
  preview: Boolean(opts.preview),
56
59
  });
57
- console.error(`Reserved version ${begin.seq} (bundle ${bundle.fileCount} files / ${bundle.totalSize} bytes)`);
60
+ printProgress(`Reserved version ${begin.seq} (bundle ${bundle.fileCount} files / ${bundle.totalSize} bytes)`);
58
61
  await uploadArtifact('bundle', begin.bundle, bundle.tarPath);
59
62
  await uploadArtifact('source', begin.source, source.tarPath);
60
63
  const version = await ctx.client.finalizeMiniAppPublish(ctx.orgId, appId, begin.seq);
61
64
  printJson(version);
62
- console.error(version.is_preview
65
+ printProgress(version.is_preview
63
66
  ? `Preview version ${version.seq} is ready (the served pointer did not move)`
64
67
  : version.current
65
68
  ? `Version ${version.seq} is ready and serving`
@@ -75,44 +78,45 @@ export function registerAppPublishCommands(app) {
75
78
  printError(err);
76
79
  }
77
80
  });
78
- app
79
- .command('versions')
80
- .description("List an app's versions, newest first")
81
- .argument('<appId>', 'App ID')
81
+ withApp(app.command('versions').description("List an app's versions, newest first"))
82
82
  .option('--limit <n>', 'Versions to return (default 50)')
83
83
  .action(async (appId, opts) => {
84
84
  try {
85
+ const id = appIdFrom(appId, opts.app);
85
86
  const { client, orgId } = resolveCredentials();
86
- printJson(await client.getMiniAppVersions(orgId, stripPrllScheme(appId), opts.limit ? Number(opts.limit) : undefined));
87
+ printJson(await client.getMiniAppVersions(orgId, id, opts.limit ? Number(opts.limit) : undefined));
87
88
  }
88
89
  catch (err) {
89
90
  printError(err);
90
91
  }
91
92
  });
92
- app
93
+ withApp(app
93
94
  .command('rollback')
94
- .description("Point the app back at an existing ready version (the app's author or an org owner/admin)")
95
- .requiredOption('--app <appId>', 'App ID')
95
+ .description("Point the app back at an existing ready version (the app's author or an org owner/admin)"))
96
96
  .requiredOption('--to <seq>', 'Version seq to serve')
97
- .action(async (opts) => {
97
+ .action(async (appId, opts) => {
98
98
  try {
99
+ const id = appIdFrom(appId, opts.app);
99
100
  const { client, orgId } = resolveCredentials();
100
- printJson(await client.rollbackMiniApp(orgId, stripPrllScheme(opts.app), Number(opts.to)));
101
+ printJson(await client.rollbackMiniApp(orgId, id, Number(opts.to)));
101
102
  }
102
103
  catch (err) {
103
104
  printError(err);
104
105
  }
105
106
  });
106
- app
107
+ withApp(app
107
108
  .command('pull')
108
- .description("Download a version's source tarball and unpack it (the app's author or an org owner/admin)")
109
- .argument('<appId>', 'App ID')
109
+ .description("Download a version's source tarball and unpack it (the app's author or an org owner/admin)"))
110
110
  .option('--v <seq>', 'Version seq (default: the current served version)')
111
- .requiredOption('--out <dir>', 'Directory to unpack into (created; must be empty or absent)')
111
+ .option('--out <dir>', 'Directory to unpack into (created; must be empty or absent)')
112
+ .option('--output <dir>', 'Same as --out')
112
113
  .action(async (appId, opts) => {
113
114
  try {
115
+ const id = appIdFrom(appId, opts.app);
116
+ const outDir = outputPath(opts);
117
+ if (outDir === undefined)
118
+ throw new Error('Pass --out <dir> to unpack the source into');
114
119
  const ctx = resolveCredentials();
115
- const id = stripPrllScheme(appId);
116
120
  let seq = opts.v ? Number(opts.v) : 0;
117
121
  if (!seq) {
118
122
  const appInfo = await ctx.client.getMiniApp(ctx.orgId, id);
@@ -121,7 +125,7 @@ export function registerAppPublishCommands(app) {
121
125
  throw new Error('The app has no published version yet; pass --v <seq>');
122
126
  }
123
127
  const { url, source_sha256 } = await ctx.client.getMiniAppVersionSource(ctx.orgId, id, seq);
124
- const out = resolve(opts.out);
128
+ const out = resolve(outDir);
125
129
  await fs.mkdir(out, { recursive: true });
126
130
  if ((await fs.readdir(out)).length > 0) {
127
131
  throw new Error(`--out ${out} is not empty`);
@@ -230,7 +234,7 @@ async function packDirectory(dir, opts) {
230
234
  }
231
235
  async function uploadArtifact(label, upload, tarPath) {
232
236
  if (upload.exists || !upload.url) {
233
- console.error(`${label}: content already stored (same digest), skipping upload`);
237
+ printProgress(`${label}: content already stored (same digest), skipping upload`);
234
238
  return;
235
239
  }
236
240
  const body = await fs.readFile(tarPath);
@@ -245,7 +249,7 @@ async function uploadArtifact(label, upload, tarPath) {
245
249
  const text = await response.text().catch(() => '');
246
250
  throw new Error(`${label} upload failed: ${response.status} ${response.statusText} ${text.slice(0, 300)}`);
247
251
  }
248
- console.error(`${label}: uploaded ${body.length} bytes`);
252
+ printProgress(`${label}: uploaded ${body.length} bytes`);
249
253
  }
250
254
  async function extractTarGz(bytes, out) {
251
255
  const extract = tar.extract();
@@ -1,7 +1,7 @@
1
1
  export const TEMPLATE_BASE = {
2
2
  "AGENTS.md": "# {{APP_NAME}} — Mini App 约定\n\n这是一个 Parall Mini App:纯静态的页面 bundle,Parall 在 app 自己的 origin 上出货,嵌在 Parall 里运行(Web / Desktop 是 iframe,iOS / Android 是原生网页控件)。\n\n## 技术栈\n\n- Vite 6 + React 19 + TypeScript + Tailwind CSS v4 + shadcn/ui(new-york,Radix)。需要 Node 20 以上。\n- `pnpm install && pnpm build`(npm 也行)产出 `dist/`;`build` 先跑 `tsc` 类型检查,类型错了不出产物。\n- 依赖都钉死了确切版本(只有 `--actions` 项目里本地跑 action 用的 miniflare 是 `^` 范围,跟着 CLI 的本地运行器走);加依赖也写确切版本。不要从 CDN 引任何东西(见下一节)。\n\n## 产物约束(发布时平台验收,不合规就 BUNDLE_REJECTED)\n\n- 脚本、样式、字体、图片全部打进 `dist/`:HTML 与 CSS 里不能有指向 `http(s)://` 或 `//` 的 script、link、`@import`、`url()`。\n- 资源用相对路径(`vite.config.ts` 已设 `base: './'`);以 `/` 开头的根路径会被拒。\n- 解包后最多 20 MiB、200 个文件,只能是普通文件。\n- 页面没有网络(CSP `connect-src 'none'`):fetch、XHR、WebSocket 都不通,数据只经 action(`parall app init --actions`)。图片只能来自 bundle、`data:` / `blob:` 或 Parall 的附件域。\n- 字体只能来自 bundle(`font-src 'self'`):模板打包了 Geist(拉丁字母),中文用系统字体;`vite.config.ts` 不让字体被内联成 `data:`,别去掉。\n- `public/manifest.json` 随构建进入 `dist/` 根部;`entry` 固定 `index.html`。\n\n## 目录\n\n- `src/pages.tsx`:页面列表,多于一页时顶部显示标签,第一页默认打开。链接 `prll://app_…#<页面 id>/<余下部分>` 打开对应页面,余下部分作为 `route` 传给页面(例:`#items/<id>` 选中一条)。\n- `src/pages/<page>/`:一个页面一个目录——`index.ts`(id、标题、图标)、组件、`messages.ts`(中英文文案)。\n- `src/components/ui/`:shadcn/ui 组件原文(button、card、table、dialog、alert-dialog、sheet、input、textarea、label、select、checkbox、switch、tabs、toggle-group、badge、skeleton、avatar、dropdown-menu、popover、tooltip、scroll-area、separator、sonner、spinner、empty)。要改样式直接改它们;有网络时可以 `npx shadcn@latest add <组件>` 加别的(`components.json` 已配好)。\n- `src/components/`:`app-shell`(外框与页面标签)、`page`(`PageContainer` / `PageHeader`)、`states`(加载、空、出错)、`responsive-dialog`(宽屏是对话框,手机是底部抽屉)、`confirm-dialog`、`user-avatar`。\n- `src/hooks/`:`use-host`(握手、`useViewer()`、route)、`use-media-query`(`useIsMobile()`)。\n- `src/lib/`:`i18n`(`defineMessages`,按浏览器语言选中文或英文;要固定语言改 `FORCED_LOCALE`)、`format`(日期、相对时间)、`errors`(把错误码变成给人看的话)、`keys`(`onEnter`)、`utils`(`cn`)。\n- `src/index.css`:颜色、圆角、字体 token。改 `--primary` 等变量换配色;浅色 / 深色跟随系统设置(`prefers-color-scheme`),Parall 不下发主题。\n\n## 界面约定\n\n- 用 Tailwind utility 和 `src/components/ui` 的组件;颜色只用 token(`bg-background`、`text-muted-foreground`、`border`…),深浅色才都对。\n- 375px 宽也要好用。Parall 还会把 app 开在对话旁边的窄面板里,所以窄屏不只是手机。布局用 CSS 断点(`md:` 768px、`lg:` 1024px),行为不同时才用 `useIsMobile()`。\n- 每块数据都处理三种状态:`LoadingState`、`EmptyState`、`ErrorState`(`src/components/states.tsx`)。\n- Parall 的 Web 与 Desktop 宿主不让页面提交表单(iframe 没有 allow-forms):`<form>` 不会触发 submit、`onSubmit` 永远不跑。保存按钮用 `onClick`,单行输入框按回车保存用 `onKeyDown={onEnter(save)}`(`src/lib/keys.ts`,输入法确认候选词的回车不算)。\n- 手机宿主不弹 `alert` / `confirm` / `prompt`:确认用 `ConfirmDialog`。外链与新窗口在手机上不打开。\n- 交互元素用原生 `button` / `input`;只有图标的按钮要有 `aria-label`。\n\n## 本地看\n\n- `pnpm build` 后 `parall app dev --dist dist`:本地宿主页加页面。不带 `--app` 时只应答握手,页面调 action 会得到 `NOT_GRANTED`。\n- `parall app dev` 在前台一直运行到被结束,不会自己退出:在 agent 里放到后台跑,`parall app dev --dist dist > dev.log 2>&1 &`,从 `dev.log` 里取它打印的地址,用完结束它。\n- 直接打开 `dist/index.html` 或 `pnpm dev` 不在宿主里,页面只会显示「请在 Parall 里打开」。\n\n## 发布\n\n- `parall app create --name \"…\"` → `parall app publish dist --app <app_…> --source .` → 把 `prll://app_…` 发给要用的人。\n- 你不是这个 app 的作者时:请作者或组织 owner / admin 执行 `parall app authors add <app_…> <你的 usr_…>`。\n- `src/parall.ts` 是 @parall/miniapp-sdk 的 vendored 副本(npm 发布前),不要改。\n- 借用的代码(shadcn/ui、shadcn-admin、Kibo UI)与字体的许可证见 `THIRD_PARTY_NOTICES.md`,保留这个文件。\n",
3
3
  "THIRD_PARTY_NOTICES.md": "# Third-party notices\n\nThis app was scaffolded by `parall app init`. Parts of its source are\nadapted from the projects below, under their licenses. Keep this file with\nthe source.\n\n## shadcn/ui\n\n`src/components/ui/*` are shadcn/ui components (new-york style), lightly\nadapted. https://github.com/shadcn-ui/ui\n\n```\nMIT License\n\nCopyright (c) 2023 shadcn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## shadcn-admin\n\n`src/components/confirm-dialog.tsx` and parts of `src/index.css` (the base\nlayer) are adapted from shadcn-admin. https://github.com/satnaing/shadcn-admin\n\n```\nMIT License\n\nCopyright (c) 2024 Sat Naing\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## Kibo UI\n\nBlocks added with `parall app add` (`src/blocks/*`) adapt patterns from\nKibo UI's kanban and calendar components. https://www.kibo-ui.com\n\n```\nCopyright (c) 2023 — Present shadcnblocks\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## Geist\n\nThe Geist typeface, bundled from `@fontsource-variable/geist`, is licensed\nunder the SIL Open Font License 1.1 (see that package's LICENSE).\nhttps://github.com/vercel/geist-font\n",
4
- "_gitignore": "node_modules\ndist\n*.log\n",
4
+ "_gitignore": "node_modules\ndist\n*.log\n# Secrets for local runs; never commit them.\n.dev.vars*\n",
5
5
  "components.json": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"new-york\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"neutral\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n },\n \"iconLibrary\": \"lucide\"\n}\n",
6
6
  "index.html": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\" />\n <meta name=\"color-scheme\" content=\"light dark\" />\n <title>{{APP_NAME}}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"./src/main.tsx\"></script>\n </body>\n</html>\n",
7
7
  "package.json": "{\n \"name\": \"mini-app\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"typecheck\": \"tsc -p tsconfig.json\",\n \"build\": \"tsc -p tsconfig.json && vite build\"\n },\n \"dependencies\": {\n \"@fontsource-variable/geist\": \"5.3.0\",\n \"class-variance-authority\": \"0.7.1\",\n \"clsx\": \"2.1.1\",\n \"lucide-react\": \"0.576.0\",\n \"radix-ui\": \"1.8.0\",\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"sonner\": \"2.0.8\",\n \"tailwind-merge\": \"3.5.0\"\n },\n \"devDependencies\": {\n \"@tailwindcss/vite\": \"4.2.2\",\n \"@types/react\": \"19.2.14\",\n \"@types/react-dom\": \"19.2.3\",\n \"@vitejs/plugin-react\": \"4.7.0\",\n \"tailwindcss\": \"4.2.2\",\n \"tw-animate-css\": \"1.4.0\",\n \"typescript\": \"5.9.3\",\n \"vite\": \"6.4.1\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n",
@@ -58,13 +58,13 @@ export const TEMPLATE_BASE = {
58
58
  "vite.config.ts": "import { fileURLToPath, URL } from 'node:url';\nimport tailwindcss from '@tailwindcss/vite';\nimport react from '@vitejs/plugin-react';\nimport { defineConfig } from 'vite';\n\n// Parall serves the build from the app's own origin under a strict CSP:\n// scripts, styles and fonts only from the bundle ('self'), images also from\n// data: and blob:, and no network at all. So:\n// - base './': assets load by relative path (the app lives under /v/<seq>/);\n// - fonts are never inlined as data: URLs (font-src allows 'self' only);\n// - nothing may point at a CDN — install packages instead.\nexport default defineConfig({\n base: './',\n plugins: [react(), tailwindcss()],\n resolve: {\n alias: {\n '@': fileURLToPath(new URL('./src', import.meta.url)),\n '@shared': fileURLToPath(new URL('./shared', import.meta.url)),\n },\n },\n build: {\n outDir: 'dist',\n assetsInlineLimit: (file) => (/\\.(woff2?|ttf|otf)$/i.test(file) ? false : undefined),\n chunkSizeWarningLimit: 2048,\n },\n});\n"
59
59
  };
60
60
  export const TEMPLATE_WITH_ACTIONS = {
61
- "AGENTS.md": "## 数据:action 与 Database\n\n- 页面的数据只经 action:`parall.action(name, params)` 以看页面的人的身份调本 app 的服务端 action,`parall.onDataChanged(fn)` 在 Database 有新写入时通知页面。桥上没有 SQL、files、clip 方法。\n- 页面里用 `src/hooks/use-action.ts`:`useAction<T>(name, params)` 读,同名同参数共用一次调用,参数变化、`reload()` 或 Database 有新写入(不论是谁写的)时重读;`useMutation<T, P>(name)` 写,写完读会自己刷新,要立刻变就用读的 `setData` 先改界面。\n- `actions/*.ts` 实现,`actions/index.ts` 的 `defineActions` 汇总,`public/manifest.json` 的 `actions.functions` 声明:`kind` 是 read(只能查询)或 write(可以写);`params` 是 JSON Schema 子集——object、array、string、number、integer、boolean,不支持 null 与联合类型,未声明的字段会被拒,`format` 只有 date 与 date-time。两边要一一对应:`parall app check dist` 核对,`publish` 也会先跑。action 名只能用字母、数字、下划线,一个版本最多 64 个。\n- 例子:`actions/items.ts`(`items_list` 读,`items_save`、`items_delete` 写)+ `src/pages/items/`(列表、详情、表单)+ `shared/items.ts`(两边共用的类型)+ `db/schema.sql`。照着它加自己的数据;用不上就删掉这几处,并从 manifest 去掉声明。\n\n## Database(PostgreSQL)\n\n- Database 是 PostgreSQL,不是 SQLite:`uuid`、`timestamptz`、`jsonb`、`ILIKE`、`ON CONFLICT`、`gen_random_uuid()` 都能用;没有 `rowid`,也没有 `AUTOINCREMENT`。自增整数主键写 `id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY`;模板与现成模块的表用的是 `id uuid PRIMARY KEY DEFAULT gen_random_uuid()`,两种都行。\n- 参数占位符是 `$1`、`$2`…,按编号取值:同一个占位符用两次只算一个,`$1` 出现两次也只传一个值。\n- 看现有的表:`parall app db schema --app <app_…>`(表、列、主键、枚举),或在 SQL 里查 `information_schema`。\n- 建表:`parall app db exec --app <app_…> --file db/schema.sql`(全是 IF NOT EXISTS,可以重复执行)。\n- 改表只能往上加(`ALTER TABLE … ADD COLUMN IF NOT EXISTS …`):agent 不能删表、清空表或删列(`DB_DDL_APPROVAL_REQUIRED`)。先加列再发布用到它的代码。\n- 结果每行是以列名为键的对象,两列同名会被拒(用 `AS` 起别名)。`date` 列回来是 `2026-10-12T00:00:00Z` 这样的时间戳字符串,只要日期就在 SQL 里 `to_char(d, 'YYYY-MM-DD')`。\n- 谁能看、谁能改写在 SQL 里,依据 `ctx.viewer`(`{id, display_name, is_agent, role}`,平台担保、改不了);不要用 params 里的用户 ID 做权限判断。能打开 app 的人都能调全部 action,action 就是唯一的门。`db/schema.sql` 末尾有「创建者或管理员可改」与「访问名单」两种写法;`actions/people.ts` 的 `rememberViewer` 在保存(新建、修改、移动)时记下调用者,`people_list` 列出这样用过 app 的人,可以拿来选负责人或分享对象。\n\n## 限额(超了就报错)\n\n- 一次 action 默认:10 秒、1 秒 CPU、50 次数据库调用(每次 `ctx.db.query` / `exec` / `batch` 算一次,能合并就合并)。\n- `ctx.db.batch` 最多 50 条语句、合计 256 KiB,是一个事务;单条 SQL 文本最多 256 KiB——`parall app db exec --file` 的整个文件也是一次请求,大的种子数据拆成几个文件分别执行。\n- action 里一次查询最多返回 1 MiB,超出的行被截掉(结果标 `truncated`);params 最多 1 MiB。\n- 每人每个 Database 每分钟 100 次请求,action 调用与 `parall app db` 共用:列表一次读出来在页面里筛选,不要每敲一个字调一次。\n\n## 写 action\n\n- 给调用者看的错误抛 `ActionError`;其他异常只有作者与 owner / admin 看得到完整消息与堆栈。写类调用的参数记进全组织可查的调用记录:不要经参数传凭据。\n- 没有网络、没有文件系统;模块级变量在调用者之间共享,不能存调用者的状态。\n- 要调 Clip:在 manifest 里给写类 action 加 `\"clip\": true`,代码里 `await ctx.clip.exec('<clip>', '<command>', args, { connection: '<alias>', timeoutMs: 60_000 })`。它以调用 action 的人的身份执行,那个人没有这个 connection 的权限就被拒(`ClipError`,`code` 如 `CONNECTION_NOT_ALLOWED`);接住它,换成给人看的 `ActionError`。`OUTCOME_UNKNOWN` 表示命令可能已经执行,不要自动重试。调 Clip 的 action 有 100 秒、最多 10 次 Clip 调用;单次命令默认只等 30 秒,命令慢就传 `timeoutMs`,并给之后的数据库写入留出时间(平台会把它截到 action 剩余时间减 8 秒)。\n- 页面拿到的失败带 `err.code`:`ACTION_FAILED`(消息是 `ActionError` 的原文)、`INVALID_ACTION_PARAMS`、`ACTION_TIMEOUT`(写类可能已生效)、`RATE_LIMITED`、`APP_VERSION_CHANGED`(app 已更新,宿主会提示看的人重新加载);`HOST_TIMEOUT` / `HOST_UNAVAILABLE` 是没拿到答复,写类先重读再决定是否重试。`describeError()`(`src/lib/errors.ts`)把这些变成给人看的话。\n- `actions/parall-actions.ts` 是 SDK 的 vendored 副本,不要改。\n\n## 调试\n\n- 核对一个 action:改完 `pnpm build`,然后 `parall app action run <app_…> items_list --local`(换成要试的 action 名):在本机 workerd 里跑本地构建,跑完就返回,不用先发布,也不用起 `app dev`。它连的是 app 的真实 Database,**写会真的生效**;`console.log` 打到 stderr,出错时堆栈按本地 source map 映射回 `actions/*.ts`。\n- 页面连本地 action:`parall app dev --dist dist --app <app_…>`,打开 CLI 打印的地址(带令牌)。页面调的 action 在本机运行,同样**写会真的生效**;右侧列出每次调用、结果与 `console` 输出。它同样在前台一直运行到被结束:在 agent 里放后台跑(`parall app dev --dist dist --app <app_…> > dev.log 2>&1 &`)、用完结束;改完重新 `pnpm build` 即可,不用重启。\n- 要在线上运行时里试:`parall app publish dist --app <app_…> --preview` 后 `parall app action run <app_…> items_list --v <seq>`。调用记录 `parall app action log <app_…>`,执行过的 SQL `parall app db log --app <app_…>`(加 `--invocation <aci_… 或 acd_…>` 只看一次调用)。\n\n## 现成模块(@parall blocks)\n\n- `parall app add --list` 列出模块(如 calendar 日历、kanban 看板);`parall app add calendar` 把它的页面(`src/blocks/<block>/`)、action(`actions/<block>.ts`)、类型(`shared/<block>.ts`)、SQL(`db/<block>.sql`)与 manifest 声明加进本项目,并接到 `src/pages.tsx` 与 `actions/index.ts` 的 `parall:` 标记处。它只改本地文件。\n- 加完照打印的步骤做:`parall app db exec --app <app_…> --file db/<block>.sql` 建表 → `pnpm install && pnpm build` → `parall app check dist` → 发布。\n- 加进来的代码就归这个 app:随意改。文件已存在且内容不同时 `add` 拒绝并什么都不写(`--force` 覆盖);`--dry-run` 只看会改什么。\n",
61
+ "AGENTS.md": "## 数据:action 与 Database\n\n- 页面的数据只经 action:`parall.action(name, params)` 以看页面的人的身份调本 app 的服务端 action,`parall.onDataChanged(fn)` 在 Database 有新写入时通知页面。桥上没有 SQL、files、clip 方法。\n- 页面里用 `src/hooks/use-action.ts`:`useAction<T>(name, params)` 读,同名同参数共用一次调用,参数变化、`reload()` 或 Database 有新写入(不论是谁写的)时重读;`useMutation<T, P>(name)` 写,写完读会自己刷新,要立刻变就用读的 `setData` 先改界面。\n- `actions/*.ts` 实现,`actions/index.ts` 的 `defineActions` 汇总,`public/manifest.json` 的 `actions.functions` 声明:`kind` 是 read(只能查询)或 write(可以写);`params` 是 JSON Schema 子集——object、array、string、number、integer、boolean,不支持 null 与联合类型,未声明的字段会被拒,`format` 只有 date 与 date-time。两边要一一对应:`parall app check dist` 核对,`publish` 也会先跑。action 名只能用字母、数字、下划线,一个版本最多 64 个。\n- 例子:`actions/items.ts`(`items_list` 读,`items_save`、`items_delete` 写)+ `src/pages/items/`(列表、详情、表单)+ `shared/items.ts`(两边共用的类型)+ `db/schema.sql`。照着它加自己的数据;用不上就删掉这几处,并从 manifest 去掉声明。\n\n## Database(PostgreSQL)\n\n- Database 是 PostgreSQL,不是 SQLite:`uuid`、`timestamptz`、`jsonb`、`ILIKE`、`ON CONFLICT`、`gen_random_uuid()` 都能用;没有 `rowid`,也没有 `AUTOINCREMENT`。自增整数主键写 `id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY`;模板与现成模块的表用的是 `id uuid PRIMARY KEY DEFAULT gen_random_uuid()`,两种都行。\n- 参数占位符是 `$1`、`$2`…,按编号取值:同一个占位符用两次只算一个,`$1` 出现两次也只传一个值。\n- 看现有的表:`parall app db schema --app <app_…>`(表、列、主键、枚举),或在 SQL 里查 `information_schema`。\n- 建表:`parall app db exec --app <app_…> --file db/schema.sql`(全是 IF NOT EXISTS,可以重复执行)。\n- 改表只能往上加(`ALTER TABLE … ADD COLUMN IF NOT EXISTS …`):agent 不能删表、清空表或删列(`DB_DDL_APPROVAL_REQUIRED`)。先加列再发布用到它的代码。\n- 结果每行是以列名为键的对象,两列同名会被拒(用 `AS` 起别名)。`date` 列回来是 `2026-10-12T00:00:00Z` 这样的时间戳字符串,只要日期就在 SQL 里 `to_char(d, 'YYYY-MM-DD')`。\n- 谁能看、谁能改写在 SQL 里,依据 `ctx.viewer`(`{id, display_name, is_agent, role}`,平台担保、改不了);不要用 params 里的用户 ID 做权限判断。能打开 app 的人都能调全部 action,action 就是唯一的门。`db/schema.sql` 末尾有「创建者或管理员可改」与「访问名单」两种写法;`actions/people.ts` 的 `rememberViewer` 在保存(新建、修改、移动)时记下调用者,`people_list` 列出这样用过 app 的人,可以拿来选负责人或分享对象。\n\n## 限额(超了就报错)\n\n- 一次 action 默认:100 秒、1 秒 CPU、50 次数据库调用(每次 `ctx.db.query` / `exec` / `batch` 算一次,能合并就合并)。\n- `ctx.db.batch` 最多 50 条语句、合计 256 KiB,是一个事务;单条 SQL 文本最多 256 KiB——`parall app db exec --file` 的整个文件也是一次请求,大的种子数据拆成几个文件分别执行。\n- action 里一次查询最多返回 1 MiB,超出的行被截掉(结果标 `truncated`);params 最多 1 MiB。\n- 每人每个 Database 每分钟 100 次请求,action 调用与 `parall app db` 共用:列表一次读出来在页面里筛选,不要每敲一个字调一次。\n\n## 写 action\n\n- 给调用者看的错误抛 `ActionError`;其他异常只有作者与 owner / admin 看得到完整消息与堆栈。写类调用的参数记进全组织可查的调用记录:不要经参数传凭据。\n- 没有网络、没有文件系统;模块级变量在调用者之间共享,不能存调用者的状态。\n- 要调 Clip:在 manifest 里给写类 action 加 `\"clip\": true`,代码里 `await ctx.clip.exec('<clip>', '<command>', args, { connection: '<alias>', timeoutMs: 60_000 })`。它以调用 action 的人的身份执行,那个人没有这个 connection 的权限就被拒(`ClipError`,`code` 如 `CONNECTION_NOT_ALLOWED`);接住它,换成给人看的 `ActionError`。`OUTCOME_UNKNOWN` 表示命令可能已经执行,不要自动重试。调 Clip 的 action 有 100 秒、最多 10 次 Clip 调用;单次命令默认只等 30 秒,命令慢就传 `timeoutMs`,并给之后的数据库写入留出时间(平台会把它截到 action 剩余时间减 8 秒)。\n- 页面拿到的失败带 `err.code`:`ACTION_FAILED`(消息是 `ActionError` 的原文)、`INVALID_ACTION_PARAMS`、`ACTION_TIMEOUT`(写类可能已生效)、`RATE_LIMITED`、`APP_VERSION_CHANGED`(app 已更新,宿主会提示看的人重新加载);`HOST_TIMEOUT` / `HOST_UNAVAILABLE` 是没拿到答复,写类先重读再决定是否重试。`describeError()`(`src/lib/errors.ts`)把这些变成给人看的话。\n- `actions/parall-actions.ts` 是 SDK 的 vendored 副本,不要改。\n\n## 调试\n\n- 核对一个 action:改完 `pnpm build`,然后 `parall app action run <app_…> items_list --local`(换成要试的 action 名):在本机 workerd 里跑本地构建,跑完就返回,不用先发布,也不用起 `app dev`。它连的是 app 的真实 Database,**写会真的生效**;`console.log` 打到 stderr,出错时堆栈按本地 source map 映射回 `actions/*.ts`。\n- 页面连本地 action:`parall app dev --dist dist --app <app_…>`,打开 CLI 打印的地址(带令牌)。页面调的 action 在本机运行,同样**写会真的生效**;右侧列出每次调用、结果与 `console` 输出。它同样在前台一直运行到被结束:在 agent 里放后台跑(`parall app dev --dist dist --app <app_…> > dev.log 2>&1 &`)、用完结束;改完重新 `pnpm build` 即可,不用重启。\n- 要在线上运行时里试:`parall app publish dist --app <app_…> --preview` 后 `parall app action run <app_…> items_list --v <seq>`。调用记录 `parall app action log <app_…>`,执行过的 SQL `parall app db log --app <app_…>`(加 `--invocation <aci_… 或 acd_…>` 只看一次调用)。\n\n## 现成模块(@parall blocks)\n\n- `parall app add --list` 列出模块(如 calendar 日历、kanban 看板);`parall app add calendar` 把它的页面(`src/blocks/<block>/`)、action(`actions/<block>.ts`)、类型(`shared/<block>.ts`)、SQL(`db/<block>.sql`)与 manifest 声明加进本项目,并接到 `src/pages.tsx` 与 `actions/index.ts` 的 `parall:` 标记处。它只改本地文件。\n- 加完照打印的步骤做:`parall app db exec --app <app_…> --file db/<block>.sql` 建表 → `pnpm install && pnpm build` → `parall app check dist` → 发布。\n- 加进来的代码就归这个 app:随意改。文件已存在且内容不同时 `add` 拒绝并什么都不写(`--force` 覆盖);`--dry-run` 只看会改什么。\n",
62
62
  "_overlay.json": "{\n \"remove\": [\"src/pages/home\"]\n}\n",
63
63
  "actions/cloudflare-workers.d.ts": "// The Workers runtime module the action wrapper imports; the runtime\n// provides it. Declared only as far as parall-actions.ts uses it.\ndeclare module 'cloudflare:workers' {\n export abstract class WorkerEntrypoint<Env = unknown> {\n protected readonly ctx: unknown;\n protected readonly env: Env;\n constructor(ctx: unknown, env: Env);\n }\n}\n",
64
64
  "actions/index.ts": "import { itemActions } from './items';\nimport { defineActions } from './parall-actions';\nimport { peopleActions } from './people';\n// parall:action-imports — `parall app add` puts block imports above this line.\n\n// Every action is declared in public/manifest.json under actions.functions\n// (kind read | write, params as a JSON Schema) and implemented here;\n// `parall app check dist` compares the two, and publish runs it too. The\n// loader looks the module up by the export name ActionRunner.\nexport const ActionRunner = defineActions({\n ...peopleActions,\n ...itemActions,\n // parall:actions — `parall app add` puts block actions above this line.\n});\n",
65
65
  "actions/items.ts": "import type { Item, ItemInput, ItemStatus } from '@shared/items';\nimport { type ActionContext, ActionError } from './parall-actions';\nimport { rememberViewer } from './people';\n\n// The example list behind src/pages/items: everyone in the organization\n// reads every item; the creator or an org owner/admin changes or deletes it.\n// The rule lives in SQL, keyed on ctx.viewer (see db/schema.sql for an\n// access-list variant).\n\nconst COLUMNS = `id, title, notes, status, created_by, created_by_name, created_at, updated_at`;\n// Whether the caller ($1 = ctx.viewer.id, $2 = ctx.viewer.role) may change a row.\nconst CAN_EDIT = `(created_by = $1 OR $2 IN ('owner', 'admin'))`;\nconst STATUSES: ItemStatus[] = ['open', 'done'];\nconst UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nfunction checkId(id: unknown): string {\n if (typeof id !== 'string' || !UUID.test(id)) throw new ActionError('This item does not exist.');\n return id;\n}\n\nexport const itemActions = {\n /** read: every item, most recently changed first. */\n async items_list(ctx: ActionContext): Promise<Item[]> {\n const { rows } = await ctx.db.query(\n `SELECT ${COLUMNS}, ${CAN_EDIT} AS can_edit\n FROM items\n ORDER BY updated_at DESC\n LIMIT 1000`,\n [ctx.viewer.id, ctx.viewer.role],\n );\n return rows as unknown as Item[];\n },\n\n /** write: creates an item (no id) or updates one the caller may change. */\n async items_save(ctx: ActionContext, input: ItemInput): Promise<Item> {\n const title = input.title.trim();\n if (!title) throw new ActionError('A title is required.');\n const notes = (input.notes ?? '').trim();\n const status = input.status ?? 'open';\n if (!STATUSES.includes(status)) throw new ActionError(`Unknown status ${status}.`);\n\n if (input.id === undefined) {\n const { results } = await ctx.db.batch([\n rememberViewer(ctx),\n {\n sql: `INSERT INTO items (title, notes, status, created_by, created_by_name)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING ${COLUMNS}, true AS can_edit`,\n params: [title, notes, status, ctx.viewer.id, ctx.viewer.display_name],\n },\n ]);\n return results[1]?.rows[0] as unknown as Item;\n }\n\n const id = checkId(input.id);\n const { results } = await ctx.db.batch([\n rememberViewer(ctx),\n {\n sql: `UPDATE items\n SET title = $3, notes = $4, status = $5, updated_at = now()\n WHERE id = $6 AND ${CAN_EDIT}\n RETURNING ${COLUMNS}, true AS can_edit`,\n params: [ctx.viewer.id, ctx.viewer.role, title, notes, status, id],\n },\n ]);\n const row = results[1]?.rows[0];\n if (!row) throw new ActionError('Only its creator or an org admin can change this item.');\n return row as unknown as Item;\n },\n\n /** write: deletes an item the caller may change. */\n async items_delete(ctx: ActionContext, params: { id: string }): Promise<{ id: string }> {\n const id = checkId(params.id);\n const { rows_affected } = await ctx.db.exec(`DELETE FROM items WHERE id = $3 AND ${CAN_EDIT}`, [\n ctx.viewer.id,\n ctx.viewer.role,\n id,\n ]);\n if (rows_affected === 0) {\n throw new ActionError('Only its creator or an org admin can delete this item.');\n }\n return { id };\n },\n};\n",
66
66
  "actions/people.ts": "import type { Person } from '@shared/people';\nimport type { ActionBatchStatement, ActionContext, ActionViewer } from './parall-actions';\n\n/** Org owners and admins may change anything; members their own rows. */\nexport function isOrgAdmin(viewer: ActionViewer): boolean {\n return viewer.role === 'owner' || viewer.role === 'admin';\n}\n\n/**\n * Remembers the caller in app_people, so pages can offer the people who use\n * the app (as assignees, for an access list…). Put it in the same\n * ctx.db.batch as the write: one round trip, one transaction.\n */\nexport function rememberViewer(ctx: ActionContext): ActionBatchStatement {\n return {\n sql: `INSERT INTO app_people (user_id, display_name, is_agent, last_seen_at)\n VALUES ($1, $2, $3, now())\n ON CONFLICT (user_id) DO UPDATE\n SET display_name = EXCLUDED.display_name,\n is_agent = EXCLUDED.is_agent,\n last_seen_at = now()`,\n params: [ctx.viewer.id, ctx.viewer.display_name, ctx.viewer.is_agent],\n };\n}\n\nexport const peopleActions = {\n /** read: the people who used the app, most recent first. */\n async people_list(ctx: ActionContext): Promise<Person[]> {\n const { rows } = await ctx.db.query(\n `SELECT user_id AS id, display_name, is_agent\n FROM app_people\n ORDER BY last_seen_at DESC\n LIMIT 500`,\n );\n return rows as unknown as Person[];\n },\n};\n",
67
- "actions/tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ES2022\",\n \"moduleResolution\": \"bundler\",\n \"lib\": [\"ES2022\"],\n \"strict\": true,\n \"noEmit\": true,\n \"skipLibCheck\": true,\n \"isolatedModules\": true,\n \"paths\": {\n \"@shared/*\": [\"../shared/*\"]\n },\n \"types\": []\n },\n \"include\": [\".\", \"../shared\"]\n}\n",
67
+ "actions/tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ES2022\",\n \"moduleResolution\": \"bundler\",\n \"lib\": [\"ES2022\", \"WebWorker\"],\n \"strict\": true,\n \"noEmit\": true,\n \"skipLibCheck\": true,\n \"isolatedModules\": true,\n \"paths\": {\n \"@shared/*\": [\"../shared/*\"]\n },\n \"types\": []\n },\n \"include\": [\".\", \"../shared\"]\n}\n",
68
68
  "db/schema.sql": "-- The app's tables. The Database is PostgreSQL (not SQLite): uuid,\n-- timestamptz, jsonb, ILIKE, ON CONFLICT and gen_random_uuid() all work.\n--\n-- Apply (safe to run again — everything is IF NOT EXISTS):\n-- parall app db exec --app <app_…> --file db/schema.sql\n--\n-- To change a table later, add to it (ALTER TABLE … ADD COLUMN IF NOT\n-- EXISTS …): an agent cannot DROP or TRUNCATE a table or drop a column.\n-- Add a column before publishing code that uses it; stop using one before\n-- a person removes it.\n\n-- People who used the app. Write actions remember the caller here\n-- (actions/people.ts rememberViewer), so pages can offer them as assignees\n-- or for an access list. ctx.viewer is the only trustworthy identity.\nCREATE TABLE IF NOT EXISTS app_people (\n user_id text PRIMARY KEY,\n display_name text NOT NULL,\n is_agent boolean NOT NULL DEFAULT false,\n last_seen_at timestamptz NOT NULL DEFAULT now()\n);\n\n-- The example list (src/pages/items, actions/items.ts).\nCREATE TABLE IF NOT EXISTS items (\n id uuid PRIMARY KEY DEFAULT gen_random_uuid(),\n title text NOT NULL CHECK (length(title) BETWEEN 1 AND 200),\n notes text NOT NULL DEFAULT '',\n status text NOT NULL DEFAULT 'open' CHECK (status IN ('open', 'done')),\n created_by text NOT NULL,\n created_by_name text NOT NULL,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now()\n);\nCREATE INDEX IF NOT EXISTS items_updated_at_idx ON items (updated_at DESC);\n\n-- Who may see or change a row is decided in SQL, from ctx.viewer — every\n-- member of the organization can call every action, so the action is the\n-- only gate. Pass the viewer from the action; never take a user id from\n-- params for this.\n--\n-- 1. Everyone reads; the creator or an org owner/admin changes\n-- (what actions/items.ts does, $1 = ctx.viewer.id, $2 = ctx.viewer.role):\n--\n-- UPDATE items SET … WHERE id = $3 AND (created_by = $1 OR $2 IN ('owner', 'admin'))\n--\n-- 2. Private rows shared through an access list:\n--\n-- CREATE TABLE IF NOT EXISTS item_access (\n-- item_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,\n-- user_id text NOT NULL,\n-- can_edit boolean NOT NULL DEFAULT false,\n-- PRIMARY KEY (item_id, user_id)\n-- );\n--\n-- -- what the caller may read\n-- SELECT i.* FROM items i\n-- WHERE i.created_by = $1\n-- OR $2 IN ('owner', 'admin')\n-- OR EXISTS (SELECT 1 FROM item_access a WHERE a.item_id = i.id AND a.user_id = $1);\n--\n-- -- what the caller may change: the same, with a.can_edit\n-- … OR EXISTS (SELECT 1 FROM item_access a\n-- WHERE a.item_id = i.id AND a.user_id = $1 AND a.can_edit)\n--\n-- Pick who to share with from app_people (the people_list action).\n",
69
69
  "package.json": "{\n \"scripts\": {\n \"typecheck\": \"tsc -p tsconfig.json && tsc -p actions/tsconfig.json\",\n \"build\": \"tsc -p tsconfig.json && tsc -p actions/tsconfig.json && vite build && vite build --config vite.actions.config.ts\"\n },\n \"devDependencies\": {\n \"miniflare\": \"^4.20260415.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\",\n \"workerd\"\n ]\n }\n}\n",
70
70
  "public/manifest.json": "{\n \"actions\": {\n \"entry\": \"_actions/index.js\",\n \"functions\": {\n \"people_list\": { \"kind\": \"read\" },\n \"items_list\": { \"kind\": \"read\" },\n \"items_save\": {\n \"kind\": \"write\",\n \"params\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"maxLength\": 64 },\n \"title\": { \"type\": \"string\", \"minLength\": 1, \"maxLength\": 200 },\n \"notes\": { \"type\": \"string\", \"maxLength\": 10000 },\n \"status\": { \"type\": \"string\", \"enum\": [\"open\", \"done\"] }\n },\n \"required\": [\"title\"]\n }\n },\n \"items_delete\": {\n \"kind\": \"write\",\n \"params\": {\n \"type\": \"object\",\n \"properties\": { \"id\": { \"type\": \"string\", \"maxLength\": 64 } },\n \"required\": [\"id\"]\n }\n }\n }\n }\n}\n",
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC;;;;;;;;;;kEAUkE;AAClE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QA+LnD"}
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC;;;;;;;;;;kEAUkE;AAClE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QA+LnD"}
@@ -2,6 +2,7 @@ import { resolveCredentials } from '../lib/client.js';
2
2
  import { printError, printJson, printRefHint, stripPrllScheme } from '../lib/output.js';
3
3
  import { registerAppActionCommands } from './apps-actions.js';
4
4
  import { registerAppAddCommand } from './apps-add.js';
5
+ import { appAndArg, appIdFrom, withApp } from './apps-args.js';
5
6
  import { registerAppCheckCommand } from './apps-check.js';
6
7
  import { registerAppDBCommands } from './apps-db.js';
7
8
  import { registerAppDevCommand } from './apps-dev.js';
@@ -46,14 +47,11 @@ export function registerAppCommands(program) {
46
47
  printError(err);
47
48
  }
48
49
  });
49
- app
50
- .command('get')
51
- .description('Get a Mini App by ID')
52
- .argument('<appId>', 'App ID (app_… or prll://app_…)')
53
- .action(async (appId) => {
50
+ withApp(app.command('get').description('Get a Mini App by ID')).action(async (appId, opts) => {
54
51
  try {
52
+ const id = appIdFrom(appId, opts.app);
55
53
  const { client, orgId } = resolveCredentials();
56
- printJson(await client.getMiniApp(orgId, stripPrllScheme(appId)));
54
+ printJson(await client.getMiniApp(orgId, id));
57
55
  }
58
56
  catch (err) {
59
57
  printError(err);
@@ -85,14 +83,14 @@ export function registerAppCommands(program) {
85
83
  printError(err);
86
84
  }
87
85
  });
88
- app
86
+ withApp(app
89
87
  .command('update')
90
- .description("Rename a Mini App or change its description (the app's author or an org owner/admin)")
91
- .argument('<appId>', 'App ID')
88
+ .description("Rename a Mini App or change its description (the app's author or an org owner/admin)"))
92
89
  .option('--name <name>', 'New name')
93
90
  .option('--description <text>', 'New description (empty string clears)')
94
91
  .action(async (appId, opts) => {
95
92
  try {
93
+ const id = appIdFrom(appId, opts.app);
96
94
  const { client, orgId } = resolveCredentials();
97
95
  const data = {};
98
96
  if (opts.name !== undefined)
@@ -102,33 +100,30 @@ export function registerAppCommands(program) {
102
100
  if (Object.keys(data).length === 0) {
103
101
  throw new Error('Nothing to update: pass at least one of --name, --description (data settings live on the Database: `parall db update`)');
104
102
  }
105
- printJson(await client.updateMiniApp(orgId, stripPrllScheme(appId), data));
103
+ printJson(await client.updateMiniApp(orgId, id, data));
106
104
  }
107
105
  catch (err) {
108
106
  printError(err);
109
107
  }
110
108
  });
111
- app
109
+ withApp(app
112
110
  .command('archive')
113
- .description("Archive a Mini App (the app's author or an org owner/admin); data and versions are kept")
114
- .argument('<appId>', 'App ID')
115
- .action(async (appId) => {
111
+ .description("Archive a Mini App (the app's author or an org owner/admin); data and versions are kept")).action(async (appId, opts) => {
116
112
  try {
113
+ const id = appIdFrom(appId, opts.app);
117
114
  const { client, orgId } = resolveCredentials();
118
- printJson(await client.archiveMiniApp(orgId, stripPrllScheme(appId)));
115
+ printJson(await client.archiveMiniApp(orgId, id));
119
116
  }
120
117
  catch (err) {
121
118
  printError(err);
122
119
  }
123
120
  });
124
- app
121
+ withApp(app
125
122
  .command('delete')
126
- .description('Delete a Mini App (org owner/admin only, not its authors). It is gone at once — no one can open it or call its actions — its Database stays, and its versions and files are removed after 30 days')
127
- .argument('<appId>', 'App ID')
128
- .action(async (appId) => {
123
+ .description('Delete a Mini App (org owner/admin only, not its authors). It is gone at once — no one can open it or call its actions — its Database stays, and its versions and files are removed after 30 days')).action(async (appId, opts) => {
129
124
  try {
125
+ const id = appIdFrom(appId, opts.app);
130
126
  const { client, orgId } = resolveCredentials();
131
- const id = stripPrllScheme(appId);
132
127
  await client.deleteMiniApp(orgId, id);
133
128
  console.error(`Deleted ${id}`);
134
129
  }
@@ -136,14 +131,13 @@ export function registerAppCommands(program) {
136
131
  printError(err);
137
132
  }
138
133
  });
139
- app
134
+ withApp(app
140
135
  .command('restore')
141
- .description("Restore an archived Mini App (the app's author or an org owner/admin)")
142
- .argument('<appId>', 'App ID')
143
- .action(async (appId) => {
136
+ .description("Restore an archived Mini App (the app's author or an org owner/admin)")).action(async (appId, opts) => {
144
137
  try {
138
+ const id = appIdFrom(appId, opts.app);
145
139
  const { client, orgId } = resolveCredentials();
146
- printJson(await client.restoreMiniApp(orgId, stripPrllScheme(appId)));
140
+ printJson(await client.restoreMiniApp(orgId, id));
147
141
  }
148
142
  catch (err) {
149
143
  printError(err);
@@ -152,14 +146,11 @@ export function registerAppCommands(program) {
152
146
  const authors = app
153
147
  .command('authors')
154
148
  .description('Manage who manages the app: publish, roll back, rename, archive, authors');
155
- authors
156
- .command('list')
157
- .description('List the authors of a Mini App')
158
- .argument('<appId>', 'App ID')
159
- .action(async (appId) => {
149
+ withApp(authors.command('list').description('List the authors of a Mini App')).action(async (appId, opts) => {
160
150
  try {
151
+ const id = appIdFrom(appId, opts.app);
161
152
  const { client, orgId } = resolveCredentials();
162
- printJson(await client.getMiniAppAuthors(orgId, stripPrllScheme(appId)));
153
+ printJson(await client.getMiniAppAuthors(orgId, id));
163
154
  }
164
155
  catch (err) {
165
156
  printError(err);
@@ -168,12 +159,14 @@ export function registerAppCommands(program) {
168
159
  authors
169
160
  .command('add')
170
161
  .description("Add an author (the app's author or an org owner/admin); the user must be a member of the organization")
171
- .argument('<appId>', 'App ID')
172
- .argument('<userId>', 'User or agent ID (usr_…)')
173
- .action(async (appId, userId) => {
162
+ .argument('[appId]', 'App ID (app_… or prll://app_…); or pass --app')
163
+ .argument('[userId]', 'User or agent ID (usr_…)')
164
+ .option('--app <appId>', 'App ID, in place of the first argument')
165
+ .action(async (first, second, opts) => {
174
166
  try {
167
+ const [id, userId] = appAndArg(first, second, opts.app, 'user ID (usr_…)');
175
168
  const { client, orgId } = resolveCredentials();
176
- printJson(await client.addMiniAppAuthor(orgId, stripPrllScheme(appId), stripPrllScheme(userId)));
169
+ printJson(await client.addMiniAppAuthor(orgId, id, stripPrllScheme(userId)));
177
170
  }
178
171
  catch (err) {
179
172
  printError(err);
@@ -182,13 +175,15 @@ export function registerAppCommands(program) {
182
175
  authors
183
176
  .command('remove')
184
177
  .description("Remove an author (the app's author or an org owner/admin); the creator cannot be removed")
185
- .argument('<appId>', 'App ID')
186
- .argument('<userId>', 'User or agent ID (usr_…)')
187
- .action(async (appId, userId) => {
178
+ .argument('[appId]', 'App ID (app_… or prll://app_…); or pass --app')
179
+ .argument('[userId]', 'User or agent ID (usr_…)')
180
+ .option('--app <appId>', 'App ID, in place of the first argument')
181
+ .action(async (first, second, opts) => {
188
182
  try {
183
+ const [id, userId] = appAndArg(first, second, opts.app, 'user ID (usr_…)');
189
184
  const { client, orgId } = resolveCredentials();
190
- await client.removeMiniAppAuthor(orgId, stripPrllScheme(appId), stripPrllScheme(userId));
191
- console.error(`Removed ${stripPrllScheme(userId)} from the authors of ${stripPrllScheme(appId)}`);
185
+ await client.removeMiniAppAuthor(orgId, id, stripPrllScheme(userId));
186
+ console.error(`Removed ${stripPrllScheme(userId)} from the authors of ${id}`);
192
187
  }
193
188
  catch (err) {
194
189
  printError(err);
@@ -1 +1 @@
1
- {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/commands/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAMpD;AAED;+CAC+C;AAC/C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,CAM3C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QA4KvD"}
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/commands/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAMpD;AAED;+CAC+C;AAC/C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,CAM3C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QA6KvD"}
@@ -63,12 +63,13 @@ export function registerCommentCommands(program) {
63
63
  comments
64
64
  .command('add')
65
65
  .description('Add a comment to a prll:// target. Inline wiki anchors must pin a revision: ' +
66
- 'prll://wik_x/path.md?rev=<full_commit_sha>#h=<anchor>')
66
+ 'prll://wik_x/path.md?rev=<full_commit_sha>#h=<anchor> (also #l= lines, #t= text bytes, ' +
67
+ 'and #e=<start>-<end> for an element of a .html file, its source byte range)')
67
68
  .requiredOption('--target <uri>', 'Target prll:// URI (task / wiki page / changeset / inline anchor)')
68
69
  .option('--body <text>', BODY_OPTION_DESC)
69
70
  .option('--body-file <path>', BODY_FILE_OPTION_DESC)
70
71
  .option('--parent <id>', 'Root comment ID — post as a threaded reply under it (works on any target type)')
71
- .option('--quote <text>', 'Exact target text the comment anchors to (required for inline text-anchor targets)')
72
+ .option('--quote <text>', 'Text the comment anchors to (required for #t= text and #e= element targets)')
72
73
  .action(async (opts) => {
73
74
  try {
74
75
  // Grammar first: a body-flag error is a parameter error even when
@@ -1,25 +1,17 @@
1
1
  import type { MiniAppSQLParam } from '@parall/sdk';
2
2
  import type { Command } from 'commander';
3
- import { resolveCredentials } from '../lib/client.js';
4
- type Ctx = ReturnType<typeof resolveCredentials>;
5
- /** What a data-plane command runs against: a Database directly, or an app
6
- * (the alias: the app's Database, with the app recorded on the log row). */
7
- export interface DataPlaneTarget {
8
- kind: 'app' | 'db';
9
- id: string;
10
- }
11
- /** How a command group names its target. `parall db …` takes `--db` (id or
12
- * name, unique in the org), `parall app db …` takes `--app`. */
3
+ /** A command group of the data plane. Both groups take the target the same
4
+ * ways — as the first argument, with --app or with --db — so the forms an
5
+ * agent reaches for all work; the group only decides which flag its help
6
+ * lists first (`parall db` --db, `parall app db` --app). */
13
7
  export interface DataPlaneBinding {
14
- flag: string;
15
- flagHelp: string;
8
+ primary: 'app' | 'db';
16
9
  /** Extra options every command of the group accepts (e.g. the deprecated
17
10
  * --project). */
18
11
  extraOptions?: Array<{
19
12
  flag: string;
20
13
  help: string;
21
14
  }>;
22
- resolve(ctx: Ctx, opts: Record<string, string | undefined>): Promise<DataPlaneTarget>;
23
15
  }
24
16
  /** The raw-SQL data plane (design §5, §7.2, §8) — a construction surface
25
17
  * for the authors of the apps attached to the Database and for org
@@ -36,5 +28,4 @@ export declare function registerDataPlaneCommands(group: Command, binding: DataP
36
28
  * the parameter's real type, so `--param 42` and `--param '"42"'` both work
37
29
  * for an integer column. */
38
30
  export declare function parseParams(raw: string[] | undefined): MiniAppSQLParam[] | undefined;
39
- export {};
40
31
  //# sourceMappingURL=db-plane.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"db-plane.d.ts","sourceRoot":"","sources":["../../src/commands/db-plane.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAUV,eAAe,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAItD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjD;4EAC4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;gEACgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB;qBACiB;IACjB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACvF;AAED;;;;;;;;mDAQmD;AACnD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,QA2JlF;AAgED;;;4BAG4B;AAC5B,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,eAAe,EAAE,GAAG,SAAS,CASpF"}
1
+ {"version":3,"file":"db-plane.d.ts","sourceRoot":"","sources":["../../src/commands/db-plane.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAUV,eAAe,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC;;;4DAG4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IACtB;qBACiB;IACjB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD;AAgBD;;;;;;;;mDAQmD;AACnD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,QAiMlF;AAgED;;;4BAG4B;AAC5B,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,eAAe,EAAE,GAAG,SAAS,CASpF"}