@parall/cli 1.88.0 → 1.90.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.
@@ -1 +1 @@
1
- {"version":3,"file":"apps-templates.gen.d.ts","sourceRoot":"","sources":["../../src/commands/apps-templates.gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0D1D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBlE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM3D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAyclD,CAAC"}
1
+ {"version":3,"file":"apps-templates.gen.d.ts","sourceRoot":"","sources":["../../src/commands/apps-templates.gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2D1D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBlE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM3D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAyclD,CAAC"}
@@ -1,10 +1,11 @@
1
1
  export const TEMPLATE_BASE = {
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;`useCanEdit()` 在看的人只能查看这个 app 时为 false,用来藏起编辑按钮,写类 action 仍由平台拒绝)、`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",
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- `pnpm-workspace.yaml` 让这个目录自成 pnpm workspace,并列出允许跑安装脚本的依赖;新增要跑安装脚本的依赖时,`allowBuilds` 和 `onlyBuiltDependencies` 两个键都要加。\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;`useCanEdit()` 在看的人只能查看这个 app 时为 false,用来藏起编辑按钮,写类 action 仍由平台拒绝)、`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
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
- "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",
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}\n",
8
+ "pnpm-workspace.yaml": "# This app is its own pnpm workspace (this directory only), so pnpm reads the\n# settings below wherever the app lives. pnpm 10.4 and older need `packages`.\npackages:\n - .\n\n# Dependencies whose install scripts may run; pnpm skips all others.\n# allowBuilds is read by pnpm 10.26 and later, onlyBuiltDependencies by every\n# pnpm 10 from 10.5 on.\nallowBuilds:\n esbuild: true\nonlyBuiltDependencies:\n - esbuild\n",
8
9
  "public/manifest.json": "{\n \"entry\": \"index.html\",\n \"sdk_version\": \"0.1.0\",\n \"capabilities\": []\n}\n",
9
10
  "src/App.tsx": "import { AppShell } from '@/components/app-shell';\nimport { HostConnecting, HostMissing } from '@/components/states';\nimport { useHostState } from '@/hooks/use-host';\nimport { pages } from '@/pages';\n\nexport function App() {\n const host = useHostState();\n if (host.status === 'connecting') return <HostConnecting />;\n if (host.status === 'missing') return <HostMissing />;\n return <AppShell pages={pages} />;\n}\n",
10
11
  "src/components/app-shell.tsx": "import type { LucideIcon } from 'lucide-react';\nimport { type ComponentType, useEffect, useMemo, useState } from 'react';\nimport { Toaster } from '@/components/ui/sonner';\nimport { TooltipProvider } from '@/components/ui/tooltip';\nimport { UserAvatar } from '@/components/user-avatar';\nimport { useHost } from '@/hooks/use-host';\nimport { cn } from '@/lib/utils';\n\nexport interface PageProps {\n /** The rest of the route after \"<page id>/\" — '' when there is none. A\n * link prll://app_…#items/42 opens the items page with route \"42\". */\n route: string;\n}\n\nexport interface AppPage {\n /** Names the page in links: prll://app_…#<id>. */\n id: string;\n title: string;\n icon: LucideIcon;\n component: ComponentType<PageProps>;\n}\n\n/** Splits a host route (\"calendar/2026-10-12\") into a page and the rest. */\nfunction resolveRoute(pages: AppPage[], route: string): { id: string; rest: string } {\n const clean = route.replace(/^[#/]+/, '');\n const slash = clean.indexOf('/');\n const id = slash === -1 ? clean : clean.slice(0, slash);\n const page = pages.find((p) => p.id === id);\n if (!page) return { id: pages[0]?.id ?? '', rest: '' };\n return { id: page.id, rest: slash === -1 ? '' : clean.slice(slash + 1) };\n}\n\n/**\n * The frame every page renders in: a top bar with one tab per page (none\n * for a single page), the active page, and the toaster. Layout follows the\n * frame's width — the full Parall panel, the narrow panel beside a chat, or\n * a phone.\n */\nexport function AppShell({ pages }: { pages: AppPage[] }) {\n const host = useHost();\n const [active, setActive] = useState(() => resolveRoute(pages, host.route));\n\n // The host moves the route when someone opens a link to another place in\n // the app while it is open.\n useEffect(() => {\n setActive(resolveRoute(pages, host.route));\n }, [pages, host.route]);\n\n const page = useMemo(() => pages.find((p) => p.id === active.id) ?? pages[0], [pages, active]);\n if (!page) return null;\n const Page = page.component;\n\n return (\n <TooltipProvider>\n <div className=\"flex min-h-svh flex-col\">\n {pages.length > 1 ? (\n <header className=\"sticky top-0 z-30 border-b bg-background/90 backdrop-blur-md\">\n <div className=\"mx-auto flex h-12 w-full max-w-screen-2xl items-center gap-3 px-2 md:px-4\">\n <nav\n aria-label=\"Pages\"\n className=\"no-scrollbar flex min-w-0 flex-1 items-center gap-1 overflow-x-auto\"\n >\n {pages.map((p) => {\n const Icon = p.icon;\n const current = p.id === page.id;\n return (\n <button\n key={p.id}\n type=\"button\"\n aria-current={current ? 'page' : undefined}\n onClick={() => setActive({ id: p.id, rest: '' })}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium text-muted-foreground text-sm transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50',\n current && 'bg-accent text-foreground',\n )}\n >\n <Icon className=\"size-4\" />\n {p.title}\n </button>\n );\n })}\n </nav>\n <UserAvatar\n id={host.viewer.id}\n name={host.viewer.display_name}\n className=\"hidden sm:flex\"\n title={host.viewer.display_name}\n />\n </div>\n </header>\n ) : null}\n <main className=\"flex min-w-0 flex-1 flex-col\">\n <Page key={page.id} route={active.rest} />\n </main>\n <Toaster position=\"top-center\" />\n </div>\n </TooltipProvider>\n );\n}\n",
@@ -66,7 +67,8 @@ export const TEMPLATE_WITH_ACTIONS = {
66
67
  "actions/people.ts": "import type { Person } from '@shared/people';\nimport type { 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\nexport const peopleActions = {\n /**\n * read: the organization's members, people and agents, in the order they\n * joined (ctx.parall.members()): whom pages offer as assignees or for an\n * access list. Keep only their ids in the Database, and read the names\n * again here when a page shows them.\n */\n async people_list(ctx: ActionContext): Promise<Person[]> {\n const members = await ctx.parall.members();\n return members.map((m) => ({\n id: m.user_id,\n display_name: m.display_name,\n is_agent: m.type === 'agent',\n }));\n },\n};\n",
67
68
  "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
69
  "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-- The organization's members are not a table here: actions/people.ts lists\n-- them with ctx.parall.members(). Keep a person's id (usr_…) in a column,\n-- as created_by below does. ctx.viewer is the only trustworthy identity.\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. It limits only what the\n-- app's pages and actions show: what a write action is passed is kept in\n-- the app's call log, which the app's authors and org owners/admins can\n-- read as well as the caller.\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 the organization's members (the\n-- people_list action).\n",
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
+ "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}\n",
71
+ "pnpm-workspace.yaml": "# This app is its own pnpm workspace (this directory only), so pnpm reads the\n# settings below wherever the app lives. pnpm 10.4 and older need `packages`.\npackages:\n - .\n\n# Dependencies whose install scripts may run; pnpm skips all others.\n# allowBuilds is read by pnpm 10.26 and later, onlyBuiltDependencies by every\n# pnpm 10 from 10.5 on.\nallowBuilds:\n esbuild: true\n workerd: true\nonlyBuiltDependencies:\n - esbuild\n - workerd\n",
70
72
  "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",
71
73
  "shared/items.ts": "// Types shared by the actions (actions/items.ts) and the page\n// (src/pages/items): the action returns rows of this shape.\n\nexport type ItemStatus = 'open' | 'done';\n\nexport interface Item {\n id: string;\n title: string;\n notes: string;\n status: ItemStatus;\n created_by: string;\n created_by_name: string;\n /** ISO timestamps. */\n created_at: string;\n updated_at: string;\n /** Whether the caller may change or delete it (creator or org owner/admin). */\n can_edit: boolean;\n}\n\n/** items_save params: no id creates an item, an id updates it. */\nexport interface ItemInput {\n id?: string;\n title: string;\n notes?: string;\n status?: ItemStatus;\n}\n",
72
74
  "shared/people.ts": "/** A member of the organization, a person or an agent (people_list). */\nexport interface Person {\n id: string;\n display_name: string;\n is_agent: boolean;\n}\n",
@@ -1 +1 @@
1
- {"version":3,"file":"clip-connect.d.ts","sourceRoot":"","sources":["../../src/commands/clip-connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AA0HjD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAkH9D"}
1
+ {"version":3,"file":"clip-connect.d.ts","sourceRoot":"","sources":["../../src/commands/clip-connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAwGjD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAqH9D"}
@@ -2,7 +2,7 @@ import { Option } from 'commander';
2
2
  import { ApiError, CLIP_CONNECTION_CONNECT_ACTION } from '@parall/sdk';
3
3
  import { printFiledApproval } from '../lib/approvers.js';
4
4
  import { resolveCredentials, resolveRuntimeContext } from '../lib/client.js';
5
- import { CLIP_REF_HELP, clipNotFoundError, findConnector } from '../lib/connector-ref.js';
5
+ import { CLIP_REF_HELP, clipNotFoundError, connectorRefArg, findConnector, } from '../lib/connector-ref.js';
6
6
  import { printError, printJson, printProgress, stripPrllScheme } from '../lib/output.js';
7
7
  // `parall connector connect` is how an agent that cannot run a connector yet
8
8
  // gets an account for it (agent-connector-connect-design.md §4): it files a
@@ -16,24 +16,6 @@ const USAGE_HINT = '(example: parall connector connect google-calendar --reason
16
16
  function shellQuote(value) {
17
17
  return `'${value.replaceAll("'", `'\\''`)}'`;
18
18
  }
19
- /** The connector argument: a bare id, name or org_<id>/<name> goes to the
20
- * registry as is (a name may look like any id); a prll:// reference is always
21
- * an entity, so anything but a connector is refused before any request. */
22
- function connectorArg(raw) {
23
- const ref = raw.trim();
24
- if (!ref.startsWith('prll://'))
25
- return ref;
26
- const id = stripPrllScheme(ref);
27
- if (id.startsWith('crg_'))
28
- return id;
29
- if (id.startsWith('ccn_')) {
30
- throw new Error(`prll://${id} is a connection, not a connector. If you can already use it, run the connector through it:\n parall connector exec <connector> <command> '<json args>' --connection ${id}`);
31
- }
32
- if (id.startsWith('usr_')) {
33
- throw new Error(`prll://${id} is a person, not a connector. Pass the connector (crg_… or its name); the card goes to the person you are working for:\n parall connector connect <connector> --reason "…"`);
34
- }
35
- throw new Error(`prll://${id} is not a connector. Pass the connector's crg_ id or name (find it with \`parall connector search <text>\`).`);
36
- }
37
19
  function detailsOf(err) {
38
20
  const details = err.extras?.details;
39
21
  return details && typeof details === 'object' ? details : {};
@@ -122,7 +104,7 @@ export function registerClipConnectCommand(clip) {
122
104
  if (opts.name !== undefined && !fromOrg) {
123
105
  throw new Error("--name only applies with --from org: a person's own account has no connection name. Leave --name out.");
124
106
  }
125
- const ref = connectorArg(raw);
107
+ const ref = connectorRefArg(raw, 'the card goes to the person you are working for:\n parall connector connect <connector> --reason "…"');
126
108
  const explicitChat = opts.chat?.trim();
127
109
  if (explicitChat && !stripPrllScheme(explicitChat).startsWith('cht_')) {
128
110
  throw new Error(`--chat takes a chat (cht_…), not ${explicitChat}. Leave --chat out to post the card in the chat you are working in.`);
@@ -1 +1 @@
1
- {"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/commands/clip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4GpC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAUpD"}
1
+ {"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/commands/clip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8GpC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAUpD"}
@@ -6,7 +6,7 @@ import { getClipMCPConfigById, listClipMCPConnectionSummaries } from '../lib/mcp
6
6
  import { printJson, printError, parsePositiveInt } from '../lib/output.js';
7
7
  import { buildPublishedManifest, collectPublishSource } from '../lib/publish-source.js';
8
8
  import { readTextFileArg } from '../lib/text-input.js';
9
- import { CLIP_REF_HELP, CONNECTOR_USAGE_HINT, clipNotFoundError, findConnector, resolveRegistryRef, } from '../lib/connector-ref.js';
9
+ import { CLIP_REF_HELP, CONNECTOR_USAGE_HINT, clipNotFoundError, connectorRefArg, findConnector, isConnectorId, resolveRegistryRef, } from '../lib/connector-ref.js';
10
10
  const NO_ALIAS_HINT = 'no alias — reference this connection by its ccn_ id, or ask a human to name it in the Connector Console so callers can tell the accounts apart';
11
11
  function connectionAnnotations(conn, deviceById) {
12
12
  const out = { target: 'orphaned' };
@@ -222,7 +222,7 @@ function registerClipTree(clip) {
222
222
  // back to it rather than failing info. Any OTHER failure (auth, 5xx,
223
223
  // network) must surface: silently printing partial data would report
224
224
  // a broken read as success.
225
- const alreadyDetail = found?.installed === false && clip.startsWith('crg_');
225
+ const alreadyDetail = found?.installed === false && isConnectorId(clip);
226
226
  if (entry && !alreadyDetail) {
227
227
  try {
228
228
  entry = await client.getRegistryClip(orgId, entry.id);
@@ -393,7 +393,7 @@ function registerClipTree(clip) {
393
393
  clip
394
394
  .command('exec')
395
395
  .description('Execute a registry (Edge) connector command through an EXPLICIT connection: --connection <ccn_|alias> is the only target form — a desktop device, a cloud/hosted profile and an MCP server are all reached through the connection bound to the connector. Omitting it is an error')
396
- .argument('<connector>', 'Connector name in the org connector registry')
396
+ .argument('<connector>', 'Registry connector id (crg_... or prll://crg_...) or name')
397
397
  .argument('<command>', 'Command name to execute')
398
398
  .argument('[args]', 'Command arguments (JSON string or plain text)')
399
399
  .option('--connection <ref>', 'Connection id (ccn_…) or alias — discover them with `parall connector connections <connector>`. REQUIRED for every exec: the connection is the unit access is granted on (who may run this connector through which account), and with several accounts it names WHICH one you act as')
@@ -403,6 +403,7 @@ function registerClipTree(clip) {
403
403
  .action(async (clipName, command, args, opts) => {
404
404
  try {
405
405
  const { client, orgId } = resolveCredentials();
406
+ const connector = connectorRefArg(clipName, "list the connections you can use with `parall connector connections <connector>`, then:\n parall connector exec <connector> <command> '<json args>' --connection <ccn_…>");
406
407
  // Explicit connection only, refused locally before any request. The
407
408
  // server answers the same thing (400 CONNECTION_REQUIRED): the
408
409
  // device selectors — `--edge` and the no-flag desktop fallback — are
@@ -449,8 +450,11 @@ function registerClipTree(clip) {
449
450
  printError(new Error('--timeout must be an integer between 1 and 120000 (milliseconds)'));
450
451
  }
451
452
  }
453
+ // A crg_ id selects the exact registry object (what connect-card
454
+ // results and refusal details hand an agent); a name keeps the
455
+ // server's name resolution. The server takes exactly one of the two.
452
456
  const req = {
453
- clip: clipName,
457
+ ...(isConnectorId(connector) ? { clip_id: connector } : { clip: connector }),
454
458
  command,
455
459
  args: parsedArgs,
456
460
  connection: opts?.connection,
@@ -69,7 +69,7 @@ async function mutation(action, target, options) {
69
69
  export function registerCloudProfileCommands(program) {
70
70
  const cloud = program
71
71
  .command('cloud-profile')
72
- .description('Self-create empty hosted Profiles within a human-granted allowance. Creation is free; execution spending is not limited. Proxy credentials and website login remain human tasks.');
72
+ .description("Self-create empty hosted Profiles within a human-granted allowance. Creation is free; execution spending is not limited. New Profiles have no website login, and Profile access or creation authority is not credential authorization: sign in yourself only when the user authorized it and the credentials reached you as secrets; hand CAPTCHA/2FA to a person. Never read, copy, import or configure proxy credentials, cookies or another browser's login state.");
73
73
  const run = (fn) => async (...args) => {
74
74
  try {
75
75
  await fn(...args);
@@ -1 +1 @@
1
- {"version":3,"file":"wiki-comments.d.ts","sourceRoot":"","sources":["../../src/commands/wiki-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC;;2BAE2B;AAC3B,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,QA6HxD"}
1
+ {"version":3,"file":"wiki-comments.d.ts","sourceRoot":"","sources":["../../src/commands/wiki-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC;;2BAE2B;AAC3B,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,QAmIxD"}
@@ -1,6 +1,7 @@
1
1
  import { resolveCredentials } from '../lib/client.js';
2
2
  import { printError, printJson, stripPrllScheme } from '../lib/output.js';
3
3
  import { BODY_FILE_OPTION_DESC, BODY_OPTION_DESC, resolveCommentBody } from '../lib/text-input.js';
4
+ import { buildListTarget } from './comments.js';
4
5
  /** Wiki comment commands (`parall wiki comment …`), extracted from wiki.ts to
5
6
  * respect the file-size ratchet. Registered by registerWikiCommands on the
6
7
  * `wiki` command group. */
@@ -8,7 +9,8 @@ export function registerWikiCommentCommands(wiki) {
8
9
  const comment = wiki.command('comment').description('Manage wiki comments');
9
10
  comment
10
11
  .command('list')
11
- .description('List comments on a wiki target')
12
+ .description('List comments on a wiki target. A page includes its inline comments; each row ' +
13
+ 'carries its own target_uri and target_quote (the commented text)')
12
14
  .argument('[wiki]', 'Wiki ID or slug')
13
15
  .requiredOption('--target-type <type>', 'Target type (changeset or page)')
14
16
  .requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
@@ -28,7 +30,10 @@ export function registerWikiCommentCommands(wiki) {
28
30
  ? COMMENT_TARGET.changeset(opts.targetId, w.id)
29
31
  : COMMENT_TARGET.wikiPage(w.id, opts.targetId);
30
32
  const result = await ctx.client.getComments(ctx.orgId, {
31
- target_uri: targetUri,
33
+ // A page lists by the same rule as `comments list`: its inline
34
+ // comments (`…path.md?rev=…#t=…`) come with the page-level ones.
35
+ // A changeset URI keeps exact matching.
36
+ ...buildListTarget(targetUri),
32
37
  limit: Number(opts.limit),
33
38
  cursor: opts.cursor,
34
39
  order: opts.order,
@@ -2,6 +2,16 @@ import type { ClipRegistryEntry, ParallClient } from '@parall/sdk';
2
2
  /** Printed after a usage error (missing argument, unknown option) under `parall connector`. */
3
3
  export declare const CONNECTOR_USAGE_HINT = "(list installed connectors with `parall connector list`; add --help for usage)";
4
4
  export declare const CLIP_REF_HELP = "Registry connector id (crg_...), an exact connector name (your org first, then a unique public match), or org_<id>/<name> to pin the publisher (discover ids with `parall connector search`)";
5
+ /** A `crg_` ref names the exact registry connector; anything else is a name. */
6
+ export declare function isConnectorId(ref: string): boolean;
7
+ /**
8
+ * The connector positional of a command: a bare id, name or org_<id>/<name>
9
+ * goes on as is (a name may look like any id); a prll:// reference is always
10
+ * an entity, so anything but a connector is refused before any request.
11
+ * `personHint` finishes the refusal for a person passed in the connector's
12
+ * place — what to do instead, with the command to copy.
13
+ */
14
+ export declare function connectorRefArg(raw: string, personHint: string): string;
5
15
  /**
6
16
  * Resolve an install/info argument to a registry entry with per-name queries
7
17
  * only — never by listing the catalog, which spans every public clip on the
@@ -1 +1 @@
1
- {"version":3,"file":"connector-ref.d.ts","sourceRoot":"","sources":["../../src/lib/connector-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEnE,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,mFACiD,CAAC;AAEnF,eAAO,MAAM,aAAa,iMACsK,CAAC;AA2BjM;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA6CnC;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAIpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,KAAK,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CAelE"}
1
+ {"version":3,"file":"connector-ref.d.ts","sourceRoot":"","sources":["../../src/lib/connector-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGnE,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,mFACiD,CAAC;AAEnF,eAAO,MAAM,aAAa,iMACsK,CAAC;AAIjM,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAkBvE;AAyBD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA6CnC;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAIpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,KAAK,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CAelE"}
@@ -1,6 +1,33 @@
1
+ import { stripPrllScheme } from './output.js';
1
2
  /** Printed after a usage error (missing argument, unknown option) under `parall connector`. */
2
3
  export const CONNECTOR_USAGE_HINT = '(list installed connectors with `parall connector list`; add --help for usage)';
3
4
  export const CLIP_REF_HELP = 'Registry connector id (crg_...), an exact connector name (your org first, then a unique public match), or org_<id>/<name> to pin the publisher (discover ids with `parall connector search`)';
5
+ /** A `crg_` ref names the exact registry connector; anything else is a name. */
6
+ export function isConnectorId(ref) {
7
+ return ref.startsWith('crg_');
8
+ }
9
+ /**
10
+ * The connector positional of a command: a bare id, name or org_<id>/<name>
11
+ * goes on as is (a name may look like any id); a prll:// reference is always
12
+ * an entity, so anything but a connector is refused before any request.
13
+ * `personHint` finishes the refusal for a person passed in the connector's
14
+ * place — what to do instead, with the command to copy.
15
+ */
16
+ export function connectorRefArg(raw, personHint) {
17
+ const ref = raw.trim();
18
+ if (!ref.startsWith('prll://'))
19
+ return ref;
20
+ const id = stripPrllScheme(ref);
21
+ if (isConnectorId(id))
22
+ return id;
23
+ if (id.startsWith('ccn_')) {
24
+ throw new Error(`prll://${id} is a connection, not a connector. If you can already use it, run the connector through it:\n parall connector exec <connector> <command> '<json args>' --connection ${id}`);
25
+ }
26
+ if (id.startsWith('usr_')) {
27
+ throw new Error(`prll://${id} is a person, not a connector. Pass the connector (crg_… or its name); ${personHint}`);
28
+ }
29
+ throw new Error(`prll://${id} is not a connector. Pass the connector's crg_ id or name (find it with \`parall connector search <text>\`).`);
30
+ }
4
31
  /**
5
32
  * The clip-ref grammar shared with the standalone Solo CLI
6
33
  * (desktop/edge/cli/parall-clip.mjs, parseClipRef) — the two install surfaces
@@ -8,7 +35,7 @@ export const CLIP_REF_HELP = 'Registry connector id (crg_...), an exact connecto
8
35
  * only org ids are authoritative namespaces; throws on a malformed ref.
9
36
  */
10
37
  function parseClipRef(ref) {
11
- if (ref.startsWith('crg_'))
38
+ if (isConnectorId(ref))
12
39
  return { id: ref };
13
40
  const slash = ref.indexOf('/');
14
41
  if (slash === -1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.88.0",
3
+ "version": "1.90.0",
4
4
  "description": "CLI client for Parall — universal agent & human access to Parall API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "node-diff3": "3.2.1",
43
43
  "tar-stream": "^3.2.1",
44
44
  "zod": "^4.3.6",
45
- "@parall/agent-core": "1.88.0",
46
- "@parall/sdk": "1.88.0"
45
+ "@parall/agent-core": "1.90.0",
46
+ "@parall/sdk": "1.90.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@dnd-kit/core": "6.3.1",
@@ -71,7 +71,7 @@
71
71
  "tw-animate-css": "1.4.0",
72
72
  "typescript": "^5.7.0",
73
73
  "vite": "6.4.1",
74
- "@parall/agent-core": "1.88.0"
74
+ "@parall/agent-core": "1.90.0"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "node scripts/generate-miniapp-sdk.mjs --check && node scripts/generate-local-runner.mjs --check && node scripts/generate-app-templates.mjs --check && tsc",