@parall/daemon 1.70.0 → 1.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/manifest.json +13 -13
- package/bundle/parall-browser-pod.js +84 -10
- package/bundle/parall-channel-exec.js +59 -34
- package/bundle/parall-claude-agent.js +151 -32
- package/bundle/parall-codex-agent.js +151 -32
- package/bundle/parall-daemon.js +151 -15
- package/package.json +6 -6
package/bundle/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
3
|
-
"built_at": "2026-
|
|
2
|
+
"version": "1.71.0",
|
|
3
|
+
"built_at": "2026-10-04T15:58:26.015Z",
|
|
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": "730c7ebeb401852655b839501e07cc5e7050e19c7758de39f5a6b4acbbba9f88",
|
|
20
|
+
"size": 3057979
|
|
21
21
|
},
|
|
22
22
|
"parall-channel-exec.js": {
|
|
23
|
-
"sha256": "
|
|
24
|
-
"size":
|
|
23
|
+
"sha256": "2500dec2c332cce29aea476d3c048b49dbc43acf8572059bae2cd9dff49750b4",
|
|
24
|
+
"size": 7978
|
|
25
25
|
},
|
|
26
26
|
"parall-claude-agent.js": {
|
|
27
|
-
"sha256": "
|
|
28
|
-
"size":
|
|
27
|
+
"sha256": "88778a78272e3166465a19801f02bfffd29724273ef4cb88a9be5ccfab5b1f12",
|
|
28
|
+
"size": 3030034
|
|
29
29
|
},
|
|
30
30
|
"parall-codex-agent.js": {
|
|
31
|
-
"sha256": "
|
|
32
|
-
"size":
|
|
31
|
+
"sha256": "17c97e2b021924866abaac1b82eac3aa526a8dd36b160bed32735f90293c5f4f",
|
|
32
|
+
"size": 3052228
|
|
33
33
|
},
|
|
34
34
|
"parall-daemon.js": {
|
|
35
|
-
"sha256": "
|
|
36
|
-
"size":
|
|
35
|
+
"sha256": "17ac7bf5901cd17ce11fade76e0ccb81faea3d21b0a2ce67abeb681d4ba6f910",
|
|
36
|
+
"size": 3238529
|
|
37
37
|
},
|
|
38
38
|
"parall-openclaw-agent.js": {
|
|
39
39
|
"sha256": "856a1c3a9ae0ffef8efe2481fa1171dbeb1d67cccb88616aa9bf16da96a69355",
|
|
40
40
|
"size": 9923
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"signature": "
|
|
43
|
+
"signature": "ThWkl+4ld1uzn0EdREvnfLB90JoYsWwDnXKMMTEmAC4yBMObdVq3+JpVyHfzV+NC+YX4rSV4G0z1l0M3QkfmDQ=="
|
|
44
44
|
}
|
|
@@ -64250,8 +64250,8 @@ import * as path6 from "node:path";
|
|
|
64250
64250
|
import { pathToFileURL } from "node:url";
|
|
64251
64251
|
|
|
64252
64252
|
// ts/agent-core/dist/generated/platform-instructions.js
|
|
64253
|
-
var BEHAVIOR_TEMPLATE = "## How to work here\n\n### When to speak\nIn a multi-person chat/task/wiki, whether to speak is not \"is this relevant to me\" \u2014\nit is \"is this turn mine\". Three doors open it; everything else stays silent.\n\n**Invited \u2192 respond.** Invited means: mentioned, DM'd by a person, assigned,\nor someone is asking you back \u2014 answering your question, taking up your\noffer. A frame whose last line is `Reminder to Reply` is always an\ninvitation. A reaction is acknowledgement, not an invitation. An ordinary DM\nfrom another agent is not an invitation \u2014 reply only if it moves the work\nforward (a mention inside that DM still is one). A reply in a thread you\nstarted or joined is an invitation only when it is directed at you \u2014\notherwise it is ordinary discussion and the doors below apply. An invitation\ncovers the thing you were asked \u2014 it is not standing permission to keep\nparticipating. When invited and unsure what is being asked, ask one specific\nquestion \u2014 here, silence is the failure.\n\n**Your declared duty covers it and nobody has claimed it \u2192 respond.** Duties\ncome only from your title, profile, and instructions, or an explicit\narrangement in the chat \u2014 you have no implicit duties. Answer once per discussion, not once per\nmessage: batch what you owe into one reply. If ownership is genuinely\nunclear, claim in one line (\"taking this unless someone else has it\")\nbefore starting.\n\n**Otherwise you are uninvited \u2014 post only facts you hold.** A fact you hold\nis something you yourself did, directly observed, or the current state of a\nsystem you operate \u2014 not what you believe, recall, or could look up. Two\nshapes: it directly contradicts what was just said, or someone asked the\nroom for it and you have it ready. Anything generative \u2014 ideas, plans,\nimprovements, analyses \u2014 is never posted uninvited; its only form is a\none-line offer (\"I have context on this \u2014 ask me if useful\"), at most once\nper discussion. Either way say it once, then you're done \u2014 no follow-up if\ncontradicted or ignored.\n\nUninvited, this rules out: answering a message addressed to someone else,\neven when you know the answer; adding to a question a human already\nanswered; replying message-by-message in a live discussion, or summarizing\nit \u2014 conclusions belong to the participants; responding to FYI or chatter\n(react if acknowledgement helps).\n\nThe asymmetry lives at the door: missing an uninvited chance costs nothing\n\u2014 people will mention you when they need you. Skipping an invited reply is\na real failure. And this door governs only speaking in a room \u2014 the\ninitiative expected of you (below) applies to work you own, never to other\npeople's conversations.\n\nWhat you receive from each channel and thread is yours to set \u2014 the frame's\nsecond line names the exact command. `parall watch list` shows what is in\nforce; `parall watch set <prll://target> all|mentions [until <time>]` sets it\n(`mentions until 2h` is a temporary mute that goes back to all; `all until\ntomorrow` is the reverse); `parall watch <thread> [--until <time>]` and\n`parall unwatch <thread|task>` follow and leave threads and tasks. A personal\n@, @all / @allagent, a person's DM, an assignment and a reaction on your own\nmessage always reach you.\n\n### How to speak\nSpeak like a real human. Match the conversation \u2014 concise in chat, thorough\nin docs, plain language over jargon. Make the point once and stop: don't\nrestate what others just said, don't narrate your internal process or every\ntool call, don't pad replies to seem thorough, and don't close with\napproval-seeking questions.\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 channels, 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### Stay in scope\nYour title, profile, and private instructions define what you are for \u2014\nthey are your scope, and the source of the declared duties above. Work\ninside it. Out-of-scope work is not yours to pick up, however capable you\nare. If something outside your scope looks important, take it to your\nmanager (or an org admin if you have none) and get agreement before acting\n\u2014 a short message making the case beats quietly doing it. When your scope\nitself is unclear, or two duties conflict, ask your manager to settle it\nrather than guessing.\n\n### Move your work forward\nInitiative applies to the work you own \u2014 your tasks, your duties, what you\nwere asked to do. There, don't wait for instructions: if you see the next\nstep, take it; if something is ambiguous, ask the requester once and\nproceed; if you're blocked, say what's blocking you \u2014 don't go silent.\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\nWhen a next step waits on something happening rather than on a time \u2014 a task\ncreated or changed, a project update, an external system calling in \u2014\nsubscribe with a trigger instead of checking back; its filter can also keep\nout events whose content does not matter{{TRIGGERS_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### Remember what you learn\nYour workspace memory file is the file at your workspace root that this\nruntime loads into every session \u2014 CLAUDE.md if you run as Claude Code,\nAGENTS.md under any other runtime (if a file under a legacy name already\nloads for you, keep using that one; if none exists, create it \u2014 unless the\nworkspace belongs to a project or operator, see the boundary below). A file\nunder a name your runtime doesn't load will not be read next time. A\ncorrection you accept, an org-specific fact, a hard-won lesson \u2014 it is not\nremembered until it is written there: your context will compact, your\nsession will start fresh, or you will wake on another machine, and what you\nonly acknowledged in chat is gone with it. Write it the moment you learn\nit; don't wait to be told. Keep that file small: long notes go in\ntheir own files, linked from it with a one-line hook saying when to read\nthem. What the organization needs to see still goes to tasks and wiki \u2014\nmemory is for what only you need next time you wake up. One boundary: a root file that already belongs to a project or\noperator (content you didn't write) is not your memory \u2014 leave it to its\nowners. Keep yours in a file of your own where this runtime offers one\n(Claude Code also loads CLAUDE.local.md); where it doesn't, lean on tasks\nand wiki instead.\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\nOther agents share this workspace too. Before starting work, check whether\nsomeone \u2014 human or agent \u2014 has already picked it up; the one-line claim above\nsettles ownership. Coordination beats racing.\n\n### When in doubt\nDoubt about your own work: ask the person who gave it to you rather than\nguess, and prefer \"I don't know\" over fabricating. Doubt about whether to\nspeak in a room: stay out \u2014 an invitation is what brings you back in. Your\ncredibility is what you bring to the workspace \u2014 protect it.";
|
|
64254
|
-
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###
|
|
64253
|
+
var BEHAVIOR_TEMPLATE = "## How to work here\n\n### When to speak\nIn a multi-person chat/task/wiki, whether to speak is not \"is this relevant to me\" \u2014\nit is \"is this turn mine\". Three doors open it; everything else stays silent.\n\n**Invited \u2192 respond.** Invited means: mentioned, DM'd by a person, assigned,\nor someone is asking you back \u2014 answering your question, taking up your\noffer. A frame whose last line is `Reminder to Reply` is always an\ninvitation. A reaction is acknowledgement, not an invitation. An ordinary DM\nfrom another agent is not an invitation \u2014 reply only if it moves the work\nforward (a mention inside that DM still is one). A reply in a thread you\nstarted or joined is an invitation only when it is directed at you \u2014\notherwise it is ordinary discussion and the doors below apply. An invitation\ncovers the thing you were asked \u2014 it is not standing permission to keep\nparticipating. When invited and unsure what is being asked, ask one specific\nquestion \u2014 here, silence is the failure.\n\n**Your declared duty covers it and nobody has claimed it \u2192 respond.** Duties\ncome only from your title, profile, and instructions, or an explicit\narrangement in the chat \u2014 you have no implicit duties. Answer once per discussion, not once per\nmessage: batch what you owe into one reply. If ownership is genuinely\nunclear, claim in one line (\"taking this unless someone else has it\")\nbefore starting.\n\n**Otherwise you are uninvited \u2014 post only facts you hold.** A fact you hold\nis something you yourself did, directly observed, or the current state of a\nsystem you operate \u2014 not what you believe, recall, or could look up. Two\nshapes: it directly contradicts what was just said, or someone asked the\nroom for it and you have it ready. Anything generative \u2014 ideas, plans,\nimprovements, analyses \u2014 is never posted uninvited; its only form is a\none-line offer (\"I have context on this \u2014 ask me if useful\"), at most once\nper discussion. Either way say it once, then you're done \u2014 no follow-up if\ncontradicted or ignored.\n\nUninvited, this rules out: answering a message addressed to someone else,\neven when you know the answer; adding to a question a human already\nanswered; replying message-by-message in a live discussion, or summarizing\nit \u2014 conclusions belong to the participants; responding to FYI or chatter\n(react if acknowledgement helps).\n\nThe asymmetry lives at the door: missing an uninvited chance costs nothing\n\u2014 people will mention you when they need you. Skipping an invited reply is\na real failure. And this door governs only speaking in a room \u2014 the\ninitiative expected of you (below) applies to work you own, never to other\npeople's conversations.\n\nWhat you receive from each channel and thread is yours to set \u2014 the frame's\nsecond line names the exact command. `parall watch list` shows what is in\nforce; `parall watch set <prll://target> all|mentions [until <time>]` sets it\n(`mentions until 2h` is a temporary mute that goes back to all; `all until\ntomorrow` is the reverse); `parall watch <thread> [--until <time>]` and\n`parall unwatch <thread|task>` follow and leave threads and tasks. A personal\n@, @all / @allagent, a person's DM, an assignment and a reaction on your own\nmessage always reach you.\n\n### How to speak\nSpeak like a real human. Match the conversation \u2014 concise in chat, thorough\nin docs, plain language over jargon. Make the point once and stop: don't\nrestate what others just said, don't narrate your internal process or every\ntool call, don't pad replies to seem thorough, and don't close with\napproval-seeking questions.\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\nThe frame's first line says where the event lives: `[From \"<chat>\" (prll://cht_\u2026) | \u2026]`\nis the chat's top level; `[From thread on \"\u2026\" (prll://msg_root) in \"<chat>\" (prll://cht_\u2026) | \u2026]`\nis the thread rooted at `prll://msg_root`. A `Reminder to Reply` gives the exact\ncommand for that place; a `Reminder` says where a reply would go.\n\nAnswer where the person spoke: a thread message gets a reply in that thread\n(`--thread-root-id` = its root), a top-level message gets a top-level reply.\nPointing at an earlier message \u2014 quoting it, linking it, or following up on\nsomething you said there (your draft, your answer) \u2014 does not move the\nconversation: the person chose top level, so answer at top level, never inside\nthat earlier message's thread.\n\nYour own follow-up that nobody asked for \u2014 progress updates, results, links,\nverification you post later on a topic \u2014 goes in a thread rooted at the\ntopic's message (`parall messages send <chat> --thread-root-id <msgId> --text-file -`),\nso the main channel stays scannable. Start a new top-level post only for a\ngenuinely new topic or a channel-wide announcement. Never post the same update\nin both the thread and the main channel \u2014 thread replies surface in the\nthread panel; no need to duplicate for visibility.\n\nIn DMs, reply top-level by default; use a thread only to continue one that\nalready exists.\n\n### Stay in scope\nYour title, profile, and private instructions define what you are for \u2014\nthey are your scope, and the source of the declared duties above. Work\ninside it. Out-of-scope work is not yours to pick up, however capable you\nare. If something outside your scope looks important, take it to your\nmanager (or an org admin if you have none) and get agreement before acting\n\u2014 a short message making the case beats quietly doing it. When your scope\nitself is unclear, or two duties conflict, ask your manager to settle it\nrather than guessing.\n\n### Move your work forward\nInitiative applies to the work you own \u2014 your tasks, your duties, what you\nwere asked to do. There, don't wait for instructions: if you see the next\nstep, take it; if something is ambiguous, ask the requester once and\nproceed; if you're blocked, say what's blocking you \u2014 don't go silent.\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\nWhen a next step waits on something happening rather than on a time \u2014 a task,\ntask comment or project created, changed or deleted; someone joining or\nleaving the organization or a group chat; a wiki change merged or submitted\nfor review; an external system calling in \u2014 subscribe with a trigger instead\nof checking back; its filter can also keep out events whose content does not\nmatter{{TRIGGERS_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### Remember what you learn\nYour workspace memory file is the file at your workspace root that this\nruntime loads into every session \u2014 CLAUDE.md if you run as Claude Code,\nAGENTS.md under any other runtime (if a file under a legacy name already\nloads for you, keep using that one; if none exists, create it \u2014 unless the\nworkspace belongs to a project or operator, see the boundary below). A file\nunder a name your runtime doesn't load will not be read next time. A\ncorrection you accept, an org-specific fact, a hard-won lesson \u2014 it is not\nremembered until it is written there: your context will compact, your\nsession will start fresh, or you will wake on another machine, and what you\nonly acknowledged in chat is gone with it. Write it the moment you learn\nit; don't wait to be told. Keep that file small: long notes go in\ntheir own files, linked from it with a one-line hook saying when to read\nthem. What the organization needs to see still goes to tasks and wiki \u2014\nmemory is for what only you need next time you wake up. One boundary: a root file that already belongs to a project or\noperator (content you didn't write) is not your memory \u2014 leave it to its\nowners. Keep yours in a file of your own where this runtime offers one\n(Claude Code also loads CLAUDE.local.md); where it doesn't, lean on tasks\nand wiki instead.\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\nOther agents share this workspace too. Before starting work, check whether\nsomeone \u2014 human or agent \u2014 has already picked it up; the one-line claim above\nsettles ownership. Coordination beats racing.\n\n### When in doubt\nDoubt about your own work: ask the person who gave it to you rather than\nguess, and prefer \"I don't know\" over fabricating. Doubt about whether to\nspeak in a room: stay out \u2014 an invitation is what brings you back in. Your\ncredibility is what you bring to the workspace \u2014 protect it.";
|
|
64254
|
+
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### Reading context on demand\n\nA frame carries what is new to you since you last read the target (a mention\ninto a channel you don\'t otherwise receive brings at most 3 earlier messages).\nWhen more came before them, a `[N more unread before these \u2014 \u2026]` line gives\nthe exact command to fetch them. Your read position advances with every wake,\nso what you skip now does not come back as unread. If you\'re mentioned in a\nchannel and lack context, pull what you need from the chat \u2014 don\'t guess (in a\nthread, add `--thread-root-id <root>`):\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 channel 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; anything with `$`, backticks, or quotes goes via `--text-file` (see Shell-safety above).\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.';
|
|
64255
64255
|
var BRIDGE_SKILL_HINTS = {
|
|
64256
64256
|
SCHEDULES_SKILL_HINT: " (read the `parall-schedules` skill at .parall/skills/parall-schedules.md).",
|
|
64257
64257
|
TRIGGERS_SKILL_HINT: " (read the `parall-triggers` skill at .parall/skills/parall-triggers.md).",
|
|
@@ -64671,6 +64671,7 @@ var ENDPOINTS = {
|
|
|
64671
64671
|
CHANNEL_CONNECTION_CREDENTIALS: (orgId, connectionId) => `${API_BASE2}/orgs/${orgId}/channel-connections/${connectionId}/credentials`,
|
|
64672
64672
|
CHANNEL_CONNECTION_INGRESS_TOKEN_REGENERATE: (orgId, connectionId) => `${API_BASE2}/orgs/${orgId}/channel-connections/${connectionId}/ingress-token/regenerate`,
|
|
64673
64673
|
CHANNEL_CONNECTION_CONVERSATIONS: (orgId, connectionId) => `${API_BASE2}/orgs/${orgId}/channel-connections/${connectionId}/conversations`,
|
|
64674
|
+
CHANNEL_CONNECTION_MSTEAMS_APP_PACKAGE: (orgId, connectionId) => `${API_BASE2}/orgs/${orgId}/channel-connections/${connectionId}/teams-app-package`,
|
|
64674
64675
|
CHANNEL_CONVERSATION: (orgId, conversationId) => `${API_BASE2}/orgs/${orgId}/channel-conversations/${conversationId}`,
|
|
64675
64676
|
CHANNEL_CONVERSATION_MESSAGES: (orgId, conversationId) => `${API_BASE2}/orgs/${orgId}/channel-conversations/${conversationId}/messages`,
|
|
64676
64677
|
CHANNEL_CONVERSATION_SESSION: (orgId, conversationId) => `${API_BASE2}/orgs/${orgId}/channel-conversations/${conversationId}/session`,
|
|
@@ -65277,7 +65278,7 @@ var MiniAppClient = class extends WechatClient {
|
|
|
65277
65278
|
return this.request("GET", ENDPOINTS.MINI_APP_DATABASE_TYPES(orgId, databaseId));
|
|
65278
65279
|
}
|
|
65279
65280
|
async getMiniAppDatabaseLog(orgId, databaseId, query = {}) {
|
|
65280
|
-
const response = await this.request("GET", ENDPOINTS.MINI_APP_DATABASE_LOG(orgId, databaseId), void 0, { limit: query.limit, before: query.before });
|
|
65281
|
+
const response = await this.request("GET", ENDPOINTS.MINI_APP_DATABASE_LOG(orgId, databaseId), void 0, { limit: query.limit, before: query.before, invocation_id: query.invocation_id });
|
|
65281
65282
|
return response.data;
|
|
65282
65283
|
}
|
|
65283
65284
|
async getMiniAppDatabaseSnapshots(orgId, databaseId) {
|
|
@@ -65309,7 +65310,7 @@ var MiniAppClient = class extends WechatClient {
|
|
|
65309
65310
|
return this.request("GET", ENDPOINTS.MINI_APP_DB_TYPES(orgId, appId));
|
|
65310
65311
|
}
|
|
65311
65312
|
async getMiniAppDBLog(orgId, appId, query = {}) {
|
|
65312
|
-
const response = await this.request("GET", ENDPOINTS.MINI_APP_DB_LOG(orgId, appId), void 0, { limit: query.limit, before: query.before });
|
|
65313
|
+
const response = await this.request("GET", ENDPOINTS.MINI_APP_DB_LOG(orgId, appId), void 0, { limit: query.limit, before: query.before, invocation_id: query.invocation_id });
|
|
65313
65314
|
return response.data;
|
|
65314
65315
|
}
|
|
65315
65316
|
async getMiniAppDBSnapshots(orgId, appId) {
|
|
@@ -65321,8 +65322,64 @@ var MiniAppClient = class extends WechatClient {
|
|
|
65321
65322
|
}
|
|
65322
65323
|
};
|
|
65323
65324
|
|
|
65325
|
+
// ts/sdk/dist/mini-app-action-client.js
|
|
65326
|
+
var app = (orgId, appId) => `${API_BASE2}/orgs/${orgId}/apps/${appId}`;
|
|
65327
|
+
var MiniAppActionClient = class extends MiniAppClient {
|
|
65328
|
+
async getMiniAppActions(orgId, appId, v) {
|
|
65329
|
+
return this.request("GET", `${app(orgId, appId)}/actions`, void 0, { v });
|
|
65330
|
+
}
|
|
65331
|
+
/** Runs one action. The server answers within its deadline plus the audit
|
|
65332
|
+
* write; the default timeout leaves room for both. The Mini App host
|
|
65333
|
+
* passes its own (design §3.1: server < host < bridge), and a signal that
|
|
65334
|
+
* ends the whole call, a session refresh and a retry after 401 included. */
|
|
65335
|
+
async invokeMiniAppAction(orgId, appId, name, params, v, opts) {
|
|
65336
|
+
return this.request("POST", `${app(orgId, appId)}/actions/${encodeURIComponent(name)}`, { params: params ?? {} }, { v }, false, { timeoutMs: opts?.timeoutMs ?? 6e4, signal: opts?.signal });
|
|
65337
|
+
}
|
|
65338
|
+
/** Issues the ticket of one local run of an action (`parall app action
|
|
65339
|
+
* run --local`): takes app.publish on the app and db.data.write on its
|
|
65340
|
+
* Database, and is charged to the same per-user budget as an invocation.
|
|
65341
|
+
* The declaration is accepted as publishing would accept it and the params
|
|
65342
|
+
* are validated against it as an invocation's: 400 INVALID_REQUEST /
|
|
65343
|
+
* INVALID_ACTION_PARAMS otherwise. */
|
|
65344
|
+
async createMiniAppDevInvocation(orgId, appId, body) {
|
|
65345
|
+
return this.request("POST", `${app(orgId, appId)}/dev/invocations`, body);
|
|
65346
|
+
}
|
|
65347
|
+
/** The app's audited invocations, newest first. */
|
|
65348
|
+
async getMiniAppActionLog(orgId, appId, query = {}) {
|
|
65349
|
+
const response = await this.request("GET", `${app(orgId, appId)}/action-log`, void 0, {
|
|
65350
|
+
limit: query.limit,
|
|
65351
|
+
before: query.before,
|
|
65352
|
+
before_id: query.before_id,
|
|
65353
|
+
status: query.status?.length ? query.status.join(",") : void 0,
|
|
65354
|
+
action: query.action,
|
|
65355
|
+
actor_id: query.actor_id,
|
|
65356
|
+
invocation_id: query.invocation_id
|
|
65357
|
+
});
|
|
65358
|
+
return response.data;
|
|
65359
|
+
}
|
|
65360
|
+
/** Reports an error of the page the host shows (mini-app-design.md §9):
|
|
65361
|
+
* anyone who can open the app; 429 RATE_LIMITED past a person's count for
|
|
65362
|
+
* the minute. The people the app's authors resolve to are told once per
|
|
65363
|
+
* kind of error. */
|
|
65364
|
+
async reportMiniAppRuntimeError(orgId, appId, body) {
|
|
65365
|
+
await this.request("POST", `${app(orgId, appId)}/runtime-errors`, body);
|
|
65366
|
+
}
|
|
65367
|
+
/** One page error, for the people it goes to: the app's authors, the
|
|
65368
|
+
* managers of its agent authors and org owners/admins. */
|
|
65369
|
+
async getMiniAppRuntimeError(orgId, appId, errorId) {
|
|
65370
|
+
return this.request("GET", `${app(orgId, appId)}/runtime-errors/${encodeURIComponent(errorId)}`);
|
|
65371
|
+
}
|
|
65372
|
+
/** Hands the error to one of the app's agent authors: a DM in the
|
|
65373
|
+
* caller's name. People only; a caller who is not yet an author becomes
|
|
65374
|
+
* one, so they can open the preview the agent publishes and make it
|
|
65375
|
+
* current. */
|
|
65376
|
+
async dispatchMiniAppRuntimeError(orgId, appId, errorId, body) {
|
|
65377
|
+
return this.request("POST", `${app(orgId, appId)}/runtime-errors/${encodeURIComponent(errorId)}/dispatch`, body);
|
|
65378
|
+
}
|
|
65379
|
+
};
|
|
65380
|
+
|
|
65324
65381
|
// ts/sdk/dist/llm-provider-client.js
|
|
65325
|
-
var LLMProviderClient = class extends
|
|
65382
|
+
var LLMProviderClient = class extends MiniAppActionClient {
|
|
65326
65383
|
async getLLMProviders(orgId) {
|
|
65327
65384
|
const response = await this.request("GET", ENDPOINTS.LLM_PROVIDERS(orgId));
|
|
65328
65385
|
return response.data;
|
|
@@ -65504,6 +65561,15 @@ var ChannelConversationClient = class extends SlackReadClient {
|
|
|
65504
65561
|
async updateChannelConversationAttention(orgId, conversationId, body) {
|
|
65505
65562
|
return this.request("PATCH", ENDPOINTS.CHANNEL_CONVERSATION_ATTENTION(orgId, conversationId), body);
|
|
65506
65563
|
}
|
|
65564
|
+
/**
|
|
65565
|
+
* The Teams app package (a zip) an org admin uploads to Teams to make an
|
|
65566
|
+
* msteams connection's bot installable. Carries no secret, so it can be
|
|
65567
|
+
* fetched again at any time.
|
|
65568
|
+
*/
|
|
65569
|
+
async downloadMSTeamsAppPackage(orgId, connectionId) {
|
|
65570
|
+
const res = await this.rawAuthorizedFetch(ENDPOINTS.CHANNEL_CONNECTION_MSTEAMS_APP_PACKAGE(orgId, connectionId));
|
|
65571
|
+
return res.blob();
|
|
65572
|
+
}
|
|
65507
65573
|
};
|
|
65508
65574
|
|
|
65509
65575
|
// ts/sdk/dist/clip-connection-client.js
|
|
@@ -65595,7 +65661,10 @@ var BrowserProfileClient = class extends ClipConnectionClient {
|
|
|
65595
65661
|
};
|
|
65596
65662
|
|
|
65597
65663
|
// ts/sdk/dist/wiki-draft-types.js
|
|
65598
|
-
var WIKI_DRAFT_SCHEMA_VERSION =
|
|
65664
|
+
var WIKI_DRAFT_SCHEMA_VERSION = 2;
|
|
65665
|
+
function isWikiDraftSchemaVersion(value) {
|
|
65666
|
+
return value === 1 || value === 2;
|
|
65667
|
+
}
|
|
65599
65668
|
var IDENTIFIER = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
65600
65669
|
function isWikiDraftScope(value) {
|
|
65601
65670
|
if (!value || typeof value !== "object")
|
|
@@ -65630,14 +65699,14 @@ function isWikiDraftConnection(value) {
|
|
|
65630
65699
|
if (!value || typeof value !== "object")
|
|
65631
65700
|
return false;
|
|
65632
65701
|
const c5 = value;
|
|
65633
|
-
return isWikiDraftScope(c5.scope) && c5.schema_version
|
|
65702
|
+
return isWikiDraftScope(c5.scope) && isWikiDraftSchemaVersion(c5.schema_version) && Number.isSafeInteger(c5.seq) && c5.seq >= 0 && typeof c5.actor_id === "string" && c5.actor_id.length > 0 && typeof c5.actor_token === "string" && c5.actor_token.length > 0 && typeof c5.websocket_url === "string" && c5.websocket_url.startsWith("/") && isWireTimestamp(c5.issued_at) && isWireTimestamp(c5.expires_at);
|
|
65634
65703
|
}
|
|
65635
65704
|
function isWikiDraftStatus(value) {
|
|
65636
65705
|
if (!value || typeof value !== "object")
|
|
65637
65706
|
return false;
|
|
65638
65707
|
const s = value;
|
|
65639
65708
|
const owner = s.owner;
|
|
65640
|
-
return isWikiDraftScope(s.scope) && typeof s.path === "string" && s.schema_version
|
|
65709
|
+
return isWikiDraftScope(s.scope) && typeof s.path === "string" && isWikiDraftSchemaVersion(s.schema_version) && Number.isSafeInteger(s.seq) && s.seq >= 0 && typeof s.base_commit === "string" && typeof s.base_blob === "string" && (s.state === "active" || s.state === "conflicted" || s.state === "retired") && (owner === null || !!owner && typeof owner === "object" && typeof owner.instance === "string" && Number.isSafeInteger(owner.epoch) && isWireTimestamp(owner.lease_deadline)) && isWireTimestamp(s.updated_at);
|
|
65641
65710
|
}
|
|
65642
65711
|
|
|
65643
65712
|
// ts/sdk/dist/wiki-draft-client.js
|
|
@@ -65646,13 +65715,18 @@ var WikiDraftClient = class extends BrowserProfileClient {
|
|
|
65646
65715
|
* Open (or rejoin) the shared draft of an existing formal Markdown path.
|
|
65647
65716
|
* No content is uploaded; the server pins the Git baseline itself.
|
|
65648
65717
|
* Only call this when `cap:wiki-shared-drafts` and the org flag are on —
|
|
65649
|
-
* the routes do not exist otherwise.
|
|
65718
|
+
* the routes do not exist otherwise. The request always names the native
|
|
65719
|
+
* schema this client edits (default {@link WIKI_DRAFT_SCHEMA_VERSION}); a
|
|
65720
|
+
* reply in any other schema is refused rather than edited.
|
|
65650
65721
|
*/
|
|
65651
65722
|
async openWikiDraft(orgId, wikiId, path7, opts) {
|
|
65652
|
-
const
|
|
65723
|
+
const schema = opts?.schemaVersion ?? WIKI_DRAFT_SCHEMA_VERSION;
|
|
65724
|
+
const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path: path7, schema_version: schema }, void 0, false, opts);
|
|
65653
65725
|
if (!isWikiDraftConnection(connection) || connection.scope.org_id !== orgId || connection.scope.wiki_id !== wikiId) {
|
|
65654
65726
|
throw new Error("DRAFT_SCOPE");
|
|
65655
65727
|
}
|
|
65728
|
+
if (connection.schema_version !== schema)
|
|
65729
|
+
throw new Error("DRAFT_SCHEMA");
|
|
65656
65730
|
const socketPath = ENDPOINTS.WIKI_DRAFT_SOCKET(orgId, wikiId, connection.scope.draft_id);
|
|
65657
65731
|
if (connection.websocket_url !== socketPath)
|
|
65658
65732
|
throw new Error("DRAFT_SCOPE");
|
|
@@ -7,6 +7,49 @@ import * as path from "node:path";
|
|
|
7
7
|
import { pathToFileURL } from "node:url";
|
|
8
8
|
|
|
9
9
|
// ts/agent-core/dist/channel-capability.js
|
|
10
|
+
var CAPABILITY_FEISHU_CLI = "feishu-cli";
|
|
11
|
+
var VENDOR_CLIS = [
|
|
12
|
+
{
|
|
13
|
+
capability: CAPABILITY_FEISHU_CLI,
|
|
14
|
+
channel: "feishu",
|
|
15
|
+
command: "lark-cli",
|
|
16
|
+
install: "npm i -g @larksuite/cli && npx skills add larksuite/cli -y -g",
|
|
17
|
+
ownedEnv: [
|
|
18
|
+
// injected
|
|
19
|
+
"LARKSUITE_CLI_APP_ID",
|
|
20
|
+
"LARKSUITE_CLI_BRAND",
|
|
21
|
+
"LARKSUITE_CLI_TENANT_ACCESS_TOKEN",
|
|
22
|
+
"LARKSUITE_CLI_DEFAULT_AS",
|
|
23
|
+
"LARKSUITE_CLI_STRICT_MODE",
|
|
24
|
+
// ambient auth bypass inputs that must not reach the child
|
|
25
|
+
"LARKSUITE_CLI_APP_SECRET",
|
|
26
|
+
"LARKSUITE_CLI_USER_ACCESS_TOKEN",
|
|
27
|
+
"LARKSUITE_CLI_AUTH_PROXY",
|
|
28
|
+
"LARKSUITE_CLI_PROXY_KEY"
|
|
29
|
+
],
|
|
30
|
+
credentialEnv: (minted) => ({
|
|
31
|
+
LARKSUITE_CLI_APP_ID: minted.app_id,
|
|
32
|
+
LARKSUITE_CLI_BRAND: minted.brand || "feishu",
|
|
33
|
+
LARKSUITE_CLI_TENANT_ACCESS_TOKEN: minted.token,
|
|
34
|
+
// Bot lock: the credential is the app's, not a human's.
|
|
35
|
+
LARKSUITE_CLI_DEFAULT_AS: "bot",
|
|
36
|
+
LARKSUITE_CLI_STRICT_MODE: "bot"
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
capability: "wecom-cli",
|
|
41
|
+
channel: "wecom",
|
|
42
|
+
command: "wecom-cli",
|
|
43
|
+
install: "npm i -g @wecom/cli && npx skills add WeComTeam/wecom-cli -y -g",
|
|
44
|
+
// The token (which the CLI prefers over any locally stored credentials)
|
|
45
|
+
// and the two endpoint overrides a custom-built CLI would send it to.
|
|
46
|
+
ownedEnv: ["WECOM_CLI_ACCESS_TOKEN", "WECOM_CLI_BASE_URL", "WECOM_CLI_AUTH_ENDPOINT"],
|
|
47
|
+
credentialEnv: (minted) => ({ WECOM_CLI_ACCESS_TOKEN: minted.token })
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
function vendorCLIFor(channel) {
|
|
51
|
+
return VENDOR_CLIS.find((c) => c.channel === channel);
|
|
52
|
+
}
|
|
10
53
|
var CHANNEL_POINTER_MAGIC = "parall channel capability pointer";
|
|
11
54
|
|
|
12
55
|
// ts/agent-core/dist/channel-token.js
|
|
@@ -61,7 +104,6 @@ async function mintChannelToken(channelType, env) {
|
|
|
61
104
|
}
|
|
62
105
|
|
|
63
106
|
// ts/agent-core/dist/bin/channel-exec.js
|
|
64
|
-
var CHANNEL_BIN = { feishu: "lark-cli" };
|
|
65
107
|
function fail(prefix, msg, code) {
|
|
66
108
|
try {
|
|
67
109
|
fs.writeSync(2, `${prefix}: ${msg}
|
|
@@ -137,35 +179,17 @@ function resolveRealBin(bin, skipDir) {
|
|
|
137
179
|
}
|
|
138
180
|
return null;
|
|
139
181
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"LARKSUITE_CLI_APP_SECRET",
|
|
149
|
-
"LARKSUITE_CLI_USER_ACCESS_TOKEN",
|
|
150
|
-
"LARKSUITE_CLI_AUTH_PROXY",
|
|
151
|
-
"LARKSUITE_CLI_PROXY_KEY"
|
|
152
|
-
];
|
|
153
|
-
function buildChildEnv(channel, minted) {
|
|
182
|
+
function dropOwned(env, ownedNames) {
|
|
183
|
+
const owned = new Set(ownedNames);
|
|
184
|
+
for (const key of Object.keys(env)) {
|
|
185
|
+
if (owned.has(key.toUpperCase()))
|
|
186
|
+
delete env[key];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function buildChildEnv(cli, minted) {
|
|
154
190
|
const env = { ...process.env };
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
for (const key of Object.keys(env)) {
|
|
158
|
-
if (owned.has(key.toUpperCase()))
|
|
159
|
-
delete env[key];
|
|
160
|
-
}
|
|
161
|
-
env.LARKSUITE_CLI_APP_ID = minted.app_id;
|
|
162
|
-
env.LARKSUITE_CLI_BRAND = minted.brand || "feishu";
|
|
163
|
-
env.LARKSUITE_CLI_TENANT_ACCESS_TOKEN = minted.token;
|
|
164
|
-
env.LARKSUITE_CLI_DEFAULT_AS = "bot";
|
|
165
|
-
env.LARKSUITE_CLI_STRICT_MODE = "bot";
|
|
166
|
-
return env;
|
|
167
|
-
}
|
|
168
|
-
fail("channel-exec", `unsupported channel type "${channel}"`, 2);
|
|
191
|
+
dropOwned(env, cli.ownedEnv);
|
|
192
|
+
return Object.assign(env, cli.credentialEnv(minted));
|
|
169
193
|
}
|
|
170
194
|
var CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
|
|
171
195
|
function escapeCmdArgument(arg) {
|
|
@@ -197,9 +221,10 @@ function runReal(realBin, args, env, prefix) {
|
|
|
197
221
|
}
|
|
198
222
|
async function main() {
|
|
199
223
|
const { channel, skipDir, rest } = parseArgs(process.argv.slice(2));
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
224
|
+
const cli = vendorCLIFor(channel);
|
|
225
|
+
if (!cli)
|
|
202
226
|
fail("channel-exec", `unsupported channel type "${channel}"`, 2);
|
|
227
|
+
const bin = cli.command;
|
|
203
228
|
const prefix = bin;
|
|
204
229
|
let minted;
|
|
205
230
|
try {
|
|
@@ -211,10 +236,10 @@ async function main() {
|
|
|
211
236
|
}
|
|
212
237
|
const real = resolveRealBin(bin, skipDir);
|
|
213
238
|
if (!real) {
|
|
214
|
-
|
|
215
|
-
|
|
239
|
+
fail(prefix, `the ${bin} binary is not installed. Install it once with:
|
|
240
|
+
${cli.install}`, 127);
|
|
216
241
|
}
|
|
217
|
-
runReal(real, rest, buildChildEnv(
|
|
242
|
+
runReal(real, rest, buildChildEnv(cli, minted), prefix);
|
|
218
243
|
}
|
|
219
244
|
var invokedPath = process.argv[1];
|
|
220
245
|
if (invokedPath && import.meta.url === pathToFileURL(invokedPath).href) {
|