@parall/daemon 1.55.3 → 1.55.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/manifest.json +11 -11
- package/bundle/parall-browser-pod.js +42 -29
- package/bundle/parall-claude-agent.js +152 -48
- package/bundle/parall-codex-agent.js +152 -48
- package/bundle/parall-daemon.js +67 -30
- package/package.json +6 -6
package/bundle/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.55.
|
|
3
|
-
"built_at": "2026-08-
|
|
2
|
+
"version": "1.55.4",
|
|
3
|
+
"built_at": "2026-08-15T12:55:26.423Z",
|
|
4
4
|
"min_node_version": "20.0.0",
|
|
5
5
|
"files": {
|
|
6
6
|
"bb-browser-daemon.js": {
|
|
@@ -16,29 +16,29 @@
|
|
|
16
16
|
"size": 18
|
|
17
17
|
},
|
|
18
18
|
"parall-browser-pod.js": {
|
|
19
|
-
"sha256": "
|
|
20
|
-
"size":
|
|
19
|
+
"sha256": "6480baf1924cccec2cfe8e93fecb5251f238de2c52b2b067e29875fa2b6f7db8",
|
|
20
|
+
"size": 2948318
|
|
21
21
|
},
|
|
22
22
|
"parall-channel-exec.js": {
|
|
23
23
|
"sha256": "7c2a6e12483a45e9eb4a42cd7d4cdd3c4fa21dd09ac1347d9a3e177b4ddee930",
|
|
24
24
|
"size": 7220
|
|
25
25
|
},
|
|
26
26
|
"parall-claude-agent.js": {
|
|
27
|
-
"sha256": "
|
|
28
|
-
"size":
|
|
27
|
+
"sha256": "a340c800280fd7522f1ae9b5082776b6bc23e4e2d7cbab21077e209753b015bc",
|
|
28
|
+
"size": 2823377
|
|
29
29
|
},
|
|
30
30
|
"parall-codex-agent.js": {
|
|
31
|
-
"sha256": "
|
|
32
|
-
"size":
|
|
31
|
+
"sha256": "3f9ceb215129568c250b0687739a55f8cf4643259d47654dcb2ed2288b29ad89",
|
|
32
|
+
"size": 2855324
|
|
33
33
|
},
|
|
34
34
|
"parall-daemon.js": {
|
|
35
|
-
"sha256": "
|
|
36
|
-
"size":
|
|
35
|
+
"sha256": "571b05da902ead03fb76f6b634a0850d50776bd0c8f1cbc3482c88356256865e",
|
|
36
|
+
"size": 3014129
|
|
37
37
|
},
|
|
38
38
|
"parall-openclaw-agent.js": {
|
|
39
39
|
"sha256": "856a1c3a9ae0ffef8efe2481fa1171dbeb1d67cccb88616aa9bf16da96a69355",
|
|
40
40
|
"size": 9923
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"signature": "
|
|
43
|
+
"signature": "NzZ4HzOlAb7a8+sumoAejzCnXub6F3oQO684Q5Mnsw+LyQs92GsrvHUy0GmcH8/Ft+ZQOiZX7BPpPnATAz/FDg=="
|
|
44
44
|
}
|
|
@@ -63487,7 +63487,7 @@ import { pathToFileURL } from "node:url";
|
|
|
63487
63487
|
|
|
63488
63488
|
// ts/agent-core/dist/generated/platform-instructions.js
|
|
63489
63489
|
var BEHAVIOR_TEMPLATE = "## How to work here\n\n### Move work forward\nDon't wait for instructions. If you see the next step, take it. If something is\nambiguous, clarify once and proceed. If you're blocked, say what's blocking you\n\u2014 don't go silent. Initiative is expected.\n\nUse schedules as self-reminders \u2014 re-checking blocked work, chasing unanswered\nrequests, verifying something landed. When a thing needs future attention and\nnothing will prompt it, schedule it{{SCHEDULES_SKILL_HINT}}\n\n### Work in the open\nNothing you do exists until the system can see it. Your progress, decisions,\nblockers, and results need to live in tasks, comments, messages, or wiki pages\n\u2014 otherwise the organization is blind to your work, and so is the next agent\nwho picks up where you left off. Leave traces as you go, not at the end.\n\nFor non-trivial work: create or claim a task, mark it `in_progress`, comment\nwhen status materially changes, close it when done, and link the origin that\ntriggered it. Decompose multi-step work into subtasks and keep their statuses\ncurrent \u2014 progress should be auditable without watching the work happen.{{TASKS_SKILL_HINT}}\n\n### Done means landed\nProducing output does not complete a task. Work counts as done only when it has\ncleared its remaining gates \u2014 review, merge, deployment, the requester's\nverification. Until then keep the status honest (`in_progress` or\n`in_review`), name the remaining gate in a comment, and chase it (schedule a\nself-reminder if nothing else will prompt follow-up). Never mark done what a\nhuman still has to accept.\n\n### Sessions, forks, and what survives\nSessions end and context compacts. Anything that must survive \u2014 decisions,\nprogress, constraints \u2014 belongs in tasks, comments, or wiki. Future sessions\nread the workspace, not this conversation.\n\nSome events are handled by parallel fork sessions \u2014 short-lived copies of the\nsame agent identity with separate context. In a fork: leave a written trace of\nwhat was done or deliberately not done (other sessions cannot see fork\ncontext), and do not start long-running processes \u2014 they die with the fork.\nWhen an event is marked fork-handled: do not re-handle it; verify its outcome\ninstead of assuming it.\n\n### Communicate like a teammate\nMatch the conversation \u2014 concise in chat, thorough in docs, plain language over\njargon. Say what matters; stop when you're done. Don't narrate every tool call\nor pad replies to seem thorough.\n\nMatch the language of the person you're replying to. If someone writes in\nChinese, reply in Chinese. If in English, reply in English. Never force a\nlanguage switch unless explicitly asked.\n\nDo not promise delivery times (\"in an hour\", \"by tonight\") unless the work is\ndriven by an explicit schedule. Scope visibly; report when actually done.\n\n### Keep topics in threads\nCheck for a `[Thread: prll://msg_xxx]` line before interpreting a message.\nPresent \u2192 that thread is the context; reply there, passing the same root as\n`--thread-root-id`. Absent \u2192 the message belongs to the main conversation:\nnever treat it as continuing your most recent thread. The sender's newest\nmessage is the anchor \u2014 never route a reply back into an older thread just\nbecause the topic used to live there.\n\nReply where the event lives: a thread message gets a thread reply, a\ntop-level message gets a top-level reply. But in group chats, your later\nfollow-up on that topic \u2014 progress updates, analysis, links, verification you\npost afterwards \u2014 belongs in a thread rooted at the topic's message\n(`parall messages send <chat> --thread-root-id <msgId> --text-file -`), so\nthe main channel stays scannable. Post follow-up at top level only when\nstarting a genuinely new topic, making a channel-wide announcement, or when\nexplicitly asked. Never post the same update in both the thread and the main\nchannel \u2014 thread replies surface in the thread panel; no need to duplicate\nfor visibility.\n\nIn DMs, reply top-level by default; use a thread only to continue one that\nalready exists.\n\n### Group chats: mentions and unaddressed work\nAn @mention is a direct request \u2014 act on it. A group message delivered to you\nwithout an @mention means the chat's routing lets you see the conversation:\ndecide whether a reply adds value; silence is the default.\n\nA message without an @mention is not an open invitation. Judge from context\nwho the work belongs to \u2014 the named domain, the topic's owner, whoever is\nalready on it. If it belongs to someone else, leave it. If genuinely unclear,\nask or claim in one line (\"taking this unless someone else has it\") before\nstarting \u2014 asking first beats duplicated or misdirected work.\n\n### Verify before you act\nEvents can be redelivered \u2014 before acting, check whether it was already\nhandled (your own recent replies, task comments); if handled, do nothing.\nSends can fail silently, and creates can error after succeeding server-side \u2014\ncheck the chat or entity before retrying. Never blind-retry a mutating call.\n\n### Gather the full picture first\nWhen a request is vague, an entity may already exist, or work may already be\nunderway \u2014 gather context before acting: search (`parall search \"...\"`),\ncheck existing tasks/chats/wiki, read the surrounding conversation. Act on the\nfull picture, not the fragment that arrived in the event.\n\n### Report only work that ran\nIf a scheduled job, scan, or tool call did not actually run \u2014 restarted\nsession, missing credentials, silent failure \u2014 say so plainly. Never fabricate\nor approximate results of work that did not execute.\n\n### Respect what's shared\nYou have broad latitude inside your own work. But actions that are visible to\nothers, hard to reverse, or touch shared state \u2014 sending DMs, editing shared\nwiki, reassigning others' tasks, deleting content \u2014 pause and confirm before\nacting, unless you've been explicitly authorized.\n\n### Shared workspace\nOther agents share this workspace. Before starting work, check whether someone\n\u2014 human or agent \u2014 has already picked it up. Coordination beats racing.\n\n### Permissions and approvals\nYou have real permissions based on your roles (chat member/admin, org member).\nIf you lack permission for an action, the API returns PERMISSION_DENIED with the\n`action` and `resource_uri` that were denied. The server decides whether that\naction is approvable: if it is, the CLI prints an `approvals request` command \u2014\nfill in the placeholders it shows (`--chat`, `--title`, `--reason`) and run\nit to ask someone with permission. If it is NOT approvable, the output says so;\nask a human with permission instead of requesting approval. A\n`INVALID_TARGET` error instead means you addressed the wrong kind of thing\n(e.g. a `usr_` id where a chat is expected) \u2014 follow the message (e.g. use\n`dm` for a user). Don't retry or work around a denial; only request approval\nafter an actual denial, never preemptively.\n\n### When in doubt\nPrefer asking over guessing. Prefer \"I don't know\" over fabricating. Your\ncredibility is what you bring to the workspace \u2014 protect it.";
|
|
63490
|
-
var REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
63490
|
+
var REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\nWhen an event carries `[Hint: forwarded_message]`, its body is a set of message\nreferences rather than the forwarded text. Run `parall refs resolve --full`\nwith those references before responding, passing the `--from` message id the\nhint names \u2014 that forwarding message carries the cross-chat access, and when\nseveral forwards arrive in one turn the CLI\'s trigger default would point at\nthe wrong one. `--full` changes only the returned text length, not what you\nare allowed to read.\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
63491
63491
|
var BRIDGE_SKILL_HINTS = {
|
|
63492
63492
|
SCHEDULES_SKILL_HINT: " (read the `parall-schedules` skill at .parall/skills/parall-schedules.md).",
|
|
63493
63493
|
TASKS_SKILL_HINT: "\nDetails: read the `parall-tasks` skill at .parall/skills/parall-tasks.md and follow it.",
|
|
@@ -63515,6 +63515,13 @@ function renderPlatformReferenceGuide(skillsAvailable) {
|
|
|
63515
63515
|
var PLATFORM_BEHAVIOR = renderPlatformBehavior(true);
|
|
63516
63516
|
var PLATFORM_REFERENCE_GUIDE = renderPlatformReferenceGuide(true);
|
|
63517
63517
|
|
|
63518
|
+
// ts/agent-core/dist/event-format.js
|
|
63519
|
+
var MESSAGE_REF_URI = "prll:\\/\\/msg_[A-Za-z0-9_-]+(?:\\/content\\?v=[1-9][0-9]{0,8}#t=[0-9]+-[0-9]+)?";
|
|
63520
|
+
var MESSAGE_RANGE_REF_URI = "prll:\\/\\/cht_[A-Za-z0-9_-]+#range=msg_[A-Za-z0-9_-]+,msg_[A-Za-z0-9_-]+";
|
|
63521
|
+
var REF_URI = `(?:${MESSAGE_REF_URI}|${MESSAGE_RANGE_REF_URI})`;
|
|
63522
|
+
var REF_TOKEN = `(?:${REF_URI}|\\[(?:[^\\[\\]]|\\[[^\\[\\]]*\\])*\\]\\(${REF_URI}\\)|<${REF_URI}>)`;
|
|
63523
|
+
var FORWARDED_REF_LINE = new RegExp(`^${REF_TOKEN}(?:\\s+${REF_TOKEN})*$`);
|
|
63524
|
+
|
|
63518
63525
|
// ts/sdk/dist/browser-viewer.js
|
|
63519
63526
|
var BROWSER_VIEWER_READINESS_TIMEOUT_MS = 6e4;
|
|
63520
63527
|
function browserViewerRequestOptions(command, opts) {
|
|
@@ -63757,6 +63764,7 @@ var ENDPOINTS = {
|
|
|
63757
63764
|
SLACK_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/slack/status`,
|
|
63758
63765
|
// WeChat tier-B read verbs (agent-only; internal research preview).
|
|
63759
63766
|
WECHAT_CONTACTS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/contacts`,
|
|
63767
|
+
WECHAT_HISTORY: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/history`,
|
|
63760
63768
|
WECHAT_PROFILE: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/profile`,
|
|
63761
63769
|
WECHAT_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/status`,
|
|
63762
63770
|
// Invitations (org-scoped, admin)
|
|
@@ -64161,8 +64169,35 @@ var TaskLabelClient = class extends ProjectTaskClient {
|
|
|
64161
64169
|
}
|
|
64162
64170
|
};
|
|
64163
64171
|
|
|
64172
|
+
// ts/sdk/dist/wechat-client.js
|
|
64173
|
+
var WechatClient = class extends TaskLabelClient {
|
|
64174
|
+
/** Address book enriched with display names. */
|
|
64175
|
+
async listWechatContacts(orgId) {
|
|
64176
|
+
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
64177
|
+
}
|
|
64178
|
+
/** Platform-retained context in chronological page order. */
|
|
64179
|
+
async wechatHistory(orgId, conversation, query) {
|
|
64180
|
+
const params = new URLSearchParams({ conversation });
|
|
64181
|
+
if (query?.before)
|
|
64182
|
+
params.set("before", query.before);
|
|
64183
|
+
if (query?.since)
|
|
64184
|
+
params.set("since", query.since);
|
|
64185
|
+
if (query?.limit !== void 0)
|
|
64186
|
+
params.set("limit", String(query.limit));
|
|
64187
|
+
return this.request("GET", `${ENDPOINTS.WECHAT_HISTORY(orgId)}?${params.toString()}`);
|
|
64188
|
+
}
|
|
64189
|
+
/** Connected WeChat account identity. */
|
|
64190
|
+
async wechatProfile(orgId) {
|
|
64191
|
+
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
64192
|
+
}
|
|
64193
|
+
/** Live online probe, identity, and platform offline record. */
|
|
64194
|
+
async wechatStatus(orgId) {
|
|
64195
|
+
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
64196
|
+
}
|
|
64197
|
+
};
|
|
64198
|
+
|
|
64164
64199
|
// ts/sdk/dist/client.js
|
|
64165
|
-
var ParallClient = class _ParallClient extends
|
|
64200
|
+
var ParallClient = class _ParallClient extends WechatClient {
|
|
64166
64201
|
baseUrl;
|
|
64167
64202
|
wikiBaseUrl;
|
|
64168
64203
|
token;
|
|
@@ -65510,28 +65545,6 @@ var ParallClient = class _ParallClient extends TaskLabelClient {
|
|
|
65510
65545
|
async setSlackStatus(orgId, input) {
|
|
65511
65546
|
await this.request("POST", ENDPOINTS.SLACK_STATUS(orgId), input);
|
|
65512
65547
|
}
|
|
65513
|
-
/**
|
|
65514
|
-
* WeChat tier-B read verb (agent-only; internal research preview): the
|
|
65515
|
-
* account's address book — friends/chatrooms enriched with display names,
|
|
65516
|
-
* followed official accounts. Same live gate as the send verb.
|
|
65517
|
-
*/
|
|
65518
|
-
async listWechatContacts(orgId) {
|
|
65519
|
-
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
65520
|
-
}
|
|
65521
|
-
/**
|
|
65522
|
-
* WeChat tier-B read verb (agent-only): the connected account's identity
|
|
65523
|
-
* (wxid / alias / nickName / app id).
|
|
65524
|
-
*/
|
|
65525
|
-
async wechatProfile(orgId) {
|
|
65526
|
-
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
65527
|
-
}
|
|
65528
|
-
/**
|
|
65529
|
-
* WeChat tier-B read verb (agent-only): live online probe + identity +
|
|
65530
|
-
* the platform's offline record.
|
|
65531
|
-
*/
|
|
65532
|
-
async wechatStatus(orgId) {
|
|
65533
|
-
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
65534
|
-
}
|
|
65535
65548
|
async listChannelConversations(orgId, connectionId) {
|
|
65536
65549
|
return this.request("GET", ENDPOINTS.CHANNEL_CONNECTION_CONVERSATIONS(orgId, connectionId));
|
|
65537
65550
|
}
|
|
@@ -65817,11 +65830,11 @@ var ParallClient = class _ParallClient extends TaskLabelClient {
|
|
|
65817
65830
|
}
|
|
65818
65831
|
// ---- References ----
|
|
65819
65832
|
async resolveRefs(orgId, refs, options) {
|
|
65820
|
-
|
|
65821
|
-
|
|
65822
|
-
|
|
65823
|
-
|
|
65824
|
-
|
|
65833
|
+
return this.request("POST", ENDPOINTS.REFS_RESOLVE(orgId), {
|
|
65834
|
+
refs,
|
|
65835
|
+
source_message_id: options?.sourceMessageId,
|
|
65836
|
+
full: options?.full || void 0
|
|
65837
|
+
});
|
|
65825
65838
|
}
|
|
65826
65839
|
async getBacklinks(orgId, params) {
|
|
65827
65840
|
return this.request("GET", ENDPOINTS.REFS_BACKLINKS(orgId), void 0, params);
|
|
@@ -51252,7 +51252,7 @@ var PLATFORM_IDENTITY_BASE = "## You on Parall\n\nParall is a shared workspace w
|
|
|
51252
51252
|
var IDENTITY_PROFILE_SUFFIX = "### Your Parall Identity\n\nYou are **{{DISPLAY_NAME}}** (`prll://{{USER_ID}}`).{{PUBLIC_PROFILE}}{{MANAGER_LINE}}{{INSTRUCTIONS_SECTION}}\n\nWhen you see `{{USER_ID}}` or `prll://{{USER_ID}}` in messages, mentions, or events \u2014 that's you.";
|
|
51253
51253
|
var PLATFORM_BRIDGE_WORKSPACE_INSTRUCTIONS = '# Agent workspace\n\nYou are an agent in Parall IM. You participate in chats, handle tasks, and interact exclusively through the Parall CLI.\n\n## Message Model\n\nIncoming events are rendered as structured `[Event: ...]` blocks.\nEach event includes `[Chat: ... (prll://cht_xxx)]` \u2014 use that chat ID (or full URI) when replying.\n\n**Your plain-text output is not delivered to anyone** \u2014 it is recorded as suppressed thinking in your session steps and discarded from the chat.\nTo say something in a chat, you **must** invoke the Parall CLI via your shell/exec tool. To stay silent, simply do not invoke it.\n\n## Parall CLI\n\nAll outbound interactions go through the `parall` CLI. Credentials are pre-injected as environment variables \u2014 no setup needed. If `parall` is not on PATH, use `npx --yes @parall/cli@latest` instead.\n\n- `parall messages send prll://cht_xxx --text-file -` \u2014 reply into the triggering chat (pipe the body via a quoted heredoc; see Shell-safety below)\n- `parall dm prll://usr_xxx --text-file - [--no-reply]` \u2014 direct message another user\n- `parall tasks update prll://tsk_xxx --status in_progress` \u2014 task state\n- `parall no-reply [--reason "..."]` \u2014 explicitly declare this turn silent (audit signal; not required for silence, just clarifies intent)\n\n**Shell-safety \u2014 never wrap real message content in double quotes.** Your command runs in a shell, which expands `$`, backticks, and `$(...)` inside `"..."` before the CLI sees them: `--text "That costs $1,000"` sends `That costs ,000`, and `--text "$(cmd)"` executes `cmd`. Pass message bodies via `--text-file <path>` (write the file first \u2014 no shell touches it) or a quoted heredoc that disables expansion:\n\n```bash\nparall messages send prll://cht_xxx --text-file - <<\'EOF\'\nThat costs $1,000, and $(whoami) stays literal. I\'m on it.\nEOF\n```\n\nKeep `--text "..."` for short literals with no `$`, backtick, or apostrophe.\n\nThe bridge injects Parall context via environment variables. The static credentials `PRLL_API_URL`, `PRLL_API_KEY`, and `PRLL_ORG_ID` are always set. `PRLL_CONTEXT_FILE` points to a per-session JSON file that the gateway updates each dispatch with `session_id`, `chat_id`, `trigger_message_id`, `no_reply`, and `step_id` (updated per tool call). The CLI reads this file automatically \u2014 you do not need to pass `--chat` or `--session` explicitly when the context file is present.\n\nCLI errors are agent-readable \u2014 read them; they usually name the next step.\n\n## Attachments\n\nImage attachments are pre-downloaded under `.parall/attachments/<messageId>/`. Each event\'s `[Local attachment files]` block lists each image as a metadata header followed by its absolute local path on its own line \u2014 pass that path to your file-reading tool when the user refers to image contents.\n\nSupported image types: PNG, JPEG, WebP, GIF. Other attachment types (PDFs, archives, etc.) are not pre-downloaded \u2014 fetch them on demand with `parall files download att_xxx --output ...`.\n\n## Guardrails\n\n- A dispatch may coalesce multiple events. Decide per event whether to reply via `messages send` / `dm` \u2014 events you do not act on simply receive no reply.\n- If an event carries `[Hint: no_reply]`, do not send anything for that event. `no-reply` is optional and only useful as an explicit intent marker.\n- Never try to "speak" by typing sentences like "No response needed" / "Noted" / "OK" \u2014 they are discarded, so they accomplish nothing except polluting your session log.\n- Keep CLI replies concise and task-focused.\n\nSee `docs/engineering-design/agent-dm-loop-prevention.md` \xA7 Layer 0 for why plain text is never auto-projected.\n\n## Approval Flow\n\nWhen you try an action (e.g., archive a chat) and receive a PERMISSION_DENIED error, you can request someone with permission to do it:\n\n1. The error includes a `PERMISSION_DENIED` code plus the denied `action` and `resource_uri`. If the action is approvable (decided by the server \u2014 no fixed allowlist), a `Request approval:` line with an approval command is printed \u2014 fill in its `--chat`, `--title`, `--reason` placeholders and run it. If it is not approvable, the output says so; ask a human with permission instead.\n2. Request approval: `parall approvals request --action chat.archive --resource prll://cht_123 --chat prll://cht_456 --title "Archive #old-project" --reason "Channel inactive"`\n3. A card will appear in the specified chat for someone with permission to approve\n4. Check the result: `parall approvals get prll://<id>` or wait: `parall approvals wait prll://<id> --timeout 300`\n5. List available actions: `parall approvals actions`\n\nOnly request approval when you\'ve actually been denied permission. Don\'t request approval preemptively.\n';
|
|
51254
51254
|
var BEHAVIOR_TEMPLATE = "## How to work here\n\n### Move work forward\nDon't wait for instructions. If you see the next step, take it. If something is\nambiguous, clarify once and proceed. If you're blocked, say what's blocking you\n\u2014 don't go silent. Initiative is expected.\n\nUse schedules as self-reminders \u2014 re-checking blocked work, chasing unanswered\nrequests, verifying something landed. When a thing needs future attention and\nnothing will prompt it, schedule it{{SCHEDULES_SKILL_HINT}}\n\n### Work in the open\nNothing you do exists until the system can see it. Your progress, decisions,\nblockers, and results need to live in tasks, comments, messages, or wiki pages\n\u2014 otherwise the organization is blind to your work, and so is the next agent\nwho picks up where you left off. Leave traces as you go, not at the end.\n\nFor non-trivial work: create or claim a task, mark it `in_progress`, comment\nwhen status materially changes, close it when done, and link the origin that\ntriggered it. Decompose multi-step work into subtasks and keep their statuses\ncurrent \u2014 progress should be auditable without watching the work happen.{{TASKS_SKILL_HINT}}\n\n### Done means landed\nProducing output does not complete a task. Work counts as done only when it has\ncleared its remaining gates \u2014 review, merge, deployment, the requester's\nverification. Until then keep the status honest (`in_progress` or\n`in_review`), name the remaining gate in a comment, and chase it (schedule a\nself-reminder if nothing else will prompt follow-up). Never mark done what a\nhuman still has to accept.\n\n### Sessions, forks, and what survives\nSessions end and context compacts. Anything that must survive \u2014 decisions,\nprogress, constraints \u2014 belongs in tasks, comments, or wiki. Future sessions\nread the workspace, not this conversation.\n\nSome events are handled by parallel fork sessions \u2014 short-lived copies of the\nsame agent identity with separate context. In a fork: leave a written trace of\nwhat was done or deliberately not done (other sessions cannot see fork\ncontext), and do not start long-running processes \u2014 they die with the fork.\nWhen an event is marked fork-handled: do not re-handle it; verify its outcome\ninstead of assuming it.\n\n### Communicate like a teammate\nMatch the conversation \u2014 concise in chat, thorough in docs, plain language over\njargon. Say what matters; stop when you're done. Don't narrate every tool call\nor pad replies to seem thorough.\n\nMatch the language of the person you're replying to. If someone writes in\nChinese, reply in Chinese. If in English, reply in English. Never force a\nlanguage switch unless explicitly asked.\n\nDo not promise delivery times (\"in an hour\", \"by tonight\") unless the work is\ndriven by an explicit schedule. Scope visibly; report when actually done.\n\n### Keep topics in threads\nCheck for a `[Thread: prll://msg_xxx]` line before interpreting a message.\nPresent \u2192 that thread is the context; reply there, passing the same root as\n`--thread-root-id`. Absent \u2192 the message belongs to the main conversation:\nnever treat it as continuing your most recent thread. The sender's newest\nmessage is the anchor \u2014 never route a reply back into an older thread just\nbecause the topic used to live there.\n\nReply where the event lives: a thread message gets a thread reply, a\ntop-level message gets a top-level reply. But in group chats, your later\nfollow-up on that topic \u2014 progress updates, analysis, links, verification you\npost afterwards \u2014 belongs in a thread rooted at the topic's message\n(`parall messages send <chat> --thread-root-id <msgId> --text-file -`), so\nthe main channel stays scannable. Post follow-up at top level only when\nstarting a genuinely new topic, making a channel-wide announcement, or when\nexplicitly asked. Never post the same update in both the thread and the main\nchannel \u2014 thread replies surface in the thread panel; no need to duplicate\nfor visibility.\n\nIn DMs, reply top-level by default; use a thread only to continue one that\nalready exists.\n\n### Group chats: mentions and unaddressed work\nAn @mention is a direct request \u2014 act on it. A group message delivered to you\nwithout an @mention means the chat's routing lets you see the conversation:\ndecide whether a reply adds value; silence is the default.\n\nA message without an @mention is not an open invitation. Judge from context\nwho the work belongs to \u2014 the named domain, the topic's owner, whoever is\nalready on it. If it belongs to someone else, leave it. If genuinely unclear,\nask or claim in one line (\"taking this unless someone else has it\") before\nstarting \u2014 asking first beats duplicated or misdirected work.\n\n### Verify before you act\nEvents can be redelivered \u2014 before acting, check whether it was already\nhandled (your own recent replies, task comments); if handled, do nothing.\nSends can fail silently, and creates can error after succeeding server-side \u2014\ncheck the chat or entity before retrying. Never blind-retry a mutating call.\n\n### Gather the full picture first\nWhen a request is vague, an entity may already exist, or work may already be\nunderway \u2014 gather context before acting: search (`parall search \"...\"`),\ncheck existing tasks/chats/wiki, read the surrounding conversation. Act on the\nfull picture, not the fragment that arrived in the event.\n\n### Report only work that ran\nIf a scheduled job, scan, or tool call did not actually run \u2014 restarted\nsession, missing credentials, silent failure \u2014 say so plainly. Never fabricate\nor approximate results of work that did not execute.\n\n### Respect what's shared\nYou have broad latitude inside your own work. But actions that are visible to\nothers, hard to reverse, or touch shared state \u2014 sending DMs, editing shared\nwiki, reassigning others' tasks, deleting content \u2014 pause and confirm before\nacting, unless you've been explicitly authorized.\n\n### Shared workspace\nOther agents share this workspace. Before starting work, check whether someone\n\u2014 human or agent \u2014 has already picked it up. Coordination beats racing.\n\n### Permissions and approvals\nYou have real permissions based on your roles (chat member/admin, org member).\nIf you lack permission for an action, the API returns PERMISSION_DENIED with the\n`action` and `resource_uri` that were denied. The server decides whether that\naction is approvable: if it is, the CLI prints an `approvals request` command \u2014\nfill in the placeholders it shows (`--chat`, `--title`, `--reason`) and run\nit to ask someone with permission. If it is NOT approvable, the output says so;\nask a human with permission instead of requesting approval. A\n`INVALID_TARGET` error instead means you addressed the wrong kind of thing\n(e.g. a `usr_` id where a chat is expected) \u2014 follow the message (e.g. use\n`dm` for a user). Don't retry or work around a denial; only request approval\nafter an actual denial, never preemptively.\n\n### When in doubt\nPrefer asking over guessing. Prefer \"I don't know\" over fabricating. Your\ncredibility is what you bring to the workspace \u2014 protect it.";
|
|
51255
|
-
var REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
51255
|
+
var REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\nWhen an event carries `[Hint: forwarded_message]`, its body is a set of message\nreferences rather than the forwarded text. Run `parall refs resolve --full`\nwith those references before responding, passing the `--from` message id the\nhint names \u2014 that forwarding message carries the cross-chat access, and when\nseveral forwards arrive in one turn the CLI\'s trigger default would point at\nthe wrong one. `--full` changes only the returned text length, not what you\nare allowed to read.\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
51256
51256
|
var BRIDGE_SKILL_HINTS = {
|
|
51257
51257
|
SCHEDULES_SKILL_HINT: " (read the `parall-schedules` skill at .parall/skills/parall-schedules.md).",
|
|
51258
51258
|
TASKS_SKILL_HINT: "\nDetails: read the `parall-tasks` skill at .parall/skills/parall-tasks.md and follow it.",
|
|
@@ -51469,6 +51469,15 @@ function buildErrorStepContent(message) {
|
|
|
51469
51469
|
}
|
|
51470
51470
|
|
|
51471
51471
|
// ts/agent-core/dist/event-format.js
|
|
51472
|
+
var MESSAGE_REF_URI = "prll:\\/\\/msg_[A-Za-z0-9_-]+(?:\\/content\\?v=[1-9][0-9]{0,8}#t=[0-9]+-[0-9]+)?";
|
|
51473
|
+
var MESSAGE_RANGE_REF_URI = "prll:\\/\\/cht_[A-Za-z0-9_-]+#range=msg_[A-Za-z0-9_-]+,msg_[A-Za-z0-9_-]+";
|
|
51474
|
+
var REF_URI = `(?:${MESSAGE_REF_URI}|${MESSAGE_RANGE_REF_URI})`;
|
|
51475
|
+
var REF_TOKEN = `(?:${REF_URI}|\\[(?:[^\\[\\]]|\\[[^\\[\\]]*\\])*\\]\\(${REF_URI}\\)|<${REF_URI}>)`;
|
|
51476
|
+
var FORWARDED_REF_LINE = new RegExp(`^${REF_TOKEN}(?:\\s+${REF_TOKEN})*$`);
|
|
51477
|
+
function isForwardedMessageBody(body) {
|
|
51478
|
+
const lines = body.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
51479
|
+
return lines.length > 0 && lines.every((line) => FORWARDED_REF_LINE.test(line));
|
|
51480
|
+
}
|
|
51472
51481
|
function sanitizeMeta(value) {
|
|
51473
51482
|
return value.replace(/[\r\n]+/g, " ").replace(/[[\]|]/g, " ").trim();
|
|
51474
51483
|
}
|
|
@@ -51499,6 +51508,9 @@ function buildEventBody(event) {
|
|
|
51499
51508
|
}
|
|
51500
51509
|
if (event.noReply)
|
|
51501
51510
|
lines.push(`[Hint: no_reply]`);
|
|
51511
|
+
if (isForwardedMessageBody(event.body)) {
|
|
51512
|
+
lines.push(`[Hint: forwarded_message \u2014 run parall refs resolve --full --from prll://${event.messageId} with the prll:// references below; that message carries the cross-chat forwarding access for these refs.]`);
|
|
51513
|
+
}
|
|
51502
51514
|
if (event.attachments?.length) {
|
|
51503
51515
|
for (const att of event.attachments) {
|
|
51504
51516
|
const sizeStr = att.fileSize >= 1048576 ? `${(att.fileSize / 1048576).toFixed(1)}MB` : `${Math.round(att.fileSize / 1024)}KB`;
|
|
@@ -51620,8 +51632,9 @@ function buildSendMessageHint(event) {
|
|
|
51620
51632
|
if (event.channelProvider === "wechat") {
|
|
51621
51633
|
const toArg = event.channelExternalConversationId ? ` --to "${event.channelExternalConversationId}"` : " --to <wxid from this event>";
|
|
51622
51634
|
const atArg = event.channelConversationType === "group" ? event.senderId && event.senderId !== "external" ? ` --at "${event.senderId}"` : " --at <wxid of the person you are answering>" : "";
|
|
51635
|
+
const historyArg = event.channelExternalConversationId ? ` --conversation "${event.channelExternalConversationId}"` : " --conversation <wxid from this event>";
|
|
51623
51636
|
return `
|
|
51624
|
-
<system-reminder>To reply, use the platform verb: \`parall wechat send${toArg}${atArg} --text-file - <<'EOF'\` \u2026 \`EOF\` (or --text "<short text>" for simple literals \u2014 the quoted heredoc keeps $, backticks and apostrophes literal). In group chats, --at @-mentions the person you are answering. \`parall wechat send\` is the ONLY outbound path \u2014 your plain text output is NOT delivered to the external conversation.</system-reminder>`;
|
|
51637
|
+
<system-reminder>Need earlier context? Run \`parall wechat history${historyArg}\`; history is not inserted automatically. To reply, use the platform verb: \`parall wechat send${toArg}${atArg} --text-file - <<'EOF'\` \u2026 \`EOF\` (or --text "<short text>" for simple literals \u2014 the quoted heredoc keeps $, backticks and apostrophes literal). In group chats, --at @-mentions the person you are answering. \`parall wechat send\` is the ONLY outbound path \u2014 your plain text output is NOT delivered to the external conversation.</system-reminder>`;
|
|
51625
51638
|
}
|
|
51626
51639
|
if (!event.channelProvider) {
|
|
51627
51640
|
return `
|
|
@@ -51919,6 +51932,7 @@ var ENDPOINTS = {
|
|
|
51919
51932
|
SLACK_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/slack/status`,
|
|
51920
51933
|
// WeChat tier-B read verbs (agent-only; internal research preview).
|
|
51921
51934
|
WECHAT_CONTACTS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/contacts`,
|
|
51935
|
+
WECHAT_HISTORY: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/history`,
|
|
51922
51936
|
WECHAT_PROFILE: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/profile`,
|
|
51923
51937
|
WECHAT_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/status`,
|
|
51924
51938
|
// Invitations (org-scoped, admin)
|
|
@@ -52414,8 +52428,35 @@ var TaskLabelClient = class extends ProjectTaskClient {
|
|
|
52414
52428
|
}
|
|
52415
52429
|
};
|
|
52416
52430
|
|
|
52431
|
+
// ts/sdk/dist/wechat-client.js
|
|
52432
|
+
var WechatClient = class extends TaskLabelClient {
|
|
52433
|
+
/** Address book enriched with display names. */
|
|
52434
|
+
async listWechatContacts(orgId) {
|
|
52435
|
+
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
52436
|
+
}
|
|
52437
|
+
/** Platform-retained context in chronological page order. */
|
|
52438
|
+
async wechatHistory(orgId, conversation, query) {
|
|
52439
|
+
const params = new URLSearchParams({ conversation });
|
|
52440
|
+
if (query?.before)
|
|
52441
|
+
params.set("before", query.before);
|
|
52442
|
+
if (query?.since)
|
|
52443
|
+
params.set("since", query.since);
|
|
52444
|
+
if (query?.limit !== void 0)
|
|
52445
|
+
params.set("limit", String(query.limit));
|
|
52446
|
+
return this.request("GET", `${ENDPOINTS.WECHAT_HISTORY(orgId)}?${params.toString()}`);
|
|
52447
|
+
}
|
|
52448
|
+
/** Connected WeChat account identity. */
|
|
52449
|
+
async wechatProfile(orgId) {
|
|
52450
|
+
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
52451
|
+
}
|
|
52452
|
+
/** Live online probe, identity, and platform offline record. */
|
|
52453
|
+
async wechatStatus(orgId) {
|
|
52454
|
+
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
52455
|
+
}
|
|
52456
|
+
};
|
|
52457
|
+
|
|
52417
52458
|
// ts/sdk/dist/client.js
|
|
52418
|
-
var ParallClient = class _ParallClient extends
|
|
52459
|
+
var ParallClient = class _ParallClient extends WechatClient {
|
|
52419
52460
|
baseUrl;
|
|
52420
52461
|
wikiBaseUrl;
|
|
52421
52462
|
token;
|
|
@@ -53763,28 +53804,6 @@ var ParallClient = class _ParallClient extends TaskLabelClient {
|
|
|
53763
53804
|
async setSlackStatus(orgId, input) {
|
|
53764
53805
|
await this.request("POST", ENDPOINTS.SLACK_STATUS(orgId), input);
|
|
53765
53806
|
}
|
|
53766
|
-
/**
|
|
53767
|
-
* WeChat tier-B read verb (agent-only; internal research preview): the
|
|
53768
|
-
* account's address book — friends/chatrooms enriched with display names,
|
|
53769
|
-
* followed official accounts. Same live gate as the send verb.
|
|
53770
|
-
*/
|
|
53771
|
-
async listWechatContacts(orgId) {
|
|
53772
|
-
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
53773
|
-
}
|
|
53774
|
-
/**
|
|
53775
|
-
* WeChat tier-B read verb (agent-only): the connected account's identity
|
|
53776
|
-
* (wxid / alias / nickName / app id).
|
|
53777
|
-
*/
|
|
53778
|
-
async wechatProfile(orgId) {
|
|
53779
|
-
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
53780
|
-
}
|
|
53781
|
-
/**
|
|
53782
|
-
* WeChat tier-B read verb (agent-only): live online probe + identity +
|
|
53783
|
-
* the platform's offline record.
|
|
53784
|
-
*/
|
|
53785
|
-
async wechatStatus(orgId) {
|
|
53786
|
-
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
53787
|
-
}
|
|
53788
53807
|
async listChannelConversations(orgId, connectionId) {
|
|
53789
53808
|
return this.request("GET", ENDPOINTS.CHANNEL_CONNECTION_CONVERSATIONS(orgId, connectionId));
|
|
53790
53809
|
}
|
|
@@ -54070,11 +54089,11 @@ var ParallClient = class _ParallClient extends TaskLabelClient {
|
|
|
54070
54089
|
}
|
|
54071
54090
|
// ---- References ----
|
|
54072
54091
|
async resolveRefs(orgId, refs, options) {
|
|
54073
|
-
|
|
54074
|
-
|
|
54075
|
-
|
|
54076
|
-
|
|
54077
|
-
|
|
54092
|
+
return this.request("POST", ENDPOINTS.REFS_RESOLVE(orgId), {
|
|
54093
|
+
refs,
|
|
54094
|
+
source_message_id: options?.sourceMessageId,
|
|
54095
|
+
full: options?.full || void 0
|
|
54096
|
+
});
|
|
54078
54097
|
}
|
|
54079
54098
|
async getBacklinks(orgId, params) {
|
|
54080
54099
|
return this.request("GET", ENDPOINTS.REFS_BACKLINKS(orgId), void 0, params);
|
|
@@ -55103,6 +55122,56 @@ var ParallWs = class {
|
|
|
55103
55122
|
}
|
|
55104
55123
|
};
|
|
55105
55124
|
|
|
55125
|
+
// ts/agent-core/dist/fork-state.js
|
|
55126
|
+
var FORK_CONTINUATION_RETRY_CAP = 256;
|
|
55127
|
+
function forkContinuationRetryKey(event) {
|
|
55128
|
+
if (event.type === "message" || event.type === "channel_message") {
|
|
55129
|
+
return event.messageId ? `message:${event.messageId}` : void 0;
|
|
55130
|
+
}
|
|
55131
|
+
return event.dispatchEventId ? `dispatch:${event.dispatchEventId}` : void 0;
|
|
55132
|
+
}
|
|
55133
|
+
function resolveForkContinuationPrefix(pendingResults, retries, event) {
|
|
55134
|
+
const retryKey = forkContinuationRetryKey(event);
|
|
55135
|
+
const retained = retryKey ? retries.get(retryKey) : void 0;
|
|
55136
|
+
if (retained)
|
|
55137
|
+
return retained;
|
|
55138
|
+
const prefix = buildForkResultPrefix(pendingResults.filter((result) => result.sourceEvent.targetId === event.targetId));
|
|
55139
|
+
return prefix || void 0;
|
|
55140
|
+
}
|
|
55141
|
+
function retainForkContinuationRetries(retries, events, prefix) {
|
|
55142
|
+
if (!prefix)
|
|
55143
|
+
return;
|
|
55144
|
+
for (const event of events) {
|
|
55145
|
+
const key = forkContinuationRetryKey(event);
|
|
55146
|
+
if (!key)
|
|
55147
|
+
continue;
|
|
55148
|
+
if (retries.delete(key) === false && retries.size >= FORK_CONTINUATION_RETRY_CAP) {
|
|
55149
|
+
const oldest = retries.keys().next().value;
|
|
55150
|
+
if (oldest !== void 0)
|
|
55151
|
+
retries.delete(oldest);
|
|
55152
|
+
}
|
|
55153
|
+
retries.set(key, prefix);
|
|
55154
|
+
}
|
|
55155
|
+
}
|
|
55156
|
+
function clearForkContinuationRetries(retries, events) {
|
|
55157
|
+
for (const event of events) {
|
|
55158
|
+
const key = forkContinuationRetryKey(event);
|
|
55159
|
+
if (key)
|
|
55160
|
+
retries.delete(key);
|
|
55161
|
+
}
|
|
55162
|
+
}
|
|
55163
|
+
function createActiveForkState(fork, targetId, continuationPrefix) {
|
|
55164
|
+
return {
|
|
55165
|
+
fork,
|
|
55166
|
+
targetId,
|
|
55167
|
+
queue: [],
|
|
55168
|
+
processedEvents: [],
|
|
55169
|
+
continuationPrefix,
|
|
55170
|
+
deadlineTimer: null,
|
|
55171
|
+
deadlineExceeded: false
|
|
55172
|
+
};
|
|
55173
|
+
}
|
|
55174
|
+
|
|
55106
55175
|
// ts/agent-core/dist/lane-ledger.js
|
|
55107
55176
|
import * as fs2 from "node:fs";
|
|
55108
55177
|
|
|
@@ -57184,6 +57253,7 @@ var ParallAgentGateway = class {
|
|
|
57184
57253
|
// LaneFlowHost.typedRedriveBackoff in gateway-lane-flow.ts.
|
|
57185
57254
|
typedRedriveBackoff = /* @__PURE__ */ new Map();
|
|
57186
57255
|
forkStates = /* @__PURE__ */ new Map();
|
|
57256
|
+
forkContinuationRetries = /* @__PURE__ */ new Map();
|
|
57187
57257
|
dispatchState = {
|
|
57188
57258
|
mainDispatching: false,
|
|
57189
57259
|
activeForks: /* @__PURE__ */ new Map(),
|
|
@@ -58205,6 +58275,7 @@ var ParallAgentGateway = class {
|
|
|
58205
58275
|
}
|
|
58206
58276
|
this.dispatchState.activeForks.delete(targetId);
|
|
58207
58277
|
this.forkStates.delete(targetId);
|
|
58278
|
+
retainForkContinuationRetries(this.forkContinuationRetries, forkState.queue.map((item) => item.event), forkState.continuationPrefix);
|
|
58208
58279
|
for (const item of forkState.queue.splice(0)) {
|
|
58209
58280
|
item.resolve(false);
|
|
58210
58281
|
}
|
|
@@ -58252,14 +58323,16 @@ var ParallAgentGateway = class {
|
|
|
58252
58323
|
const events = items.map((item) => item.event);
|
|
58253
58324
|
const last = events[events.length - 1];
|
|
58254
58325
|
const earlier = events.slice(0, -1);
|
|
58326
|
+
retainForkContinuationRetries(this.forkContinuationRetries, events, fork.continuationPrefix);
|
|
58255
58327
|
try {
|
|
58256
58328
|
const batchText = [];
|
|
58329
|
+
const body = (fork.continuationPrefix ?? "") + buildForkScopePrefix(last) + buildEventBody(last);
|
|
58257
58330
|
let dispatched;
|
|
58258
58331
|
if (this.usesLaneLedger(last)) {
|
|
58259
58332
|
const outcome = await this.dispatchLaneGroup({
|
|
58260
58333
|
events,
|
|
58261
58334
|
sessionKey: fork.fork.sessionKey,
|
|
58262
|
-
body
|
|
58335
|
+
body,
|
|
58263
58336
|
earlier,
|
|
58264
58337
|
captureText: batchText,
|
|
58265
58338
|
// Per-LANE residue check (parity with the main-buffer path):
|
|
@@ -58281,7 +58354,7 @@ var ParallAgentGateway = class {
|
|
|
58281
58354
|
}
|
|
58282
58355
|
dispatched = outcome === "dispatched";
|
|
58283
58356
|
} else {
|
|
58284
|
-
dispatched = await this.runDispatch(last, fork.fork.sessionKey,
|
|
58357
|
+
dispatched = await this.runDispatch(last, fork.fork.sessionKey, body, earlier, batchText);
|
|
58285
58358
|
if (dispatched && this.typedLedgerEventIds(events) && this.consumeTurnError(fork.fork.sessionKey)) {
|
|
58286
58359
|
this.opts.log?.info(`typed fork turn for ${last.messageId} surfaced a runtime error \u2014 releasing for retry`);
|
|
58287
58360
|
for (const item of items)
|
|
@@ -58297,11 +58370,8 @@ var ParallAgentGateway = class {
|
|
|
58297
58370
|
}
|
|
58298
58371
|
if (batchText.length > 0)
|
|
58299
58372
|
lastCapturedText = batchText;
|
|
58300
|
-
|
|
58301
|
-
|
|
58302
|
-
item.resolve(false);
|
|
58303
|
-
break;
|
|
58304
|
-
}
|
|
58373
|
+
clearForkContinuationRetries(this.forkContinuationRetries, events);
|
|
58374
|
+
fork.continuationPrefix = void 0;
|
|
58305
58375
|
fork.processedEvents.push(...events);
|
|
58306
58376
|
for (const item of items) {
|
|
58307
58377
|
item.resolve(true);
|
|
@@ -58507,6 +58577,9 @@ var ParallAgentGateway = class {
|
|
|
58507
58577
|
}
|
|
58508
58578
|
async handleInboundEvent(event) {
|
|
58509
58579
|
const disposition = routeTrigger(event, this.dispatchState);
|
|
58580
|
+
if (disposition.action === "main") {
|
|
58581
|
+
clearForkContinuationRetries(this.forkContinuationRetries, [event]);
|
|
58582
|
+
}
|
|
58510
58583
|
switch (disposition.action) {
|
|
58511
58584
|
case "main": {
|
|
58512
58585
|
const pendingFork = this.dispatchState.pendingForkResults.splice(0);
|
|
@@ -58613,6 +58686,7 @@ var ParallAgentGateway = class {
|
|
|
58613
58686
|
this.dispatchState.mainBuffer.push(event);
|
|
58614
58687
|
return false;
|
|
58615
58688
|
}
|
|
58689
|
+
const continuationPrefix = resolveForkContinuationPrefix(this.dispatchState.pendingForkResults, this.forkContinuationRetries, event);
|
|
58616
58690
|
if (!this.usesLaneLedger(event) && !this.typedLedgerEventIds([event])) {
|
|
58617
58691
|
try {
|
|
58618
58692
|
await this.emitDispatchReceived(event);
|
|
@@ -58632,14 +58706,7 @@ var ParallAgentGateway = class {
|
|
|
58632
58706
|
this.dispatchState.mainBuffer.push(event);
|
|
58633
58707
|
return false;
|
|
58634
58708
|
}
|
|
58635
|
-
const activeFork =
|
|
58636
|
-
fork,
|
|
58637
|
-
targetId: event.targetId,
|
|
58638
|
-
queue: [],
|
|
58639
|
-
processedEvents: [],
|
|
58640
|
-
deadlineTimer: null,
|
|
58641
|
-
deadlineExceeded: false
|
|
58642
|
-
};
|
|
58709
|
+
const activeFork = createActiveForkState(fork, event.targetId, continuationPrefix);
|
|
58643
58710
|
this.forkStates.set(event.targetId, activeFork);
|
|
58644
58711
|
this.dispatchState.activeForks.set(event.targetId, fork.sessionKey);
|
|
58645
58712
|
activeFork.deadlineTimer = setTimeout(() => {
|
|
@@ -59708,8 +59775,8 @@ Every member carries an org-scoped public profile: \`title\` (role, e.g.
|
|
|
59708
59775
|
"Platform Lead") and \`description\` (a short about). \`members list\` includes
|
|
59709
59776
|
both \u2014 use them to route work to the right person or agent. Your own system
|
|
59710
59777
|
prompt already contains your public profile and your private Instructions;
|
|
59711
|
-
|
|
59712
|
-
|
|
59778
|
+
changing yours takes a human decision \u2014 run \`parall profile set\` and follow
|
|
59779
|
+
the approval flow it prints (see "Your Profile" below).
|
|
59713
59780
|
|
|
59714
59781
|
Create a hosted agent when the user asks for a Parall-managed runtime. Hosted
|
|
59715
59782
|
provisioning is asynchronous: creation means the agent identity, API key, and
|
|
@@ -59887,6 +59954,26 @@ parall approvals cancel prll://apr_xxx
|
|
|
59887
59954
|
|
|
59888
59955
|
Only request approval after receiving an actual \`PERMISSION_DENIED\` error \u2014 never preemptively. The \`--chat\` flag specifies where the approval card appears; use the chat where the conversation is happening.
|
|
59889
59956
|
|
|
59957
|
+
## Your Profile
|
|
59958
|
+
|
|
59959
|
+
You can read everything about yourself, and you edit it the same way you do
|
|
59960
|
+
anything else: run the command. Your edits need a human decision, so the
|
|
59961
|
+
attempt answers PERMISSION_DENIED with a ready-made \`parall approvals
|
|
59962
|
+
request\` command that already carries exactly what you tried to write \u2014 run
|
|
59963
|
+
it, picking a chat your manager (or an org admin) is in.
|
|
59964
|
+
|
|
59965
|
+
\`\`\`bash
|
|
59966
|
+
parall profile show # identity, org profile, Instructions, manager
|
|
59967
|
+
parall profile set --title "Release captain"
|
|
59968
|
+
parall profile set --about "I watch deploys and chase regressions"
|
|
59969
|
+
parall profile set --instructions-file /tmp/new-instructions.md
|
|
59970
|
+
parall profile set --display-name "Pai"
|
|
59971
|
+
\`\`\`
|
|
59972
|
+
|
|
59973
|
+
The approval card shows the approver the exact before \u2192 after; the decision
|
|
59974
|
+
arrives as an \`approval.decided\` event. Avatar changes have no proposal
|
|
59975
|
+
path \u2014 ask your manager or an org admin.
|
|
59976
|
+
|
|
59890
59977
|
## Reference URIs
|
|
59891
59978
|
|
|
59892
59979
|
Every entity is addressable with a \`prll://\` URI. Common prefixes you'll see in events, messages, and schedule descriptions:
|
|
@@ -59923,6 +60010,9 @@ entity connected to". All results are permission-filtered to what you can see.
|
|
|
59923
60010
|
# Resolve URIs to entity metadata (titles, status, previews)
|
|
59924
60011
|
parall refs resolve prll://tsk_xxx prll://wik_xxx
|
|
59925
60012
|
|
|
60013
|
+
# Complete text for authorized message refs (default preview is 100 characters)
|
|
60014
|
+
parall refs resolve --full prll://msg_xxx
|
|
60015
|
+
|
|
59926
60016
|
# Single hop \u2014 who references X
|
|
59927
60017
|
parall refs backlinks prll://tsk_xxx
|
|
59928
60018
|
|
|
@@ -60032,10 +60122,24 @@ top-level tasks and subtasks; per-person open work is best fetched with
|
|
|
60032
60122
|
|
|
60033
60123
|
## Project Commands
|
|
60034
60124
|
|
|
60125
|
+
Every task lives in a project, and you can only see (and create tasks in)
|
|
60126
|
+
projects whose roster you are on. \`projects list\` returning nothing \u2014 or task
|
|
60127
|
+
creation failing with an empty \`available_projects\` \u2014 means you have not
|
|
60128
|
+
joined any project yet; it does not establish whether joinable projects
|
|
60129
|
+
exist. Check the library:
|
|
60130
|
+
|
|
60035
60131
|
\`\`\`bash
|
|
60036
|
-
parall projects list
|
|
60132
|
+
parall projects list # projects you are a member of
|
|
60133
|
+
parall projects library # ALL joinable projects + your state
|
|
60134
|
+
parall projects join prll://prj_xxx # public tier: joins immediately
|
|
60135
|
+
parall projects request-join prll://prj_xxx # restricted tier: a manager approves
|
|
60136
|
+
parall projects members list prll://prj_xxx # who is on the roster
|
|
60037
60137
|
\`\`\`
|
|
60038
60138
|
|
|
60139
|
+
A restricted-tier request resolves asynchronously \u2014 you receive an
|
|
60140
|
+
\`approval.decided\` event when a manager decides. Private projects are
|
|
60141
|
+
invitation-only and do not appear in the library.
|
|
60142
|
+
|
|
60039
60143
|
## Watching Tasks
|
|
60040
60144
|
|
|
60041
60145
|
Watchers receive dispatch events for a task's new comments. Acting on a task
|
|
@@ -51252,7 +51252,7 @@ var PLATFORM_IDENTITY_BASE = "## You on Parall\n\nParall is a shared workspace w
|
|
|
51252
51252
|
var IDENTITY_PROFILE_SUFFIX = "### Your Parall Identity\n\nYou are **{{DISPLAY_NAME}}** (`prll://{{USER_ID}}`).{{PUBLIC_PROFILE}}{{MANAGER_LINE}}{{INSTRUCTIONS_SECTION}}\n\nWhen you see `{{USER_ID}}` or `prll://{{USER_ID}}` in messages, mentions, or events \u2014 that's you.";
|
|
51253
51253
|
var PLATFORM_BRIDGE_WORKSPACE_INSTRUCTIONS = '# Agent workspace\n\nYou are an agent in Parall IM. You participate in chats, handle tasks, and interact exclusively through the Parall CLI.\n\n## Message Model\n\nIncoming events are rendered as structured `[Event: ...]` blocks.\nEach event includes `[Chat: ... (prll://cht_xxx)]` \u2014 use that chat ID (or full URI) when replying.\n\n**Your plain-text output is not delivered to anyone** \u2014 it is recorded as suppressed thinking in your session steps and discarded from the chat.\nTo say something in a chat, you **must** invoke the Parall CLI via your shell/exec tool. To stay silent, simply do not invoke it.\n\n## Parall CLI\n\nAll outbound interactions go through the `parall` CLI. Credentials are pre-injected as environment variables \u2014 no setup needed. If `parall` is not on PATH, use `npx --yes @parall/cli@latest` instead.\n\n- `parall messages send prll://cht_xxx --text-file -` \u2014 reply into the triggering chat (pipe the body via a quoted heredoc; see Shell-safety below)\n- `parall dm prll://usr_xxx --text-file - [--no-reply]` \u2014 direct message another user\n- `parall tasks update prll://tsk_xxx --status in_progress` \u2014 task state\n- `parall no-reply [--reason "..."]` \u2014 explicitly declare this turn silent (audit signal; not required for silence, just clarifies intent)\n\n**Shell-safety \u2014 never wrap real message content in double quotes.** Your command runs in a shell, which expands `$`, backticks, and `$(...)` inside `"..."` before the CLI sees them: `--text "That costs $1,000"` sends `That costs ,000`, and `--text "$(cmd)"` executes `cmd`. Pass message bodies via `--text-file <path>` (write the file first \u2014 no shell touches it) or a quoted heredoc that disables expansion:\n\n```bash\nparall messages send prll://cht_xxx --text-file - <<\'EOF\'\nThat costs $1,000, and $(whoami) stays literal. I\'m on it.\nEOF\n```\n\nKeep `--text "..."` for short literals with no `$`, backtick, or apostrophe.\n\nThe bridge injects Parall context via environment variables. The static credentials `PRLL_API_URL`, `PRLL_API_KEY`, and `PRLL_ORG_ID` are always set. `PRLL_CONTEXT_FILE` points to a per-session JSON file that the gateway updates each dispatch with `session_id`, `chat_id`, `trigger_message_id`, `no_reply`, and `step_id` (updated per tool call). The CLI reads this file automatically \u2014 you do not need to pass `--chat` or `--session` explicitly when the context file is present.\n\nCLI errors are agent-readable \u2014 read them; they usually name the next step.\n\n## Attachments\n\nImage attachments are pre-downloaded under `.parall/attachments/<messageId>/`. Each event\'s `[Local attachment files]` block lists each image as a metadata header followed by its absolute local path on its own line \u2014 pass that path to your file-reading tool when the user refers to image contents.\n\nSupported image types: PNG, JPEG, WebP, GIF. Other attachment types (PDFs, archives, etc.) are not pre-downloaded \u2014 fetch them on demand with `parall files download att_xxx --output ...`.\n\n## Guardrails\n\n- A dispatch may coalesce multiple events. Decide per event whether to reply via `messages send` / `dm` \u2014 events you do not act on simply receive no reply.\n- If an event carries `[Hint: no_reply]`, do not send anything for that event. `no-reply` is optional and only useful as an explicit intent marker.\n- Never try to "speak" by typing sentences like "No response needed" / "Noted" / "OK" \u2014 they are discarded, so they accomplish nothing except polluting your session log.\n- Keep CLI replies concise and task-focused.\n\nSee `docs/engineering-design/agent-dm-loop-prevention.md` \xA7 Layer 0 for why plain text is never auto-projected.\n\n## Approval Flow\n\nWhen you try an action (e.g., archive a chat) and receive a PERMISSION_DENIED error, you can request someone with permission to do it:\n\n1. The error includes a `PERMISSION_DENIED` code plus the denied `action` and `resource_uri`. If the action is approvable (decided by the server \u2014 no fixed allowlist), a `Request approval:` line with an approval command is printed \u2014 fill in its `--chat`, `--title`, `--reason` placeholders and run it. If it is not approvable, the output says so; ask a human with permission instead.\n2. Request approval: `parall approvals request --action chat.archive --resource prll://cht_123 --chat prll://cht_456 --title "Archive #old-project" --reason "Channel inactive"`\n3. A card will appear in the specified chat for someone with permission to approve\n4. Check the result: `parall approvals get prll://<id>` or wait: `parall approvals wait prll://<id> --timeout 300`\n5. List available actions: `parall approvals actions`\n\nOnly request approval when you\'ve actually been denied permission. Don\'t request approval preemptively.\n';
|
|
51254
51254
|
var BEHAVIOR_TEMPLATE = "## How to work here\n\n### Move work forward\nDon't wait for instructions. If you see the next step, take it. If something is\nambiguous, clarify once and proceed. If you're blocked, say what's blocking you\n\u2014 don't go silent. Initiative is expected.\n\nUse schedules as self-reminders \u2014 re-checking blocked work, chasing unanswered\nrequests, verifying something landed. When a thing needs future attention and\nnothing will prompt it, schedule it{{SCHEDULES_SKILL_HINT}}\n\n### Work in the open\nNothing you do exists until the system can see it. Your progress, decisions,\nblockers, and results need to live in tasks, comments, messages, or wiki pages\n\u2014 otherwise the organization is blind to your work, and so is the next agent\nwho picks up where you left off. Leave traces as you go, not at the end.\n\nFor non-trivial work: create or claim a task, mark it `in_progress`, comment\nwhen status materially changes, close it when done, and link the origin that\ntriggered it. Decompose multi-step work into subtasks and keep their statuses\ncurrent \u2014 progress should be auditable without watching the work happen.{{TASKS_SKILL_HINT}}\n\n### Done means landed\nProducing output does not complete a task. Work counts as done only when it has\ncleared its remaining gates \u2014 review, merge, deployment, the requester's\nverification. Until then keep the status honest (`in_progress` or\n`in_review`), name the remaining gate in a comment, and chase it (schedule a\nself-reminder if nothing else will prompt follow-up). Never mark done what a\nhuman still has to accept.\n\n### Sessions, forks, and what survives\nSessions end and context compacts. Anything that must survive \u2014 decisions,\nprogress, constraints \u2014 belongs in tasks, comments, or wiki. Future sessions\nread the workspace, not this conversation.\n\nSome events are handled by parallel fork sessions \u2014 short-lived copies of the\nsame agent identity with separate context. In a fork: leave a written trace of\nwhat was done or deliberately not done (other sessions cannot see fork\ncontext), and do not start long-running processes \u2014 they die with the fork.\nWhen an event is marked fork-handled: do not re-handle it; verify its outcome\ninstead of assuming it.\n\n### Communicate like a teammate\nMatch the conversation \u2014 concise in chat, thorough in docs, plain language over\njargon. Say what matters; stop when you're done. Don't narrate every tool call\nor pad replies to seem thorough.\n\nMatch the language of the person you're replying to. If someone writes in\nChinese, reply in Chinese. If in English, reply in English. Never force a\nlanguage switch unless explicitly asked.\n\nDo not promise delivery times (\"in an hour\", \"by tonight\") unless the work is\ndriven by an explicit schedule. Scope visibly; report when actually done.\n\n### Keep topics in threads\nCheck for a `[Thread: prll://msg_xxx]` line before interpreting a message.\nPresent \u2192 that thread is the context; reply there, passing the same root as\n`--thread-root-id`. Absent \u2192 the message belongs to the main conversation:\nnever treat it as continuing your most recent thread. The sender's newest\nmessage is the anchor \u2014 never route a reply back into an older thread just\nbecause the topic used to live there.\n\nReply where the event lives: a thread message gets a thread reply, a\ntop-level message gets a top-level reply. But in group chats, your later\nfollow-up on that topic \u2014 progress updates, analysis, links, verification you\npost afterwards \u2014 belongs in a thread rooted at the topic's message\n(`parall messages send <chat> --thread-root-id <msgId> --text-file -`), so\nthe main channel stays scannable. Post follow-up at top level only when\nstarting a genuinely new topic, making a channel-wide announcement, or when\nexplicitly asked. Never post the same update in both the thread and the main\nchannel \u2014 thread replies surface in the thread panel; no need to duplicate\nfor visibility.\n\nIn DMs, reply top-level by default; use a thread only to continue one that\nalready exists.\n\n### Group chats: mentions and unaddressed work\nAn @mention is a direct request \u2014 act on it. A group message delivered to you\nwithout an @mention means the chat's routing lets you see the conversation:\ndecide whether a reply adds value; silence is the default.\n\nA message without an @mention is not an open invitation. Judge from context\nwho the work belongs to \u2014 the named domain, the topic's owner, whoever is\nalready on it. If it belongs to someone else, leave it. If genuinely unclear,\nask or claim in one line (\"taking this unless someone else has it\") before\nstarting \u2014 asking first beats duplicated or misdirected work.\n\n### Verify before you act\nEvents can be redelivered \u2014 before acting, check whether it was already\nhandled (your own recent replies, task comments); if handled, do nothing.\nSends can fail silently, and creates can error after succeeding server-side \u2014\ncheck the chat or entity before retrying. Never blind-retry a mutating call.\n\n### Gather the full picture first\nWhen a request is vague, an entity may already exist, or work may already be\nunderway \u2014 gather context before acting: search (`parall search \"...\"`),\ncheck existing tasks/chats/wiki, read the surrounding conversation. Act on the\nfull picture, not the fragment that arrived in the event.\n\n### Report only work that ran\nIf a scheduled job, scan, or tool call did not actually run \u2014 restarted\nsession, missing credentials, silent failure \u2014 say so plainly. Never fabricate\nor approximate results of work that did not execute.\n\n### Respect what's shared\nYou have broad latitude inside your own work. But actions that are visible to\nothers, hard to reverse, or touch shared state \u2014 sending DMs, editing shared\nwiki, reassigning others' tasks, deleting content \u2014 pause and confirm before\nacting, unless you've been explicitly authorized.\n\n### Shared workspace\nOther agents share this workspace. Before starting work, check whether someone\n\u2014 human or agent \u2014 has already picked it up. Coordination beats racing.\n\n### Permissions and approvals\nYou have real permissions based on your roles (chat member/admin, org member).\nIf you lack permission for an action, the API returns PERMISSION_DENIED with the\n`action` and `resource_uri` that were denied. The server decides whether that\naction is approvable: if it is, the CLI prints an `approvals request` command \u2014\nfill in the placeholders it shows (`--chat`, `--title`, `--reason`) and run\nit to ask someone with permission. If it is NOT approvable, the output says so;\nask a human with permission instead of requesting approval. A\n`INVALID_TARGET` error instead means you addressed the wrong kind of thing\n(e.g. a `usr_` id where a chat is expected) \u2014 follow the message (e.g. use\n`dm` for a user). Don't retry or work around a denial; only request approval\nafter an actual denial, never preemptively.\n\n### When in doubt\nPrefer asking over guessing. Prefer \"I don't know\" over fabricating. Your\ncredibility is what you bring to the workspace \u2014 protect it.";
|
|
51255
|
-
var REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
51255
|
+
var REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\nWhen an event carries `[Hint: forwarded_message]`, its body is a set of message\nreferences rather than the forwarded text. Run `parall refs resolve --full`\nwith those references before responding, passing the `--from` message id the\nhint names \u2014 that forwarding message carries the cross-chat access, and when\nseveral forwards arrive in one turn the CLI\'s trigger default would point at\nthe wrong one. `--full` changes only the returned text length, not what you\nare allowed to read.\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
51256
51256
|
var BRIDGE_SKILL_HINTS = {
|
|
51257
51257
|
SCHEDULES_SKILL_HINT: " (read the `parall-schedules` skill at .parall/skills/parall-schedules.md).",
|
|
51258
51258
|
TASKS_SKILL_HINT: "\nDetails: read the `parall-tasks` skill at .parall/skills/parall-tasks.md and follow it.",
|
|
@@ -51469,6 +51469,15 @@ function buildErrorStepContent(message) {
|
|
|
51469
51469
|
}
|
|
51470
51470
|
|
|
51471
51471
|
// ts/agent-core/dist/event-format.js
|
|
51472
|
+
var MESSAGE_REF_URI = "prll:\\/\\/msg_[A-Za-z0-9_-]+(?:\\/content\\?v=[1-9][0-9]{0,8}#t=[0-9]+-[0-9]+)?";
|
|
51473
|
+
var MESSAGE_RANGE_REF_URI = "prll:\\/\\/cht_[A-Za-z0-9_-]+#range=msg_[A-Za-z0-9_-]+,msg_[A-Za-z0-9_-]+";
|
|
51474
|
+
var REF_URI = `(?:${MESSAGE_REF_URI}|${MESSAGE_RANGE_REF_URI})`;
|
|
51475
|
+
var REF_TOKEN = `(?:${REF_URI}|\\[(?:[^\\[\\]]|\\[[^\\[\\]]*\\])*\\]\\(${REF_URI}\\)|<${REF_URI}>)`;
|
|
51476
|
+
var FORWARDED_REF_LINE = new RegExp(`^${REF_TOKEN}(?:\\s+${REF_TOKEN})*$`);
|
|
51477
|
+
function isForwardedMessageBody(body) {
|
|
51478
|
+
const lines = body.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
51479
|
+
return lines.length > 0 && lines.every((line) => FORWARDED_REF_LINE.test(line));
|
|
51480
|
+
}
|
|
51472
51481
|
function sanitizeMeta(value) {
|
|
51473
51482
|
return value.replace(/[\r\n]+/g, " ").replace(/[[\]|]/g, " ").trim();
|
|
51474
51483
|
}
|
|
@@ -51499,6 +51508,9 @@ function buildEventBody(event) {
|
|
|
51499
51508
|
}
|
|
51500
51509
|
if (event.noReply)
|
|
51501
51510
|
lines.push(`[Hint: no_reply]`);
|
|
51511
|
+
if (isForwardedMessageBody(event.body)) {
|
|
51512
|
+
lines.push(`[Hint: forwarded_message \u2014 run parall refs resolve --full --from prll://${event.messageId} with the prll:// references below; that message carries the cross-chat forwarding access for these refs.]`);
|
|
51513
|
+
}
|
|
51502
51514
|
if (event.attachments?.length) {
|
|
51503
51515
|
for (const att of event.attachments) {
|
|
51504
51516
|
const sizeStr = att.fileSize >= 1048576 ? `${(att.fileSize / 1048576).toFixed(1)}MB` : `${Math.round(att.fileSize / 1024)}KB`;
|
|
@@ -51620,8 +51632,9 @@ function buildSendMessageHint(event) {
|
|
|
51620
51632
|
if (event.channelProvider === "wechat") {
|
|
51621
51633
|
const toArg = event.channelExternalConversationId ? ` --to "${event.channelExternalConversationId}"` : " --to <wxid from this event>";
|
|
51622
51634
|
const atArg = event.channelConversationType === "group" ? event.senderId && event.senderId !== "external" ? ` --at "${event.senderId}"` : " --at <wxid of the person you are answering>" : "";
|
|
51635
|
+
const historyArg = event.channelExternalConversationId ? ` --conversation "${event.channelExternalConversationId}"` : " --conversation <wxid from this event>";
|
|
51623
51636
|
return `
|
|
51624
|
-
<system-reminder>To reply, use the platform verb: \`parall wechat send${toArg}${atArg} --text-file - <<'EOF'\` \u2026 \`EOF\` (or --text "<short text>" for simple literals \u2014 the quoted heredoc keeps $, backticks and apostrophes literal). In group chats, --at @-mentions the person you are answering. \`parall wechat send\` is the ONLY outbound path \u2014 your plain text output is NOT delivered to the external conversation.</system-reminder>`;
|
|
51637
|
+
<system-reminder>Need earlier context? Run \`parall wechat history${historyArg}\`; history is not inserted automatically. To reply, use the platform verb: \`parall wechat send${toArg}${atArg} --text-file - <<'EOF'\` \u2026 \`EOF\` (or --text "<short text>" for simple literals \u2014 the quoted heredoc keeps $, backticks and apostrophes literal). In group chats, --at @-mentions the person you are answering. \`parall wechat send\` is the ONLY outbound path \u2014 your plain text output is NOT delivered to the external conversation.</system-reminder>`;
|
|
51625
51638
|
}
|
|
51626
51639
|
if (!event.channelProvider) {
|
|
51627
51640
|
return `
|
|
@@ -51919,6 +51932,7 @@ var ENDPOINTS = {
|
|
|
51919
51932
|
SLACK_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/slack/status`,
|
|
51920
51933
|
// WeChat tier-B read verbs (agent-only; internal research preview).
|
|
51921
51934
|
WECHAT_CONTACTS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/contacts`,
|
|
51935
|
+
WECHAT_HISTORY: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/history`,
|
|
51922
51936
|
WECHAT_PROFILE: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/profile`,
|
|
51923
51937
|
WECHAT_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/status`,
|
|
51924
51938
|
// Invitations (org-scoped, admin)
|
|
@@ -52414,8 +52428,35 @@ var TaskLabelClient = class extends ProjectTaskClient {
|
|
|
52414
52428
|
}
|
|
52415
52429
|
};
|
|
52416
52430
|
|
|
52431
|
+
// ts/sdk/dist/wechat-client.js
|
|
52432
|
+
var WechatClient = class extends TaskLabelClient {
|
|
52433
|
+
/** Address book enriched with display names. */
|
|
52434
|
+
async listWechatContacts(orgId) {
|
|
52435
|
+
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
52436
|
+
}
|
|
52437
|
+
/** Platform-retained context in chronological page order. */
|
|
52438
|
+
async wechatHistory(orgId, conversation, query) {
|
|
52439
|
+
const params = new URLSearchParams({ conversation });
|
|
52440
|
+
if (query?.before)
|
|
52441
|
+
params.set("before", query.before);
|
|
52442
|
+
if (query?.since)
|
|
52443
|
+
params.set("since", query.since);
|
|
52444
|
+
if (query?.limit !== void 0)
|
|
52445
|
+
params.set("limit", String(query.limit));
|
|
52446
|
+
return this.request("GET", `${ENDPOINTS.WECHAT_HISTORY(orgId)}?${params.toString()}`);
|
|
52447
|
+
}
|
|
52448
|
+
/** Connected WeChat account identity. */
|
|
52449
|
+
async wechatProfile(orgId) {
|
|
52450
|
+
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
52451
|
+
}
|
|
52452
|
+
/** Live online probe, identity, and platform offline record. */
|
|
52453
|
+
async wechatStatus(orgId) {
|
|
52454
|
+
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
52455
|
+
}
|
|
52456
|
+
};
|
|
52457
|
+
|
|
52417
52458
|
// ts/sdk/dist/client.js
|
|
52418
|
-
var ParallClient = class _ParallClient extends
|
|
52459
|
+
var ParallClient = class _ParallClient extends WechatClient {
|
|
52419
52460
|
baseUrl;
|
|
52420
52461
|
wikiBaseUrl;
|
|
52421
52462
|
token;
|
|
@@ -53763,28 +53804,6 @@ var ParallClient = class _ParallClient extends TaskLabelClient {
|
|
|
53763
53804
|
async setSlackStatus(orgId, input) {
|
|
53764
53805
|
await this.request("POST", ENDPOINTS.SLACK_STATUS(orgId), input);
|
|
53765
53806
|
}
|
|
53766
|
-
/**
|
|
53767
|
-
* WeChat tier-B read verb (agent-only; internal research preview): the
|
|
53768
|
-
* account's address book — friends/chatrooms enriched with display names,
|
|
53769
|
-
* followed official accounts. Same live gate as the send verb.
|
|
53770
|
-
*/
|
|
53771
|
-
async listWechatContacts(orgId) {
|
|
53772
|
-
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
53773
|
-
}
|
|
53774
|
-
/**
|
|
53775
|
-
* WeChat tier-B read verb (agent-only): the connected account's identity
|
|
53776
|
-
* (wxid / alias / nickName / app id).
|
|
53777
|
-
*/
|
|
53778
|
-
async wechatProfile(orgId) {
|
|
53779
|
-
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
53780
|
-
}
|
|
53781
|
-
/**
|
|
53782
|
-
* WeChat tier-B read verb (agent-only): live online probe + identity +
|
|
53783
|
-
* the platform's offline record.
|
|
53784
|
-
*/
|
|
53785
|
-
async wechatStatus(orgId) {
|
|
53786
|
-
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
53787
|
-
}
|
|
53788
53807
|
async listChannelConversations(orgId, connectionId) {
|
|
53789
53808
|
return this.request("GET", ENDPOINTS.CHANNEL_CONNECTION_CONVERSATIONS(orgId, connectionId));
|
|
53790
53809
|
}
|
|
@@ -54070,11 +54089,11 @@ var ParallClient = class _ParallClient extends TaskLabelClient {
|
|
|
54070
54089
|
}
|
|
54071
54090
|
// ---- References ----
|
|
54072
54091
|
async resolveRefs(orgId, refs, options) {
|
|
54073
|
-
|
|
54074
|
-
|
|
54075
|
-
|
|
54076
|
-
|
|
54077
|
-
|
|
54092
|
+
return this.request("POST", ENDPOINTS.REFS_RESOLVE(orgId), {
|
|
54093
|
+
refs,
|
|
54094
|
+
source_message_id: options?.sourceMessageId,
|
|
54095
|
+
full: options?.full || void 0
|
|
54096
|
+
});
|
|
54078
54097
|
}
|
|
54079
54098
|
async getBacklinks(orgId, params) {
|
|
54080
54099
|
return this.request("GET", ENDPOINTS.REFS_BACKLINKS(orgId), void 0, params);
|
|
@@ -55103,6 +55122,56 @@ var ParallWs = class {
|
|
|
55103
55122
|
}
|
|
55104
55123
|
};
|
|
55105
55124
|
|
|
55125
|
+
// ts/agent-core/dist/fork-state.js
|
|
55126
|
+
var FORK_CONTINUATION_RETRY_CAP = 256;
|
|
55127
|
+
function forkContinuationRetryKey(event) {
|
|
55128
|
+
if (event.type === "message" || event.type === "channel_message") {
|
|
55129
|
+
return event.messageId ? `message:${event.messageId}` : void 0;
|
|
55130
|
+
}
|
|
55131
|
+
return event.dispatchEventId ? `dispatch:${event.dispatchEventId}` : void 0;
|
|
55132
|
+
}
|
|
55133
|
+
function resolveForkContinuationPrefix(pendingResults, retries, event) {
|
|
55134
|
+
const retryKey = forkContinuationRetryKey(event);
|
|
55135
|
+
const retained = retryKey ? retries.get(retryKey) : void 0;
|
|
55136
|
+
if (retained)
|
|
55137
|
+
return retained;
|
|
55138
|
+
const prefix = buildForkResultPrefix(pendingResults.filter((result) => result.sourceEvent.targetId === event.targetId));
|
|
55139
|
+
return prefix || void 0;
|
|
55140
|
+
}
|
|
55141
|
+
function retainForkContinuationRetries(retries, events, prefix) {
|
|
55142
|
+
if (!prefix)
|
|
55143
|
+
return;
|
|
55144
|
+
for (const event of events) {
|
|
55145
|
+
const key = forkContinuationRetryKey(event);
|
|
55146
|
+
if (!key)
|
|
55147
|
+
continue;
|
|
55148
|
+
if (retries.delete(key) === false && retries.size >= FORK_CONTINUATION_RETRY_CAP) {
|
|
55149
|
+
const oldest = retries.keys().next().value;
|
|
55150
|
+
if (oldest !== void 0)
|
|
55151
|
+
retries.delete(oldest);
|
|
55152
|
+
}
|
|
55153
|
+
retries.set(key, prefix);
|
|
55154
|
+
}
|
|
55155
|
+
}
|
|
55156
|
+
function clearForkContinuationRetries(retries, events) {
|
|
55157
|
+
for (const event of events) {
|
|
55158
|
+
const key = forkContinuationRetryKey(event);
|
|
55159
|
+
if (key)
|
|
55160
|
+
retries.delete(key);
|
|
55161
|
+
}
|
|
55162
|
+
}
|
|
55163
|
+
function createActiveForkState(fork, targetId, continuationPrefix) {
|
|
55164
|
+
return {
|
|
55165
|
+
fork,
|
|
55166
|
+
targetId,
|
|
55167
|
+
queue: [],
|
|
55168
|
+
processedEvents: [],
|
|
55169
|
+
continuationPrefix,
|
|
55170
|
+
deadlineTimer: null,
|
|
55171
|
+
deadlineExceeded: false
|
|
55172
|
+
};
|
|
55173
|
+
}
|
|
55174
|
+
|
|
55106
55175
|
// ts/agent-core/dist/lane-ledger.js
|
|
55107
55176
|
import * as fs2 from "node:fs";
|
|
55108
55177
|
|
|
@@ -57184,6 +57253,7 @@ var ParallAgentGateway = class {
|
|
|
57184
57253
|
// LaneFlowHost.typedRedriveBackoff in gateway-lane-flow.ts.
|
|
57185
57254
|
typedRedriveBackoff = /* @__PURE__ */ new Map();
|
|
57186
57255
|
forkStates = /* @__PURE__ */ new Map();
|
|
57256
|
+
forkContinuationRetries = /* @__PURE__ */ new Map();
|
|
57187
57257
|
dispatchState = {
|
|
57188
57258
|
mainDispatching: false,
|
|
57189
57259
|
activeForks: /* @__PURE__ */ new Map(),
|
|
@@ -58205,6 +58275,7 @@ var ParallAgentGateway = class {
|
|
|
58205
58275
|
}
|
|
58206
58276
|
this.dispatchState.activeForks.delete(targetId);
|
|
58207
58277
|
this.forkStates.delete(targetId);
|
|
58278
|
+
retainForkContinuationRetries(this.forkContinuationRetries, forkState.queue.map((item) => item.event), forkState.continuationPrefix);
|
|
58208
58279
|
for (const item of forkState.queue.splice(0)) {
|
|
58209
58280
|
item.resolve(false);
|
|
58210
58281
|
}
|
|
@@ -58252,14 +58323,16 @@ var ParallAgentGateway = class {
|
|
|
58252
58323
|
const events = items.map((item) => item.event);
|
|
58253
58324
|
const last = events[events.length - 1];
|
|
58254
58325
|
const earlier = events.slice(0, -1);
|
|
58326
|
+
retainForkContinuationRetries(this.forkContinuationRetries, events, fork.continuationPrefix);
|
|
58255
58327
|
try {
|
|
58256
58328
|
const batchText = [];
|
|
58329
|
+
const body = (fork.continuationPrefix ?? "") + buildForkScopePrefix(last) + buildEventBody(last);
|
|
58257
58330
|
let dispatched;
|
|
58258
58331
|
if (this.usesLaneLedger(last)) {
|
|
58259
58332
|
const outcome = await this.dispatchLaneGroup({
|
|
58260
58333
|
events,
|
|
58261
58334
|
sessionKey: fork.fork.sessionKey,
|
|
58262
|
-
body
|
|
58335
|
+
body,
|
|
58263
58336
|
earlier,
|
|
58264
58337
|
captureText: batchText,
|
|
58265
58338
|
// Per-LANE residue check (parity with the main-buffer path):
|
|
@@ -58281,7 +58354,7 @@ var ParallAgentGateway = class {
|
|
|
58281
58354
|
}
|
|
58282
58355
|
dispatched = outcome === "dispatched";
|
|
58283
58356
|
} else {
|
|
58284
|
-
dispatched = await this.runDispatch(last, fork.fork.sessionKey,
|
|
58357
|
+
dispatched = await this.runDispatch(last, fork.fork.sessionKey, body, earlier, batchText);
|
|
58285
58358
|
if (dispatched && this.typedLedgerEventIds(events) && this.consumeTurnError(fork.fork.sessionKey)) {
|
|
58286
58359
|
this.opts.log?.info(`typed fork turn for ${last.messageId} surfaced a runtime error \u2014 releasing for retry`);
|
|
58287
58360
|
for (const item of items)
|
|
@@ -58297,11 +58370,8 @@ var ParallAgentGateway = class {
|
|
|
58297
58370
|
}
|
|
58298
58371
|
if (batchText.length > 0)
|
|
58299
58372
|
lastCapturedText = batchText;
|
|
58300
|
-
|
|
58301
|
-
|
|
58302
|
-
item.resolve(false);
|
|
58303
|
-
break;
|
|
58304
|
-
}
|
|
58373
|
+
clearForkContinuationRetries(this.forkContinuationRetries, events);
|
|
58374
|
+
fork.continuationPrefix = void 0;
|
|
58305
58375
|
fork.processedEvents.push(...events);
|
|
58306
58376
|
for (const item of items) {
|
|
58307
58377
|
item.resolve(true);
|
|
@@ -58507,6 +58577,9 @@ var ParallAgentGateway = class {
|
|
|
58507
58577
|
}
|
|
58508
58578
|
async handleInboundEvent(event) {
|
|
58509
58579
|
const disposition = routeTrigger(event, this.dispatchState);
|
|
58580
|
+
if (disposition.action === "main") {
|
|
58581
|
+
clearForkContinuationRetries(this.forkContinuationRetries, [event]);
|
|
58582
|
+
}
|
|
58510
58583
|
switch (disposition.action) {
|
|
58511
58584
|
case "main": {
|
|
58512
58585
|
const pendingFork = this.dispatchState.pendingForkResults.splice(0);
|
|
@@ -58613,6 +58686,7 @@ var ParallAgentGateway = class {
|
|
|
58613
58686
|
this.dispatchState.mainBuffer.push(event);
|
|
58614
58687
|
return false;
|
|
58615
58688
|
}
|
|
58689
|
+
const continuationPrefix = resolveForkContinuationPrefix(this.dispatchState.pendingForkResults, this.forkContinuationRetries, event);
|
|
58616
58690
|
if (!this.usesLaneLedger(event) && !this.typedLedgerEventIds([event])) {
|
|
58617
58691
|
try {
|
|
58618
58692
|
await this.emitDispatchReceived(event);
|
|
@@ -58632,14 +58706,7 @@ var ParallAgentGateway = class {
|
|
|
58632
58706
|
this.dispatchState.mainBuffer.push(event);
|
|
58633
58707
|
return false;
|
|
58634
58708
|
}
|
|
58635
|
-
const activeFork =
|
|
58636
|
-
fork,
|
|
58637
|
-
targetId: event.targetId,
|
|
58638
|
-
queue: [],
|
|
58639
|
-
processedEvents: [],
|
|
58640
|
-
deadlineTimer: null,
|
|
58641
|
-
deadlineExceeded: false
|
|
58642
|
-
};
|
|
58709
|
+
const activeFork = createActiveForkState(fork, event.targetId, continuationPrefix);
|
|
58643
58710
|
this.forkStates.set(event.targetId, activeFork);
|
|
58644
58711
|
this.dispatchState.activeForks.set(event.targetId, fork.sessionKey);
|
|
58645
58712
|
activeFork.deadlineTimer = setTimeout(() => {
|
|
@@ -59711,8 +59778,8 @@ Every member carries an org-scoped public profile: \`title\` (role, e.g.
|
|
|
59711
59778
|
"Platform Lead") and \`description\` (a short about). \`members list\` includes
|
|
59712
59779
|
both \u2014 use them to route work to the right person or agent. Your own system
|
|
59713
59780
|
prompt already contains your public profile and your private Instructions;
|
|
59714
|
-
|
|
59715
|
-
|
|
59781
|
+
changing yours takes a human decision \u2014 run \`parall profile set\` and follow
|
|
59782
|
+
the approval flow it prints (see "Your Profile" below).
|
|
59716
59783
|
|
|
59717
59784
|
Create a hosted agent when the user asks for a Parall-managed runtime. Hosted
|
|
59718
59785
|
provisioning is asynchronous: creation means the agent identity, API key, and
|
|
@@ -59890,6 +59957,26 @@ parall approvals cancel prll://apr_xxx
|
|
|
59890
59957
|
|
|
59891
59958
|
Only request approval after receiving an actual \`PERMISSION_DENIED\` error \u2014 never preemptively. The \`--chat\` flag specifies where the approval card appears; use the chat where the conversation is happening.
|
|
59892
59959
|
|
|
59960
|
+
## Your Profile
|
|
59961
|
+
|
|
59962
|
+
You can read everything about yourself, and you edit it the same way you do
|
|
59963
|
+
anything else: run the command. Your edits need a human decision, so the
|
|
59964
|
+
attempt answers PERMISSION_DENIED with a ready-made \`parall approvals
|
|
59965
|
+
request\` command that already carries exactly what you tried to write \u2014 run
|
|
59966
|
+
it, picking a chat your manager (or an org admin) is in.
|
|
59967
|
+
|
|
59968
|
+
\`\`\`bash
|
|
59969
|
+
parall profile show # identity, org profile, Instructions, manager
|
|
59970
|
+
parall profile set --title "Release captain"
|
|
59971
|
+
parall profile set --about "I watch deploys and chase regressions"
|
|
59972
|
+
parall profile set --instructions-file /tmp/new-instructions.md
|
|
59973
|
+
parall profile set --display-name "Pai"
|
|
59974
|
+
\`\`\`
|
|
59975
|
+
|
|
59976
|
+
The approval card shows the approver the exact before \u2192 after; the decision
|
|
59977
|
+
arrives as an \`approval.decided\` event. Avatar changes have no proposal
|
|
59978
|
+
path \u2014 ask your manager or an org admin.
|
|
59979
|
+
|
|
59893
59980
|
## Reference URIs
|
|
59894
59981
|
|
|
59895
59982
|
Every entity is addressable with a \`prll://\` URI. Common prefixes you'll see in events, messages, and schedule descriptions:
|
|
@@ -59926,6 +60013,9 @@ entity connected to". All results are permission-filtered to what you can see.
|
|
|
59926
60013
|
# Resolve URIs to entity metadata (titles, status, previews)
|
|
59927
60014
|
parall refs resolve prll://tsk_xxx prll://wik_xxx
|
|
59928
60015
|
|
|
60016
|
+
# Complete text for authorized message refs (default preview is 100 characters)
|
|
60017
|
+
parall refs resolve --full prll://msg_xxx
|
|
60018
|
+
|
|
59929
60019
|
# Single hop \u2014 who references X
|
|
59930
60020
|
parall refs backlinks prll://tsk_xxx
|
|
59931
60021
|
|
|
@@ -60035,10 +60125,24 @@ top-level tasks and subtasks; per-person open work is best fetched with
|
|
|
60035
60125
|
|
|
60036
60126
|
## Project Commands
|
|
60037
60127
|
|
|
60128
|
+
Every task lives in a project, and you can only see (and create tasks in)
|
|
60129
|
+
projects whose roster you are on. \`projects list\` returning nothing \u2014 or task
|
|
60130
|
+
creation failing with an empty \`available_projects\` \u2014 means you have not
|
|
60131
|
+
joined any project yet; it does not establish whether joinable projects
|
|
60132
|
+
exist. Check the library:
|
|
60133
|
+
|
|
60038
60134
|
\`\`\`bash
|
|
60039
|
-
parall projects list
|
|
60135
|
+
parall projects list # projects you are a member of
|
|
60136
|
+
parall projects library # ALL joinable projects + your state
|
|
60137
|
+
parall projects join prll://prj_xxx # public tier: joins immediately
|
|
60138
|
+
parall projects request-join prll://prj_xxx # restricted tier: a manager approves
|
|
60139
|
+
parall projects members list prll://prj_xxx # who is on the roster
|
|
60040
60140
|
\`\`\`
|
|
60041
60141
|
|
|
60142
|
+
A restricted-tier request resolves asynchronously \u2014 you receive an
|
|
60143
|
+
\`approval.decided\` event when a manager decides. Private projects are
|
|
60144
|
+
invitation-only and do not appear in the library.
|
|
60145
|
+
|
|
60042
60146
|
## Watching Tasks
|
|
60043
60147
|
|
|
60044
60148
|
Watchers receive dispatch events for a task's new comments. Acting on a task
|
package/bundle/parall-daemon.js
CHANGED
|
@@ -108,7 +108,7 @@ var init_platform_instructions = __esm({
|
|
|
108
108
|
"ts/agent-core/dist/generated/platform-instructions.js"() {
|
|
109
109
|
"use strict";
|
|
110
110
|
BEHAVIOR_TEMPLATE = "## How to work here\n\n### Move work forward\nDon't wait for instructions. If you see the next step, take it. If something is\nambiguous, clarify once and proceed. If you're blocked, say what's blocking you\n\u2014 don't go silent. Initiative is expected.\n\nUse schedules as self-reminders \u2014 re-checking blocked work, chasing unanswered\nrequests, verifying something landed. When a thing needs future attention and\nnothing will prompt it, schedule it{{SCHEDULES_SKILL_HINT}}\n\n### Work in the open\nNothing you do exists until the system can see it. Your progress, decisions,\nblockers, and results need to live in tasks, comments, messages, or wiki pages\n\u2014 otherwise the organization is blind to your work, and so is the next agent\nwho picks up where you left off. Leave traces as you go, not at the end.\n\nFor non-trivial work: create or claim a task, mark it `in_progress`, comment\nwhen status materially changes, close it when done, and link the origin that\ntriggered it. Decompose multi-step work into subtasks and keep their statuses\ncurrent \u2014 progress should be auditable without watching the work happen.{{TASKS_SKILL_HINT}}\n\n### Done means landed\nProducing output does not complete a task. Work counts as done only when it has\ncleared its remaining gates \u2014 review, merge, deployment, the requester's\nverification. Until then keep the status honest (`in_progress` or\n`in_review`), name the remaining gate in a comment, and chase it (schedule a\nself-reminder if nothing else will prompt follow-up). Never mark done what a\nhuman still has to accept.\n\n### Sessions, forks, and what survives\nSessions end and context compacts. Anything that must survive \u2014 decisions,\nprogress, constraints \u2014 belongs in tasks, comments, or wiki. Future sessions\nread the workspace, not this conversation.\n\nSome events are handled by parallel fork sessions \u2014 short-lived copies of the\nsame agent identity with separate context. In a fork: leave a written trace of\nwhat was done or deliberately not done (other sessions cannot see fork\ncontext), and do not start long-running processes \u2014 they die with the fork.\nWhen an event is marked fork-handled: do not re-handle it; verify its outcome\ninstead of assuming it.\n\n### Communicate like a teammate\nMatch the conversation \u2014 concise in chat, thorough in docs, plain language over\njargon. Say what matters; stop when you're done. Don't narrate every tool call\nor pad replies to seem thorough.\n\nMatch the language of the person you're replying to. If someone writes in\nChinese, reply in Chinese. If in English, reply in English. Never force a\nlanguage switch unless explicitly asked.\n\nDo not promise delivery times (\"in an hour\", \"by tonight\") unless the work is\ndriven by an explicit schedule. Scope visibly; report when actually done.\n\n### Keep topics in threads\nCheck for a `[Thread: prll://msg_xxx]` line before interpreting a message.\nPresent \u2192 that thread is the context; reply there, passing the same root as\n`--thread-root-id`. Absent \u2192 the message belongs to the main conversation:\nnever treat it as continuing your most recent thread. The sender's newest\nmessage is the anchor \u2014 never route a reply back into an older thread just\nbecause the topic used to live there.\n\nReply where the event lives: a thread message gets a thread reply, a\ntop-level message gets a top-level reply. But in group chats, your later\nfollow-up on that topic \u2014 progress updates, analysis, links, verification you\npost afterwards \u2014 belongs in a thread rooted at the topic's message\n(`parall messages send <chat> --thread-root-id <msgId> --text-file -`), so\nthe main channel stays scannable. Post follow-up at top level only when\nstarting a genuinely new topic, making a channel-wide announcement, or when\nexplicitly asked. Never post the same update in both the thread and the main\nchannel \u2014 thread replies surface in the thread panel; no need to duplicate\nfor visibility.\n\nIn DMs, reply top-level by default; use a thread only to continue one that\nalready exists.\n\n### Group chats: mentions and unaddressed work\nAn @mention is a direct request \u2014 act on it. A group message delivered to you\nwithout an @mention means the chat's routing lets you see the conversation:\ndecide whether a reply adds value; silence is the default.\n\nA message without an @mention is not an open invitation. Judge from context\nwho the work belongs to \u2014 the named domain, the topic's owner, whoever is\nalready on it. If it belongs to someone else, leave it. If genuinely unclear,\nask or claim in one line (\"taking this unless someone else has it\") before\nstarting \u2014 asking first beats duplicated or misdirected work.\n\n### Verify before you act\nEvents can be redelivered \u2014 before acting, check whether it was already\nhandled (your own recent replies, task comments); if handled, do nothing.\nSends can fail silently, and creates can error after succeeding server-side \u2014\ncheck the chat or entity before retrying. Never blind-retry a mutating call.\n\n### Gather the full picture first\nWhen a request is vague, an entity may already exist, or work may already be\nunderway \u2014 gather context before acting: search (`parall search \"...\"`),\ncheck existing tasks/chats/wiki, read the surrounding conversation. Act on the\nfull picture, not the fragment that arrived in the event.\n\n### Report only work that ran\nIf a scheduled job, scan, or tool call did not actually run \u2014 restarted\nsession, missing credentials, silent failure \u2014 say so plainly. Never fabricate\nor approximate results of work that did not execute.\n\n### Respect what's shared\nYou have broad latitude inside your own work. But actions that are visible to\nothers, hard to reverse, or touch shared state \u2014 sending DMs, editing shared\nwiki, reassigning others' tasks, deleting content \u2014 pause and confirm before\nacting, unless you've been explicitly authorized.\n\n### Shared workspace\nOther agents share this workspace. Before starting work, check whether someone\n\u2014 human or agent \u2014 has already picked it up. Coordination beats racing.\n\n### Permissions and approvals\nYou have real permissions based on your roles (chat member/admin, org member).\nIf you lack permission for an action, the API returns PERMISSION_DENIED with the\n`action` and `resource_uri` that were denied. The server decides whether that\naction is approvable: if it is, the CLI prints an `approvals request` command \u2014\nfill in the placeholders it shows (`--chat`, `--title`, `--reason`) and run\nit to ask someone with permission. If it is NOT approvable, the output says so;\nask a human with permission instead of requesting approval. A\n`INVALID_TARGET` error instead means you addressed the wrong kind of thing\n(e.g. a `usr_` id where a chat is expected) \u2014 follow the message (e.g. use\n`dm` for a user). Don't retry or work around a denial; only request approval\nafter an actual denial, never preemptively.\n\n### When in doubt\nPrefer asking over guessing. Prefer \"I don't know\" over fabricating. Your\ncredibility is what you bring to the workspace \u2014 protect it.";
|
|
111
|
-
REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
111
|
+
REFERENCE_GUIDE_TEMPLATE = '## Parall References\n\nEvery entity on Parall has a `prll://` URI. Use these URIs to link related\nentities when you create or update tasks, comments, messages, and wiki files.\n\nAll three forms work \u2014 pick whichever fits:\n\n prll://tsk_abc bare URI (auto-linked)\n [](prll://tsk_abc) empty context (renders resolved title)\n [relevant context](prll://tsk_abc) with author annotation\n\nBare URIs and empty-context refs are preferred in most cases \u2014 the platform\nresolves and renders the entity title automatically.\n\n### Mentioning people and agents\n\nA real member mention is a `prll://usr_...` reference. Plain `@Display Name` is\nonly text: it does not notify a human or trigger an agent.\n\nWhen another member must be notified or an agent explicitly triggered, include\ntheir user reference in the message body. Prefer the empty-context form because\nthe platform resolves the member\'s current display name:\n\n [](prll://usr_xxx)\n\nUse `[Display Name](prll://usr_xxx)` when the surrounding sentence needs an\nexplicit label. Find the user ID in the incoming message or with\n`parall members list`. Never substitute plain `@Display Name` when notification\nor agent dispatch matters.\n\n### URI format\n\n`prll://` follows standard URI structure: `scheme://authority/path?query#fragment`.\n\n**Entities** \u2014 the entity ID is the authority:\n\n prll://usr_xxx user prll://prj_xxx project\n prll://tsk_xxx task prll://wik_xxx wiki\n prll://msg_xxx message prll://cmt_xxx comment\n prll://cht_xxx chat prll://tcm_xxx task comment (legacy)\n prll://att_xxx attachment prll://ase_xxx agent session\n prll://sch_xxx schedule prll://srn_xxx schedule run\n\n**Wiki** \u2014 path is file path, fragment is a typed anchor:\n\n prll://wik_xxx/docs/guide.md file\n prll://wik_xxx/docs/guide.md#h=Auth::OAuth heading (:: = hierarchy)\n prll://wik_xxx/src/auth.go?rev=<sha>#l=42-58 line range (revision-pinned)\n\n Anchor types: `h=` heading, `l=` line/range, `s=` symbol.\n Line anchors in persistent content require `?rev=<full-40-char-sha>`.\n\n**Chat message range**:\n\n prll://cht_xxx#range=msg_01HA,msg_01HZ\n\n**Field access** \u2014 path selects a field (omit to reference the entity itself):\n\n prll://tsk_xxx/description#Implementation heading within task description\n\n### Unread context\n\nWhen dispatched to a chat, you may see `[Unread: N messages | since: prll://msg_xxx]`.\nThis shows messages since your last interaction \u2014 your read cursor advances after each\ndispatch, so context you skip now won\'t appear as unread next time. Use\n`parall messages list <chat> --limit 20` to fetch recent context. For large unread\ncounts (50+), fetch only recent messages rather than everything.\n\nThread dispatches may show `[Thread: prll://msg_root | N replies | M unread | since: prll://msg_r]`.\nSame semantics \u2014 use `parall messages list <chat> --thread-root-id <thread_root> --limit 20` to\ncatch up on the thread.\n\n### Reading context on demand\n\nAn event only carries the single triggering message. If you\'re mentioned in a\ngroup chat and lack context, pull what you need from the chat \u2014 don\'t guess:\n\n parall messages list cht_xxx --limit 20 --before msg_xxx\n parall messages get msg_xxx\n parall chats get cht_xxx\n\nRule of thumb: in a group chat mention, the conversation that led up to you\nbeing called almost always matters \u2014 read it before replying. In a DM, your\nsession already has continuity, so skip the fetch unless something is unclear.\n\nSame pattern for any other entity referenced in the event: `tasks get`,\n`projects get`, `users get`, `chats get`. Follow the reflink, don\'t ask.\nWhen one entity isn\'t enough \u2014 you need what\'s *around* it \u2014 walk the\nreference graph instead of guessing (see "Walk the reference graph" below).\n\nWhen an event carries `[Hint: forwarded_message]`, its body is a set of message\nreferences rather than the forwarded text. Run `parall refs resolve --full`\nwith those references before responding, passing the `--from` message id the\nhint names \u2014 that forwarding message carries the cross-chat access, and when\nseveral forwards arrive in one turn the CLI\'s trigger default would point at\nthe wrong one. `--full` changes only the returned text length, not what you\nare allowed to read.\n\n### Find context with search first\n\nReach for unified semantic search before paging chat history:\n\n parall search "pricing decision june" --limit 10\n\nIt spans messages, tasks, wiki, and comments. Page `messages list` only for the\nverbatim recent flow of one chat, not for discovery.\n\n### Walk the reference graph\n\nReferences form a traversable graph, and you can query it \u2014 don\'t stop at\nfetching entities one by one:\n\n # entity metadata (title, status, preview)\n parall refs resolve prll://tsk_xxx prll://wik_xxx\n # who references this entity\n parall refs backlinks prll://tsk_xxx\n # connected sub-graph around it\n parall refs graph prll://tsk_xxx --depth 2\n\nUse `refs backlinks` when you need "where is this discussed / used"; use\n`refs graph` when you need the full picture around an entity (related tasks,\ndocs, conversations \u2014 edges carry the author\'s annotation for why they linked).\nThen `refs resolve` the interesting node URIs in one batch to get titles and\nstatus. `refs graph` takes entity-level URIs only (`prll://wik_xxx`, not\n`prll://wik_xxx/docs/a.md`). All results are filtered to what you can see.{{PLATFORM_SKILL_HINT}}\n\n### File attachments\n\nMessages may include attachments. They appear in events as:\n\n [Attachment: prll://att_xxx | image/png | 1.2MB | screenshot.png]\n\nTo download an attachment, use the CLI:\n\n parall files download att_xxx --output /tmp/screenshot.png\n\nTo send a file:\n\n parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"\n\nOr upload first and reuse across chats:\n\n parall files upload /tmp/report.pdf\n parall messages send prll://cht_aaa --attachment att_yyy --text "Report"\n parall messages send prll://cht_bbb --attachment att_yyy --text "FYI"\n\nThe `--text` captions above are safe short literals. For message text containing `$`, backticks, or quotes, pass it via `--text-file <path>` (write the file first, or a quoted heredoc `--text-file - <<\'EOF\'`) instead of `--text "..."` \u2014 inside double quotes the shell turns `$1,000` into `,000` and executes `$(...)`.\n\n### When to reference\n\n- **Origin** \u2014 always link the message or task that triggered your work\n- **Design docs / wiki** \u2014 link specs and guides relevant to the work\n- **Related tasks** \u2014 link parent, sibling, or blocking tasks\n- **People** \u2014 link assignees or stakeholders when mentioning them\n- **Conversations** \u2014 link a chat or message range as context\n\n### Why this matters\n\nOther agents and humans read your output. References build a navigable context graph \u2014\nin multi-agent workflows, your references are the map that the next agent follows.';
|
|
112
112
|
BRIDGE_SKILL_HINTS = {
|
|
113
113
|
SCHEDULES_SKILL_HINT: " (read the `parall-schedules` skill at .parall/skills/parall-schedules.md).",
|
|
114
114
|
TASKS_SKILL_HINT: "\nDetails: read the `parall-tasks` skill at .parall/skills/parall-tasks.md and follow it.",
|
|
@@ -149,9 +149,15 @@ var init_dispatch_adapter = __esm({
|
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
// ts/agent-core/dist/event-format.js
|
|
152
|
+
var MESSAGE_REF_URI, MESSAGE_RANGE_REF_URI, REF_URI, REF_TOKEN, FORWARDED_REF_LINE;
|
|
152
153
|
var init_event_format = __esm({
|
|
153
154
|
"ts/agent-core/dist/event-format.js"() {
|
|
154
155
|
"use strict";
|
|
156
|
+
MESSAGE_REF_URI = "prll:\\/\\/msg_[A-Za-z0-9_-]+(?:\\/content\\?v=[1-9][0-9]{0,8}#t=[0-9]+-[0-9]+)?";
|
|
157
|
+
MESSAGE_RANGE_REF_URI = "prll:\\/\\/cht_[A-Za-z0-9_-]+#range=msg_[A-Za-z0-9_-]+,msg_[A-Za-z0-9_-]+";
|
|
158
|
+
REF_URI = `(?:${MESSAGE_REF_URI}|${MESSAGE_RANGE_REF_URI})`;
|
|
159
|
+
REF_TOKEN = `(?:${REF_URI}|\\[(?:[^\\[\\]]|\\[[^\\[\\]]*\\])*\\]\\(${REF_URI}\\)|<${REF_URI}>)`;
|
|
160
|
+
FORWARDED_REF_LINE = new RegExp(`^${REF_TOKEN}(?:\\s+${REF_TOKEN})*$`);
|
|
155
161
|
}
|
|
156
162
|
});
|
|
157
163
|
|
|
@@ -407,6 +413,7 @@ var init_constants = __esm({
|
|
|
407
413
|
SLACK_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/slack/status`,
|
|
408
414
|
// WeChat tier-B read verbs (agent-only; internal research preview).
|
|
409
415
|
WECHAT_CONTACTS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/contacts`,
|
|
416
|
+
WECHAT_HISTORY: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/history`,
|
|
410
417
|
WECHAT_PROFILE: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/profile`,
|
|
411
418
|
WECHAT_STATUS: (orgId) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/status`,
|
|
412
419
|
// Invitations (org-scoped, admin)
|
|
@@ -919,6 +926,41 @@ var init_task_label_client = __esm({
|
|
|
919
926
|
}
|
|
920
927
|
});
|
|
921
928
|
|
|
929
|
+
// ts/sdk/dist/wechat-client.js
|
|
930
|
+
var WechatClient;
|
|
931
|
+
var init_wechat_client = __esm({
|
|
932
|
+
"ts/sdk/dist/wechat-client.js"() {
|
|
933
|
+
"use strict";
|
|
934
|
+
init_constants();
|
|
935
|
+
init_task_label_client();
|
|
936
|
+
WechatClient = class extends TaskLabelClient {
|
|
937
|
+
/** Address book enriched with display names. */
|
|
938
|
+
async listWechatContacts(orgId) {
|
|
939
|
+
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
940
|
+
}
|
|
941
|
+
/** Platform-retained context in chronological page order. */
|
|
942
|
+
async wechatHistory(orgId, conversation, query) {
|
|
943
|
+
const params = new URLSearchParams({ conversation });
|
|
944
|
+
if (query?.before)
|
|
945
|
+
params.set("before", query.before);
|
|
946
|
+
if (query?.since)
|
|
947
|
+
params.set("since", query.since);
|
|
948
|
+
if (query?.limit !== void 0)
|
|
949
|
+
params.set("limit", String(query.limit));
|
|
950
|
+
return this.request("GET", `${ENDPOINTS.WECHAT_HISTORY(orgId)}?${params.toString()}`);
|
|
951
|
+
}
|
|
952
|
+
/** Connected WeChat account identity. */
|
|
953
|
+
async wechatProfile(orgId) {
|
|
954
|
+
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
955
|
+
}
|
|
956
|
+
/** Live online probe, identity, and platform offline record. */
|
|
957
|
+
async wechatStatus(orgId) {
|
|
958
|
+
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
|
|
922
964
|
// ts/sdk/dist/client.js
|
|
923
965
|
function normalizeWikiChangeset(changeset) {
|
|
924
966
|
return {
|
|
@@ -963,8 +1005,8 @@ var init_client = __esm({
|
|
|
963
1005
|
"use strict";
|
|
964
1006
|
init_browser_viewer();
|
|
965
1007
|
init_constants();
|
|
966
|
-
|
|
967
|
-
ParallClient = class _ParallClient extends
|
|
1008
|
+
init_wechat_client();
|
|
1009
|
+
ParallClient = class _ParallClient extends WechatClient {
|
|
968
1010
|
baseUrl;
|
|
969
1011
|
wikiBaseUrl;
|
|
970
1012
|
token;
|
|
@@ -2312,28 +2354,6 @@ var init_client = __esm({
|
|
|
2312
2354
|
async setSlackStatus(orgId, input) {
|
|
2313
2355
|
await this.request("POST", ENDPOINTS.SLACK_STATUS(orgId), input);
|
|
2314
2356
|
}
|
|
2315
|
-
/**
|
|
2316
|
-
* WeChat tier-B read verb (agent-only; internal research preview): the
|
|
2317
|
-
* account's address book — friends/chatrooms enriched with display names,
|
|
2318
|
-
* followed official accounts. Same live gate as the send verb.
|
|
2319
|
-
*/
|
|
2320
|
-
async listWechatContacts(orgId) {
|
|
2321
|
-
return this.request("GET", ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
2322
|
-
}
|
|
2323
|
-
/**
|
|
2324
|
-
* WeChat tier-B read verb (agent-only): the connected account's identity
|
|
2325
|
-
* (wxid / alias / nickName / app id).
|
|
2326
|
-
*/
|
|
2327
|
-
async wechatProfile(orgId) {
|
|
2328
|
-
return this.request("GET", ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
2329
|
-
}
|
|
2330
|
-
/**
|
|
2331
|
-
* WeChat tier-B read verb (agent-only): live online probe + identity +
|
|
2332
|
-
* the platform's offline record.
|
|
2333
|
-
*/
|
|
2334
|
-
async wechatStatus(orgId) {
|
|
2335
|
-
return this.request("GET", ENDPOINTS.WECHAT_STATUS(orgId));
|
|
2336
|
-
}
|
|
2337
2357
|
async listChannelConversations(orgId, connectionId) {
|
|
2338
2358
|
return this.request("GET", ENDPOINTS.CHANNEL_CONNECTION_CONVERSATIONS(orgId, connectionId));
|
|
2339
2359
|
}
|
|
@@ -2619,11 +2639,11 @@ var init_client = __esm({
|
|
|
2619
2639
|
}
|
|
2620
2640
|
// ---- References ----
|
|
2621
2641
|
async resolveRefs(orgId, refs, options) {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2642
|
+
return this.request("POST", ENDPOINTS.REFS_RESOLVE(orgId), {
|
|
2643
|
+
refs,
|
|
2644
|
+
source_message_id: options?.sourceMessageId,
|
|
2645
|
+
full: options?.full || void 0
|
|
2646
|
+
});
|
|
2627
2647
|
}
|
|
2628
2648
|
async getBacklinks(orgId, params) {
|
|
2629
2649
|
return this.request("GET", ENDPOINTS.REFS_BACKLINKS(orgId), void 0, params);
|
|
@@ -3291,6 +3311,13 @@ var init_types = __esm({
|
|
|
3291
3311
|
}
|
|
3292
3312
|
});
|
|
3293
3313
|
|
|
3314
|
+
// ts/sdk/dist/wechat-types.js
|
|
3315
|
+
var init_wechat_types = __esm({
|
|
3316
|
+
"ts/sdk/dist/wechat-types.js"() {
|
|
3317
|
+
"use strict";
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
|
|
3294
3321
|
// ts/sdk/dist/ws.js
|
|
3295
3322
|
function isRetryableNetworkError(err) {
|
|
3296
3323
|
return err instanceof Error && err.name === "ApiError" && "status" in err && err.status === 0;
|
|
@@ -3641,10 +3668,19 @@ var init_dist = __esm({
|
|
|
3641
3668
|
init_subject();
|
|
3642
3669
|
init_task_label_types();
|
|
3643
3670
|
init_types();
|
|
3671
|
+
init_wechat_types();
|
|
3644
3672
|
init_ws();
|
|
3645
3673
|
}
|
|
3646
3674
|
});
|
|
3647
3675
|
|
|
3676
|
+
// ts/agent-core/dist/fork-state.js
|
|
3677
|
+
var init_fork_state = __esm({
|
|
3678
|
+
"ts/agent-core/dist/fork-state.js"() {
|
|
3679
|
+
"use strict";
|
|
3680
|
+
init_event_format();
|
|
3681
|
+
}
|
|
3682
|
+
});
|
|
3683
|
+
|
|
3648
3684
|
// ts/agent-core/dist/lane-key.js
|
|
3649
3685
|
var init_lane_key = __esm({
|
|
3650
3686
|
"ts/agent-core/dist/lane-key.js"() {
|
|
@@ -30284,6 +30320,7 @@ var init_gateway_base = __esm({
|
|
|
30284
30320
|
init_event_format();
|
|
30285
30321
|
init_channel_capability();
|
|
30286
30322
|
init_dispatch_adapter();
|
|
30323
|
+
init_fork_state();
|
|
30287
30324
|
init_gateway_lane_flow();
|
|
30288
30325
|
init_lane_ledger();
|
|
30289
30326
|
init_dispatch_inactivity_deadline();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/daemon",
|
|
3
|
-
"version": "1.55.
|
|
3
|
+
"version": "1.55.4",
|
|
4
4
|
"description": "Parall local agent runtime — daemon supervisor + bridge runtimes, bundled as standalone JS files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@aws-sdk/client-s3": "3.984.0",
|
|
34
34
|
"@pinixai/bb-browser-pro": "0.15.0",
|
|
35
35
|
"ws": "^8.18.0",
|
|
36
|
-
"@parall/agent-core": "1.55.
|
|
37
|
-
"@parall/
|
|
38
|
-
"@parall/
|
|
39
|
-
"@parall/
|
|
40
|
-
"@parall/openclaw-agent": "1.55.
|
|
36
|
+
"@parall/agent-core": "1.55.4",
|
|
37
|
+
"@parall/sdk": "1.55.4",
|
|
38
|
+
"@parall/claude-agent": "1.55.4",
|
|
39
|
+
"@parall/codex-agent": "1.55.4",
|
|
40
|
+
"@parall/openclaw-agent": "1.55.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^22.0.0",
|