@codions/portta 0.1.0 → 0.3.1
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/README.md +41 -88
- package/dist/assets/agents/hook.sh.tmpl +21 -0
- package/dist/assets/agents/instruction.md +8 -0
- package/dist/assets/agents/portta-context.ts.tmpl +24 -0
- package/dist/assets/skills/portta-adopt-compose/SKILL.md +220 -0
- package/dist/assets/skills/portta-dockerize/SKILL.md +118 -0
- package/dist/assets/skills/portta-host-context/SKILL.md +142 -0
- package/dist/cli.js +1568 -1017
- package/dist/documentation.json.gz +0 -0
- package/dist/runtime/.env.example +6 -42
- package/dist/runtime/VERSION +1 -1
- package/dist/runtime/docker/compose/features/web-dev.yaml +0 -2
- package/dist/runtime/docker/compose/features/web.yaml +0 -8
- package/dist/runtime/docker/images/apply/Dockerfile +1 -1
- package/dist/runtime/docker/images/toolbox/Dockerfile +1 -1
- package/dist/runtime/templates/README.md +3 -3
- package/dist/runtime/templates/overlays/06-monorepo.yaml +0 -7
- package/dist/runtime/templates/overlays/07-worktree.env +0 -1
- package/dist/runtime/templates/project/PORTTA.md +8 -7
- package/package.json +5 -16
- package/dist/acp-providers-M3DUUBYJ.js +0 -3
- package/dist/arktype-aI7TBD0R-SOJGD3SZ.js +0 -3
- package/dist/assets/skills/portta-workflows/SKILL.md +0 -285
- package/dist/assets/workflows/bake-off.workflow.js +0 -172
- package/dist/assets/workflows/code-review.workflow.js +0 -179
- package/dist/assets/workflows/deep-research.workflow.js +0 -223
- package/dist/assets/workflows/multi-provider-review.workflow.js +0 -169
- package/dist/assets/workflows/provider-debate.workflow.js +0 -141
- package/dist/assets/workflows/second-opinion.workflow.js +0 -176
- package/dist/chunk-3EZNE4MC.js +0 -6
- package/dist/chunk-4TGTGGMK.js +0 -4
- package/dist/chunk-4YGEG6YX.js +0 -1878
- package/dist/chunk-5SBYE3YH.js +0 -26
- package/dist/chunk-6J5HN4ZN.js +0 -3
- package/dist/chunk-6TV2V7RR.js +0 -3
- package/dist/chunk-CFWGQ7VJ.js +0 -19
- package/dist/chunk-EFZZFIRZ.js +0 -3
- package/dist/chunk-EH7H7D7J.js +0 -15
- package/dist/chunk-EYT7VTYA.js +0 -4
- package/dist/chunk-FRQCKCCK.js +0 -332
- package/dist/chunk-GI2EUNAK.js +0 -16
- package/dist/chunk-HB5T7XDN.js +0 -5
- package/dist/chunk-IILMQFWO.js +0 -14
- package/dist/chunk-LAYNTFDR.js +0 -70
- package/dist/chunk-MH5YJA5O.js +0 -2
- package/dist/chunk-O6U47HHQ.js +0 -341
- package/dist/chunk-OPVZAG2C.js +0 -10
- package/dist/chunk-PTKKSRMI.js +0 -223
- package/dist/chunk-Q3VNQ3LU.js +0 -3
- package/dist/chunk-QBKADN76.js +0 -4
- package/dist/chunk-QS5PHDYT.js +0 -240
- package/dist/chunk-SBVO6RXF.js +0 -87
- package/dist/chunk-T3TSZO4I.js +0 -7
- package/dist/chunk-TA2XHP5D.js +0 -4
- package/dist/chunk-UUSUJUAD.js +0 -7
- package/dist/chunk-UX7P3YHF.js +0 -3
- package/dist/chunk-VDSWNWUY.js +0 -168
- package/dist/chunk-WNZR7VOO.js +0 -145
- package/dist/chunk-YYSFNLBX.js +0 -5
- package/dist/cli-O2MMC25H.js +0 -98
- package/dist/completions-F4476JAU.js +0 -12
- package/dist/config-E5XLLPKE.js +0 -3
- package/dist/core-FSKGFGJO.js +0 -18
- package/dist/default-u_dwuiYb-OWTONHM6.js +0 -3
- package/dist/dispatch-ZCNGHCNP.js +0 -8
- package/dist/doctor-7F6ZXPZE.js +0 -5
- package/dist/effect-QlVUlMFu-4UNP2EGS.js +0 -3
- package/dist/esm-575VQW4T.js +0 -4
- package/dist/host.js +0 -8
- package/dist/init-HGEXUJP3.js +0 -245
- package/dist/linear-commands-XGHGICI7.js +0 -5
- package/dist/oneshot-DL57ZA55.js +0 -36
- package/dist/opencode-YDUTVKTG.js +0 -3
- package/dist/pi-L73UX3S5.js +0 -3
- package/dist/project-commands-2N44CRGM.js +0 -7
- package/dist/project-env-NWBVITHM.js +0 -4
- package/dist/run-commands-TCBNFJOT.js +0 -13
- package/dist/runtime/docker/compose/features/panel-host.yaml +0 -42
- package/dist/shell-ZWXPCUMD.js +0 -3
- package/dist/subprocess-jsonl-FQKDRENI.js +0 -3
- package/dist/supervisor.js +0 -179
- package/dist/sury-CWZTCd75-XQOYZHNU.js +0 -3
- package/dist/typebox-Dei93FPO-RCGWIHUQ.js +0 -3
- package/dist/valibot--1zFm7rT-DKLMYF44.js +0 -3
- package/dist/valibot-D_HTw1Gn-QTR63R64.js +0 -4
- package/dist/worktree-commands-F7REOKFJ.js +0 -50
- package/dist/zod-Bwrt9trS-6RSVELLV.js +0 -3
- package/dist/zod-DSgpEGAE-5JBFOUHY.js +0 -3
package/dist/host.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{$b as p,Vb as r,Xb as i,Zb as c,_b as s,pc as m}from"./chunk-4YGEG6YX.js";import"./chunk-VDSWNWUY.js";import"./chunk-5SBYE3YH.js";import"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-GI2EUNAK.js";import"./chunk-EYT7VTYA.js";import"./chunk-MH5YJA5O.js";import"./chunk-QBKADN76.js";import"./chunk-EFZZFIRZ.js";import"./chunk-SBVO6RXF.js";import"./chunk-EH7H7D7J.js";import"./chunk-O6U47HHQ.js";
|
|
4
|
-
import"./chunk-FRQCKCCK.js";import"./chunk-TA2XHP5D.js";import"./chunk-T3TSZO4I.js";import"./chunk-UUSUJUAD.js";import{a as n}from"./chunk-6J5HN4ZN.js";var o=process.env,e=c(o.PORTTA_ROOT||process.cwd(),o),T=p(s(e)),d=m,a=await i({...r(o),token:T,modules:d,context:{stateDir:e,env:o}});process.stdout.write(`portta host daemon listening on ${a.url}
|
|
5
|
-
`);process.stdout.write(`token: ${s(e)}
|
|
6
|
-
`);process.stdout.write(`modules: ${d.map(t=>t.manifest.id).join(", ")||"none"}
|
|
7
|
-
`);function u(t){process.stdout.write(`${t}: stopping the host daemon
|
|
8
|
-
`),a.close().finally(()=>process.exit(0)),setTimeout(()=>process.exit(0),3e3).unref()}n(u,"shutdown");process.on("SIGINT",()=>u("SIGINT"));process.on("SIGTERM",()=>u("SIGTERM"));
|
package/dist/init-HGEXUJP3.js
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as Z,c as a,d as ee,e as w,f as C,g as te}from"./chunk-LAYNTFDR.js";import{a as F}from"./chunk-3EZNE4MC.js";import{c as ne,d as re,e as oe}from"./chunk-HB5T7XDN.js";import{b as X}from"./chunk-6TV2V7RR.js";import{q as W,t as V}from"./chunk-OPVZAG2C.js";import{a as I,d as Q,e as D}from"./chunk-4TGTGGMK.js";import{c as R}from"./chunk-UX7P3YHF.js";import{ac as K}from"./chunk-4YGEG6YX.js";import"./chunk-VDSWNWUY.js";import"./chunk-5SBYE3YH.js";
|
|
4
|
-
import"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-GI2EUNAK.js";import"./chunk-EYT7VTYA.js";import"./chunk-MH5YJA5O.js";import"./chunk-QBKADN76.js";import"./chunk-EFZZFIRZ.js";import{E as J}from"./chunk-SBVO6RXF.js";import{d as Y}from"./chunk-EH7H7D7J.js";import"./chunk-O6U47HHQ.js";import{b as y}from"./chunk-FRQCKCCK.js";import{c as q}from"./chunk-TA2XHP5D.js";import{a as h,
|
|
5
|
-
b as G,h as p,j as S,k as O,o as M}from"./chunk-T3TSZO4I.js";import"./chunk-UUSUJUAD.js";import{a as i}from"./chunk-6J5HN4ZN.js";import{existsSync as he}from"node:fs";import{mkdir as Fe,readFile as Le,writeFile as ye}from"node:fs/promises";import{dirname as Ue}from"node:path";import{existsSync as k,readFileSync as Ae,rmSync as be}from"node:fs";import{tmpdir as Se}from"node:os";import{join as v}from"node:path";var Ie="haiku",we="low",Pe="low";function m(e){return typeof e=="string"&&e.trim().length>0?e:null}i(m,"readString");function $e(e){return k(v(e,"bun.lock"))||k(v(e,"bun.lockb"))?"bun":k(v(e,"pnpm-lock.yaml"))?"pnpm":k(v(e,"yarn.lock"))?"yarn":"npm"}i($e,"detectPackageManager");function Ce(e){let t=I("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(t.success){let s=t.stdout.toString().trim();if(s&&s!=="HEAD")return s}let n=I("git",["symbolic-ref","--quiet","--short","refs/remotes/origin/HEA\
|
|
6
|
-
D"],{cwd:e});if(n.success){let s=n.stdout.toString().trim().split("/").pop();if(s)return s}let o=I("git",["branch","--list","main"],{cwd:e});if(o.success&&o.stdout.toString().trim())return"main";let r=I("git",["branch","--list","master"],{cwd:e});return r.success&&r.stdout.toString().trim()?"master":S.mainBranch}i(Ce,"detectMainBranch");function Ee(e,t){return e==="bun"?`bun run ${t}`:e==="pnpm"?`pnpm ${t}`:e==="yarn"?`yarn ${t}`:`npm run ${t}`}i(Ee,"buildRunScriptCommand");function ce(e,t){return{
|
|
7
|
-
gitRoot:e,projectName:D(e),mainBranch:Ce(e),defaultAgent:t,packageManager:$e(e)}}i(ce,"detectInitProjectContext");function le(e,t="auto"){let n=[".devcontainer.json",".devcontainer/devcontainer.json"].filter(s=>k(v(e,s))),o=["compose.yaml","compose.yml","docker-compose.yaml","docker-compose.yml"].filter(s=>k(v(e,s))),r=t!=="auto"?t:n.length===1?"devcontainer":o.length>0?"compose":k(v(e,"Dockerfile"))?"dockerfile":"host";return{devcontainerConfigs:n,composeFiles:o,dockerfile:k(v(e,"Dockerfile")),
|
|
8
|
-
packageJson:k(v(e,"package.json")),selectedRuntime:r}}i(le,"detectInitEnvironment");function ue(e){return{systemPrompt:[`You are bootstrapping a local repository for ${h}.`,`A starter \`${p}\` already exists at the repo root.`,`Inspect the repository in the current working directory and edit that existing \`${p}\` in place.`,"Do not modify any other file.","Do not ask the user questions. Infer the config from the repository contents.","Be efficient: inspect only the files needed to determine the\
|
|
9
|
-
project name, main branch, service layout, dev commands, and ports.","The active, uncommented YAML must be valid and minimal.","Do not remove other starter sections or their explanatory comments just because they are unused.","Keep optional examples and comments in place so the user can uncomment and use them later.",`Set workspace.defaultAgent to ${e.defaultAgent}.`,"Use this config shape:","name: infer from the repository","workspace.mainBranch: infer from git",`workspace.worktrees.root: keep\
|
|
10
|
-
${S.worktreeRoot} unless there is clear evidence of an existing alternative`,"Do not copy detected Compose services or ports into config unless the user needs an explicit override.","Preserve the commented services example: it is for Taskflow-managed host or Docker profile processes, not discovered Dev Container or Compose services.","profiles.default.environment.provider: auto unless the user chose a runtime override. If no Dev Container, Compose, or Dockerfile exists, set it to host.","For a \
|
|
11
|
-
host project, put its one managed development command in profiles.default.environment.command; never add a third app command pane for it.","Only declare services when a host command has a proven port and supports the injected port environment variable. When the port is uncertain, keep the command but omit services.","profiles.default.envPassthrough: []","profiles.default.panes: keep the active agent and runtime panes; runtime follows the selected environment and is where users inspect and contro\
|
|
12
|
-
l it.","Do not add docker compose command panes when an environment provider can manage the runtime.","Use split: right for the first command pane and split: bottom for later command panes.","Include integrations.github.linkedRepos as an empty list, integrations.linear.enabled as true, and startupEnvs as an empty object.","Only include optional sections like auto_name, lifecycleHooks, sandbox/docker config, mounts, or systemPrompt if the repository gives clear evidence they are needed.","Prefer \
|
|
13
|
-
editing the existing keys over replacing the file with a completely different shape.","Preserve the existing template structure and comments unless a specific change requires updating them.",`Before finishing, verify that \`${p}\` exists and contains the final YAML.`].join(`
|
|
14
|
-
`),userPrompt:`Adapt the existing starter \`${p}\` for this repository.`}}i(ue,"buildInitPromptSpec");function me(e,t,n=`${G}-init`){if(e==="claude")return{agent:e,cmd:"claude",args:["-p","--verbose","--safe-mode","--disable-slash-commands","--no-session-persistence","--permission-mode","bypassPermissions","--model",Ie,"--effort",we,"--output-format","stream-json","--include-partial-messages","--append-system-prompt",t.systemPrompt,t.userPrompt]};let o=v(Se(),`${n}-${Date.now()}-${Math.random().
|
|
15
|
-
toString(36).slice(2,8)}.txt`);return{agent:e,cmd:"codex",args:["exec","--ignore-user-config","--ignore-rules","--ephemeral","--sandbox","workspace-write","--color","never","--json","-o",o,"-c",`model_reasoning_effort="${Pe}"`,"-c",`developer_instructions=${t.systemPrompt}`,t.userPrompt],summaryPath:o}}i(me,"buildInitAgentCommand");function P(e){return e.assistantSnapshot?(e.assistantSnapshot="",[{kind:"assistant_done",text:""}]):[]}i(P,"closeAssistant");function T(e,t){if(!t)return[];if(!e.assistantSnapshot)
|
|
16
|
-
return e.assistantSnapshot=t,[{kind:"assistant_delta",text:t}];if(t===e.assistantSnapshot)return[];if(t.startsWith(e.assistantSnapshot)){let n=t.slice(e.assistantSnapshot.length);return e.assistantSnapshot=t,n?[{kind:"assistant_delta",text:n}]:[]}return e.assistantSnapshot=t,[{kind:"assistant_done",text:""},{kind:"assistant_delta",text:t}]}i(T,"streamSnapshot");function L(e,t){let n=t?.trim();return!n||n===e.lastStatus?[]:(e.lastStatus=n,[...P(e),{kind:"status",text:n}])}i(L,"emitStatus");function de(e,t){
|
|
17
|
-
let n=t?.trim();return n?[...P(e),{kind:"warning",text:n}]:[]}i(de,"emitWarning");function A(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>A(t)).filter(t=>t.length>0).join(""):y(e)?e.type==="text"&&typeof e.text=="string"?e.text:typeof e.output_text=="string"?e.output_text:typeof e.text=="string"?e.text:typeof e.delta=="string"?e.delta:Array.isArray(e.content)?A(e.content):Array.isArray(e.contents)?A(e.contents):Array.isArray(e.parts)?A(e.parts):Array.isArray(e.output)?A(e.output):"":
|
|
18
|
-
""}i(A,"extractTextBlocks");function ie(e){return typeof e=="string"&&e.trim().length>0?e.trim():Array.isArray(e)&&e.every(t=>typeof t=="string")&&e.join(" ").trim()||null}i(ie,"extractCommandText");function se(e,t=120){return e.length>t?`${e.slice(0,t-3)}...`:e}i(se,"truncateText");function pe(e){let t=[e.message,e.result,e.item,e.output,e.content,e.text,e.response];for(let n of t){let o=A(n).trim();if(o)return o}return null}i(pe,"extractStructuredMessage");function _e(e,t){let n=m(e.type)??"un\
|
|
19
|
-
known";if(n==="content_block_delta"&&y(e.delta)){if(e.delta.type==="text_delta"&&typeof e.delta.text=="string")return[{kind:"assistant_delta",text:e.delta.text}];if(typeof e.delta.text=="string")return[{kind:"assistant_delta",text:e.delta.text}]}if(n==="content_block_start"&&y(e.content_block)){if(e.content_block.type==="tool_use")return L(t,`Using ${m(e.content_block.name)??"tool"}...`);let r=A(e.content_block).trim();return T(t,r)}if(n==="message_stop"||n==="result_stop"||n==="content_block_st\
|
|
20
|
-
op")return P(t);if(n==="error"){let r=y(e.error)?m(e.error.message):m(e.message);return de(t,r??"Claude returned an error.")}if(n.includes("tool")){let r=m(e.tool_name)??(y(e.tool)?m(e.tool.name):null)??m(e.name);if(r)return L(t,`Using ${r}...`)}let o=pe(e);return o?T(t,o):[]}i(_e,"parseClaudeStreamLine");function Re(e,t){let n=ie(e.command)??(y(e.item)?ie(e.item.command):null);if(n&&(t.includes("command")||t.includes("exec")||t.includes("shell")))return`Running ${se(n)}`;let o=m(e.tool_name)??m(
|
|
21
|
-
e.name)??(y(e.item)?m(e.item.name):null);if(o&&(t.includes("tool")||t.includes("function")))return`Using ${o}...`;let r=m(e.status);return r&&!["completed","done","finished"].includes(r)?se(r):t.includes("turn")?"Thinking...":null}i(Re,"parseCodexStatus");function De(e,t){let n=m(e.type)??m(e.event)??"unknown";if(n==="response.output_text.delta"&&typeof e.delta=="string")return[{kind:"assistant_delta",text:e.delta}];if(n==="response.output_text.done"){let s=m(e.text)??A(e.item).trim();return[...s?
|
|
22
|
-
T(t,s):[],...P(t)]}if(n.includes("error")){let s=y(e.error)?m(e.error.message):m(e.message);return de(t,s??"Codex returned an error.")}let o=Re(e,n);if(o)return L(t,o);if(n.includes("delta")&&typeof e.delta=="string")return[{kind:"assistant_delta",text:e.delta}];let r=pe(e);if(r&&(n.includes("assistant")||n.includes("message")||n.includes("output")||n.includes("response"))){let s=T(t,r);return(n.includes("done")||n.includes("completed")||n.includes("finished"))&&s.push(...P(t)),s}return n.includes(
|
|
23
|
-
"done")||n.includes("completed")||n.includes("finished")?P(t):[]}i(De,"parseCodexStreamLine");function ae(e,t,n={assistantSnapshot:"",lastStatus:null}){let o=t.trim();if(!o)return[];let r;try{r=JSON.parse(o)}catch{return[]}return y(r)?e==="claude"?_e(r,n):De(r,n):[]}i(ae,"parseInitAgentStreamLine");async function Te(e,t,n){if(!e)return{raw:"",assistantText:""};let o=e.getReader(),r=new TextDecoder,s={assistantSnapshot:"",lastStatus:null},d="",c="",f="";for(;;){let{done:l,value:B}=await o.read();
|
|
24
|
-
if(l)break;let u=r.decode(B,{stream:!0});c+=u,d+=u;let b=d.indexOf(`
|
|
25
|
-
`);for(;b!==-1;){let j=d.slice(0,b).replace(/\r$/,"");d=d.slice(b+1);for(let $ of ae(t,j,s))$.kind==="assistant_delta"&&(f+=$.text),n?.($);b=d.indexOf(`
|
|
26
|
-
`)}}let E=r.decode();c+=E,d+=E;let x=d.replace(/\r$/,"");if(x)for(let l of ae(t,x,s))l.kind==="assistant_delta"&&(f+=l.text),n?.(l);for(let l of P(s))n?.(l);return{raw:c,assistantText:f}}i(Te,"consumeStructuredStream");async function je(e){if(!e)return"";let t=e.getReader(),n=new TextDecoder,o="";for(;;){let{done:r,value:s}=await t.read();if(r)break;o+=n.decode(s,{stream:!0})}return o+n.decode()}i(je,"consumeRawStream");async function fe(e,t,n={}){let o=new J().start({command:Y(e.cmd),args:e.args,
|
|
27
|
-
cwd:t,timeoutMs:n.timeoutMs}),[r,s,d]=await Promise.all([o.exited,Te(o.stdout,e.agent,n.onEvent),je(o.stderr)]);return Ne(e,r.code??1,s,d)}i(fe,"runInitAgentCommand");function Ne(e,t,n,o){let r=n.assistantText.trim();if(e.summaryPath&&k(e.summaryPath))try{r=Ae(e.summaryPath,"utf8").trim()||r}finally{be(e.summaryPath,{force:!0})}return{exitCode:t,stdout:n.raw,stderr:o,summary:r}}i(Ne,"finalizeAgentRun");function U(e){let t=e.defaultAgent??S.defaultAgent,n=e.packageManager??"npm",o=Ee(n,"dev"),r=e.
|
|
28
|
-
environmentProvider??"auto";return`# Starter config for ${h}.
|
|
29
|
-
# Keep the active keys below as a minimal working setup, then uncomment
|
|
30
|
-
# the examples to enable more services, profiles, integrations, or hooks.
|
|
31
|
-
|
|
32
|
-
# Project display name shown in the dashboard and browser title.
|
|
33
|
-
name: ${e.projectName}
|
|
34
|
-
|
|
35
|
-
workspace:
|
|
36
|
-
# Git branch new worktrees start from.
|
|
37
|
-
mainBranch: ${e.mainBranch}
|
|
38
|
-
# Relative or absolute directory where managed worktrees are created.
|
|
39
|
-
worktrees:
|
|
40
|
-
root: ${S.worktreeRoot}
|
|
41
|
-
# Agent new worktrees use by default.
|
|
42
|
-
defaultAgent: ${t}
|
|
43
|
-
# Example background pull settings for keeping the main branch fresh.
|
|
44
|
-
# autoPull:
|
|
45
|
-
# # Turn automatic pulls on or off.
|
|
46
|
-
# enabled: false
|
|
47
|
-
# # Seconds between pull attempts.
|
|
48
|
-
# intervalSeconds: 300
|
|
49
|
-
|
|
50
|
-
# Taskflow discovers Dev Container, Compose, and Dockerfile services from the resolved runtime.
|
|
51
|
-
# Declare services here only for a process started by a host or Docker profile pane
|
|
52
|
-
# that accepts an injected port environment variable. Do not duplicate discovered services.
|
|
53
|
-
services:
|
|
54
|
-
# Example app service with a predictable port per worktree.
|
|
55
|
-
# - name: app
|
|
56
|
-
# # Environment variable injected into panes and lifecycle hooks.
|
|
57
|
-
# portEnv: PORT
|
|
58
|
-
# # Base port used to derive a unique port for each managed worktree.
|
|
59
|
-
# portStart: 3000
|
|
60
|
-
# # Increment between worktree port allocations.
|
|
61
|
-
# portStep: 10
|
|
62
|
-
# # Host-reachable URL shown in the dashboard when the process is running.
|
|
63
|
-
# urlTemplate: http://localhost:\${PORT}
|
|
64
|
-
|
|
65
|
-
exposure:
|
|
66
|
-
local:
|
|
67
|
-
# Automatically expose detected container ports locally. Use manual to require
|
|
68
|
-
# an explicit action for every service, or http to expose HTTP(S) only.
|
|
69
|
-
autoExpose: all
|
|
70
|
-
# loopback forwards container services to private 127.0.0.1 ports; disabled
|
|
71
|
-
# creates no endpoints at all.
|
|
72
|
-
provider: loopback
|
|
73
|
-
|
|
74
|
-
# Profiles define runtime, permissions, and tmux pane layout.
|
|
75
|
-
profiles:
|
|
76
|
-
default:
|
|
77
|
-
# Panes run on the host; the environment provider controls the development
|
|
78
|
-
# runtime and is automatically resolved from Dev Container, Compose, or Dockerfile.
|
|
79
|
-
runtime: host
|
|
80
|
-
environment:
|
|
81
|
-
provider: ${r}
|
|
82
|
-
# For a host-only project, uncomment a single command that the Runtime pane owns.
|
|
83
|
-
# command: ${o}
|
|
84
|
-
# Forward selected host env vars into the agent process.
|
|
85
|
-
envPassthrough:
|
|
86
|
-
# - ANTHROPIC_API_KEY
|
|
87
|
-
# - OPENAI_API_KEY
|
|
88
|
-
# Extra system instructions for the agent in this profile.
|
|
89
|
-
# systemPrompt: >
|
|
90
|
-
# You are working in \${${O.worktreePath}}
|
|
91
|
-
# Skip agent permission prompts in this profile.
|
|
92
|
-
# yolo: true
|
|
93
|
-
# Panes define the tmux layout created for each worktree session.
|
|
94
|
-
panes:
|
|
95
|
-
# Main AI coding pane.
|
|
96
|
-
- id: agent
|
|
97
|
-
# Pane type: agent, runtime, command, or shell.
|
|
98
|
-
kind: agent
|
|
99
|
-
# Focus this pane when the session opens.
|
|
100
|
-
focus: true
|
|
101
|
-
# Place this pane to the right of the existing layout.
|
|
102
|
-
# split: right
|
|
103
|
-
# Percent of the available space this pane should take.
|
|
104
|
-
# sizePct: 50
|
|
105
|
-
# Start this pane in the repo root or managed worktree.
|
|
106
|
-
# cwd: worktree
|
|
107
|
-
# Runtime console: follows the selected environment's logs, then becomes
|
|
108
|
-
# an interactive shell for status, restart, terminal, and service commands.
|
|
109
|
-
- id: runtime
|
|
110
|
-
kind: runtime
|
|
111
|
-
split: right
|
|
112
|
-
sizePct: 30
|
|
113
|
-
cwd: worktree
|
|
114
|
-
# Example dev server pane.
|
|
115
|
-
# - id: app
|
|
116
|
-
# # Pane type: agent, runtime, command, or shell.
|
|
117
|
-
# kind: command
|
|
118
|
-
# # Place this pane to the right of the existing layout.
|
|
119
|
-
# split: right
|
|
120
|
-
# # Percent of the available space this pane should take.
|
|
121
|
-
# sizePct: 50
|
|
122
|
-
# # Start this pane in the repo root or managed worktree.
|
|
123
|
-
# cwd: worktree
|
|
124
|
-
# # Change into a subdirectory before running the command.
|
|
125
|
-
# workingDir: frontend
|
|
126
|
-
# # Command run when the pane starts. ${h} injects $PORT.
|
|
127
|
-
# command: PORT=$PORT ${o}
|
|
128
|
-
# Example shell pane for manual commands.
|
|
129
|
-
# - id: shell
|
|
130
|
-
# # Pane type: agent, command, or shell.
|
|
131
|
-
# kind: shell
|
|
132
|
-
# # Place this pane below the existing layout.
|
|
133
|
-
# split: bottom
|
|
134
|
-
# # Percent of the available space this pane should take.
|
|
135
|
-
# sizePct: 30
|
|
136
|
-
# # Start this pane in the repo root or managed worktree.
|
|
137
|
-
# cwd: repo
|
|
138
|
-
|
|
139
|
-
# Example sandbox profile that runs panes inside Docker.
|
|
140
|
-
# sandbox:
|
|
141
|
-
# # Run panes inside a container instead of on the host.
|
|
142
|
-
# runtime: docker
|
|
143
|
-
# # Docker image used for the sandbox container.
|
|
144
|
-
# image: ghcr.io/your-org/your-image:latest
|
|
145
|
-
# # Forward selected host env vars into the container.
|
|
146
|
-
# envPassthrough:
|
|
147
|
-
# - ANTHROPIC_API_KEY
|
|
148
|
-
# - OPENAI_API_KEY
|
|
149
|
-
# # Extra system instructions for the agent in this profile.
|
|
150
|
-
# systemPrompt: >
|
|
151
|
-
# Extra instructions for the sandbox profile.
|
|
152
|
-
# # Skip agent permission prompts in this profile.
|
|
153
|
-
# yolo: true
|
|
154
|
-
# # Extra host paths to mount into the container.
|
|
155
|
-
# mounts:
|
|
156
|
-
# # Host path mounted into the sandbox.
|
|
157
|
-
# - hostPath: ~/.codex
|
|
158
|
-
# # Path inside the container.
|
|
159
|
-
# guestPath: /root/.codex
|
|
160
|
-
# # Allow writes through this mount.
|
|
161
|
-
# writable: true
|
|
162
|
-
# # Panes define the tmux layout created for sandbox sessions.
|
|
163
|
-
# panes:
|
|
164
|
-
# # Main AI coding pane.
|
|
165
|
-
# - id: agent
|
|
166
|
-
# # Pane type: agent, command, or shell.
|
|
167
|
-
# kind: agent
|
|
168
|
-
# # Focus this pane when the session opens.
|
|
169
|
-
# focus: true
|
|
170
|
-
# # Example shell pane for manual commands.
|
|
171
|
-
# - id: shell
|
|
172
|
-
# # Pane type: agent, command, or shell.
|
|
173
|
-
# kind: shell
|
|
174
|
-
# # Place this pane to the right of the existing layout.
|
|
175
|
-
# split: right
|
|
176
|
-
# # Start this pane in the repo root or managed worktree.
|
|
177
|
-
# cwd: repo
|
|
178
|
-
|
|
179
|
-
# Integrations connect ${h} to external systems.
|
|
180
|
-
integrations:
|
|
181
|
-
github:
|
|
182
|
-
# Additional local repos ${h} should consider alongside the main repo.
|
|
183
|
-
linkedRepos:
|
|
184
|
-
# GitHub slug for a related repo.
|
|
185
|
-
# - repo: your-org/your-repo
|
|
186
|
-
# # Short label shown in the UI.
|
|
187
|
-
# alias: repo
|
|
188
|
-
# # Relative or absolute path to that local checkout.
|
|
189
|
-
# dir: ../your-repo
|
|
190
|
-
# Remove managed worktrees automatically when their PR merges.
|
|
191
|
-
# autoRemoveOnMerge: true
|
|
192
|
-
linear:
|
|
193
|
-
# Enable Linear issue lookup and linking in the UI.
|
|
194
|
-
enabled: true
|
|
195
|
-
# Auto-create worktrees for assigned issues labeled "${M.label}" or "${M.oneshotLabel}".
|
|
196
|
-
# autoCreateWorktrees: true
|
|
197
|
-
# Show a create-ticket action in the dashboard. The team to file into is
|
|
198
|
-
# picked in the dialog at creation time.
|
|
199
|
-
# createTicketOption: true
|
|
200
|
-
# Restrict the auto-create watcher to issues from these teams. Useful when
|
|
201
|
-
# the authenticated Linear user is in multiple teams or when running ${h}
|
|
202
|
-
# in several projects on the same machine that share a Linear account.
|
|
203
|
-
# watchTeams: [ENG, OPS]
|
|
204
|
-
|
|
205
|
-
# startupEnvs become runtime env vars for panes, agents, and hooks.
|
|
206
|
-
startupEnvs:
|
|
207
|
-
# Example feature flag available in every worktree session.
|
|
208
|
-
# FEATURE_FLAG: true
|
|
209
|
-
# Example service URL built from allocated ports.
|
|
210
|
-
# API_BASE_URL: http://localhost:\${PORT}
|
|
211
|
-
|
|
212
|
-
# lifecycleHooks run custom shell commands during worktree lifecycle events.
|
|
213
|
-
# lifecycleHooks:
|
|
214
|
-
# # Runs after env setup and before panes start.
|
|
215
|
-
# postCreate: npm install
|
|
216
|
-
# # Runs before the worktree directory is removed.
|
|
217
|
-
# preRemove: tmux kill-session -t "$${O.worktreeId}" || true
|
|
218
|
-
|
|
219
|
-
# auto_name lets ${h} generate a branch name when one is not provided.
|
|
220
|
-
# auto_name:
|
|
221
|
-
# # Provider used for automatic branch naming.
|
|
222
|
-
# provider: ${t}
|
|
223
|
-
# # Optional model override. Omit it to use the provider's current default.
|
|
224
|
-
# # model: your-provider-model
|
|
225
|
-
# # Prompt that tells the model how to name branches.
|
|
226
|
-
# system_prompt: >
|
|
227
|
-
# Generate a short kebab-case git branch name.
|
|
228
|
-
`}i(U,"buildStarterTemplate");function Oe(e){let t=/^v?(\d+)/.exec(e.trim());if(!t?.[1])return null;let n=Number.parseInt(t[1],10);return Number.isFinite(n)?n:null}i(Oe,"parseNodeMajor");function ge(e,t=24){let n=Oe(e);return n!==null&&n>=t}i(ge,"isSupportedNodeVersion");function Be(e){if(e.found){console.log(` \u2713 ${e.tool}`),e.probeOk||console.log(` ${e.tool} was found but \`${e.tool} ${e.args.join(" ")}\` failed`);return}if(e.required){console.log(` \u2717 ${e.tool} \u2014 not found (required)`);return}console.log(` \u25CB ${e.tool} \u2014 not found (optional)`)}i(Be,"reportDependency");function ze(){let e=ne();for(let t of e)Be(t);return e}i(ze,"checkDeps");function ke(e){return e==="claude"?"Claude":"Codex"}i(ke,"agentLabel");function He(e){let t=`\
|
|
229
|
-
${e}: `,n=!0,o=!1,r=!1,s=i(()=>{o&&!n&&process.stdout.write(`
|
|
230
|
-
`),o=!1,n=!0},"closeAssistantLine"),d=i(c=>{if(c){o=!0,r=!0;for(let f of c)n&&(process.stdout.write(t),n=!1),process.stdout.write(f),f===`
|
|
231
|
-
`&&(n=!0)}},"writeAssistantChunk");return{onEvent(c){if(c.kind==="assistant_delta"){d(c.text);return}if(c.kind==="assistant_done"){s();return}s();let f=c.kind==="warning"?"warning":"status";console.log(` ${e} ${f}: ${c.text}`)},finish(){s()},sawAssistantText(){return r}}}i(He,"createAgentStreamPrinter");function Ye(e,t){return e.analyze===null&&e.runtime==="auto"&&t==="host"}i(Ye,"needsInteractiveAnalysisFallback");function Ge(e,t){return e.analyze==="auto"?e.runtime==="auto"&&t==="host"?S.defaultAgent:
|
|
232
|
-
null:e.analyze}i(Ge,"resolveInitAnalysis");async function qe(){let e=await te({message:"No Dev Container, Compose, or Dockerfile was found. Analyze the repository to prepare its host runtime?",options:[{value:"claude",label:"Analyze with Claude"},{value:"codex",label:"Analyze with Codex"},{value:"manual",label:"Skip analysis; create the starter config"}]});return Z(e)||e==="manual"?null:e}i(qe,"selectFallbackAgent");function At(e){let t=["devcontainer","compose","dockerfile","host"].filter(s=>e[s]),
|
|
233
|
-
n=e.runtime??"auto",o=n==="auto"?t:[n,...t];if(o.length>1)throw new F("Choose only one runtime override");let r=e.analyze??null;if(r!==null&&r!=="auto"&&r!=="claude"&&r!=="codex")throw new F("--analyze must be auto, claude, or codex");return{analyze:r,runtime:o[0]??"auto"}}i(At,"initOptionsFromCli");async function Je(e){let t=X(),n=!1;try{await V(W(t)).addProject({body:{path:e}}),n=!0}catch{}return K().add({path:e,name:D(e),addedAt:Date.now()}),n?"hub":"registry"}i(Je,"registerProject");function Ke(e){
|
|
234
|
-
a.info("Detected:"),a.message(` ${e.devcontainerConfigs.length?"\u2713":"\u25CB"} Dev Container${e.devcontainerConfigs.length?` (${e.devcontainerConfigs.join(", ")})`:""}`),a.message(` ${e.composeFiles.length?"\u2713":"\u25CB"} Docker Compose${e.composeFiles.length?` (${e.composeFiles.join(", ")})`:""}`),a.message(` ${e.dockerfile?"\u2713":"\u25CB"} Dockerfile`),a.message(` ${e.packageJson?"\u2713":"\u25CB"} package.json`),a.message(` \u2713 Runtime strategy: ${e.selectedRuntime}`)}i(Ke,"re\
|
|
235
|
-
portDetection");async function bt(e){ee(`${R()} init`);let t=Q();if(!t){a.error("Not inside a git repository. Run this from within a project."),w("Aborted."),process.exitCode=1;return}a.success(`Git root: ${t}`),a.step("Checking dependencies...");let n=ze(),o=re(n);if(o.length>0){let x=o.map(l=>` ${l.tool}: ${l.hint}`).join(`
|
|
236
|
-
`);C(x,`Install these required dependencies, then re-run ${R()} init`),w("Setup incomplete."),process.exitCode=1;return}if(!ge(process.versions.node)){a.error(`Node ${process.versions.node} is too old. ${h} requires Node >= ${24}.`),a.info("Install the current Node.js LTS from https://nodejs.org/"),w("Setup incomplete."),process.exitCode=1;return}n.find(x=>x.tool==="gh")?.found&&(I("gh",["auth","status"]).success?a.success("gh \u2014 authenticated"):a.warning("gh is installed but not authenticat\
|
|
237
|
-
ed. Run: gh auth login")),a.step("Checking config files...");let r=q(t).config,s=le(t,e.runtime);Ke(s);let d=s.selectedRuntime,c=Ge(e,d),f=he(r);if(f?a.info(`${p} already exists`):Ye(e,d)&&(c=await qe()),f&&c===null)a.info("Existing configuration was preserved.");else{let l=ce(t,c??"claude");if(await Fe(Ue(r),{recursive:!0}),c===null)await ye(r,U({projectName:l.projectName,mainBranch:l.mainBranch,defaultAgent:l.defaultAgent,packageManager:l.packageManager,environmentProvider:s.selectedRuntime})),
|
|
238
|
-
a.success(`${p} created from deterministic detection`);else{if(!oe(n.find(_=>_.tool===c)??{found:!1})){a.error(`${ke(c)} CLI was not found`),w("Setup incomplete."),process.exitCode=1;return}let u=ke(c),b=U({projectName:l.projectName,mainBranch:l.mainBranch,defaultAgent:c,packageManager:l.packageManager,environmentProvider:s.selectedRuntime});f||await ye(r,b);let j=ue({...l,defaultAgent:c}),$=me(c,j),N=He(u);a.step(`Running ${u} to adapt ${p}...`);let g=await fe($,t,{onEvent:N.onEvent});if(N.finish(),
|
|
239
|
-
!he(r)){a.error(`${u} removed ${p}`);let _=[g.summary?`Summary:
|
|
240
|
-
${g.summary}`:"",g.stderr.trim()?`stderr:
|
|
241
|
-
${g.stderr.trim()}`:""].filter(xe=>xe.length>0).join(`
|
|
242
|
-
|
|
243
|
-
`);_&&C(_,`${u} output`),w("Setup incomplete."),process.exitCode=1;return}let ve=await Le(r,"utf8"),z=f||ve!==b;g.exitCode===0&&z?a.success(`${u} adapted ${p}`):g.exitCode===0?(a.warning(`${u} left the starter template unchanged`),a.warning(`${u} did not change the starter template. Review ${p} manually.`)):z?(a.warning(`${u} updated ${p}`),a.warning(`${u} exited with code ${g.exitCode}. Review the generated file before using it.`)):(a.warning(`${u} left the starter template in place`),a.warning(
|
|
244
|
-
`${u} exited with code ${g.exitCode}. The starter template is still there for manual editing.`)),g.summary&&!N.sawAssistantText()&&C(g.summary,`${u} summary`);let H=g.stderr.trim();H&&C(H,`${u} stderr`)}}let E=await Je(t);a.success(`Project registered${E==="hub"?" with the running host daemon":" for the next host daemon start"}`),w("You're all set! Next steps:"),console.log(),console.log(` 1. Review ${p} and adjust runtime and exposure overrides if needed`),console.log(" 2. Keep the host daemo\
|
|
245
|
-
n running: portta host serve --detach (or portta host service install)"),console.log(` 3. Enable tab completion: eval "$(${R()} completion zsh)" (or bash)`),console.log()}i(bt,"runInit");export{At as initOptionsFromCli,Ge as resolveInitAnalysis,bt as runInit};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as s,c as l,e as c}from"./chunk-3EZNE4MC.js";import{t as m}from"./chunk-OPVZAG2C.js";import"./chunk-4TGTGGMK.js";import"./chunk-UX7P3YHF.js";import{Pb as i}from"./chunk-4YGEG6YX.js";import"./chunk-VDSWNWUY.js";import"./chunk-5SBYE3YH.js";import"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-GI2EUNAK.js";import"./chunk-EYT7VTYA.js";import"./chunk-MH5YJA5O.js";import"./chunk-QBKADN76.js";
|
|
4
|
-
import"./chunk-EFZZFIRZ.js";import"./chunk-SBVO6RXF.js";import"./chunk-EH7H7D7J.js";import"./chunk-O6U47HHQ.js";import"./chunk-FRQCKCCK.js";import"./chunk-TA2XHP5D.js";import"./chunk-T3TSZO4I.js";import"./chunk-UUSUJUAD.js";import{a}from"./chunk-6J5HN4ZN.js";function g(r){let e=i(r);if(e.kind==="team")return{kind:"team",teamKey:e.teamKey};throw e.kind==="issue"?new s(`Post target must be a team key (e.g. ENG). To post to issue ${e.issueId} as part of a session, use --linear ${e.issueId} on the oneshot/add command (loads issue context and posts back to it).`):new s(`Invalid Linear team key "${e.raw}". Use a team key like ENG.`)}a(g,"parseLinearTargetArg");function P(r,e,o){let t=o.title??null,n=g(e),d=n.kind==="team"&&t?{kind:"team",teamKey:n.teamKey,
|
|
5
|
-
title:t}:n;return{branch:r,target:d,titleOverride:t}}a(P,"linearPostFromCli");async function f(r,e){try{let t=await m(await c(e)).postWorktreeToLinear({params:{name:r.branch},body:{target:r.target}});return console.log(`Posted to Linear issue: ${t.issueUrl}`),t.commentUrl&&console.log(`Comment: ${t.commentUrl}`),console.log(`Attachment: ${t.attachmentUrl}`),0}catch(o){return console.error(l(o,e)),1}}a(f,"runLinearCommand");export{P as linearPostFromCli,g as parseLinearTargetArg,f as runLinearCommand};
|
package/dist/oneshot-DL57ZA55.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as Q,f as Z,g as ee}from"./chunk-LAYNTFDR.js";import{a as w,b as V,c as E,e as X}from"./chunk-3EZNE4MC.js";import{q as L,s as F,t as z,u as Y}from"./chunk-OPVZAG2C.js";import"./chunk-4TGTGGMK.js";import{c as J}from"./chunk-UX7P3YHF.js";import{Pb as M,Qb as _,Rb as D,Tb as q,Ub as j,Wb as P,kc as H,lc as K,mc as B,nc as G}from"./chunk-4YGEG6YX.js";import"./chunk-VDSWNWUY.js";import"./chunk-5SBYE3YH.js";import"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";
|
|
4
|
-
import"./chunk-IILMQFWO.js";import"./chunk-GI2EUNAK.js";import"./chunk-EYT7VTYA.js";import"./chunk-MH5YJA5O.js";import"./chunk-QBKADN76.js";import"./chunk-EFZZFIRZ.js";import"./chunk-SBVO6RXF.js";import"./chunk-EH7H7D7J.js";import"./chunk-O6U47HHQ.js";import"./chunk-FRQCKCCK.js";import"./chunk-TA2XHP5D.js";import{a as I}from"./chunk-T3TSZO4I.js";import"./chunk-UUSUJUAD.js";import{a as o}from"./chunk-6J5HN4ZN.js";var W=null;function R(e){return z(W??L(e))}o(R,"oneshotApi");function Oe(e,r){let t={},n=e??null,m=r.branch!==void 0,i=r.prompt??null,a=r.resume!==void 0,l=r.resume?.trim()??null,u=null,h=null;if(r.agent!==void 0&&(t.agent=r.agent.trim()),r.base!==void 0&&(t.baseBranch=r.base),r.profile!==void 0&&(t.profile=r.profile),r.linear!==void 0){let d=M(r.linear);if(d.kind==="issue")u=d.issueId,h={kind:"issue",issueId:d.issueId};else if(d.kind==="team")h={kind:"team",teamKey:d.teamKey};else throw new w(`\
|
|
5
|
-
--linear expects either an issue id (ENG-123) or a team key (ENG); got "${d.raw}"`)}if(r.branch!==void 0){if(n&&n!==r.branch)throw new w(`Conflicting branch values: "${n}" and "${r.branch}"`);n=r.branch.trim()}if(a){if(u)throw new w("Cannot use --resume with --linear <issue-id>");if(m)throw new w("Cannot use --branch with --resume; --resume already names the branch");if(!l)throw new w("--resume requires a branch name");if(n&&n!==l)throw new w("Cannot pass both a positional branch and --resume");
|
|
6
|
-
if(!i)throw new w("--resume requires --prompt; use the dashboard to re-attach without re-prompting");n=l}if(m&&!u)throw new w("--branch only applies with --linear; pass the branch as a positional argument otherwise");if(!a&&!u&&!i)throw new w("oneshot requires --prompt (or use --linear)");n&&(t.branch=n),i&&(t.prompt=i);let f=V(r.env);return f&&(t.envOverrides=f),{branch:n,prompt:i,resume:a,body:t,keepOpen:!!r.keepOpen,fromLinearIssueId:u,postToLinearTarget:h}}o(Oe,"oneshotFromCli");function s(){
|
|
7
|
-
let e=new Date,r=String(e.getHours()).padStart(2,"0"),t=String(e.getMinutes()).padStart(2,"0"),n=String(e.getSeconds()).padStart(2,"0");return`${r}:${t}:${n}`}o(s,"timestamp");function se(e,r){return`[${s()}] [${e}] ${r}`}o(se,"formatLogLine");var oe={bash:["command"],bashoutput:["bash_id"],killshell:["shell_id"],read:["file_path"],edit:["file_path"],multiedit:["file_path"],write:["file_path"],notebookedit:["notebook_path"],glob:["pattern"],grep:["pattern"],webfetch:["url"],websearch:["query"],task:[
|
|
8
|
-
"description","subagent_type"],exitplanmode:["plan"]};function C(e,r){let t=e.replace(/\s+/g," ").trim();return t.length<=r?t:`${t.slice(0,r)}\u2026`}o(C,"truncateInline");function ae(e,r){let t=null;try{let i=JSON.parse(r);i&&typeof i=="object"&&!Array.isArray(i)&&(t=i)}catch{return C(r,100)}if(!t)return C(r,100);if(e.toLowerCase()==="askuserquestion"&&Array.isArray(t.questions)){let i=[];for(let a of t.questions)if(a&&typeof a=="object"&&!Array.isArray(a)){let l=a.header;typeof l=="string"&&i.
|
|
9
|
-
push(l)}if(i.length>0)return C(i.join(", "),120)}let n=oe[e.toLowerCase()];if(n){let i=[];for(let a of n){let l=t[a];typeof l=="string"&&l.length>0&&i.push(l)}if(i.length>0)return C(i.join(" "),120)}let m=[];for(let[i,a]of Object.entries(t))typeof a=="string"&&m.push(`${i}=${C(a,40)}`);return m.length===0?"":C(m.join(" "),120)}o(ae,"summarizeToolInput");function le(e){let r=e.split(`
|
|
10
|
-
`).map(n=>n.trimEnd()).filter(n=>n.length>0);if(r.length===0)return"(empty)";let t=C(r[0]??"",200);return r.length>1?`${t} (+${r.length-1} lines)`:t}o(le,"summarizeToolResult");function ue(e){let r=e.kind??"text";if(r==="toolUse"){let t=e.toolName??"tool",n=ae(t,e.text);return`[${s()}] \u25CF ${t}(${n})`}return r==="toolResult"?`[${s()}] \u23BF ${le(e.text)}`:se(e.role,e.text)}o(ue,"formatConversationLine");function y(e){e.streamingItemId!==null&&(process.stdout.write(`
|
|
11
|
-
`),e.streamingItemId=null,e.streamingText="",e.streamingTurnId=null,e.streamingNeedsHeader=!1)}o(y,"flushStreamingLine");function ce(e){return e.kind??"text"}o(ce,"messageKind");function de(e,r){return e.streamingItemId===null?!1:e.streamingItemId===r.id?!0:r.role!=="assistant"||ce(r)!=="text"||e.streamingText.length===0?!1:r.turnId===e.streamingTurnId&&(e.streamingText.startsWith(r.text)||r.text.startsWith(e.streamingText))}o(de,"isSameStreamingMessage");function O(e,r){for(let t of r)if(!e.printedMessageIds.
|
|
12
|
-
has(t.id)){if(de(e,t)){e.printedMessageIds.add(t.id),t.status==="completed"&&y(e);continue}if(y(e),t.text.trim().length===0){e.printedMessageIds.add(t.id);continue}process.stdout.write(`${ue(t)}
|
|
13
|
-
`),e.printedMessageIds.add(t.id)}}o(O,"printNewMessages");function me(e,r,t){if(e.type==="messageDelta"){if(e.revision<=r.lastStreamRevision)return;r.lastStreamRevision=e.revision,r.streamingItemId!==e.itemId&&(y(r),r.streamingItemId=e.itemId,r.streamingText="",r.streamingTurnId=e.turnId,r.streamingNeedsHeader=!0),r.streamingNeedsHeader&&(process.stdout.write(`[${s()}] [assistant] `),r.streamingNeedsHeader=!1),process.stdout.write(e.delta),r.streamingText+=e.delta;return}if(e.type==="messageUpse\
|
|
14
|
-
rt"){if(e.revision<=r.lastStreamRevision)return;r.lastStreamRevision=e.revision,O(r,[e.message]);return}if(e.type==="conversationStatus"){if(e.revision<=r.lastStreamRevision)return;r.lastStreamRevision=e.revision,e.running||y(r);return}if(e.type==="error"){y(r),t(`[${s()}] [error] ${e.message}`);return}}o(me,"handleConversationEvent");var re=30,fe=[3,15];function pe(e,r,t,n,m){let i=!1,a=null,l=null,u=0,h=o(()=>{if(i)return;let f=Y(W??L(r),D.streamAgentsWorktreeConversation.replace(":name",encodeURIComponent(
|
|
15
|
-
e))),d=new P(f,{headers:F()});a=d,d.addEventListener("open",()=>{u=0,t.lastStreamRevision=0}),d.addEventListener("message",v=>{if(typeof v.data=="string")try{let S=_.parse(JSON.parse(v.data));me(S,t,n)}catch{n(`[${s()}] [error] received malformed conversation stream data`)}}),d.addEventListener("close",()=>{if(a=null,!i){if(u+=1,fe.includes(u)&&n(`[${s()}] [warn] ${I} server unreachable, retrying (${u}/${re})`),u>=re){i=!0,m(`${I} server unreachable after ${u} reconnect attempts`);return}l=setTimeout(
|
|
16
|
-
h,2e3)}}),d.addEventListener("error",()=>{})},"connect");return h(),{close:o(()=>{i=!0,l&&clearTimeout(l),a&&(a.readyState===P.OPEN||a.readyState===P.CONNECTING)&&a.close()},"close")}}o(pe,"streamConversation");var ge=15e3;function te(e,r,t){for(let n of r.prs)e.seenPrUrls.has(n.url)||(e.seenPrUrls.add(n.url),t(`PR #${n.number} opened: ${n.url}`)),n.state==="merged"&&!e.seenMergedUrls.has(n.url)&&(e.seenMergedUrls.add(n.url),t(`PR #${n.number} merged: ${n.url}`))}o(te,"recordPrEvents");function he(e,r,t,n,m){
|
|
17
|
-
let i=R(r),a=!1,l=null,u=o(async()=>{try{let f=await i.syncWorktreePrs({params:{name:e}});te(t,f,n.onPrEvent)}catch(f){let d=f instanceof Error?f.message:String(f);m(`[${s()}] [warn] failed to sync PRs from server: ${d}`)}},"forcePrSync"),h=o(async()=>{if(!a){try{let d=(await i.fetchWorktrees()).worktrees.find(v=>v.branch===e);if(d){if(d.mux&&(t.hadOpenSession=!0,t.consecutiveClosedReadings=0),te(t,d,n.onPrEvent),d.oneshot)t.watcherWasArmed=!0;else if(t.watcherWasArmed&&d.mux){n.onUserTookOver();
|
|
18
|
-
return}if(t.hadOpenSession&&!d.mux&&(t.consecutiveClosedReadings+=1,t.consecutiveClosedReadings>=2)){n.onSessionClosed();return}let v=d.status,S=v==="stopped"||v==="error";if(S||v==="idle"){if(t.idleSinceMs===null&&(t.idleSinceMs=Date.now()),S||Date.now()-t.idleSinceMs>=ge){await u(),t.seenPrUrls.size>0?n.onAgentDone(`agent ${v} after opening PR`):n.onAgentStuck(`agent ${v} without opening a PR`);return}}else t.idleSinceMs=null}else if(t.hadOpenSession){n.onWorktreeRemoved();return}}catch{}l=setTimeout(
|
|
19
|
-
h,3e3)}},"tick");return h(),{stop:o(()=>{a=!0,l&&clearTimeout(l)},"stop")}}o(he,"pollProjectState");async function ve(e,r,t){let n=R(r),m=Date.now()+6e4;for(;Date.now()<m;){try{let a=(await n.fetchWorktrees()).worktrees.find(l=>l.branch===e);if(a?.mux&&a.status!=="creating"&&a.status!=="closed")return{ready:!0,worktree:a}}catch{}await new Promise(i=>setTimeout(i,500))}return t(`[${s()}] [error] timed out waiting for ${e} session to start`),{ready:!1}}o(ve,"ensureWorktreeReady");function $e(e,r){
|
|
20
|
-
O(r,e.conversation.messages)}o($e,"printConversationHistory");function we(e,r,t){let n=R(r),m=!1,i=null,a=o(async()=>{if(!m){try{let l=await n.fetchAgentsWorktreeConversationHistory({params:{name:e}});O(t,l.conversation.messages)}catch{}m||(i=setTimeout(a,2e3))}},"tick");return a(),{stop:o(()=>{m=!0,i&&clearTimeout(i)},"stop")}}o(we,"pollConversationHistory");function ye(e){return e==="codex"?"history":"stream-and-history"}o(ye,"oneshotConversationTransport");async function be(e,r){if(!process.stdin.
|
|
21
|
-
isTTY)return process.stderr.write(`[${s()}] [warn] non-interactive shell; ignoring possible duplicate ${e.identifier}: "${e.title}" (${e.url})
|
|
22
|
-
`),"create_new";Z(`${e.identifier}: ${e.title}
|
|
23
|
-
${e.url}`,"Possible existing match");let t=await ee({message:`Found a possible existing match. What should ${I} do?`,initialValue:"use_existing",options:[{value:"use_existing",label:`Use existing (${e.identifier})`,hint:"Treat this oneshot as resuming the existing issue"},{value:"create_new",label:"Create new issue",hint:`Title: "${r}"`},{value:"cancel",label:"Cancel",hint:"Don't start the oneshot"}]});return Q(t)?"cancel":t}o(be,"promptDuplicateChoice");async function Ue(e,r){let t=o(c=>{process.
|
|
24
|
-
stdout.write(`${c}
|
|
25
|
-
`)},"stdout"),n=o(c=>{process.stderr.write(`${c}
|
|
26
|
-
`)},"stderr");try{W=await X(r)}catch(c){return n(`[${s()}] [error] ${E(c,r)}`),1}let m=R(r),i=e.branch,a={...e.body},l=e.fromLinearIssueId,u=e.postToLinearTarget;try{let c=null;if(u){let p=await m.fetchAutoNameConfig();if(p.linearAvailability==="missing_api_key")return n(`[${s()}] [error] server has no LINEAR_API_KEY \u2014 the post-back to Linear at the end of the run will fail. Set the env var on the ${I} server and restart it.`),1;if(p.linearAvailability==="disabled")return n(`[${s()}] [error\
|
|
27
|
-
] Linear integration is disabled on the ${I} server.`),1;c=p.autoName}if(u?.kind==="team"){if(!e.prompt)return n(`[${s()}] [error] --linear ${u.teamKey} requires --prompt to derive an issue title`),1;let p=await B({prompt:e.prompt,autoName:c});if(!p)return n(`[${s()}] [error] could not derive a title from --prompt`),1;p.source==="llm"&&t(`[${s()}] [event] polished title: "${p.title}"`),e.resume&&t(`[${s()}] [event] no Linear issue for this resume; creating a fresh ${u.teamKey}-N for the post-bac\
|
|
28
|
-
k`);let g=await q(u.teamKey);if(!g.ok)return n(`[${s()}] [error] Linear team lookup failed: ${g.error}`),1;let $=null;if(c&&($=await G({polishedTitle:p.title,prompt:e.prompt,teamId:g.data.id,autoName:c})),$){let b=await be($,p.title);if(b==="cancel")return t(`[${s()}] [event] cancelled by user`),0;b==="use_existing"?(t(`[${s()}] [event] using existing Linear issue ${$.identifier} \u2192 ${$.url}`),l=$.identifier,u={kind:"issue",issueId:$.identifier}):t(`[${s()}] [event] user chose to create a ne\
|
|
29
|
-
w issue despite candidate ${$.identifier}`)}if(u.kind==="team"){t(`[${s()}] [event] creating Linear issue in team ${u.teamKey}...`);let b=await j({teamId:g.data.id,title:p.title,description:""});if(!b.ok)return n(`[${s()}] [error] Linear issue creation failed: ${b.error}`),1;t(`[${s()}] [event] created Linear issue ${b.data.identifier} \u2192 ${b.data.url}`),l=b.data.identifier,u={kind:"issue",issueId:b.data.identifier}}}if(l){t(`[${s()}] [event] resolving Linear issue ${l}...`);let p=await K({issueId:l},
|
|
30
|
-
H);if(!p.ok)return n(`[${s()}] [error] Linear seed lookup failed: ${p.error}`),1;let g=p.data;t(`[${s()}] [event] seed source: ${g.source}${g.branch?` branch=${g.branch}`:""}${g.prUrl?` pr=${g.prUrl}`:""}`);let $=i??g.branch??null;if(!$)return n(`[${s()}] [error] Linear issue did not resolve to a branch; pass --branch to override.`),1;i=$,a.branch=$,g.source!=="none"&&(a.mode="existing"),a.fromLinear={issueId:l,...g.conversationMarkdown?{conversationContext:g.conversationMarkdown}:{}}}let ie=i?(await m.
|
|
31
|
-
fetchWorktrees()).worktrees.find(p=>p.branch===i):void 0,N={autoCloseOnDone:!e.keepOpen,...u?{postToLinearOnDone:u}:{}};if(e.resume||ie){if(!i)throw new Error("resume requires a branch name");let p=e.resume?"resuming":`worktree exists, resuming ${i}`;t(`[${s()}] [event] ${p}`),l&&t(`[${s()}] [event] skipping Linear seed \u2014 agent's existing session history already covers it`),await m.openWorktree({params:{name:i},body:{...e.prompt?{prompt:e.prompt}:{},oneshot:N}}),e.prompt&&t(`[${s()}] [event\
|
|
32
|
-
] sent prompt`)}else t(`[${s()}] [event] creating worktree${i?` ${i}`:""}...`),i=(await m.createWorktree({body:{...a,source:"oneshot",oneshot:N}})).primaryBranch,t(`[${s()}] [event] created ${i}`)}catch(c){return n(`[${s()}] [error] ${E(c,r)}`),1}if(!i)return n(`[${s()}] [error] could not resolve branch`),1;let h=await ve(i,r,n);if(!h.ready)return 1;let f={printedMessageIds:new Set,streamingItemId:null,streamingText:"",streamingTurnId:null,streamingNeedsHeader:!1,lastStreamRevision:0};try{let c=await m.
|
|
33
|
-
fetchAgentsWorktreeConversationHistory({params:{name:i}});$e(c,f)}catch{}let d,v=new Promise(c=>{d=c}),S=!1,x=null,A=null,U=null,k=o(c=>{S||(S=!0,x?.close(),A?.stop(),U?.stop(),y(f),d(c))},"finalize");ye(h.worktree.agentName)==="stream-and-history"&&(x=pe(i,r,f,n,c=>{n(`[${s()}] [fatal] ${c}`),k(1)})),A=we(i,r,f),U=he(i,r,{seenPrUrls:new Set,seenMergedUrls:new Set,hadOpenSession:!1,consecutiveClosedReadings:0,idleSinceMs:null,watcherWasArmed:!1},{onSessionClosed:o(()=>{t(`[${s()}] [event] sessio\
|
|
34
|
-
n closed \u2014 exiting`),k(0)},"onSessionClosed"),onWorktreeRemoved:o(()=>{t(`[${s()}] [event] worktree removed \u2014 exiting`),k(0)},"onWorktreeRemoved"),onPrEvent:o(c=>{y(f),t(`[${s()}] [event] ${c}`)},"onPrEvent"),onAgentDone:o(c=>{y(f),t(`[${s()}] [event] ${c} \u2014 exiting`),k(0)},"onAgentDone"),onAgentStuck:o(c=>{y(f),n(`[${s()}] [error] ${c}`),k(1)},"onAgentStuck"),onUserTookOver:o(()=>{y(f),t(`[${s()}] [event] user took over from the browser \u2014 exiting`),k(0)},"onUserTookOver")},n);
|
|
35
|
-
let T=o(()=>{t(`
|
|
36
|
-
[${s()}] [event] interrupted \u2014 worktree ${i} keeps running`),t(`[${s()}] [event] resume with: ${J()} oneshot --resume ${i} --prompt <text>`),k(130)},"onSignal");process.on("SIGINT",T),process.on("SIGTERM",T);let ne=await v;return process.off("SIGINT",T),process.off("SIGTERM",T),ne}o(Ue,"runOneshot");export{ye as oneshotConversationTransport,Oe as oneshotFromCli,Ue as runOneshot};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-5SBYE3YH.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-EFZZFIRZ.js";import"./chunk-T3TSZO4I.js";import"./chunk-6J5HN4ZN.js";export{a as OPENCODE_MIN_VERSION,b as OpencodeWorker};
|
package/dist/pi-L73UX3S5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-EFZZFIRZ.js";import"./chunk-T3TSZO4I.js";import"./chunk-6J5HN4ZN.js";export{a as PI_MIN_VERSION,b as PiWorker};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{c as d}from"./chunk-3EZNE4MC.js";import{q as p,t as l}from"./chunk-OPVZAG2C.js";import"./chunk-4TGTGGMK.js";import{c as m}from"./chunk-UX7P3YHF.js";import"./chunk-4YGEG6YX.js";import"./chunk-VDSWNWUY.js";import"./chunk-5SBYE3YH.js";import"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-GI2EUNAK.js";import"./chunk-EYT7VTYA.js";import"./chunk-MH5YJA5O.js";import"./chunk-QBKADN76.js";
|
|
4
|
-
import"./chunk-EFZZFIRZ.js";import"./chunk-SBVO6RXF.js";import"./chunk-EH7H7D7J.js";import"./chunk-O6U47HHQ.js";import"./chunk-FRQCKCCK.js";import"./chunk-TA2XHP5D.js";import{h as s}from"./chunk-T3TSZO4I.js";import"./chunk-UUSUJUAD.js";import{a as i}from"./chunk-6J5HN4ZN.js";import{resolve as f}from"node:path";import{setTimeout as P}from"node:timers/promises";var h=700,j=5*6e4;function g(r){switch(r){case"creating_config":return`Creating ${s}`;case"analyzing":return"Analyzing project structure";case"ready":return"Project ready";case"failed":return"Setup failed"}}i(g,"projectSetupPhaseLabel");async function w(r,o){let c=o.log??(e=>console.log(e)),n=o.now??Date.now,t=n()+(o.timeoutMs??j),a=null;for(;n()<t;){let e;try{e=(await o.poll()).find(u=>u.path===r)}catch{e=void 0}if(e&&e.phase!==a&&(a=e.phase,e.phase!=="ready"&&e.phase!=="failed"&&c(` ${g(e.phase)}\
|
|
5
|
-
\u2026`)),e?.phase==="ready")return e;if(e?.phase==="failed")throw new Error(e.error??"Project setup failed.");await o.sleep(h)}throw new Error("Project setup timed out.")}i(w,"awaitProjectSetup");function _(r){let[o]=r.path.slice(1);return o==="add"?{subcommand:o,path:r.args[0]??"."}:o==="rm"?{subcommand:o,prefix:String(r.args[0])}:{subcommand:"ls"}}i(_,"projectFromCli");async function v(r,o){let c=l(p(o));try{if(r.subcommand==="ls"){let{projects:n}=await c.fetchProjects();if(n.length===0)return console.
|
|
6
|
-
log(`No projects. Add one with: ${m()} project add [path]`),0;for(let t of n){let a=t.active?"\u25CF":"\u25CB";console.log(`${a} ${t.prefix} ${t.name} ${t.path}`)}return 0}if(r.subcommand==="add"){let n=f(process.cwd(),r.path),t=await c.addProject({body:{path:n}});if(!t.initializing)return t.project?(console.log(`Added ${t.project.name} (${t.project.prefix}) \u2014 ${t.project.path}`),0):(console.error("Server accepted the project but returned nothing to open."),1);let a=await w(t.path,{poll:i(async()=>(await c.
|
|
7
|
-
projectInits()).inits,"poll"),sleep:i(e=>P(e),"sleep")});return console.log(`Added ${a.name??a.prefix} (${a.prefix}) \u2014 ${t.path}`),0}return await c.removeProject({params:{prefix:r.prefix}}),console.log(`Removed project: ${r.prefix}`),0}catch(n){return console.error(d(n,o)),1}}i(v,"runProjectCommand");export{w as awaitProjectSetup,_ as projectFromCli,v as runProjectCommand};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{b as a}from"./chunk-TA2XHP5D.js";import"./chunk-T3TSZO4I.js";import{a as e}from"./chunk-6J5HN4ZN.js";import{existsSync as p}from"node:fs";import{readFile as v}from"node:fs/promises";import{resolve as l}from"node:path";function f(){return a().env}e(f,"taskflowConfigEnvPath");async function c(o){if(!p(o))return[];let t=[],n=(await v(o,"utf8")).split(`
|
|
4
|
-
`);for(let m of n){let r=m.trim();if(!r||r.startsWith("#"))continue;let i=r.indexOf("=");if(i===-1)continue;let s=r.slice(0,i).trim(),d=r.slice(i+1).trim().replace(/^["']|["']$/g,"");s in process.env||(process.env[s]=d,t.push(s))}return t}e(c,"loadEnvFile");async function h(o=process.cwd()){let t=new Set;for(let n of await c(l(o,".env.local")))t.add(n);for(let n of await c(l(o,".env")))t.add(n);for(let n of await c(f()))t.add(n);return t}e(h,"loadProjectEnv");export{h as loadProjectEnv};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as s,c as v,d as u,e as S}from"./chunk-3EZNE4MC.js";import{t as I}from"./chunk-OPVZAG2C.js";import"./chunk-4TGTGGMK.js";import"./chunk-UX7P3YHF.js";import{Ob as k}from"./chunk-4YGEG6YX.js";import"./chunk-VDSWNWUY.js";import"./chunk-5SBYE3YH.js";import"./chunk-CFWGQ7VJ.js";import"./chunk-QS5PHDYT.js";import"./chunk-IILMQFWO.js";import"./chunk-GI2EUNAK.js";import"./chunk-EYT7VTYA.js";import"./chunk-MH5YJA5O.js";
|
|
4
|
-
import"./chunk-QBKADN76.js";import"./chunk-EFZZFIRZ.js";import"./chunk-SBVO6RXF.js";import"./chunk-EH7H7D7J.js";import"./chunk-O6U47HHQ.js";import"./chunk-FRQCKCCK.js";import"./chunk-TA2XHP5D.js";import"./chunk-T3TSZO4I.js";import"./chunk-UUSUJUAD.js";import{a as f}from"./chunk-6J5HN4ZN.js";function b(r){try{let n=JSON.parse(r);if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("not an object");return n}catch{throw new s("--input-json must be a JSON object")}}f(b,"parseJson");function J(r,n){if(n.input!==void 0&&n.inputJson!==void 0)throw new s("Use only one of --input or --input-json");let t=n.inputJson!==void 0?b(n.inputJson):n.input??"",{profile:e,harness:d,provider:i,model:c,branch:p,base:o}=n,w;if(n.transport!==void 0){if(n.transport!=="native"&&n.transport!=="a\
|
|
5
|
-
cp")throw new s("--transport must be native or acp");w=n.transport}let l;if(n.permissionMode!==void 0){let a=n.permissionMode;if(a!=="interactive"&&a!=="workspace"&&a!=="deny")throw new s("--permission-mode must be interactive, workspace, or deny");l=a}let g;if(n.mcpJson!==void 0)try{g=k.array().parse(JSON.parse(n.mcpJson))}catch{throw new s("--mcp-json must be a valid stdio MCP server array")}let m;if(n.workspace!==void 0){let a=n.workspace;if(a!=="worktree"&&a!=="branch"&&a!=="current")throw new s(
|
|
6
|
-
"--workspace must be worktree, branch, or current");m=a==="worktree"?"isolated_worktree":a==="branch"?"new_branch":"current_branch"}if(m==="current_branch"&&(p||o))throw new s("--branch and --base do not apply to --workspace current");m===void 0&&(p||o)&&(m="isolated_worktree");let y=m===void 0?void 0:m==="current_branch"?{strategy:"current_branch"}:{strategy:m,...p?{branch:p}:{},...o?{baseBranch:o}:{}};if(r!=="direct"&&l==="interactive")throw new s("--permission-mode interactive is only availab\
|
|
7
|
-
le for Direct Runs");if(r!=="direct")return{command:"runs",action:"create",mode:"workflow",workflowId:r,input:t,...e?{profile:e}:{},...y?{workspace:y}:{},...w?{transport:w}:{},...l?{permissionMode:l}:{},...g?{mcpServers:g}:{}};if(!d)throw new s("run direct requires --harness <agent>");return{command:"runs",action:"create",mode:"direct",harness:d,input:t,...e?{profile:e}:{},...i?{provider:i}:{},...c?{model:c}:{},...y?{workspace:y}:{},...w?{transport:w}:{},...l?{permissionMode:l}:{},...g?{mcpServers:g}:
|
|
8
|
-
{}}}f(J,"buildRunCreate");function O(r){let[n,t]=r.path,[e="",d="",i=""]=r.args.map(String);if(n==="workflows")return{command:n,action:"list"};if(n==="run")return J(t==="direct"?"direct":e,r.options);switch(t){case"show":case"cancel":case"resume":return{command:"runs",action:t,runId:e};case"transcript":return{command:"runs",action:t,executionId:e};case"permission":return{command:"runs",action:t,runId:e,requestId:d,optionId:i==="deny"?null:i};default:return{command:"runs",action:"list"}}}f(O,"run\
|
|
9
|
-
CommandFromCli");function h(r){let n=new URL(r).pathname.split("/").filter(Boolean).at(-1);if(!n)throw new s("Could not resolve the served project id");return n}f(h,"projectId");async function P(r,n,t={}){let e=t.stdout??console.log,d=t.stderr??console.error;try{let i=await u(n,()=>(t.resolveBaseUrl??S)(n)),c=I(i);if(r.command==="workflows"){let o=await u(n,()=>c.fetchProjectWorkflows({params:{projectId:h(i)}}));return e(JSON.stringify(o.workflows,null,2)),0}if(r.action==="list"){let o=await u(n,
|
|
10
|
-
()=>c.fetchProjectRuns({params:{projectId:h(i)}}));return e(JSON.stringify(o.runs,null,2)),0}if(r.action==="show"){let o=await u(n,()=>c.fetchRun({params:{runId:r.runId}}));return e(JSON.stringify(o.run,null,2)),0}if(r.action==="transcript"){let o=await u(n,()=>c.fetchExecutionTranscript({params:{executionId:r.executionId},query:{}}));return e(JSON.stringify(o,null,2)),0}if(r.action==="permission"){let o=await u(n,()=>c.respondRunPermission({params:{runId:r.runId},body:{requestId:r.requestId,optionId:r.
|
|
11
|
-
optionId}}));return e(JSON.stringify(o.run,null,2)),0}if(r.action==="create"){let o=await u(n,()=>c.createProjectRun({params:{projectId:h(i)},body:r.mode==="workflow"?{mode:r.mode,workflowId:r.workflowId,input:r.input,...r.profile?{profile:r.profile}:{},...r.workspace?{workspace:r.workspace}:{},...r.transport?{transport:r.transport}:{},...r.permissionMode?{permissionMode:r.permissionMode==="deny"?"deny":"workspace"}:{},...r.mcpServers?{mcpServers:r.mcpServers}:{},idempotencyKey:t.createOperationId?.()??
|
|
12
|
-
crypto.randomUUID()}:{mode:r.mode,harness:r.harness,input:r.input,...r.profile?{profile:r.profile}:{},...r.provider?{provider:r.provider}:{},...r.model?{model:r.model}:{},...r.workspace?{workspace:r.workspace}:{},...r.transport?{transport:r.transport}:{},...r.permissionMode?{permissionMode:r.permissionMode}:{},...r.mcpServers?{mcpServers:r.mcpServers}:{},idempotencyKey:t.createOperationId?.()??crypto.randomUUID()}}));return e(JSON.stringify(o.run,null,2)),0}let p=r.action==="cancel"?await u(n,()=>c.
|
|
13
|
-
cancelRun({params:{runId:r.runId},body:{idempotencyKey:t.createOperationId?.()??crypto.randomUUID()}})):await u(n,()=>c.resumeRun({params:{runId:r.runId},body:{idempotencyKey:t.createOperationId?.()??crypto.randomUUID()}}));return e(JSON.stringify(p.run,null,2)),0}catch(i){return d(i instanceof s?i.message:v(i,n)),1}}f(P,"runRunCommand");export{J as buildRunCreate,O as runCommandFromCli,P as runRunCommand};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# ============================================================================
|
|
2
|
-
# Portta: the panel's way to the host daemon
|
|
3
|
-
# ============================================================================
|
|
4
|
-
# Applied whenever the panel is on.
|
|
5
|
-
#
|
|
6
|
-
# The panel is a container with no `gh`, no git, no tmux, no agent CLI and no
|
|
7
|
-
# project directory, and ADR 0001 keeps it that way. Work that needs the host
|
|
8
|
-
# runs in `portta host serve` instead, and the panel reaches it over HTTP and
|
|
9
|
-
# WebSocket through its authorised proxy
|
|
10
|
-
# (docs/development/adr/0047-host-daemon-and-panel-proxy.md).
|
|
11
|
-
#
|
|
12
|
-
# Issues are the panel's work surface and are read through the daemon
|
|
13
|
-
# (docs/development/adr/0018-github-issues-through-the-gh-cli.md), so the
|
|
14
|
-
# connection is part of having a panel, and Taskflow's routes ride on it.
|
|
15
|
-
#
|
|
16
|
-
# What this adds to the panel, and nothing else
|
|
17
|
-
# ----------------------------------------------
|
|
18
|
-
# host.docker.internal a name for the host. Docker Desktop resolves it on
|
|
19
|
-
# its own; on Linux `host-gateway` maps it to the
|
|
20
|
-
# bridge gateway, which is where the daemon must bind
|
|
21
|
-
# (PORTTA_HOST_BIND=172.17.0.1, or the address of the
|
|
22
|
-
# bridge in use). The daemon's loopback default is not
|
|
23
|
-
# reachable from a container on Linux.
|
|
24
|
-
# state/host/token the daemon's token, read-only. `portta up` and
|
|
25
|
-
# `portta web up` create it first: a bind mount of a
|
|
26
|
-
# file that does not exist would become a directory.
|
|
27
|
-
#
|
|
28
|
-
# The panel never receives a project directory, a socket or the daemon's own
|
|
29
|
-
# databases: only a URL and a secret. A daemon that is not running is not a
|
|
30
|
-
# failure to start — it is a panel that reports which of its surfaces are
|
|
31
|
-
# unavailable and why.
|
|
32
|
-
# ============================================================================
|
|
33
|
-
|
|
34
|
-
services:
|
|
35
|
-
web:
|
|
36
|
-
extra_hosts:
|
|
37
|
-
- "host.docker.internal:host-gateway"
|
|
38
|
-
environment:
|
|
39
|
-
PORTTA_HOST_URL: ${PORTTA_HOST_URL:-http://host.docker.internal:${PORTTA_HOST_PORT:-5111}}
|
|
40
|
-
PORTTA_RUNTIME_HOST_TOKEN_FILE: /app/state/host/token
|
|
41
|
-
volumes:
|
|
42
|
-
- ./state/host/token:/app/state/host/token:ro
|
package/dist/shell-ZWXPCUMD.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e}from"./chunk-4TGTGGMK.js";import"./chunk-EH7H7D7J.js";import"./chunk-6J5HN4ZN.js";export{e as detectProjectName,d as getGitRoot,b as resolveExecutablePath,a as run,c as which};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g}from"./chunk-IILMQFWO.js";import"./chunk-6J5HN4ZN.js";export{b as DEFAULT_KILL_GRACE_MS,a as DEFAULT_STALL_TIMEOUT_MS,e as captureStdout,d as exitError,f as parseVersion,c as runJsonlSubprocess,g as versionAtLeast};
|