@midhunxavier/code-flow 0.0.0-stage → 0.1.0-preview.3
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/LICENSE +21 -0
- package/README.md +141 -2
- package/bin/codeflow.mjs +8 -0
- package/bin/launcher.mjs +127 -0
- package/dist/remote-host.json +1 -0
- package/licenses/inter.txt +92 -0
- package/licenses/preact.txt +21 -0
- package/licenses/signals-core.txt +21 -0
- package/licenses/signals.txt +21 -0
- package/licenses/typescript-notices.txt +193 -0
- package/licenses/typescript.txt +55 -0
- package/licenses/uqr.txt +22 -0
- package/licenses/xterm-fit.txt +19 -0
- package/licenses/xterm.txt +21 -0
- package/package.json +34 -4
- package/public/assets/changes-62ZIEQSN.js +1 -0
- package/public/assets/chunk-2PZVOKID.js +1 -0
- package/public/assets/chunk-4D5IENEB.js +1 -0
- package/public/assets/chunk-5SARP5MU.js +1 -0
- package/public/assets/chunk-63YLZ3PR.js +1 -0
- package/public/assets/chunk-7FUHKF2M.js +1 -0
- package/public/assets/chunk-APQEVJ2K.js +1 -0
- package/public/assets/chunk-CGOZQMEZ.js +2 -0
- package/public/assets/chunk-J4VYS3KV.js +2 -0
- package/public/assets/chunk-L7TUCIYF.js +1 -0
- package/public/assets/chunk-SIHDWM2Y.js +154 -0
- package/public/assets/chunk-TEJVYIKC.js +1 -0
- package/public/assets/code-browser-VB2HGZSG.js +4 -0
- package/public/assets/filtered-tasks-ES5CP4KV.js +1 -0
- package/public/assets/interactive-browser-7F5ZXRUV.js +7 -0
- package/public/assets/join-project-6RTFHNCA.js +1 -0
- package/public/assets/main-65EW73SB.js +1 -0
- package/public/assets/project-invitations-view-GMPWGWYM.js +1 -0
- package/public/assets/settings-UB5Q4AQM.js +9 -0
- package/public/assets/styles-18792BB4.css +32 -0
- package/public/assets/team-server-wizard-2GLDWS6D.js +8 -0
- package/public/assets/terminal-IWAIM4DE.js +62 -0
- package/public/assets.json +1 -0
- package/public/bundle-meta.json +1 -0
- package/public/docs/.nojekyll +0 -0
- package/public/docs/accessibility.html +19 -0
- package/public/docs/acp-agents.html +117 -0
- package/public/docs/agent-containers.html +79 -0
- package/public/docs/api.html +1130 -0
- package/public/docs/app.js +342 -0
- package/public/docs/application-improvements.html +275 -0
- package/public/docs/architecture-explorer.html +19 -0
- package/public/docs/architecture.html +149 -0
- package/public/docs/auto-team.html +148 -0
- package/public/docs/automations.html +109 -0
- package/public/docs/checkpoint-review.html +37 -0
- package/public/docs/code-hosts.html +35 -0
- package/public/docs/code-intelligence.html +35 -0
- package/public/docs/configuration.html +346 -0
- package/public/docs/context-inspection.html +23 -0
- package/public/docs/coordinated-changes.html +28 -0
- package/public/docs/deferred-runs.html +25 -0
- package/public/docs/dependency-discovery.html +19 -0
- package/public/docs/documentation.html +84 -0
- package/public/docs/dynamic-teams-evaluation.html +174 -0
- package/public/docs/dynamic-teams-implementation-plan.html +882 -0
- package/public/docs/dynamic-teams-implementation-review-1.html +141 -0
- package/public/docs/dynamic-teams-plan-review-0.html +204 -0
- package/public/docs/extensions.html +42 -0
- package/public/docs/external-sources.html +96 -0
- package/public/docs/filesystem-policy.html +26 -0
- package/public/docs/filtered-tasks.html +44 -0
- package/public/docs/font-license.txt +92 -0
- package/public/docs/getting-started.html +143 -0
- package/public/docs/github-review-threads.html +26 -0
- package/public/docs/github.html +157 -0
- package/public/docs/help.html +69 -0
- package/public/docs/index.html +88 -0
- package/public/docs/installation.html +80 -0
- package/public/docs/launch-profiles.html +48 -0
- package/public/docs/maintenance.html +60 -0
- package/public/docs/memory-claims.html +31 -0
- package/public/docs/memory-storage.html +58 -0
- package/public/docs/notifications.html +39 -0
- package/public/docs/patterns.html +195 -0
- package/public/docs/performance-results.html +210 -0
- package/public/docs/performance.html +166 -0
- package/public/docs/project-conventions.html +22 -0
- package/public/docs/project-first-navigation-plan.html +587 -0
- package/public/docs/project-teams-implementation-plan.html +772 -0
- package/public/docs/project-teams.html +129 -0
- package/public/docs/provider-compatibility.html +20 -0
- package/public/docs/releasing.html +65 -0
- package/public/docs/remote-workers.html +64 -0
- package/public/docs/review-inbox.html +26 -0
- package/public/docs/run-storage.html +23 -0
- package/public/docs/runs.html +141 -0
- package/public/docs/search.json +1 -0
- package/public/docs/security.html +133 -0
- package/public/docs/shared-projects.html +31 -0
- package/public/docs/ssh-projects.html +60 -0
- package/public/docs/style.css +768 -0
- package/public/docs/task-reruns.html +30 -0
- package/public/docs/team-collaboration.html +412 -0
- package/public/docs/verification.html +22 -0
- package/public/docs/vscode.html +53 -0
- package/public/docs/worker-permission-verification.html +131 -0
- package/public/index.html +17 -0
- package/scripts/check-node.mjs +7 -0
- package/scripts/codeflow.mjs +55 -0
- package/scripts/computer-use.swift +64 -0
- package/scripts/pty.py +273 -0
- package/src/acp-connections.js +110 -0
- package/src/adapters/acp-presets.js +37 -0
- package/src/adapters/acp-types.js +0 -0
- package/src/adapters/acp.js +328 -0
- package/src/adapters/agent-tools.js +28 -0
- package/src/adapters/agy-auth.js +67 -0
- package/src/adapters/agy-isolation.js +242 -0
- package/src/adapters/agy-tools.js +45 -0
- package/src/adapters/agy.js +326 -0
- package/src/adapters/claude-stream.js +58 -0
- package/src/adapters/claude.js +282 -0
- package/src/adapters/codex-app-server.js +555 -0
- package/src/adapters/codex.js +311 -0
- package/src/adapters/errors.js +57 -0
- package/src/adapters/index.js +91 -0
- package/src/adapters/managed-permissions.js +37 -0
- package/src/adapters/model-discovery.js +100 -0
- package/src/adapters/process.js +433 -0
- package/src/adapters/team-tools.js +103 -0
- package/src/adapters/types.js +0 -0
- package/src/agent-browser.js +688 -0
- package/src/agent-computer.js +88 -0
- package/src/agent-container.js +155 -0
- package/src/agent-team-definitions.js +131 -0
- package/src/agent-tool-client.mjs +79 -0
- package/src/agent-tools.js +296 -0
- package/src/approvals.js +134 -0
- package/src/architecture.js +456 -0
- package/src/assets.js +44 -0
- package/src/automation.js +901 -0
- package/src/browser-files.js +293 -0
- package/src/browser-ownership.js +150 -0
- package/src/certificate-renewal.js +75 -0
- package/src/chat-family.js +25 -0
- package/src/chat-handoff.js +87 -0
- package/src/checkpoint-review.js +72 -0
- package/src/checks.js +303 -0
- package/src/code-host-git.js +102 -0
- package/src/code-hosts-api.js +99 -0
- package/src/code-hosts.js +482 -0
- package/src/code-intelligence-worker.mjs +452 -0
- package/src/code-intelligence.js +141 -0
- package/src/collab/api.js +365 -0
- package/src/collab/checkpoints.js +198 -0
- package/src/collab/connections.js +139 -0
- package/src/collab/host-execution.js +347 -0
- package/src/collab/hub-client.js +210 -0
- package/src/collab/link-api.js +229 -0
- package/src/collab/link.js +595 -0
- package/src/collab/model.js +496 -0
- package/src/collab/runner.js +1014 -0
- package/src/collab/store.js +1452 -0
- package/src/collab/terminals.js +361 -0
- package/src/collaboration-reviews.js +116 -0
- package/src/config.js +48 -0
- package/src/context-budget.js +14 -0
- package/src/context-inspection.js +204 -0
- package/src/context.js +154 -0
- package/src/conventions.js +283 -0
- package/src/coordinated-api.js +247 -0
- package/src/deferred-launch.js +82 -0
- package/src/deferred-runs.js +515 -0
- package/src/dependency-health.js +35 -0
- package/src/diff.js +43 -0
- package/src/docs-help.js +316 -0
- package/src/doctor.js +232 -0
- package/src/documentation-changes.js +20 -0
- package/src/engine.js +5258 -0
- package/src/env.js +44 -0
- package/src/execution-budget.js +8 -0
- package/src/experience.js +50 -0
- package/src/extensions.js +144 -0
- package/src/filesystem-access.js +107 -0
- package/src/filesystem-policy.js +238 -0
- package/src/filtered-task-limits.js +93 -0
- package/src/filtered-tasks-api.js +53 -0
- package/src/filtered-tasks.js +576 -0
- package/src/frame-policy.js +66 -0
- package/src/fs.js +57 -0
- package/src/git.js +626 -0
- package/src/github-review-threads.js +181 -0
- package/src/github.js +538 -0
- package/src/http.js +69 -0
- package/src/improve-settings.js +38 -0
- package/src/improve.js +187 -0
- package/src/integrations.js +373 -0
- package/src/integrity.js +259 -0
- package/src/journey-api.js +77 -0
- package/src/journey-replay.js +65 -0
- package/src/journey-store.js +97 -0
- package/src/journeys.js +60 -0
- package/src/json.js +81 -0
- package/src/launch-profiles.js +292 -0
- package/src/learnings.js +80 -0
- package/src/local-app-url.js +19 -0
- package/src/log.js +39 -0
- package/src/maintenance.js +335 -0
- package/src/memory-analysis.js +182 -0
- package/src/memory-claims.js +153 -0
- package/src/memory-sqlite.js +236 -0
- package/src/memory.js +552 -0
- package/src/merge-validation.js +58 -0
- package/src/model-catalog.js +239 -0
- package/src/model-research.js +91 -0
- package/src/notes.js +176 -0
- package/src/notifications.js +413 -0
- package/src/patterns/auto-team-model.js +230 -0
- package/src/patterns/auto-team.js +816 -0
- package/src/patterns/council.js +199 -0
- package/src/patterns/debate.js +188 -0
- package/src/patterns/findings.js +141 -0
- package/src/patterns/index.js +21 -0
- package/src/patterns/loop.js +158 -0
- package/src/patterns/pipeline.js +125 -0
- package/src/patterns/prompts.js +181 -0
- package/src/patterns/race.js +147 -0
- package/src/patterns/schemas.js +40 -0
- package/src/patterns/solo.js +46 -0
- package/src/patterns/supervisor.js +235 -0
- package/src/patterns/task-draft.js +29 -0
- package/src/patterns/task-review.js +45 -0
- package/src/patterns/tdd.js +231 -0
- package/src/patterns/team-strategies.js +67 -0
- package/src/performance.js +43 -0
- package/src/persistence-status.js +35 -0
- package/src/phone-sessions.js +96 -0
- package/src/preview-overlay.js +392 -0
- package/src/preview.js +230 -0
- package/src/privacy.js +23 -0
- package/src/project-report.js +22 -0
- package/src/project-team-budget.js +22 -0
- package/src/project-team-model.js +225 -0
- package/src/project-team-policy.js +42 -0
- package/src/project-team-store.js +234 -0
- package/src/project-team-usage.js +24 -0
- package/src/project-teams-api.js +43 -0
- package/src/project-teams.js +644 -0
- package/src/projects.js +290 -0
- package/src/provider-eligibility.js +9 -0
- package/src/readiness.js +98 -0
- package/src/remote-tls.js +66 -0
- package/src/remote-workers/bundles.js +198 -0
- package/src/remote-workers/client.js +332 -0
- package/src/remote-workers/durability.js +37 -0
- package/src/remote-workers/protocol.js +68 -0
- package/src/remote-workers/stdio.js +138 -0
- package/src/remote-workers/worker.js +304 -0
- package/src/remote.js +204 -0
- package/src/repo-config.js +201 -0
- package/src/repo-coordination.js +725 -0
- package/src/repo-tree.js +106 -0
- package/src/repository-identity.js +13 -0
- package/src/retention-policy.js +466 -0
- package/src/review-inbox.js +38 -0
- package/src/routing.js +49 -0
- package/src/run-analysis.js +111 -0
- package/src/run-cold-store.js +231 -0
- package/src/run-environment.js +15 -0
- package/src/run-history.js +91 -0
- package/src/run-log.js +160 -0
- package/src/run-permissions.js +111 -0
- package/src/run-projection.js +77 -0
- package/src/run-recovery.js +53 -0
- package/src/run-status.js +56 -0
- package/src/serve.js +138 -0
- package/src/server.js +2871 -0
- package/src/shared-access.js +103 -0
- package/src/shared-accounts.js +381 -0
- package/src/shared-api.js +239 -0
- package/src/shell.js +346 -0
- package/src/ship.js +344 -0
- package/src/slots.js +74 -0
- package/src/snapshot.js +388 -0
- package/src/source-context.js +17 -0
- package/src/sse-writer.js +70 -0
- package/src/ssh-projects/bootstrap.mjs +95 -0
- package/src/ssh-projects/config.js +45 -0
- package/src/ssh-projects/gateway.js +143 -0
- package/src/ssh-projects/manager.js +320 -0
- package/src/ssh-projects/team-autostart.mjs +93 -0
- package/src/ssh-projects/team-remove.mjs +69 -0
- package/src/ssh-projects/team-status.mjs +39 -0
- package/src/ssh-projects/transport.js +133 -0
- package/src/stats.js +139 -0
- package/src/store.js +544 -0
- package/src/stream.js +91 -0
- package/src/sweeps.js +241 -0
- package/src/tailscale.js +101 -0
- package/src/task-draft.js +23 -0
- package/src/task-team.js +164 -0
- package/src/team-evaluation.js +243 -0
- package/src/team-mailbox.js +160 -0
- package/src/team-memory.js +84 -0
- package/src/team-rerun-graph.js +15 -0
- package/src/team-reruns.js +130 -0
- package/src/team-scheduler.js +121 -0
- package/src/team-steering.js +21 -0
- package/src/team-template-store.js +98 -0
- package/src/team-templates.js +117 -0
- package/src/team-tool-client.mjs +79 -0
- package/src/team-tools.js +235 -0
- package/src/teams.js +0 -0
- package/src/templates.js +62 -0
- package/src/transcript.js +134 -0
- package/src/verification-integrity.js +27 -0
- package/src/verification.js +183 -0
- package/src/watch.js +195 -0
- package/src/work-queue.js +47 -0
- package/src/workflow-control.js +83 -0
- package/src/workspace-api.js +207 -0
- package/src/workspace-changes.js +61 -0
- package/src/workspace.js +146 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=["viewer","reviewer","contributor","maintainer"],a={viewer:"reads results",reviewer:"also comments and records reviews",contributor:"also owns team tasks and runs them on their own computer",maintainer:"also manages project tasks, repositories and handovers"},s=e=>e.charAt(0).toUpperCase()+e.slice(1);function i(e,t){let r=e===void 0?-1:n.indexOf(e),o=n.indexOf(t);return r>=0&&o>=0&&r>=o}export{n as a,a as b,s as c,i as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as C,H as E,R as S,b as c,c as p,d,da as u,e as f,f as h,h as v}from"./chunk-63YLZ3PR.js";function A(e){let t=new URL(location.href);t.searchParams.set("team",e),t.searchParams.delete("token"),t.hash.startsWith("#/settings/")||(t.hash="#/team"),location.assign(t.href)}function X({hideWhenEmpty:e=!1}){let[t,n]=v([]),[o,r]=v("");S(async a=>{try{let l=await E("/api/team-link/connections");a()&&(n(l.connections),r(""))}catch(l){a()&&r(l.message)}},15e3,[]);let i=t.filter(a=>a.id!=="local"),s=C||(i.length===1?i[0].id:i.length===0?"local":"");return e&&!i.length&&!o?null:u("section",{class:"settings-card team-connection-picker","aria-label":"Team connections",children:[u("label",{class:"lbl",children:["Team connection",u("select",{class:"field",value:s,onChange:a=>A(a.currentTarget.value),children:[u("option",{value:"",disabled:!0,children:"Choose a team\u2026"}),s&&t.length>0&&!t.some(a=>a.id===s)?u("option",{value:s,disabled:!0,children:"Connection unavailable"}):null,t.map(a=>u("option",{value:a.id,children:a.id==="local"?"This computer\u2019s own board":`${a.hubName||a.url} \xB7 ${a.user?.username??""} \xB7 ${a.connection}`},a.id))]})]}),u("p",{class:"help",children:"Each team keeps its own projects, account and repository mappings. Switching teams keeps other connections and running tasks active."}),o?u("p",{class:"msg err",role:"alert",children:o}):null,u("a",{class:"btn small",href:"#/settings/connections/join",children:"Manage team connections"})]})}function $(e,t){for(var n in t)e[n]=t[n];return e}function k(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function R(e,t){this.props=e,this.context=t}(R.prototype=new f).isPureReactComponent=!0,R.prototype.shouldComponentUpdate=function(e,t){return k(this.props,e)||k(this.state,t)};var x=c.__b;c.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),x&&x(e)};var ve=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var j=c.__e;c.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t)}j(e,t,n,o)};var P=c.unmount;function U(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=$({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return U(o,t,n)})),e}function L(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return L(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function m(){this.__u=0,this.o=null,this.__b=null}function D(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function V(e){var t,n,o,r=null;function i(s){if(t||(t=e()).then(function(a){a&&(r=a.default||a),o=!0},function(a){n=a,o=!0}),n)throw n;if(!o)throw t;return r?p(r,s):null}return i.displayName="Lazy",i.__f=!0,i}function y(){this.i=null,this.l=null}c.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),P&&P(e)},(m.prototype=new f).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=D(o.__v),i=!1,s=function(){i||o.__z||(i=!0,n.__R=null,r?r(l):l())};n.__R=s;var a=n.__P;n.__P=null;var l=function(){if(!--o.__u){if(o.state.__a){var _=o.state.__a;o.__v.__k[0]=L(_,_.__c.__P,_.__c.__O)}var b;for(o.setState({__a:o.__b=null});b=o.o.pop();)b.__P=a,b.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},m.prototype.componentWillUnmount=function(){this.o=[]},m.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=U(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&p(d,null,e.fallback);return r&&(r.__u&=-33),[p(d,null,t.__a?null:e.children),r]};var N=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(y.prototype=new f).__a=function(e){var t=this,n=D(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),N(t,e,o)):r()};n?n(i):i()}},y.prototype.render=function(e){this.i=null,this.l=new Map;var t=h(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},y.prototype.componentDidUpdate=y.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){N(e,n,t)})};var H=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Y=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Z=/[A-Z0-9]/g,q=typeof document<"u",G=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};f.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(f.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var w=c.event;c.event=function(e){return w&&(e=w(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var M,J={configurable:!0,get:function(){return this.class}},T=c.vnode;c.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")==-1;for(var s in n){var a=n[s];if(!(s==="value"&&"defaultValue"in n&&a==null||q&&s==="children"&&o==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||G(n.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":Y.test(s)&&(s=l):l=s="oninput":i&&B.test(s)?s=s.replace(Z,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&r[s=l]&&(s="oninputCapture"),r[s]=a}}o=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=h(n.children).forEach(function(_){_.props.selected=r.value.indexOf(_.props.value)!=-1})),r.defaultValue!=null&&(r.value=h(n.children).forEach(function(_){_.props.selected=r.multiple?r.defaultValue.indexOf(_.props.value)!=-1:r.defaultValue==_.props.value}))),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",J)):n.className&&(r.class=r.className=n.className),t.props=r})(e),e.$$typeof=H,T&&T(e)};var O=c.__r;c.__r=function(e){O&&O(e),M=e.__c};var I=c.diffed;c.diffed=function(e){I&&I(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),M=null};var g=class extends f{state={};static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?u("div",{role:"alert",class:"msg err",children:["This view could not load. ",u("button",{class:"btn",onClick:()=>location.reload(),children:"Reload app"})]}):this.props.children}};function F(e){let t=V(()=>e().then(n=>({default:n})));return n=>u(g,{children:u(m,{fallback:u("div",{role:"status",class:"help",children:"Loading view\u2026"}),children:u(t,{...n})})})}var xe=F(()=>import("./project-invitations-view-GMPWGWYM.js").then(e=>e.ProjectInvitations));export{F as a,A as b,X as c,xe as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function Ae(e,t,n=()=>{}){let o=!1,i=!1,r,s=async()=>{if(clearTimeout(r),!(o||i||document.hidden)){i=!0;try{await e()}catch(_){n(_)}finally{i=!1,!o&&t>0&&!document.hidden&&(r=setTimeout(()=>void s(),t))}}},c=()=>{clearTimeout(r),document.hidden||s()};return document.addEventListener("visibilitychange",c),s(),()=>{o=!0,clearTimeout(r),document.removeEventListener("visibilitychange",c)}}var ie,p,We,be,R,De,qe,Be,ge,ee,W,Ve,ke,ye,we,St,ne={},oe=[],Ct=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,q=Array.isArray;function T(e,t){for(var n in t)e[n]=t[n];return e}function xe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Tt(e,t,n){var o,i,r,s={};for(r in t)r=="key"?o=t[r]:r=="ref"?i=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?ie.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)s[r]===void 0&&(s[r]=e.defaultProps[r]);return te(e,s,o,i,null)}function te(e,t,n,o,i){var r={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++We,__i:-1,__u:0};return i==null&&p.vnode!=null&&p.vnode(r),r}function A(e){return e.children}function M(e,t){this.props=e,this.context=t}function P(e,t){if(t==null)return e.__?P(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?P(e):null}function $t(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],r=T({},t);r.__v=t.__v+1,p.vnode&&p.vnode(r),Se(e.__P,r,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??P(t),!!(32&t.__u),i),r.__v=t.__v,r.__.__k[r.__i]=r,Ze(o,r,i),t.__e=t.__=null,r.__e!=n&&Ge(r)}}function Ge(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Ge(e)}function Fe(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!re.__r++||De!=p.debounceRendering)&&((De=p.debounceRendering)||qe)(re)}function re(){try{for(var e,t=1;R.length;)R.length>t&&R.sort(Be),e=R.shift(),t=R.length,$t(e)}finally{R.length=re.__r=0}}function Je(e,t,n,o,i,r,s,c,_,u,f){var m,a,l,g,x,k,b=o&&o.__k||oe,d=t.length;for(_=Rt(n,t,b,_,d),m=0;m<d;m++)(l=n.__k[m])!=null&&(a=l.__i!=-1&&b[l.__i]||ne,l.__i=m,k=Se(e,l,a,i,r,s,c,_,u,f),g=l.__e,l.ref&&a.ref!=l.ref&&(a.ref&&Ce(a.ref,null,l),f.push(l.ref,l.__c||g,l)),x==null&&g!=null&&(x=g),4&l.__u?(_=ze(l,_,e),a.__e&&(a.__e=null)):typeof l.type=="function"&&k!==void 0?_=k:g&&(_=g.nextSibling),l.__u&=-7);return n.__e=x,_}function Rt(e,t,n,o,i){var r,s,c,_,u,f=n.length,m=f,a=0;for(e.__k=new Array(i),r=0;r<i;r++)(s=t[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[r]=te(null,s,null,null,null):q(s)?s=e.__k[r]=te(A,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[r]=te(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[r]=s,_=r+a,s.__=e,s.__b=e.__b+1,c=null,(u=s.__i=It(s,n,_,m))!=-1&&(m--,(c=n[u])&&(c.__u|=2)),c==null||c.__v==null?(u==-1&&(i>f?a--:i<f&&a++),typeof s.type!="function"&&(s.__u|=4)):u!=_&&(u==_-1?a--:u==_+1?a++:(u>_?a--:a++,s.__u|=4))):e.__k[r]=null;if(m)for(r=0;r<f;r++)(c=n[r])!=null&&(2&c.__u)==0&&(c.__e==o&&(o=P(c)),Ye(c,c));return o}function ze(e,t,n){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=ze(o[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=P(e)),t=n.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function jt(e,t){return t=t||[],e==null||typeof e=="boolean"||(q(e)?e.some(function(n){jt(n,t)}):t.push(e)),t}function It(e,t,n,o){var i,r,s,c=e.key,_=e.type,u=t[n],f=u!=null&&(2&u.__u)==0;if(u===null&&c==null||f&&c==u.key&&_==u.type)return n;if(o>(f?1:0)){for(i=n-1,r=n+1;i>=0||r<t.length;)if((u=t[s=i>=0?i--:r++])!=null&&(2&u.__u)==0&&c==u.key&&_==u.type)return s}return-1}function He(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ct.test(t)?n:n+"px"}function Q(e,t,n,o,i){var r,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||He(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||He(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Ve,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n[W]=o[W]:(n[W]=ke,e.addEventListener(t,r?we:ye,r)):e.removeEventListener(t,r?we:ye,r);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Le(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[ee]==null)t[ee]=ke++;else if(t[ee]<n[W])return;return n(p.event?p.event(t):t)}}}function Se(e,t,n,o,i,r,s,c,_,u){var f,m,a,l,g,x,k,b,d,S,H,I,L,Me,Y,me,C=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(_=!!(32&n.__u),r=[c=t.__e=n.__e]),(f=p.__b)&&f(t);e:if(typeof C=="function"){m=s.length;try{if(d=t.props,S=C.prototype&&C.prototype.render,H=(f=C.contextType)&&o[f.__c],I=f?H?H.props.value:f.__:o,n.__c?b=(a=t.__c=n.__c).__=a.__E:(S?t.__c=a=new C(d,I):(t.__c=a=new M(d,I),a.constructor=C,a.render=Ut),H&&H.sub(a),a.state||(a.state={}),a.__n=o,l=a.__d=!0,a.__h=[],a._sb=[]),S&&a.__s==null&&(a.__s=a.state),S&&C.getDerivedStateFromProps!=null&&(a.__s==a.state&&(a.__s=T({},a.__s)),T(a.__s,C.getDerivedStateFromProps(d,a.__s))),g=a.props,x=a.state,a.__v=t,l)S&&C.getDerivedStateFromProps==null&&a.componentWillMount!=null&&a.componentWillMount(),S&&a.componentDidMount!=null&&a.__h.push(a.componentDidMount);else{if(S&&C.getDerivedStateFromProps==null&&d!==g&&a.componentWillReceiveProps!=null&&a.componentWillReceiveProps(d,I),t.__v==n.__v||!a.__e&&a.shouldComponentUpdate!=null&&a.shouldComponentUpdate(d,a.__s,I)===!1){t.__v!=n.__v&&(a.props=d,a.state=a.__s,a.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(N){N&&(N.__=t)}),oe.push.apply(a.__h,a._sb),a._sb=[],a.__h.length&&s.push(a),c=P(n);break e}a.componentWillUpdate!=null&&a.componentWillUpdate(d,a.__s,I),S&&a.componentDidUpdate!=null&&a.__h.push(function(){a.componentDidUpdate(g,x,k)})}if(a.context=I,a.props=d,a.__P=e,a.__e=!1,L=p.__r,Me=0,S)a.state=a.__s,a.__d=!1,L&&L(t),f=a.render(a.props,a.state,a.context),oe.push.apply(a.__h,a._sb),a._sb=[];else do a.__d=!1,L&&L(t),f=a.render(a.props,a.state,a.context),a.state=a.__s;while(a.__d&&++Me<25);a.state=a.__s,a.getChildContext!=null&&(o=T(T({},o),a.getChildContext())),S&&!l&&a.getSnapshotBeforeUpdate!=null&&(k=a.getSnapshotBeforeUpdate(g,x)),Y=f!=null&&f.type===A&&f.key==null?Xe(f.props.children):f,c=Je(e,q(Y)?Y:[Y],t,n,o,i,r,s,c,_,u),a.base=t.__e,t.__u&=-161,a.__h.length&&s.push(a),b&&(a.__E=a.__=null)}catch(N){if(s.length=m,t.__v=null,_||r!=null){if(N.then){for(t.__u|=_?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;r!=null&&(r[r.indexOf(c)]=null),t.__e=c}else if(r!=null)for(me=r.length;me--;)xe(r[me])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),N.then||Ke(t),p.__e(N,t,n)}}else r==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=Pt(n.__e,t,n,o,i,r,s,_,u);return(f=p.diffed)&&f(t),128&t.__u?void 0:c}function Ke(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ke))}function Ze(e,t,n){for(var o=0;o<n.length;o++)Ce(n[o],n[++o],n[++o]);p.__c&&p.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(r){r.call(i)})}catch(r){p.__e(r,i.__v)}})}function Xe(e){return typeof e!="object"||e==null||e.__b>0?e:q(e)?e.map(Xe):e.constructor!==void 0?null:T({},e)}function Pt(e,t,n,o,i,r,s,c,_){var u,f,m,a,l,g,x,k=n.props||ne,b=t.props,d=t.type;if(d=="svg"?i="http://www.w3.org/2000/svg":d=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(u=0;u<r.length;u++)if((l=r[u])&&"setAttribute"in l==!!d&&(d?l.localName==d:l.nodeType==3)){e=l,r[u]=null;break}}if(e==null){if(d==null)return document.createTextNode(b);e=document.createElementNS(i,d,b.is&&b),c&&(p.__m&&p.__m(t,r),c=!1),r=null}if(d==null)k===b||c&&e.data==b||(e.data=b);else{if(r=d=="textarea"&&b.defaultValue!=null?null:r&&ie.call(e.childNodes),!c&&r!=null)for(k={},u=0;u<e.attributes.length;u++)k[(l=e.attributes[u]).name]=l.value;for(u in k)l=k[u],u=="dangerouslySetInnerHTML"?m=l:u=="children"||u in b||u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b||Q(e,u,null,l,i);for(u in b)l=b[u],u=="children"?a=l:u=="dangerouslySetInnerHTML"?f=l:u=="value"?g=l:u=="checked"?x=l:c&&typeof l!="function"||k[u]===l||Q(e,u,l,k[u],i);if(f)c||m&&(f.__html==m.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(m&&(e.innerHTML=""),Je(t.type=="template"?e.content:e,q(a)?a:[a],t,n,o,d=="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,s,r?r[0]:n.__k&&P(n,0),c,_),r!=null)for(u=r.length;u--;)xe(r[u]);c&&d!="textarea"||(u="value",d=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[u]||d=="progress"&&!g||d=="option"&&g!=k[u])&&Q(e,u,g,k[u],i),u="checked",x!=null&&x!=e[u]&&Q(e,u,x,k[u],i))}return e}function Ce(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){p.__e(i,n)}}function Ye(e,t,n){var o,i;if(p.unmount&&p.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Ce(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){p.__e(r,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Ye(o[i],t,n||typeof e.type!="function");n||xe(e.__e),e.__c=e.__=e.__e=void 0}function Ut(e,t,n){return this.constructor(e,n)}function Xt(e,t,n){var o,i,r,s;t==document&&(t=document.documentElement),p.__&&p.__(e,t),i=(o=typeof n=="function")?null:n&&n.__k||t.__k,r=[],s=[],Se(t,e=(!o&&n||t).__k=Tt(A,null,[e]),i||ne,ne,t.namespaceURI,!o&&n?[n]:i?null:t.firstChild?ie.call(t.childNodes):null,r,!o&&n?n:i?i.__e:t.firstChild,o,s),Ze(r,e,s),e.props.children=null}ie=oe.slice,p={__e:function(e,t,n,o){for(var i,r,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(c){e=c}throw e}},We=0,be=function(e){return e!=null&&e.constructor===void 0},M.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof e=="function"&&(e=e(T({},n),this.props)),e&&T(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Fe(this))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Fe(this))},M.prototype.render=A,R=[],qe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Be=function(e,t){return e.__v.__b-t.__v.__b},re.__r=0,ge=Math.random().toString(8),ee="__d"+ge,W="__a"+ge,Ve=/(PointerCapture)$|Capture$/i,ke=0,ye=Le(!1),we=Le(!0),St=0;var U,v,Te,Qe,B=0,at=[],y=p,et=y.__b,tt=y.__r,nt=y.diffed,ot=y.__c,rt=y.unmount,it=y.__;function V(e,t){y.__h&&y.__h(v,e,B||t),B=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function en(e){return B=1,Et(ut,e)}function Et(e,t,n){var o=V(U++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):ut(void 0,t),function(c){var _=o.__N?o.__N[0]:o.__[0],u=o.t(_,c);_!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=v,!v.__f)){var i=function(c,_,u){if(!o.__c.__H)return!0;var f=!1,m=o.__c.props!==c;if(o.__c.__H.__.some(function(l){if(l.__N){f=!0;var g=l.__[0];l.__=l.__N,l.__N=void 0,g!==l.__[0]&&(m=!0)}}),r){var a=r.call(this,c,_,u);return f?a||m:a}return!f||m};v.__f=!0;var r=v.shouldComponentUpdate,s=v.componentWillUpdate;v.componentWillUpdate=function(c,_,u){if(this.__e){var f=r;r=void 0,i(c,_,u),r=f}s&&s.call(this,c,_,u)},v.shouldComponentUpdate=i}return o.__N||o.__}function ae(e,t){var n=V(U++,3);!y.__s&&Re(n.__H,t)&&(n.__=e,n.u=t,v.__H.__h.push(n))}function tn(e,t){var n=V(U++,4);!y.__s&&Re(n.__H,t)&&(n.__=e,n.u=t,v.__h.push(n))}function ce(e){return B=5,G(function(){return{current:e}},[])}function G(e,t){var n=V(U++,7);return Re(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ct(e,t){return B=8,G(function(){return e},t)}function nn(){var e=V(U++,11);if(!e.__){for(var t=v.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ot(){for(var e;e=at.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(se),t.__h.some($e),t.__h=[]}catch(n){t.__h=[],y.__e(n,e.__v)}}}y.__b=function(e){v=null,et&&et(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),it&&it(e,t)},y.__r=function(e){tt&&tt(e),U=0;var t=(v=e.__c).__H;t&&(Te===v?(t.__h=[],v.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(se),t.__h.some($e),t.__h=[],U=0)),Te=v},y.diffed=function(e){nt&&nt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(at.push(t)!==1&&Qe===y.requestAnimationFrame||((Qe=y.requestAnimationFrame)||Nt)(Ot)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Te=v=null},y.__c=function(e,t){t.some(function(n){try{n.__h.some(se),n.__h=n.__h.filter(function(o){return!o.__||$e(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(o,n.__v)}}),ot&&ot(e,t)},y.unmount=function(e){rt&&rt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{se(o)}catch(i){t=i}}),n.__H=void 0,t&&y.__e(t,n.__v))};var st=typeof requestAnimationFrame=="function";function Nt(e){var t,n=function(){clearTimeout(o),st&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);st&&(t=requestAnimationFrame(n))}function se(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function $e(e){var t=v;e.__c=e.__(),v=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function ut(e,t){return typeof t=="function"?t(e):t}var Mt=Symbol.for("preact-signals");function fe(){if($>1)$--;else{var e,t=!1;for((function(){var i=_e;for(_e=void 0;i!==void 0;){var r=i.S;if(r.v===i.v)for(var s=r.t;s!==void 0;s=s.x)s.i===i.i&&(s.i=r.i);i=i.o}})();z!==void 0;){var n=z;for(z=void 0,ue++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&<(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=o}}if(ue=0,$--,t)throw e}}function At(e){if($>0)return e();je=++Dt,$++;try{return e()}finally{fe()}}var J,h=void 0;function K(e){var t=h,n=J;h=void 0,J=void 0;try{return e()}finally{h=t,J=n}}var z=void 0,$=0,ue=0,Dt=0,je=0,_e=void 0,le=0;function _t(e){if(h!==void 0){var t=e.n;if(t===void 0||t.t!==h)return t={i:0,S:e,p:h.s,n:void 0,t:h,e:void 0,x:void 0,r:t},h.s!==void 0&&(h.s.n=t),h.s=t,e.n=t,32&h.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=h.s,t.n=void 0,h.s.n=t,h.s=t),t}}function w(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}w.prototype.brand=Mt;w.prototype.h=function(){return!0};w.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:K(function(){var o;(o=t.W)==null||o.call(t)}))};w.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&K(function(){var i;(i=t.Z)==null||i.call(t)}))}};w.prototype.subscribe=function(e){var t=this;return Z(function(){var n=t.value;K(function(){return e(n)})},{name:"sub"})};w.prototype.valueOf=function(){return this.value};w.prototype.toString=function(){return this.value+""};w.prototype.toJSON=function(){return this.value};w.prototype.peek=function(){var e=this;return K(function(){return e.value})};Object.defineProperty(w.prototype,"value",{get:function(){var e=_t(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ue>100)throw new Error("Cycle detected");(function(n){$!==0&&ue===0&&n.l!==je&&(n.l=je,_e={S:n,v:n.v,i:n.i,o:_e})})(this),this.v=e,this.i++,le++,$++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{fe()}}}});function E(e,t){return new w(e,t)}function lt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ft(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function pt(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function O(e,t){w.call(this,void 0,t),this.x=e,this.s=void 0,this.g=le-1,this.f=4}O.prototype=new w;O.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===le))return!0;if(this.g=le,this.f|=1,this.i>0&&!lt(this))return this.f&=-2,!0;var e=h;try{ft(this),h=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return h=e,pt(this),this.f&=-2,!0};O.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}w.prototype.S.call(this,e)};O.prototype.U=function(e){if(this.t!==void 0&&(w.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};O.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(O.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=_t(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ie(e,t){return new O(e,t)}function dt(e){var t=e.m;if(e.m=void 0,typeof t=="function"){$++;var n=h;h=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Pe(e),o}finally{h=n,fe()}}}function Pe(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,dt(e)}function Ft(e){if(h!==this)throw new Error("Out-of-order effect");pt(this),h=e,this.f&=-2,8&this.f&&Pe(this),fe()}function D(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,J&&J.push(this)}D.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};D.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,dt(this),ft(this),$++;var e=h;return h=this,Ft.bind(this,e)};D.prototype.N=function(){2&this.f||(this.f|=2,this.u=z,z=this)};D.prototype.d=function(){this.f|=8,1&this.f||Pe(this)};D.prototype.dispose=function(){this.d()};function Z(e,t){var n=new D(e,t);try{n.c()}catch(i){throw n.d(),i}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Ue,pe;function F(e,t){p[e]=t.bind(null,p[e]||function(){})}function de(e){if(pe){var t=pe;pe=void 0,t()}pe=e&&e.S()}function ht(e){var t=this,n=e.data,o=Lt(n);o.value=n;var i=G(function(){for(var r=t.__v;r=r.__;)if(r.__c){r.__c.__$f|=4;break}return t.__$u.c=function(){var s,c=t.__$u.S(),_=i.value;c(),be(_)||((s=t.base)==null?void 0:s.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=_},Ie(function(){var s=o.value.value;return s===0?0:s===!0?"":s||""})},[]);return i.value}ht.displayName="_st";Object.defineProperties(w.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ht},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});F("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var i in o)if(i!=="children"){var r=o[i];r instanceof w&&(n||(t.__np=n={}),n[i]=r,o[i]=r.peek())}}e(t)});F("__r",function(e,t){e(t),de();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(i){var r;return Z(function(){r=this}),r.c=function(){o.__$f|=1,o.setState({})},r})())),Ue=o,de(n)});F("__e",function(e,t,n,o){de(),Ue=void 0,e(t,n,o)});F("diffed",function(e,t){de(),Ue=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,i=t.props;if(o){var r=n.U;if(r)for(var s in r){var c=r[s];c!==void 0&&!(s in o)&&(c.d(),r[s]=void 0)}else n.U=r={};for(var _ in o){var u=r[_],f=o[_];u===void 0?(u=Ht(n,_,f,i),r[_]=u):u.o(f,i)}}}e(t)});function Ht(e,t,n,o){var i=t in e&&e.ownerSVGElement===void 0,r=E(n);return{o:function(s,c){r.value=s,o=c},d:Z(function(){var s=r.value.value;o[t]!==s&&(o[t]=s,i?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}F("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var i in o){var r=o[i];r&&r.d()}}}}else{var s=t.__c;if(s){var c=s.__$u;c&&(s.__$u=void 0,c.d())}}e(t)});F("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});M.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(o||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var r in e)if(r!=="__source"&&e[r]!==this.props[r])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Lt(e){return G(function(){return E(e)},[])}var vt=[{id:"general",label:"General",icon:"sliders",group:"Preferences",description:"Make code-flow feel at home.",keywords:"appearance theme light dark system sidebar group shortcuts keyboard desktop app updates version restart"},{id:"agents",label:"Agents & models",icon:"sparkle",group:"Preferences",description:"Connect coding agents and choose their models and effort.",keywords:"claude codex antigravity opencode kilo cline acp cli connection providers login health quota prompt improvement improve rewrite quick repo"},{id:"runs",label:"Run defaults",icon:"layers",group:"Preferences",description:"Set the starting point for your next run.",keywords:"workflow permissions trust sandbox limits minutes steps tokens cost approval"},{id:"notifications",label:"Notifications",icon:"bell",group:"Preferences",description:"Decide how code-flow gets your attention.",keywords:"desktop browser alerts slack webhook delivery"},{id:"connections",label:"Connections",icon:"terminal",group:"Connections",description:"Work on another computer, delegate execution, or share access.",keywords:"ssh remote vm server host worker runner port keys tailscale phone tablet people team accounts collaboration handoff board teammates"},{id:"integrations",label:"Integrations",icon:"globe",group:"Connections",description:"Connect issues and code hosts.",keywords:"github gitlab bitbucket sources"},{id:"workspace",label:"Repository tools",icon:"files",group:"Tools & activity",description:"Inspect code, verify changes and manage repository operations.",keywords:"repository files verification dependencies context history checkpoints services coordination filtered tasks"},{id:"insights",label:"Insights",icon:"chart",group:"Tools & activity",description:"Understand run results, usage and comparisons.",keywords:"statistics analytics costs tokens agents patterns comparisons evaluations disk"},{id:"automations",label:"Scheduling",icon:"clock",group:"Tools & activity",description:"Run once later, repeat tasks, process a backlog or pursue a project mission.",keywords:"schedule recurring sweep trigger queue deferred inbox review"},{id:"projects",label:"Projects",icon:"project",group:"Management",description:"Configure project defaults, templates, conventions and filesystem policies.",keywords:"repositories setup checks verification isolation docker templates readiness filesystem policy permissions rules instructions"},{id:"extensions",label:"Extensions",icon:"plus",group:"Management",description:"Manage trusted providers and workflows.",keywords:"plugins bundles"},{id:"data",label:"Data & storage",icon:"archive",group:"Management",description:"Choose how long to keep your workspace data.",keywords:"retention cleanup history logs memory"},{id:"advanced",label:"Advanced",icon:"keyboard",group:"Management",description:"Inspect health and troubleshoot your environment.",keywords:"diagnostics export server configuration environment versions"}];function mt(e){return vt.some(t=>t.id===e)?e:"general"}function ln(e){let t=e.toLowerCase().trim().split(/\s+/).filter(Boolean);return vt.filter(n=>t.every(o=>`${n.label} ${n.description} ${n.keywords}`.toLowerCase().includes(o)))}var Wt=["chat","changes","files","terminal","browser","notes"],qt=["runs","repositories","board","people","automation","settings"],Bt=["verification","code","context","history","services","coordination","filtered-tasks"];function Vt(e){let t;try{t=e.replace(/^#\/?/,"").split("/").map(decodeURIComponent)}catch{return{view:"invalid",hash:e}}let[n,o,...i]=t;if(n==="run"&&o)return{view:"run",id:o};if(n==="review"&&o&&i.length)return{view:"review",id:o,branch:i.join("/")};if(n==="settings"&&(o==="workspace"||o==="automations"||o==="insights"))return{view:o,...o==="insights"&&i[0]?{group:i[0]}:{}};if(n==="settings"&&["ssh","remote-access","team"].includes(o??""))return{view:"settings",section:"connections",group:o==="ssh"?"workspace":o==="remote-access"?"devices":"manage"};if(n==="settings")return{view:"settings",...o?{section:mt(o)}:{},...(o==="insights"||o==="connections")&&i[0]?{group:i[0]}:{}};if(n==="workspace")return{view:"workspace"};if(n==="automations")return{view:n,...o?{kind:o}:{}};if(n==="inbox")return{view:n};if(n==="insights")return{view:"insights",...o?{group:o}:{}};if(n==="new"&&o==="unassigned"&&!i.length)return{view:"composer",project:""};if(n==="project"&&o&&i[0]==="new"&&i.length===1)return{view:"composer",project:o};if(n==="project"&&o&&i[0]==="workspace"&&i.length===1)return{view:"workspace",project:o};if(n==="project"&&o){if(!i.length)return{view:"project",id:o};let[r,s,c,..._]=i;return r==="automation"?_.length||c||s&&!["once","repeat","backlog","missions"].includes(s)?{view:"invalid",hash:e}:{view:"project",id:o,section:r,...s?{kind:s}:{}}:!qt.includes(r)||_.length||r!=="repositories"&&i.length!==1||c&&!Bt.includes(c)?{view:"invalid",hash:e}:{view:"project",id:o,section:r,...s?{repository:s}:{},...c?{tool:c}:{}}}return n==="team"?o==="people"?{view:"team-people",...i[0]?{project:i[0]}:{}}:o==="task"&&i[0]?{view:"team-task",id:i[0]}:o==="project"&&i[0]?{view:"team",project:i[0]}:{view:"team"}:n==="side"&&o&&i[0]?{view:"side",tab:Wt.includes(o)?o:"chat",scope:i[0]}:{view:"composer"}}function dn(e){return e.view==="composer"&&e.project!==void 0?e.project?`#/project/${encodeURIComponent(e.project)}/new`:"#/new/unassigned":e.view==="invalid"?e.hash:e.view==="inbox"?"#/inbox":e.view==="automations"?`#/automations${e.kind?`/${encodeURIComponent(e.kind)}`:""}`:e.view==="workspace"?e.project?`#/project/${encodeURIComponent(e.project)}/workspace`:"#/workspace":e.view==="insights"?`#/insights${e.group?`/${encodeURIComponent(e.group)}`:""}`:e.view==="run"?`#/run/${encodeURIComponent(e.id)}`:e.view==="settings"?e.section?`#/settings/${e.section}${(e.section==="insights"||e.section==="connections")&&e.group?`/${encodeURIComponent(e.group)}`:""}`:"#/settings":e.view==="project"?`#/project/${encodeURIComponent(e.id)}${e.section?`/${e.section}`:""}${e.section==="automation"&&e.kind?`/${encodeURIComponent(e.kind)}`:""}${e.section==="repositories"&&(e.repository||e.tool)?`/${encodeURIComponent(e.repository??"")}${e.tool?`/${e.tool}`:""}`:""}`:e.view==="team-people"?`#/team/people${e.project?`/${encodeURIComponent(e.project)}`:""}`:e.view==="team"?e.project?`#/team/project/${encodeURIComponent(e.project)}`:"#/team":e.view==="team-task"?`#/team/task/${encodeURIComponent(e.id)}`:e.view==="side"?`#/side/${e.tab}/${encodeURIComponent(e.scope)}`:e.view==="review"?`#/review/${encodeURIComponent(e.id)}/${e.branch.split("/").map(encodeURIComponent).join("/")}`:"#/"}function Ee(e){let t=Vt(e);return t.view==="project"&&(t.section==="board"||t.section==="people")}var ve=class extends Error{constructor(n,o,i){super(n);this.status=o;this.confirm=i}},Oe=window.__CODEFLOW_WORKSPACE,wn=(e="local",t="#/")=>`${e==="local"?"/":`/computer/${encodeURIComponent(e)}/`}${t}`,j=Ee(location.hash)?"local":new URLSearchParams(location.search).get("team")??"",Gt=E(!1);function Jt(e,t=j||"local"){let n=new URL(location.href);return n.searchParams.delete("token"),n.searchParams.set("team",t),n.hash=e,`${n.pathname}${n.search}${n.hash}`}function bn(e){return!Ee(e)||j==="local"?!0:(location.assign(Jt(e,"local")),!1)}var kt=e=>(j&&/^\/api\/team(?:-link)?(?:\/|\?|$)/.test(e)&&!new URLSearchParams(e.split("?")[1]).has("teamConnection")&&(e+=`${e.includes("?")?"&":"?"}teamConnection=${encodeURIComponent(j)}`),Oe&&e.startsWith("/api/")?`/computer/${Oe}${e}`:e);async function kn(){if(j){let e=new URL(location.href);e.searchParams.set("team",j),history.replaceState(history.state,"",e.href);return}try{let t=(await xt("/api/team-link/connections")).connections.filter(o=>o.linked);Gt.value=t.length>0,j=t.length===1?t[0].id:"local";let n=new URL(location.href);n.searchParams.set("team",j),history.replaceState(history.state,"",n.href)}catch{}}var xn=(e,t={})=>Ne(e,t),xt=(e,t={})=>Ne(e==="/api/auth/logout"?e:kt(e),t),Sn=e=>Ne(kt(e),{},!0),X=new Map;function Ne(e,t={},n=!1){let o=t.method??"GET";if(o!=="GET"&&X.clear(),!n||o!=="GET"||Object.keys(t).length)return gt(e,t);let i=X.get(e);if(i)return i;let r=gt(e,t);return X.set(e,r),r.finally(()=>{X.get(e)===r&&X.delete(e)}).catch(()=>{}),r}async function gt(e,t={}){let n;try{n=await fetch(e,{...t,headers:{"content-type":"application/json",...t.headers||{}}})}catch{throw new ve("Can't reach code-flow. Is the server still running?",0)}let o=await n.json().catch(()=>({}));if(n.status===401&&o.signIn&&zt(),!n.ok)throw new ve(o.error||n.statusText,n.status,o.confirm);return o}function zt(){try{let e=Number(sessionStorage.getItem("signInReload")??0);if(Date.now()-e<6e4)return;sessionStorage.setItem("signInReload",String(Date.now()))}catch{}location.reload()}var Cn=(e,t={})=>xt(e,{method:"POST",body:JSON.stringify(t)}),he=e=>{let t=Oe;return t?`ssh:${t}:${e}`:e},Tn={remove(e){try{localStorage.removeItem(he(e))}catch{}},get(e){try{return localStorage.getItem(he(e))}catch{return null}},set(e,t){try{localStorage.setItem(he(e),t)}catch{}},json(e,t){try{return JSON.parse(localStorage.getItem(he(e))??"null")??t}catch{return t}}},$n=!["localhost","127.0.0.1","[::1]"].includes(location.hostname),Rn=encodeURIComponent;function jn(e){if(typeof e=="string")try{let{protocol:t}=new URL(e);return t==="https:"||t==="http:"?e:void 0}catch{return}}function In(){let e=0;return()=>{let t=++e;return()=>t===e}}function Pn(){let e=ce(0);return ae(()=>()=>{e.current++},[]),ct(()=>{let t=++e.current;return()=>t===e.current},[])}function Un(e,t,n,o=!0){let i=ce(e);i.current=e,ae(()=>{if(!o)return;let r=!0,s=()=>r,c=Ae(()=>i.current(s),t);return()=>{r=!1,c()}},[o,t,...n])}var En=e=>(e||"").replace(/\/+$/,"").split("/").pop()??"",On=e=>e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`,Nn=e=>{let t=Math.round((Date.now()-e)/1e3);return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`},Mn=e=>e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`:`${Math.floor(e/36e5)}h ${Math.round(e%36e5/6e4)}m`,An=e=>e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(1)}M`,Dn=e=>e>=10?`$${e.toFixed(0)}`:e>=.01?`$${e.toFixed(2)}`:e>0?"<$0.01":"$0",Fn=(e,t)=>t?`${Math.round(e/t*100)}%`:"\u2013",Hn={claude:"Claude",codex:"Codex",agy:"Antigravity",auto:"Auto"};var Ln={running:"Running",done:"Done",failed:"Failed",cancelled:"Cancelled",stopped:"Stopped at limit",interrupted:"Interrupted"},yt=E(null),wt;function bt(e,t=2e3){yt.value={text:e,id:Date.now()},clearTimeout(wt),wt=setTimeout(()=>yt.value=null,t)}async function Wn(e,t="Copied"){try{return await navigator.clipboard.writeText(e),bt(t)}catch{let n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.append(n),n.select();let o=document.execCommand("copy");n.remove(),bt(o?t:`Copy this: ${e}`,o?2e3:6e3)}}var qn=e=>new Promise((t,n)=>{let o=new FileReader;o.onload=()=>t(String(o.result).split(",")[1]||""),o.onerror=()=>n(o.error),o.readAsDataURL(e)});var Kt=0;function Gn(e,t,n,o,i,r){t||(t={});var s,c,_=t;if("ref"in _)for(c in _={},t)c=="ref"?s=t[c]:_[c]=t[c];var u={type:e,props:_,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Kt,__i:-1,__u:0,__source:i,__self:r};if(typeof e=="function"&&(s=e.defaultProps))for(c in s)_[c]===void 0&&(_[c]=s[c]);return p.vnode&&p.vnode(u),u}export{Ae as a,p as b,Tt as c,A as d,M as e,jt as f,Xt as g,en as h,ae as i,tn as j,ce as k,G as l,nn as m,At as n,K as o,E as p,Ie as q,Z as r,vt as s,ln as t,Wt as u,Vt as v,dn as w,ve as x,Oe as y,wn as z,j as A,Gt as B,Jt as C,bn as D,kt as E,kn as F,xn as G,xt as H,Sn as I,Cn as J,he as K,Tn as L,$n as M,Rn as N,jn as O,In as P,Pn as Q,Un as R,En as S,On as T,Nn as U,Mn as V,An as W,Dn as X,Fn as Y,Hn as Z,Ln as _,yt as $,bt as aa,Wn as ba,qn as ca,Gn as da};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tc as A}from"./chunk-J4VYS3KV.js";import{c as L}from"./chunk-CGOZQMEZ.js";import{H as P,J as N,a as I,aa as H,ba as $,d as g,da as e,h as o,i as D,k as C}from"./chunk-63YLZ3PR.js";function U(){let[t,p]=o(null),s=()=>P("/api/remote/devices").then(p,l=>H(l.message,5e3));return D(()=>{s()},[]),e("details",{class:"phone-devices",children:[e("summary",{children:["Paired devices",t?` \xB7 ${t.length}`:""]}),e("p",{class:"help",children:"Each phone has its own expiring session. Revoking one phone leaves your other devices signed in."}),t?.length?e("div",{class:"pd-list",children:t.map(l=>e("div",{class:"pd-row",children:[e("span",{class:"pd-name",children:l.label}),e("span",{class:"pd-when",children:["expires ",new Date(l.expiresAt).toLocaleDateString()]}),e("button",{class:"btn small",onClick:async()=>{try{await P(`/api/remote/devices/${l.id}`,{method:"DELETE"}),await s()}catch(u){H(u.message,5e3)}},children:"Revoke device"})]},l.id))}):e("p",{class:"help",children:"No paired devices."}),e("button",{class:"btn small pd-refresh",onClick:s,children:"Refresh devices"})]})}function G(){let[t,p]=o(null),[s,l]=o(!1),[u,S]=o(!1),[f,b]=o(""),[E,w]=o(Date.now()),i=C(0),v=C(!1),d=C(!1),y=async(a=!1)=>{if(v.current||d.current)return;d.current=!0,S(!0);let h=++i.current;try{let T=await P(`/api/remote${a?"?refresh=1":""}`);h===i.current&&(p(T),b(""),w(Date.now()))}catch(T){h===i.current&&b(T.message)}finally{d.current=!1,S(!1)}};D(()=>{let a=I(()=>(w(Date.now()),y()),1e4);return()=>{a(),++i.current}},[]);let c=async(a,h="/api/remote")=>{if(v.current)return!1;v.current=!0;let T=++i.current;l(!0);try{let R=await N(h,a);return T===i.current&&(p(R),b(""),w(Date.now())),!0}catch(R){return T===i.current&&b(R.message),!1}finally{v.current=!1,l(!1)}},r=t?.transport==="tailscale",m=!!t?.control&&t.lan,x=m&&E>=(t?.pairingUntil??0),k=!t||x||f?[]:r?t.tailscaleUrl?[t.tailscaleUrl]:[]:t.lanUrls,n=a=>a.replace(/\/r\/(\w{6})\w+/,"/r/$1\u2026");return e("section",{class:"section auto-card phone-card","aria-label":"Remote access",children:[e("h2",{class:"section-title",children:"Remote access"}),e("p",{class:"help",children:"Open Codeflow from your phone, tablet or another computer. This computer must stay awake and Codeflow must remain running."}),e("ol",{class:"connection-checklist",children:[e("li",{children:"Choose Wi-Fi for nearby devices or Tailscale for access across networks."}),e("li",{children:"Set up HTTPS to enable full control, then scan the QR code on your device."}),e("li",{children:["Manage paired devices below. To invite a teammate with their own account, use ",e("a",{href:"#/settings/connections/host",children:"Host a team"}),"."]})]}),f?e("p",{class:"msg err",role:"alert",children:[f," ",e("button",{class:"btn small",disabled:s,onClick:()=>void y(!0),children:"Retry"})]}):null,t?e(g,{children:[e("label",{class:"checkpoint",children:[e("input",{type:"checkbox","aria-label":"Enable remote access",disabled:s,checked:t.enabled,onChange:a=>void c({enabled:a.currentTarget.checked})}),e("span",{children:[e("b",{children:"Enable remote access"})," \u2014 a private link to your runs and results. Starts with a read-only view."]})]}),t.enabled?e(g,{children:[e("label",{class:"remote-connection",children:["Connection",e("select",{class:"field","aria-label":"Remote connection",disabled:s,value:t.lan?t.transport:"local",onChange:a=>{let h=a.currentTarget.value;c({lan:h!=="local",transport:h==="tailscale"?"tailscale":"lan",...h!=="local"&&!t.secure&&!t.insecureDevelopment?{control:!1}:{}})},children:[e("option",{value:"local",children:"This computer only"}),e("option",{value:"tailscale",children:"Tailscale \xB7 access anywhere"}),e("option",{value:"lan",children:"Wi-Fi \xB7 local network"})]})]}),r?e("div",{class:"remote-status",role:"status",children:[e("b",{children:t.tailscale.state==="connected"?"Tailscale connected":"Tailscale setup needed"}),e("p",{class:"help",children:[t.tailscale.message,t.tailscale.ip?` ${t.tailscale.dnsName?`${t.tailscale.dnsName} \xB7 `:""}${t.tailscale.ip}`:""]}),e("button",{class:"btn small",disabled:s||u,onClick:()=>void y(!0),children:u?"Checking Tailscale\u2026":"Refresh Tailscale"})," ",t.tailscale.state==="not-installed"?e("a",{class:"btn small",href:"https://tailscale.com/download",target:"_blank",rel:"noreferrer",children:"Install Tailscale"}):null,e("p",{class:"help",children:"Connect your other device to the same Tailscale network. Its access rules must allow this computer's remote port. Codeflow listens only on the Tailscale address in this mode."})]}):t.lan?e("p",{class:"help",children:"Your other device must be on the same trusted Wi-Fi network. HTTPS is required for full control."}):null,t.lan?e(g,{children:[e(M,{info:t,busy:s,save:a=>c(a,"/api/remote/tls")}),e("label",{class:`checkpoint${t.control?" danger":""}`,children:[e("input",{type:"checkbox","aria-label":"Full control from remote devices",disabled:s||!t.secure&&!t.insecureDevelopment,checked:t.control,onChange:a=>void c({control:a.currentTarget.checked})}),e("span",{children:[e("b",{children:"Full control from remote devices"})," \u2014 start runs, answer questions, review changes, merge and open pull requests. Anyone with the pairing link has your control of this computer."]})]}),e("p",{class:"help",children:[t.secure?"Encrypted HTTPS. ":t.insecureDevelopment?"Development override: unencrypted HTTP. ":"Set up secure remote access above to enable full control. ",m?"Pairing links expire after ten minutes. Paired devices stay signed in for up to 30 days.":""]}),e(U,{},`${t.transport}-${t.pairingUntil}`)]}):null,t.lanError?e("p",{class:"msg err",role:"alert",children:t.lanError}):null,x?e("p",{class:"msg",role:"status",children:"Pairing link expired. Choose New link to pair another device."}):null,k[0]?e("div",{class:"phone-qr",children:[e(L,{text:k[0]}),e("div",{class:"phone-qr-text",children:[e("b",{children:"Scan with your phone"}),e("span",{class:"help",children:[m?"Pairs this device with full control":"Opens the read-only view"," at ",n(k[0]),". ",r?"Turn on Tailscale on the phone before opening the link.":"Connect your phone to the same Wi-Fi first."]})]})]}):t.lan&&!x&&!f?e("p",{class:"help",children:["No remote link until ",r?"Tailscale is connected and Codeflow can listen on its address":"Codeflow can listen on your network","."]}):null,e("div",{class:"hook",children:[(t.lan?k:[t.local]).map(a=>e("div",{children:[e("code",{children:n(a)})," ",e("button",{class:"btn small",onClick:()=>$(a,"Link copied"),children:"Copy link"})," ",t.lan?null:e("a",{class:"btn small",href:a,target:"_blank",rel:"noreferrer",children:"Open"})]},a)),t.lan?e("p",{class:"help",children:"Open this link on your other device. Connections from this computer are blocked on the remote port."}):null,e("button",{class:"btn small",disabled:s,onClick:async()=>await A("Make a new link? Old links stop working and all paired devices are signed out.",{title:"Replace access link?",confirmLabel:"Replace link",danger:!0})&&void c({rotate:!0}),children:"New link"})]})]}):null]}):e("p",{class:"help",children:f?"Remote access settings could not be loaded.":"Loading remote access\u2026"})]})}function M({info:t,busy:p,save:s}){let[l,u]=o(!1),[S,f]=o("tailscale"),[b,E]=o(t.tls?.hostname??t.tailscale.dnsName??""),[w,i]=o(""),v=C(null),d=C(null),y=t.transport==="tailscale",c=y&&S==="tailscale",r=t.tls?.renewal,m=t.tls?.expiresAt,x=!!m&&m-Date.now()<30*864e5,k=async()=>{i("");try{if(c){await s({mode:"tailscale"})&&u(!1);return}let n=v.current?.files?.[0],a=d.current?.files?.[0];if(!n||!a)throw new Error("Choose both the certificate and private key files");if(n.size>128*1024||a.size>32*1024)throw new Error("Certificate must be under 128 KB and private key under 32 KB");await s({mode:"import",hostname:b,cert:await n.text(),key:await a.text()})&&(d.current&&(d.current.value=""),u(!1))}catch(n){i(n.message)}};return e("div",{class:"remote-status secure-remote-setup",children:[e("b",{children:t.secure?"Secure remote access is set up":"Set up secure remote access"}),t.tls?.source==="environment"?e("p",{class:"help",children:"HTTPS is managed by this server's environment configuration."}):e(g,{children:[t.tls?.hostname?e("p",{class:"help",children:[t.tls.hostname,m?` \xB7 Certificate expires ${new Date(m).toLocaleDateString()}`:""]}):null,t.tls?.error?e("p",{class:"msg err",children:t.tls.error}):x&&!r?e("p",{class:"help",children:"Renew the certificate before it expires to keep remote access available."}):null,r?e("div",{class:"help",children:[e("b",{children:"Automatic renewal is on"}),e("p",{children:[r.running?"Renewing certificate\u2026":`Next renewal attempt: ${new Date(Math.max(Date.now(),r.nextAttempt)).toLocaleString()}`,r.lastSuccess?` \xB7 Last renewed ${new Date(r.lastSuccess).toLocaleString()}`:""]}),e("p",{children:"Codeflow renews within 30 days of expiry while it is running and Tailscale access is enabled. Paired devices stay signed in."}),r.error?e("p",{role:"status",children:r.error}):null]}):null,e("p",{class:"help",children:"Configure HTTPS here. Codeflow saves the certificate privately and applies it immediately without restarting your chats. Manually replacing a certificate turns full control off until you enable it below."}),t.tls?.editable?e("button",{class:"btn small",disabled:p,"aria-expanded":l,onClick:()=>u(!l),children:l?"Close setup":t.secure?"Renew or replace certificate":"Set up secure remote access"}):e("p",{class:"help",children:"Open these settings on the computer running Codeflow to configure HTTPS."}),l?e("form",{class:"secure-remote-form",onSubmit:n=>{n.preventDefault(),k()},children:e("fieldset",{disabled:p,children:[y?e("label",{children:["Certificate setup",e("select",{class:"field",value:S,onChange:n=>f(n.currentTarget.value),children:[e("option",{value:"tailscale",children:"Use Tailscale \xB7 recommended"}),e("option",{value:"import",children:"Import certificate files"})]})]}):null,c?e(g,{children:[e("p",{class:"help",children:["Create or renew a certificate for ",e("b",{children:t.tailscale.dnsName??"this computer's Tailscale name"}),". Enable HTTPS certificates in your ",e("a",{href:"https://login.tailscale.com/admin/dns",target:"_blank",rel:"noreferrer",children:"Tailscale DNS settings"})," first."]}),e("p",{class:"help",children:["The computer's DNS name will appear in public certificate transparency logs. This does not make Codeflow public. ",e("a",{href:"https://tailscale.com/docs/how-to/set-up-https-certificates",target:"_blank",rel:"noreferrer",children:"About Tailscale certificates"})]}),e("p",{class:"help",children:"Automatic renewal is included. Codeflow renews within 30 days of expiry while it is running and Tailscale access is enabled, and retries automatically if renewal fails."})]}):e(g,{children:[e("label",{children:["Remote hostname or IP",e("input",{class:"field",value:b,placeholder:"codeflow.example.com",onInput:n=>E(n.currentTarget.value),required:!0})]}),e("label",{children:["Certificate file (PEM)",e("input",{class:"field",type:"file",accept:".pem,.crt,.cer",ref:v,required:!0})]}),e("label",{children:["Private key file (PEM)",e("input",{class:"field",type:"file",accept:".pem,.key",ref:d,required:!0})]}),e("p",{class:"help",children:"Use a certificate trusted by your other device for this exact hostname or IP. The hostname must resolve to this computer. The key must be unencrypted; it is saved privately on this computer and never returned to the browser."})]}),e("p",{class:"help",children:"Replacing a certificate signs paired devices out. Pair them again after enabling full control."}),w?e("p",{class:"msg err",role:"alert",children:w}):null,e("button",{type:"submit",class:"btn primary",disabled:p||c&&(t.tailscale.state!=="connected"||!t.tailscale.dnsName),children:p?"Setting up HTTPS\u2026":c?"Get Tailscale certificate":"Save and apply HTTPS"})]})}):null]})]})}export{G as a,M as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(r){let t="Enter an HTTPS team address or the connection link your teammate shared.",n;try{n=new URL(r.trim())}catch{throw new Error(t)}let o=["localhost","127.0.0.1","[::1]"].includes(n.hostname);if(n.protocol!=="https:"&&!(o&&n.protocol==="http:")||n.username||n.password||n.search||n.pathname!=="/")throw new Error(t+" Personal device pairing links cannot be used to join a team.");if(n.hash.startsWith("#/join/")){if(!/^#\/join\/[a-zA-Z0-9_-]{43}$/.test(n.hash))throw new Error("This invitation link is incomplete. Ask the owner for the full link.");return{url:n.origin,invitation:n.href}}if(n.hash&&!n.hash.startsWith("#/connect?"))throw new Error(t);let e=new URLSearchParams(n.hash.slice(10)).get("username")??void 0;return{url:n.origin,...e?{username:e}:{}}}var s=(r,t)=>`${new URL(r).origin}/#/connect?${new URLSearchParams({username:t})}`;export{i as a,s as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as P}from"./chunk-4D5IENEB.js";import{c as G}from"./chunk-TEJVYIKC.js";import{A as _,B as x,E as q,H as w,N as K,P as V,U as Y,Z as X,da as c,l as D,p as b}from"./chunk-63YLZ3PR.js";var A=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(A||{}),gt=[0,1],Z=[1,0],Q=[2,3],tt=[3,2],bt={L:gt,M:Z,Q,H:tt},wt=/^\d*$/,kt=/^[A-Z0-9 $%*+./:-]*$/,C="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",z=1,$=40,J=3,yt=3,S=40,At=10,et=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],nt=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],L=class{constructor(t,n,o,r){if(this.version=t,this.ecc=n,t<z||t>$)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let s=Array.from({length:this.size}).fill(!1);for(let a=0;a<this.size;a++)this.modules.push(s.slice()),this.types.push(s.map(()=>0));this.drawFunctionPatterns();let i=this.addEccAndInterleave(o);if(this.drawCodewords(i),r===-1){let a=1e9;for(let l=0;l<8;l++){this.applyMask(l),this.drawFormatBits(l);let u=this.getPenaltyScore();u<a&&(r=l,a=u),this.applyMask(l)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(t,n){return t>=0&&t<this.size&&n>=0&&n<this.size&&this.modules[n][t]}drawFunctionPatterns(){for(let o=0;o<this.size;o++)this.setFunctionModule(6,o,o%2===0,A.Timing),this.setFunctionModule(o,6,o%2===0,A.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let t=this.getAlignmentPatternPositions(),n=t.length;for(let o=0;o<n;o++)for(let r=0;r<n;r++)o===0&&r===0||o===0&&r===n-1||o===n-1&&r===0||this.drawAlignmentPattern(t[o],t[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){let n=this.ecc[1]<<3|t,o=n;for(let s=0;s<10;s++)o=o<<1^(o>>>9)*1335;let r=(n<<10|o)^21522;for(let s=0;s<=5;s++)this.setFunctionModule(8,s,k(r,s));this.setFunctionModule(8,7,k(r,6)),this.setFunctionModule(8,8,k(r,7)),this.setFunctionModule(7,8,k(r,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,k(r,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,k(r,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,k(r,s));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let o=0;o<12;o++)t=t<<1^(t>>>11)*7973;let n=this.version<<12|t;for(let o=0;o<18;o++){let r=k(n,o),s=this.size-11+o%3,i=Math.floor(o/3);this.setFunctionModule(s,i,r),this.setFunctionModule(i,s,r)}}drawFinderPattern(t,n){for(let o=-4;o<=4;o++)for(let r=-4;r<=4;r++){let s=Math.max(Math.abs(r),Math.abs(o)),i=t+r,a=n+o;i>=0&&i<this.size&&a>=0&&a<this.size&&this.setFunctionModule(i,a,s!==2&&s!==4,A.Position)}}drawAlignmentPattern(t,n){for(let o=-2;o<=2;o++)for(let r=-2;r<=2;r++)this.setFunctionModule(t+r,n+o,Math.max(Math.abs(r),Math.abs(o))!==1,A.Alignment)}setFunctionModule(t,n,o,r=A.Function){this.modules[n][t]=o,this.types[n][t]=r}addEccAndInterleave(t){let n=this.version,o=this.ecc;if(t.length!==M(n,o))throw new RangeError("Invalid argument");let r=nt[o[0]][n],s=et[o[0]][n],i=Math.floor(B(n)/8),a=r-i%r,l=Math.floor(i/r),u=[],m=It(s);for(let h=0,g=0;h<r;h++){let f=t.slice(g,g+l-s+(h<a?0:1));g+=f.length;let p=_t(f,m);h<a&&f.push(0),u.push(f.concat(p))}let d=[];for(let h=0;h<u[0].length;h++)u.forEach((g,f)=>{(h!==l-s||f>=a)&&d.push(g[h])});return d}drawCodewords(t){if(t.length!==Math.floor(B(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let o=this.size-1;o>=1;o-=2){o===6&&(o=5);for(let r=0;r<this.size;r++)for(let s=0;s<2;s++){let i=o-s,l=(o+1&2)===0?this.size-1-r:r;!this.types[l][i]&&n<t.length*8&&(this.modules[l][i]=k(t[n>>>3],7-(n&7)),n++)}}}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let o=0;o<this.size;o++){let r;switch(t){case 0:r=(o+n)%2===0;break;case 1:r=n%2===0;break;case 2:r=o%3===0;break;case 3:r=(o+n)%3===0;break;case 4:r=(Math.floor(o/3)+Math.floor(n/2))%2===0;break;case 5:r=o*n%2+o*n%3===0;break;case 6:r=(o*n%2+o*n%3)%2===0;break;case 7:r=((o+n)%2+o*n%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[n][o]&&r&&(this.modules[n][o]=!this.modules[n][o])}}getPenaltyScore(){let t=0;for(let s=0;s<this.size;s++){let i=!1,a=0,l=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[s][u]===i?(a++,a===5?t+=J:a>5&&t++):(this.finderPenaltyAddHistory(a,l),i||(t+=this.finderPenaltyCountPatterns(l)*S),i=this.modules[s][u],a=1);t+=this.finderPenaltyTerminateAndCount(i,a,l)*S}for(let s=0;s<this.size;s++){let i=!1,a=0,l=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[u][s]===i?(a++,a===5?t+=J:a>5&&t++):(this.finderPenaltyAddHistory(a,l),i||(t+=this.finderPenaltyCountPatterns(l)*S),i=this.modules[u][s],a=1);t+=this.finderPenaltyTerminateAndCount(i,a,l)*S}for(let s=0;s<this.size-1;s++)for(let i=0;i<this.size-1;i++){let a=this.modules[s][i];a===this.modules[s][i+1]&&a===this.modules[s+1][i]&&a===this.modules[s+1][i+1]&&(t+=yt)}let n=0;for(let s of this.modules)n=s.reduce((i,a)=>i+(a?1:0),n);let o=this.size*this.size,r=Math.ceil(Math.abs(n*20-o*10)/o)-1;return t+=r*At,t}getAlignmentPatternPositions(){if(this.version===1)return[];{let t=Math.floor(this.version/7)+2,n=this.version===32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,o=[6];for(let r=this.size-7;o.length<t;r-=n)o.splice(1,0,r);return o}}finderPenaltyCountPatterns(t){let n=t[1],o=n>0&&t[2]===n&&t[3]===n*3&&t[4]===n&&t[5]===n;return(o&&t[0]>=n*4&&t[6]>=n?1:0)+(o&&t[6]>=n*4&&t[0]>=n?1:0)}finderPenaltyTerminateAndCount(t,n,o){return t&&(this.finderPenaltyAddHistory(n,o),n=0),n+=this.size,this.finderPenaltyAddHistory(n,o),this.finderPenaltyCountPatterns(o)}finderPenaltyAddHistory(t,n){n[0]===0&&(t+=this.size),n.pop(),n.unshift(t)}};function y(e,t,n){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let o=t-1;o>=0;o--)n.push(e>>>o&1)}function k(e,t){return(e>>>t&1)!==0}var v=class{constructor(t,n,o){if(this.mode=t,this.numChars=n,this.bitData=o,n<0)throw new RangeError("Invalid argument");this.bitData=o.slice()}getData(){return this.bitData.slice()}},Et=[1,10,12,14],vt=[2,9,11,13],Tt=[4,8,16,16];function ot(e,t){return e[Math.floor((t+7)/17)+1]}function rt(e){let t=[];for(let n of e)y(n,8,t);return new v(Tt,e.length,t)}function xt(e){if(!st(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){let o=Math.min(e.length-n,3);y(Number.parseInt(e.substring(n,n+o),10),o*3+1,t),n+=o}return new v(Et,e.length,t)}function Pt(e){if(!it(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t=[],n;for(n=0;n+2<=e.length;n+=2){let o=C.indexOf(e.charAt(n))*45;o+=C.indexOf(e.charAt(n+1)),y(o,11,t)}return n<e.length&&y(C.indexOf(e.charAt(n)),6,t),new v(vt,e.length,t)}function St(e){return e===""?[]:st(e)?[xt(e)]:it(e)?[Pt(e)]:[rt(Rt(e))]}function st(e){return wt.test(e)}function it(e){return kt.test(e)}function Mt(e,t){let n=0;for(let o of e){let r=ot(o.mode,t);if(o.numChars>=1<<r)return Number.POSITIVE_INFINITY;n+=4+r+o.bitData.length}return n}function Rt(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)!=="%"?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}function B(e){if(e<z||e>$)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function M(e,t){return Math.floor(B(e)/8)-et[t[0]][e]*nt[t[0]][e]}function It(e){if(e<1||e>255)throw new RangeError("Degree out of range");let t=[];for(let o=0;o<e-1;o++)t.push(0);t.push(1);let n=1;for(let o=0;o<e;o++){for(let r=0;r<t.length;r++)t[r]=N(t[r],n),r+1<t.length&&(t[r]^=t[r+1]);n=N(n,2)}return t}function _t(e,t){let n=t.map(o=>0);for(let o of e){let r=o^n.shift();n.push(0),t.forEach((s,i)=>n[i]^=N(s,r))}return n}function N(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let n=0;for(let o=7;o>=0;o--)n=n<<1^(n>>>7)*285,n^=(t>>>o&1)*e;return n}function Ct(e,t,n=1,o=40,r=-1,s=!0){if(!(z<=n&&n<=o&&o<=$)||r<-1||r>7)throw new RangeError("Invalid value");let i,a;for(i=n;;i++){let d=M(i,t)*8,h=Mt(e,i);if(h<=d){a=h;break}if(i>=o)throw new RangeError("Data too long")}for(let d of[Z,Q,tt])s&&a<=M(i,d)*8&&(t=d);let l=[];for(let d of e){y(d.mode[0],4,l),y(d.numChars,ot(d.mode,i),l);for(let h of d.getData())l.push(h)}let u=M(i,t)*8;y(0,Math.min(4,u-l.length),l),y(0,(8-l.length%8)%8,l);for(let d=236;l.length<u;d^=253)y(d,8,l);let m=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((d,h)=>m[h>>>3]|=d<<7-(h&7)),new L(i,t,m,r)}function at(e,t){let{ecc:n="L",boostEcc:o=!1,minVersion:r=1,maxVersion:s=40,maskPattern:i=-1,border:a=1}=t||{},l=typeof e=="string"?St(e):Array.isArray(e)?[rt(e)]:void 0;if(!l)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let u=Ct(l,bt[n],r,s,i,o),m=Lt({version:u.version,maskPattern:u.mask,size:u.size,data:u.modules,types:u.types},a);return t?.invert&&(m.data=m.data.map(d=>d.map(h=>!h))),t?.onEncoded?.(m),m}function Lt(e,t=1){if(!t)return e;let{size:n}=e,o=n+t*2;e.size=o,e.data.forEach(s=>{for(let i=0;i<t;i++)s.unshift(!1),s.push(!1)});for(let s=0;s<t;s++)e.data.unshift(Array.from({length:o},i=>!1)),e.data.push(Array.from({length:o},i=>!1));let r=A.Border;e.types.forEach(s=>{for(let i=0;i<t;i++)s.unshift(r),s.push(r)});for(let s=0;s<t;s++)e.types.unshift(Array.from({length:o},i=>r)),e.types.push(Array.from({length:o},i=>r));return e}function oe({cantRun:e}){return c("div",{class:"cant-run",children:["The check can't run here: ",c("code",{children:e.reason}),". Set ",c("code",{children:"setup"})," and ",c("code",{children:"check"})," in ",c("code",{children:".codeflow/config.json"}),".",c("div",{class:"cr-why",children:"That's the environment, not the change: it fails on the base commit too. So no fix rounds were spent on it, and whether the change works is unknown."})]})}function re({id:e,note:t}){return e?c("span",{class:`agent ${e}`,children:[X[e]??e,t?c("span",{class:"model",children:[" ",t]}):null]}):null}function se({text:e,size:t=168}){let n=at(e,{ecc:"M",border:0}),o=4,r=n.size+o*2,s="";return n.data.forEach((i,a)=>i.forEach((l,u)=>l&&(s+=`M${u+o} ${a+o}h1v1h-1z`))),c("svg",{class:"qr",width:t,height:t,viewBox:`0 0 ${r} ${r}`,"shape-rendering":"crispEdges",role:"img","aria-label":`QR code for ${e}`,children:[c("rect",{width:r,height:r,fill:"#fff"}),c("path",{d:s,fill:"#1a1b16"})]})}function ie({text:e}){let t=D(()=>Bt(e),[e]);return c("div",{class:"md",children:t})}function Bt(e){let t=[];return e.split(/^```[^\n]*\n?/m).forEach((n,o)=>{o%2===1?t.push(c("pre",{children:n.replace(/\n$/,"")},`c${o}`)):Nt(n,`b${o}`,t)}),t}var F=/^(\s*)([-*+]|\d+[.)])\s+(.*)/,lt=/^\s*([-*_])(\s*\1){2,}\s*$/,ct=/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;function Nt(e,t,n){let o=e.split(`
|
|
2
|
+
`),r=0,s=()=>`${t}-${r}`;for(;r<o.length;){let i=o[r];if(!i.trim()){r++;continue}let a=i.match(/^(#{1,6})\s+(.*)/);if(a){n.push(a[1].length<=2?c("h3",{children:E(a[2])},s()):c("h4",{children:E(a[2])},s())),r++;continue}if(lt.test(i)){n.push(c("hr",{},s())),r++;continue}if(F.test(i)){let m=/^\s*\d/.test(i),d=[],h=s();for(;r<o.length;){let f=o[r].match(F);if(!f){if(d.length&&/^\s{2,}\S/.test(o[r]))d.at(-1).lines.push(o[r++].trim());else break;continue}let p=Math.min(3,Math.floor(f[1].replace(/\t/g," ").length/2)),I=/\d/.test(f[2])?parseInt(f[2],10):void 0;if(!p&&I!==void 0!==m)break;d.push({depth:p,num:I,lines:[f[3]]}),r++}let g=d.map((f,p)=>c("li",{value:m&&!f.depth?f.num:void 0,class:`${f.depth?`d${f.depth}`:""} ${f.num===void 0?"bullet":"num"}`,children:U(f.lines)},p));n.push(m?c("ol",{children:g},h):c("ul",{children:g},h));continue}if(i.trimStart().startsWith(">")){let m=[],d=s();for(;r<o.length&&o[r].trimStart().startsWith(">");)m.push(o[r++].trimStart().replace(/^>\s?/,""));n.push(c("blockquote",{children:U(m)},d));continue}if(i.includes("|")&&ct.test(o[r+1]??"")){let m=s(),d=f=>f.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(p=>p.trim()),h=d(i);r+=2;let g=[];for(;r<o.length&&o[r].includes("|")&&o[r].trim();)g.push(d(o[r++]));n.push(c("div",{class:"md-table",children:c("table",{children:[c("thead",{children:c("tr",{children:h.map((f,p)=>c("th",{children:E(f)},p))})}),c("tbody",{children:g.map((f,p)=>c("tr",{children:h.map((I,H)=>c("td",{children:E(f[H]??"")},H))},p))})]})},m));continue}let l=[],u=s();for(;r<o.length&&o[r].trim()&&!zt(o,r);)l.push(o[r++]);l.length||l.push(o[r++]),n.push(c("p",{children:U(l)},u))}}var zt=(e,t)=>{let n=e[t];return/^#{1,6}\s/.test(n)||lt.test(n)||F.test(n)||n.trimStart().startsWith(">")||n.includes("|")&&ct.test(e[t+1]??"")},U=e=>e.flatMap((t,n)=>n?[c("br",{},`br${n}`),...E(t)]:E(t));function E(e){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|__[^_]+__|\[[^\]]+\]\(https?:\/\/[^\s)]+\)|(?<![\w*])\*[^*\s][^*]*\*(?![\w*])|(?<![\w_])_[^_\s][^_]*_(?![\w_]))/).map((t,n)=>{if(t.length>1&&t.startsWith("`")&&t.endsWith("`"))return c("code",{children:t.slice(1,-1)},n);if(t.startsWith("**")&&t.endsWith("**")||t.startsWith("__")&&t.endsWith("__"))return c("b",{children:t.slice(2,-2)},n);let o=t.match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);return o?c("a",{href:o[2],target:"_blank",rel:"noreferrer",children:o[1]},n):t.length>2&&(t.startsWith("*")&&t.endsWith("*")||t.startsWith("_")&&t.endsWith("_"))?c("i",{children:t.slice(1,-1)},n):t})}var O=b(null),$t=b(!1),ut=b(""),R=b(null),dt=b(""),T=b(0),ht=b([]),Ut=b(null),fe=b(!1),Ft=b(0),me=(e,t)=>w(e,{method:"PUT",body:JSON.stringify(t)}),pe=(e,t)=>w(e,{method:"DELETE",...t===void 0?{}:{body:JSON.stringify(t)}}),Ot=V();async function Wt(){let e=Ot();try{let t=await w("/api/team/board");return e()?(O.value=t,(t.tasks.length||t.projects.some(n=>n.repositories.length>0||n.members.some(o=>o.userId!=="owner")))&&(x.value=!0),ut.value="",T.value=t.inboxUnread,t):O.value}catch(t){return e()&&(O.value=null,Ut.value=null,T.value=0,ut.value=t.message),null}finally{e()&&($t.value=!0)}}var ge=e=>w(`/api/team/tasks/${K(e)}`);async function jt(){try{R.value=await w("/api/team-link"),R.value.linked&&(x.value=!0),dt.value=""}catch(e){R.value=null,dt.value=e.message}return R.value}async function be(){try{let e=await w("/api/team-link/attempts");ht.value=Array.isArray(e)?e:e.attempts??[]}catch{ht.value=[]}}async function Ht(){let e=await w("/api/team/inbox");return T.value=e.unread,e}async function we(e){let t=await w("/api/team/inbox/read",{method:"POST",body:JSON.stringify(e==="all"?{all:!0}:{ids:e})});return T.value=t.unread,t.unread}var ft;function Dt(){clearTimeout(ft),ft=setTimeout(()=>{Ft.value++},150)}function pt(e){e?.type!=="error"&&(typeof e?.unread=="number"&&e.unread>=0?T.value=e.unread:e?.type==="hello"&&(Ht().catch(()=>{}),Wt()),Dt())}var mt;function ke(){mt||(jt(),w("/api/team-link/connections").then(e=>{e.connections.some(t=>t.linked)&&(x.value=!0)}).catch(()=>{}),mt=G(_?`team:${_}`:"team",e=>pt(e)))}var qt=3e4;function ye(e){let t,n,o=!1,r=()=>{if(o)return;let s=t=new EventSource(q("/api/team/events"));s.onopen=()=>e?.("connected"),s.onerror=()=>{e?.("reconnecting"),s.readyState===EventSource.CLOSED&&!o&&(clearTimeout(n),n=setTimeout(r,qt))},s.onmessage=i=>{let a=null;try{a=JSON.parse(i.data)}catch{}pt(a&&typeof a=="object"?a:null)}};return r(),()=>{o=!0,clearTimeout(n),t?.close()}}function Ae(e){let t=e?.tailscaleUrl??e?.lanUrls?.[0];if(!(!e?.secure||typeof t!="string"))try{let n=new URL(t);return n.protocol==="https:"?n.origin:void 0}catch{return}}var Ee=["planned","working","blocked","review","done"],ve={planned:"Planned",working:"Working",blocked:"Blocked",review:"In review",done:"Done"},Te={planned:"planned",working:"running",blocked:"blocked",review:"review",done:"done"},xe={claimed:"Starting",running:"Running",paused:"Paused",finished:"Finished",failed:"Failed",stopped:"Stopped at a limit",unknown:"Connection lost",superseded:"Superseded"},Pe={claimed:"running",running:"running",paused:"stopped",finished:"done",failed:"failed",stopped:"stopped",unknown:"failing",superseded:""},Se={assigned:"Assigned to you",mention:"Mentioned you","review-requested":"Review requested","review-recorded":"Review recorded","handoff-offered":"Hand-over offered","handoff-accepted":"Hand-over accepted","handoff-declined":"Hand-over declined","handoff-cancelled":"Hand-over cancelled","instruction-proposed":"Instruction proposed",blocked:"Blocked","attempt-finished":"Attempt finished","attempt-failed":"Attempt failed",comment:"New comment"},Kt=9e4,Me=(e,t)=>e?e.userId===t?`${e.displayName} (you)`:e.displayName:"Unassigned";function Re(e){let t=e.trim().split(/\s+/).filter(Boolean);return(t.length>1?`${t[0][0]??""}${t[t.length-1][0]??""}`:(t[0]??"").slice(0,2)).toUpperCase()||"?"}var Ie=e=>Y(e),_e=e=>new Date(e).toLocaleString(),Ce=e=>e.slice(0,10),Le=(e,t)=>{for(let n of e?.projects??[]){let o=n.members.find(r=>r.userId===t);if(o)return o.displayName}return t};var Vt=["claimed","running","unknown"],Yt=["claimed","running","paused","unknown"],Xt=["paused","stopped","unknown"],W=(e,t)=>{for(let n=e.length-1;n>=0;n--){let o=e[n];if(t.includes(o.state))return o}},j=e=>W(e.attempts,["claimed","running"])??W(e.attempts,Vt),Gt=e=>j(e)??W(e.attempts,Yt),Be=e=>Gt(e)??e.attempts[e.attempts.length-1],Ne=(e,t)=>Xt.includes(e.state)&&t?.status!=="done",ze=e=>{let t;for(let n of e.checkpoints)(!t||n.at>=t.at)&&(t=n);return t},Jt=(e,t=Date.now())=>(e.state==="claimed"||e.state==="running")&&t-e.lastHeartbeatAt<Kt,$e=(e,t=Date.now())=>e.state==="unknown"||(e.state==="claimed"||e.state==="running")&&!Jt(e,t),Zt="Describe what blocks the task before marking it blocked";function Ue(e,t,n,o=e.blocker){if(!P(n,"contributor"))return"A project contributor role is required to change the status";if(t==="blocked"&&!o?.trim())return Zt;if(t!==e.status&&t==="done"){let r=j(e);if(r)return`Stop the attempt running on ${r.runnerName} before marking the task done`;if(e.handoff?.state==="offered")return"Accept, decline or cancel the offered hand-over before marking the task done"}}function Fe(e,t,n){if(!P(t,"contributor"))return"A project contributor role is required to take a task";let o=j(e);if(o)return`Stop the attempt running on ${o.runnerName} before changing the owner`;if(!(P(t,"maintainer")||!e.owner||e.owner.userId===n))return"Only a project maintainer may reassign a task that already has an owner"}export{oe as a,re as b,se as c,ie as d,O as e,$t as f,ut as g,R as h,dt as i,T as j,ht as k,Ut as l,fe as m,Ft as n,me as o,pe as p,Wt as q,ge as r,jt as s,be as t,Ht as u,we as v,ke as w,ye as x,Ae as y,Ee as z,ve as A,Te as B,xe as C,Pe as D,Se as E,Me as F,Re as G,Ie as H,_e as I,Ce as J,Le as K,j as L,Be as M,Ne as N,ze as O,Jt as P,$e as Q,Ue as R,Fe as S};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as Bt,c as Lt}from"./chunk-TEJVYIKC.js";import{H as q,I as Z,J as Nt,K as Xe,L as l,Z as Ft,aa as Ze,n as Ye,p as a,q as h,r as Ce,u as Oe,v as $t,w as Qe,x as Dt,y as ce}from"./chunk-63YLZ3PR.js";var U=e=>e.taskExecution?.taskId??(e.pattern==="solo"?e.chatLink?.workspaceId??e.id:e.id),Rn=e=>Math.max(e.createdAt,e.endedAt??0,e.followUps?.at(-1)?.at??0);function ur(e){let t=new Map;for(let r of e){let n=U(r),o=t.get(n)??[];o.push(r),t.set(n,o)}return[...t].map(([r,n])=>(n.sort((o,i)=>o.createdAt-i.createdAt||o.id.localeCompare(i.id)),{id:r,root:n.find(o=>o.id===r)??n.find(o=>!o.taskExecution)??n[0],chats:n.filter(o=>!o.taskExecution),updatedAt:Math.max(...n.map(Rn))})).sort((r,n)=>n.updatedAt-r.updatedAt||n.id.localeCompare(r.id))}function et(e,t=!1,r){if(t)return"Running";if(e.status==="running")return"Pending";let n=e.verification?.branch??e.worktrees?.find(o=>o.name===e.lastCheck?.worktree)?.branch;return r&&n!==r?"Not verified for this branch":e.checkCantRun?"Blocked":e.verdict==="failing"?"Failed":e.verification?{verified:"Passed","needs-changes":"Failed",blocked:"Blocked",unchecked:"Unverified"}[e.verification.state]:e.verdict==="passed"?"Passed":e.loop?.check?"Not verified":"Not configured"}var jn=e=>e.status==="done"&&et(e)==="Passed";function Pn(e){if(e.status!=="done")return e.status;let t=et(e);return t==="Failed"?"failing":t==="Blocked"?"unchecked":t==="Passed"?"done":"unverified"}function ee(e){if(e.archived)return!1;let t=e.status==="running"&&!!e.team?.awaitingRequestId;if(e.awaiting||t)return!0;if(e.projectTeam||e.taskExecution)return!1;let r=e.teamTurns?.at(-1);return r?.executionStatus&&r.executionStatus!=="done"&&e.status!=="running"||r?.reconciliation||r?.resolutionCheck?.ok===!1||r?.reviewStale||r?.resolutionReview?.approved===!1?!0:e.team?.status==="blocked"||e.triage?.state==="pending"||Object.values(e.watches??{}).some(n=>n.state==="needs-you")||e.status!=="running"&&(e.status==="interrupted"||!e.seen)}var Ut=e=>Object.keys(e.integrity??{}).length>0||!!e.followUps?.some(t=>t.integrity?.length);function Wt(e,t){if(t.repo&&e.repo!==t.repo||t.pattern&&e.pattern!==t.pattern||t.agent&&!Object.values(e.roles).some(r=>r.some(n=>n===t.agent))||t.section&&(e.archived||(t.section==="waiting"?!ee(e):ee(e)||(t.section==="running"?e.status!=="running":e.status==="running"))))return!1;switch(t.status){case"attention":return ee(e);case"running":return e.status==="running";case"passed":return jn(e);case"failing":return et(e)==="Failed"||["failed","stopped","interrupted"].includes(e.status);case"flagged":return Ut(e);default:return!0}}var tt={maxSteps:200,maxMinutes:240};function pr(e){return Math.max(1,Math.floor(e/4))}var P=a(null);function gr(e,t){if(!e)return;let r=e.kind!=="alert"||(e.tool??"code-scanning")===(t?.alert?.tool??"code-scanning")&&JSON.stringify(e.numbers?.length?e.numbers:[e.number])===JSON.stringify(t?.alert?.numbers?.length?t.alert.numbers:[t?.number]);if(!(t?.kind===e.kind&&t.number===e.number&&!!t.ci==!!e.ciLogs&&r))return{kind:e.kind,number:e.number,ciLogs:!!e.ciLogs,tool:e.tool,numbers:e.numbers}}function nt(e){if(e==null)return;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Context budget must be an object.");let t=e;if(Object.keys(t).some(n=>!["maxPromptBytes","maxApproximateTokens","policy"].includes(n)))throw new Error("Unknown context budget field.");let r=(n,o)=>Number.isSafeInteger(n)&&Number(n)>=1&&Number(n)<=o;if(t.maxPromptBytes!==void 0&&!r(t.maxPromptBytes,64*1024*1024)||t.maxApproximateTokens!==void 0&&!r(t.maxApproximateTokens,16*1024*1024))throw new Error("Context ceilings must be positive bounded integers.");if(t.maxPromptBytes===void 0&&t.maxApproximateTokens===void 0)throw new Error("Choose at least one context ceiling.");if(t.policy!==void 0&&t.policy!=="warn"&&t.policy!=="block")throw new Error("Context budget policy must be warn or block.");return{...t.maxPromptBytes!==void 0?{maxPromptBytes:t.maxPromptBytes}:{},...t.maxApproximateTokens!==void 0?{maxApproximateTokens:t.maxApproximateTokens}:{},policy:t.policy??"warn"}}var Ee;try{Ee=nt(JSON.parse(l.get("contextBudget")??"null"))}catch{Ee=void 0}var de=a(Ee),te=a(Ee?l.get("contextBudgetOrigin")||"Explicit browser preference":"Application default");function br(e,t){let r=nt(e);de.value=r,te.value=t??(r?"Explicit browser preference":"Application default"),l.set("contextBudget",JSON.stringify(r??null)),l.set("contextBudgetOrigin",te.value)}var qe=a(),pe=a();function Vt(e,t,r){let n=e.find(s=>s.id===t),o=e.filter(s=>s.repos.includes(r)),i=t&&!n?"This project's draft is retained, but the project is unavailable. Choose a destination.":n&&r&&!n.repos.includes(r)?"This repository is no longer in the project. Add it explicitly or choose another repository.":!n&&r?"Choose a project for this repository before starting.":"";return{project:n,matches:o,problem:i}}function Ht(e,t,r){if(e.some(o=>o.id===t&&o.repos.includes(r)))return t;let n=e.filter(o=>o.repos.includes(r));return n.length===1?n[0].id:""}var Ie=class{constructor(t,r=globalThis.localStorage){this.prefix=t;this.fallback=r}database;connection;writes=Promise.resolve();memory=new Map;failures=new Set;get unsavedKeys(){return[...this.failures]}open(){return this.database??=new Promise((t,r)=>{let n=!1,o=indexedDB.open("codeflow-project-drafts",1);o.onupgradeneeded=()=>o.result.createObjectStore("drafts"),o.onsuccess=()=>{if(n){o.result.close();return}this.connection=o.result,t(o.result)},o.onerror=()=>r(o.error),o.onblocked=()=>{n=!0,r(new Error("Close older Code Flow tabs to restore drafts."))}}).catch(()=>{})}async read(t){await this.writes.catch(()=>{});let r=this.prefix+t;if(this.memory.has(r))return structuredClone(this.memory.get(r));let n=typeof indexedDB>"u"?void 0:await this.open();if(!n){let o=this.fallback?.getItem(r);return o?JSON.parse(o):void 0}return new Promise((o,i)=>{let u=n.transaction("drafts","readonly").objectStore("drafts").get(r);u.onsuccess=()=>o(u.result),u.onerror=()=>i(u.error)})}write(t,r){let n=this.prefix+t,o=structuredClone(r);this.memory.set(n,o);let s=(async()=>{let u=typeof indexedDB>"u"?void 0:this.connection??await this.open();if(!u){if(!this.fallback)throw new Error("Draft storage is unavailable.");this.fallback.setItem(n,JSON.stringify(o));return}await new Promise((c,g)=>{let f=u.transaction("drafts","readwrite");f.objectStore("drafts").put(o,n),f.oncomplete=()=>c(),f.onerror=()=>g(f.error),f.onabort=()=>g(f.error??new Error("Draft save was interrupted.")),f.commit?.()})})().then(()=>{this.failures.delete(t)},u=>{throw this.failures.add(t),u});return this.writes=Promise.all([this.writes.catch(()=>{}),s]).then(()=>{}),this.writes.catch(()=>{}),s}};var _t=e=>e==="claude"||e==="codex"||e==="agy";var An=/^[a-z][a-z0-9-]{0,39}$/,V=e=>!!e&&typeof e=="object"&&!Array.isArray(e),p=e=>{throw new Error(e)},S=(e,t=4e3)=>typeof e=="string"&&e.length<=t&&!e.includes("\0")?e:p("Template text is missing or too long"),W=e=>typeof e=="string"&&An.test(e)?e:p("Use lowercase template identifiers (up to 40 characters)"),D=(e,t=24)=>Array.isArray(e)&&e.length<=t?e.map(r=>S(r)):p("Invalid template list");function Me(e){if(!V(e)||e.schemaVersion!==1)return p("Expected a version 1 team template");let t=["schemaVersion","id","version","name","description","scope","project","autoEnabled","parameters","roles","tasks","contracts","workflow","task","criteria","preferences"];if(Object.keys(e).some(d=>!t.includes(d)))return p("Templates cannot contain permissions, credentials, sessions, or unsupported fields");if(!Number.isSafeInteger(e.version)||e.version<1||!["builtin","personal","project"].includes(e.scope)||typeof e.autoEnabled!="boolean")return p("Invalid template version or scope");if(e.scope==="project"!=(typeof e.project=="string"&&!!e.project))return p("Project templates need a project; personal templates cannot bind one");let r=D(e.parameters).map(W),n=D(e.roles,6).map(W);if(new Set(r).size!==r.length||new Set(n).size!==n.length)return p("Duplicate template parameters or roles");if(!Array.isArray(e.tasks)||e.tasks.length>24)return p("A template can contain at most 24 tasks");let o=e.tasks.map(d=>{if(!V(d)||Object.keys(d).some(E=>!["id","title","role","kind","instructions","dependsOn","dependencyTypes","paths","acceptance"].includes(E))||!["implementation","investigation"].includes(d.kind))return p("Invalid template task");let w={id:W(d.id),title:S(d.title,200),role:W(d.role),kind:d.kind,instructions:S(d.instructions,8e3),dependsOn:D(d.dependsOn).map(W),paths:D(d.paths),acceptance:D(d.acceptance)};if(d.dependencyTypes!==void 0){if(!V(d.dependencyTypes)||Object.entries(d.dependencyTypes).some(([E,Tn])=>!w.dependsOn.includes(E)||!["completion","artifact","knowledge"].includes(Tn)))return p("Invalid template dependency types");w.dependencyTypes={...d.dependencyTypes}}if(!n.includes(w.role)||!w.title.trim()||!w.instructions.trim()||!w.acceptance.length||w.acceptance.some(E=>!E.trim())||!w.paths.length)return p("Every task needs a role, instructions, owned paths, and acceptance criteria");for(let E of w.paths)if(!On(E))return p("Template paths must be repository relative");return w});if(new Set(o.map(d=>d.id)).size!==o.length)return p("Duplicate template task IDs");let s=new Set,u=new Set,c=d=>{if(u.has(d))return p("Template dependencies contain a cycle");if(s.has(d))return;let w=o.find(E=>E.id===d);if(!w)return p(`Unknown template dependency ${d}`);u.add(d),w.dependsOn.forEach(c),u.delete(d),s.add(d)};o.forEach(d=>c(d.id));let g=e.workflow===void 0?void 0:W(e.workflow);if(g&&o.length||!g&&!o.length)return p("Choose a fixed workflow or a task graph");if(g&&e.autoEnabled)return p("Fixed workflows are manual templates; Auto composes validated task graphs");let f={schemaVersion:1,id:W(e.id),version:e.version,name:S(e.name,100),description:S(e.description),scope:e.scope,...e.project?{project:S(e.project,200)}:{},autoEnabled:e.autoEnabled,parameters:r,roles:n,tasks:o,contracts:D(e.contracts),...g?{workflow:g}:{},task:S(e.task,1e5),criteria:D(e.criteria,100)};if(!f.name.trim()||!f.task.trim())return p("Give the template a name and a task prompt");e.preferences!==void 0&&(f.preferences=Cn(e.preferences));let Ge=JSON.stringify([o,f.contracts,f.task,f.criteria]);for(let d of Ge.matchAll(/\{\{([a-z][a-z0-9-]*)\}\}/g))if(!r.includes(d[1]))return p(`Undeclared parameter ${d[1]}`);return JSON.stringify(f).length>15e4?p("Template is too large"):f}function Cn(e){if(!V(e)||Object.keys(e).some(n=>!["roles","options","agentSettings","roleSettings"].includes(n)))return p("Template preferences may contain only roles, options and model settings");let t=(n,o)=>!V(n)||Object.keys(n).length>64||Object.keys(n).some(i=>!/^[a-zA-Z][a-zA-Z0-9_:/.-]{0,150}$/.test(i)||["constructor","prototype","__proto__"].includes(i))?p("Invalid template preference record"):Object.fromEntries(Object.entries(n).map(([i,s])=>[i,o(s)])),r=n=>t(n,o=>{if(!V(o)||Object.keys(o).some(s=>!["model","effort","variants"].includes(s)))return p("Only model and effort preferences are supported");if(o.variants!==void 0&&(!Array.isArray(o.variants)||o.variants.length>128))return p("Invalid model variants");let i=o.variants?.map(s=>!V(s)||Object.keys(s).some(u=>!["model","effort"].includes(u))?p("Invalid model variant"):{model:S(s.model,256),...s.effort!==void 0?{effort:S(s.effort,64)}:{}});return{...o.model!==void 0?{model:S(o.model,256)}:{},...o.effort!==void 0?{effort:S(o.effort,64)}:{},...i?{variants:i}:{}}});return{roles:t(e.roles??{},n=>D(n,6)),options:t(e.options??{},n=>typeof n=="boolean"||typeof n=="number"&&Number.isFinite(n)?n:p("Invalid workflow option")),agentSettings:r(e.agentSettings??{}),roleSettings:t(e.roleSettings??{},r)}}function On(e){return e==="*"||!!e&&!/^[/-]|^[A-Za-z]:|[\\\x00-\x1f]/.test(e)&&!e.split("/").some(t=>!t||t==="."||t===".."||t===".git")&&!e.includes("*")}function Jt(e,t){if(Object.keys(t).some(n=>!e.parameters.includes(n)))return p("Unknown template input");for(let n of e.parameters)if(typeof t[n]!="string"||!t[n].trim()||t[n].length>1e4)return p(`Enter a value for ${n}`);let r=n=>n.replace(/\{\{([a-z][a-z0-9-]*)\}\}/g,(o,i)=>t[i]);return Me({...e,task:r(e.task),criteria:e.criteria.map(r),contracts:e.contracts.map(r),tasks:e.tasks.map(n=>({...n,title:r(n.title),instructions:r(n.instructions),acceptance:n.acceptance.map(r),paths:n.paths.map(r)}))})}function Pr(e,t){let r=[...new Set(e.tasks.map(o=>o.owner))],n=o=>`worker-${r.indexOf(o)+1}`;return Me({schemaVersion:1,...t,version:1,description:"Strategy saved from a run. Review task-specific instructions and replace them with parameters before reuse.",autoEnabled:!1,parameters:["task"],roles:r.map(n),task:"{{task}}",criteria:[],contracts:[...e.contracts],tasks:e.tasks.map(o=>({id:o.id,role:n(o.owner),title:o.title,kind:o.kind,instructions:o.instructions,dependsOn:[...o.dependsOn],...o.dependencyTypes?{dependencyTypes:{...o.dependencyTypes}}:{},paths:[...o.paths],acceptance:[...o.acceptance]}))})}function En(){try{let e=l.json("selectedTeamTemplate",null);if(!e)return null;let t=Me(e.template);return Jt(t,e.inputs),{template:t,inputs:e.inputs}}catch{return null}}var N=a(En());Ce(()=>{N.value?l.set("selectedTeamTemplate",JSON.stringify(N.value)):l.remove("selectedTeamTemplate")});function zt(e,t,r,n){let o={...t},i=s=>n.find(u=>!s.includes(u));if(e==="race"&&!r.judge&&!o.contestants?.includes("auto")){let s=i(o.contestants??[]);s&&(o.judge=[s])}if(e==="supervisor"&&!r.reviewer){let[s]=o.supervisor??[],u=s&&i([s]);s&&s!=="auto"&&(o.reviewer?.[0]??s)===s&&u&&(o.reviewer=[u])}if(e==="pipeline"&&!r.reviewer){let[s]=o.planner??[],[u]=o.builder??[],[c]=o.reviewer??[];if(s&&s!=="auto"&&c!=="auto"&&(c===s||c===u)){let g=i([s,...u&&u!=="auto"?[u]:[]])??i([s]);g&&(o.reviewer=[g])}}if(e==="debate"&&!r.synthesizer&&!o.debaters?.includes("auto")){let[s]=o.synthesizer??[],u=i(o.debaters??[]);s&&o.debaters?.includes(s)&&u&&(o.synthesizer=[u])}return o}function Kt(e,t){return t??e==="auto-team"}function Mr(e,t,r){return e&&(t||r==="team")?4:1}function $r(e){return e.status==="stopped"&&e.team?.status==="blocked"&&e.patternDone!==!0}function Gt(e){return e.status==="running"&&!!e.team?.awaitingRequestId}function Dr(e,t){let r=t.dependsOn.flatMap(n=>{let o=e.tasks.find(c=>c.id===n),i=!!o&&(o.status==="completed"||o.status==="submitted")&&!o.evidenceStale,s=t.dependencyTypes?.[n]??"completion";return(s==="artifact"?i&&!!o?.head&&!!o.artifacts?.length:s==="knowledge"?!o?.evidenceStale&&(i&&!!o?.artifacts?.length||e.messages.some(c=>c.kind==="reply"&&c.sender===o?.owner&&c.recipient===t.owner&&c.taskId===t.id&&c.evidence.length>0&&c.status!=="open")):i)?[]:[`Waiting for ${o?.title??n}${o?.evidenceStale?" to be reverified":s==="artifact"?" artifacts":s==="knowledge"?" knowledge":""}`]});for(let n of e.messages){if(n.kind!=="question"||n.taskId!==t.id||!n.blocking||n.status!=="open")continue;let o=e.members.find(i=>i.id===n.recipient);r.push(`Waiting for ${n.recipient==="user"?"your answer":o?.name??n.recipient}: ${n.body}`)}return t.error&&r.push(t.error),r}function Nr(e,t,r="done"){let n=e.tasks.filter(s=>s.requirements.includes(t));if(!n.length)return"unassigned";if(!n.every(s=>s.status==="completed"&&!s.evidenceStale))return"in_progress";let o=e.verification;return r==="done"&&e.status==="completed"&&!!o?.approved&&o.reviewed&&!e.gaps.length?o.check==="passed"||o.check==="not_required"?"verified":"reviewed_unchecked":"awaiting_verification"}function Fr(e,t){if(t.status==="retired")return"Retired";let r=e.tasks.filter(n=>n.owner===t.id);return r.some(n=>n.status==="running")?"Working":r.some(n=>n.status==="needs_info")?"Waiting for information":r.some(n=>n.status==="failed")?"Needs attention":r.length&&r.every(n=>n.status==="completed")?"Finished assignments":t.status?{idle:"Ready",working:"Working",waiting:"Waiting",done:"Done",failed:"Needs attention",retired:"Retired"}[t.status]:"Ready"}var xt=a([]);async function to(){let e=await Z("/api/agents");for(let t of e)Ft[t.id]=t.displayName;xt.value=e}var at=a([]),Yt=a({}),x=a(new Map),qn=a(null);async function no(){try{let e=await q("/api/team-rollout");qn.value=e}catch{}}var wt=a(!1),y=a({view:"composer"});function ro(e=location.hash){return $t(e)}var oo=a(!1),sn=a(l.get("railCollapsed")==="1");function io(e){sn.value=e,l.set("railCollapsed",e?"1":"0")}var so=a(!1),bt=a(window.innerWidth>760&&l.get("sideOpen")==="1"),an=a(Oe.includes(l.get("sideTab"))?l.get("sideTab"):"chat"),lt=a(Math.min(Math.max(Number(l.get("sideWidth"))||420,300),900)),Be=a(window.innerWidth);window.addEventListener("resize",()=>{Be.value=window.innerWidth});var ln=h(()=>Math.max(300,Math.min(900,Be.value-(sn.value?64:Be.value<=1180?236:248)-360))),ao=h(()=>Math.min(lt.value,ln.value)),un=a(!1),lo=h(()=>bt.value&&(un.value||Be.value<=760));function cn(e){e&&(dn(e),Ct({tab:e})),bt.value=!0,l.set("sideOpen","1")}function dn(e){an.value=e,l.set("sideTab",e)}function uo(){un.value=!1,bt.value=!1,l.set("sideOpen","0")}function co(e){lt.value=Math.min(Math.max(Math.round(e),300),ln.value),l.set("sideWidth",String(lt.value))}var po=h(()=>yn.value.chat||null);function In(e,t=Q.value.key){t=Pe(t);let r=At(t),n=e&&!e.startsWith("side:")&&e!=="solo";Ct({chat:e??"",chats:n&&!(r.chats??[]).includes(e)?[...r.chats??[],e]:r.chats,closed:e?r.closed?.filter(o=>o!==e):r.closed},t)}var fo=a(""),ve=a([]);function Mn(e,t,r=[]){ve.value=[...ve.value,{to:e,text:t,images:r}]}function mo(e){let t=ve.value.filter(r=>r.to===e);return t.length&&(ve.value=ve.value.filter(r=>r.to!==e)),t}var go=a(null);var $n=e=>xt.value.find(t=>t.id===e)?.available??!1,vo=a(""),ho=a(!1),yo=a(!1),ie=a(null),Qt=a(""),rt=a(!1),Ne=a(!1),j=h(()=>ie.value?.repo??""),Le=a(l.get("repo")??""),I=0,ut=0,Ue=Promise.resolve();async function pn(e,t=!0){e=e.trim();let r=e&&P.value?.repo===j.value?P.value:null;Le.value=e;let n=++I;++ut;let o=()=>{P.value=null,ie.value=null,Fe.value=null,b.value="",T.value="",fe.value="",B.value=["safe","standard","trusted","full"].includes(l.get("trust")??"")?l.get("trust"):"standard",Se.value=new Map};if(r||o(),Ne.value=!1,rt.value=!0,Qt.value="",!e)return rt.value=!1,!0;try{let i=await q(`/api/branches?repo=${encodeURIComponent(e)}`);if(n!==I)return!1;let s=r&&i.repo===r.repo&&P.value?.repo===i.repo;if(r&&!s&&o(),ie.value=i,Le.value=i.repo,!s&&K.value&&!i.branches.some(u=>u.name===K.value)&&(K.value=""),t&&(l.set("repo",i.repo),l.set("recentRepos",JSON.stringify([i.repo,...Dn().filter(u=>u!==i.repo)].slice(0,8)))),s)return!0}catch(i){if(n!==I||(r||(ie.value=null),Qt.value=e?vn(e.split("/").pop()||e,i):"",r))return!1}finally{n===I&&(rt.value=!1)}return n!==I?!1:(Ue=Yn(),await Ue,n===I&&F.value.thisRepo&&Mt(),n===I)}var Dn=()=>l.json("recentRepos",[]),xo=a(null),ye="",fn="none",v=a([]),mn=a(!1),je=a(l.get("project")??ye),wo=h(()=>v.value.find(e=>e.id===je.value)),k=a(l.get("composerProject")??""),_=a(!1),kt=a(!1),se=a(""),Nn=a("filter"),Fn=a(null),xe=a({}),Bn=a(!1),Ln=a(null);function bo(e){Nn.value="filter",Ln.value=e,Bn.value=!0}async function gn(){try{v.value=await Z("/api/projects"),mn.value=!0}catch{return}let e=je.value;e!==ye&&e!==fn&&!v.value.some(t=>t.id===e)&&St(ye)}function _e(e){return e.project?v.value.find(t=>t.id===e.project):v.value.find(t=>t.repos.includes(e.repo))}function ko(e,t=je.value){if(t===ye)return!0;let r=_e(e);return t===fn?!r:r?.id===t}function St(e){je.value=e,l.set("project",e)}function So(e,t={}){St(e)}function Tt(e){let t=l.get(`projectRepo:${e.id}`);return t&&e.repos.includes(t)?t:[...x.value.values()].filter(n=>e.repos.includes(n.repo)&&_e(n)?.id===e.id).sort((n,o)=>o.createdAt-n.createdAt)[0]?.repo??e.repos[0]??""}function Un(e){for(let[t,r]of Object.entries(e.teams))R.value={...R.value,[t]:r.roles},A.value={...A.value,[t]:r.roleSettings??{}};at.value.some(t=>t.id===e.pattern)&&bn(e.pattern),M.value=e.agentSettings??{},l.set("roleSel",JSON.stringify(R.value)),l.set("roleModels",JSON.stringify(A.value)),l.set("agentSettings",JSON.stringify(M.value)),O.value={...O.value,pattern:"Project defaults",roles:"Project defaults",models:"Project defaults"}}var ot=0;async function To(e,t=k.value){let r=++ot;try{let n=await q(`/api/branches?repo=${encodeURIComponent(e)}`);if(r!==ot)return;let o=v.value.find(s=>s.id===t);if(o?.repos.includes(n.repo)){if(k.value!==o.id&&!await yt(o.id))return;await ar(n.repo),y.value={view:"composer",project:o.id};return}let i=v.value.filter(s=>s.repos.includes(n.repo));if(!t&&i.length===1)return void await yt(i[0].id,{repository:n.repo,carryUnassigned:!0});Fn.value={repository:n.repo,project:o?.id}}catch(n){r===ot&&Ze(vn(e,n),6e3)}}var Wn=h(()=>{let e=j.value,t=Vt(v.value,k.value,e);return{...t,adds:!!t.project&&!!e&&!t.project.repos.includes(e),creates:!t.project&&!!e}});async function Ro(e){await gn(),e&&je.value!==ye&&St(e)}function vn(e,t){return t instanceof Dt?t.status===400&&/not a git repository/i.test(t.message)?`${e} isn't a git repository`:t.status===401?"Not signed in to code-flow":t.status>=500?`Couldn't open ${e}: ${t.message}`:t.message:`Couldn't reach code-flow to open ${e}`}var hn=a(l.json("sidePin",null)),Rt=(e,t=!1)=>({key:`run:${U(e)}`,kind:"run",run:e,project:_e(e),repo:e.repo,pinned:t});function we(e,t,r=!1){let n=t;return{key:e?`project:${e.id}`:n?`repo:${n}`:"none",kind:"project",project:e,repo:n,pinned:r}}function ct(e,t){let r=e.startsWith("run:");return{key:e,kind:r?"run":"project",repo:"",pinned:t,waiting:!(r?wt.value:mn.value)}}var jt=h(()=>{let e=y.value;if(e.view==="project"||e.view==="workspace"&&e.project){let t=v.value.find(r=>r.id===(e.view==="project"?e.id:e.project));if(t){let r=e.view==="project"?e.repository:void 0,n=r&&[...x.value.values()].some(o=>_e(o)?.id===t.id&&t.repos.includes(o.repo)&&o.worktrees.some(i=>i.path===r));return we(t,r?t.repos.includes(r)||n?r:"":Tt(t))}return ct(`project:${e.view==="project"?e.id:e.project}`,!1)}if(e.view==="run"||e.view==="review"){let t=x.value.get(e.id);if(t)return Rt(t);if(!wt.value)return ct(`run:${e.id}`,!1)}return we(Wn.value.project,j.value)}),dt=h(()=>y.value.view==="side"?y.value.scope:null);function Vn(e){if(e.startsWith("run:")){let t=x.value.get(e.slice(4));return t?Rt(t,!0):void 0}if(e.startsWith("project:")){let t=v.value.find(r=>r.id===e.slice(8));return t?we(t,t.repos.includes(j.value)?j.value:t.repos.length?Tt(t):"",!0):void 0}return e.startsWith("repo:")?we(void 0,e.slice(5),!0):void 0}var Q=h(()=>{let e=dt.value;if(e)return Vn(e)??ct(e,!0);let t=hn.value;if(t?.kind==="run"){let r=x.value.get(t.id);if(r)return Rt(r,!0)}else if(t)return we(v.value.find(r=>r.id===t.project),t.repo,!0);return jt.value});function Pt(e){hn.value=e,l.set("sidePin",JSON.stringify(e))}function jo(e){let t=Q.value;Pt(e?t.run?{kind:"run",id:t.run.id}:{kind:"project",project:t.project?.id,repo:t.repo}:null)}function Hn(e,t){let r=Pe(`run:${e}`);if(dt.value&&dt.value!==r)return xn({type:Ot,route:{view:"run",id:e},drafts:[],sideChat:{run:e,chat:t}});In(`side:${t}`,r),Q.value.key!==r&&Pt(jt.value.key===r?null:{kind:"run",id:e}),cn("chat")}function Po(e,t){let r=t?Pe(`run:${t}`):Q.value.key,n=be.value[r],o=n?.pages??(n?.url?[{id:"p0",url:n.url}]:[]),i=o.find(u=>{try{return new URL(u.url).href===new URL(e).href}catch{return u.url===e}}),s=i?.id??`p${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;Ct({pages:i?o:[...o,{id:s,url:e}],page:s,tab:"browser",browserRequest:{id:`${Date.now()}-${Math.random()}`,url:e}},r),t&&Q.value.key!==r&&Pt(jt.value.key===r?null:{kind:"run",id:t}),cn("browser")}var Xt=200,be=a(l.json("sideMemory",{}));function Pe(e){let t=e.startsWith("run:")?x.value.get(e.slice(4)):void 0;return t?`run:${U(t)}`:e}function At(e){let t=Object.entries(be.value).filter(([n])=>Pe(n)===e).map(([,n])=>n).sort((n,o)=>n.at-o.at);if(!t.length)return{at:0};let r=Object.assign({},...t);return t.some(n=>n.chats!==void 0)&&(r.chats=[...new Set(t.flatMap(n=>n.chats??[]))].filter(n=>!r.closed?.includes(n))),r}var yn=h(()=>At(Q.value.key));function Ct(e,t=Q.value.key){t=Pe(t);let r={...be.value,[t]:{...At(t),...e,at:Date.now()}},n=Object.keys(r);if(n.length>Xt)for(let o of n.sort((i,s)=>r[i].at-r[s].at).slice(0,n.length-Xt))delete r[o];be.value=r,l.set("sideMemory",JSON.stringify(r))}window.addEventListener("storage",e=>{if(e.key===Xe("sideMemory")&&e.newValue)try{be.value=JSON.parse(e.newValue)}catch{}});function Ao(){let e=yn.value.tab;e&&Oe.includes(e)&&e!==an.value&&dn(e)}var Ot=ce?`codeflow:open:${ce}`:"codeflow:open",Zt=ce?`codeflow:ready:${ce}`:"codeflow:ready",J=null,pt=!1,ft=[];function _n(e,t=[]){if(y.value.view==="side")return xn({type:Ot,route:e,drafts:t});for(let r of t)Mn(r.to,r.text,r.images);y.value=e}function Jn(){for(let e of[J,window.opener])try{if(e&&!e.closed&&e.location.origin===location.origin&&e.location.pathname===location.pathname)return e}catch{}return null}function xn(e){let t=Jn();if(t&&(t!==J||pt)){t.postMessage(e,location.origin),t.focus();return}if(!t&&(ft.length=0,pt=!1,J=window.open(`${location.origin}${location.pathname}${Qe(e.route)}`,"_blank"),!J))return Ze("The browser blocked the window: allow pop-ups for code-flow",5e3);ft.push(e)}function Co(){window.addEventListener("message",e=>{if(e.origin!==location.origin)return;let t=e.data;if(t?.type===Zt&&J&&e.source===J){pt=!0;for(let n of ft.splice(0))J.postMessage(n,location.origin);return}if(t?.type!==Ot||y.value.view==="side")return;let r=t;typeof r.route?.view!="string"||r.route.view==="side"||(_n(r.route,Array.isArray(r.drafts)?r.drafts:[]),r.sideChat&&Hn(r.sideChat.run,r.sideChat.chat))}),y.value.view!=="side"&&window.opener?.postMessage({type:Zt},location.origin)}var Je=a(l.get("draftTask")??""),ke=a(l.json("draftAcceptance",[])instanceof Array?l.json("draftAcceptance",[]).filter(e=>typeof e=="string").slice(0,100):[]);function zn(e){ke.value=e.slice(0,100).map(t=>t.slice(0,2e3)),l.set("draftAcceptance",JSON.stringify(ke.value))}var O=a({pattern:l.get("pattern")?"Browser preference":"Application default",roles:l.get("roleSel")?"Browser preferences":"Workflow defaults",models:l.get("agentSettings")?"Browser preferences":"CLI defaults"}),Se=a(new Map),Et=a([]),Oo=a(""),Ae=a(l.get("pattern")??"solo"),Eo=h(()=>at.value.find(e=>e.id===Ae.value)??at.value[0]),R=a(l.json("roleSel",{})),z=a({}),M=a(l.json("agentSettings",{})),K=a(l.get("baseRef")??""),qt=a(""),T=a(""),fe=a(""),b=a(""),ae=a(l.json("limits",tt)),B=a(l.get("trust")||"standard");function qo(e){B.value=e,l.set("trust",e)}var A=a(l.json("roleModels",{}));function Io(e,t,r,n){let o=A.value[e]??{},i=o[t]??{};A.value={...A.value,[e]:{...o,[t]:{...i,[r]:{...i[r]??{},...n}}}},l.set("roleModels",JSON.stringify(A.value))}var Fe=a(null),wn=a(null),Kn=a(null),Mo=a(!1);async function $o(){let[e,t]=await Promise.allSettled([Z("/api/doctor"),Z("/api/doctor/git")]);wn.value=e.status==="fulfilled"?e.value:null,Kn.value=t.status==="fulfilled"?t.value:null}var G=a(l.json("approvePlanByPattern",{})),en=l.get("approvePlan");function Do(e,t){G.value={...G.value,[t]:e},l.set("approvePlanByPattern",JSON.stringify(G.value))}function No(e){let t=G.value[e];return t!==void 0?t:Kt(e,e!=="auto-team"&&en!==null?en==="1":void 0)}var Fo={pipeline:"the plan",debate:"the plan",supervisor:"the subtasks",tdd:"the tests","auto-team":"the team and plan"};function Gn(e){Je.value=e,l.set("draftTask",e)}function bn(e){N.value=null,Ae.value=e,l.set("pattern",e),O.value={...O.value,pattern:"This run (remembered)"}}function Bo(e,t,r){R.value={...R.value,[e]:{...R.value[e]??{},[t]:r}},l.set("roleSel",JSON.stringify(R.value)),O.value={...O.value,roles:"This run (remembered)"}}function Lo(e,t){M.value={...M.value,[e]:{...M.value[e]??{},...t}},l.set("agentSettings",JSON.stringify(M.value)),O.value={...O.value,models:"This run (remembered)"}}var ne=0,me=0;function Uo(e){ne++,T.value=e}function Wo(e){me++,b.value=e}function Vo(e){ae.value={...ae.value,...e},l.set("limits",JSON.stringify(ae.value))}function Ho(e){if(!e)return{};let t=R.value[e.id]??{},r=xt.value.filter(s=>{let u=wn.value?.find(c=>c.id===s.id);return s.available&&_t(s.id)&&(s.id!=="agy"||xe.value.antigravityExecution==="native"||u?.managedCompatible===!0)&&u?.signedIn!==!1&&u?.compatible!==!1&&(!s.id.startsWith("acp:")||B.value==="full")}),n=new Set(r.map(s=>s.id)),o=r[0]?.id,i={};for(let s of e.roles){let u=(t[s.id]??s.default).filter(c=>c==="auto"||(t[s.id]?$n(c):n.has(c)));e.id==="auto-team"&&s.id==="coordinator"&&!t[s.id]&&(u=["auto"]),s.multiple||(u=u.slice(0,1)),!u.length&&!s.optional&&!t[s.id]&&o&&(u=[o]),i[s.id]=u}return zt(e.id,i,t,r.map(s=>s.id))}function _o(e){if(!e)return{};let t=z.value[e.id]??{};return Object.fromEntries(e.options.map(r=>[r.id,t[r.id]??r.default]))}function Jo(e,t,r){z.value={...z.value,[e.id]:{...z.value[e.id]??{},[t]:r}}}function Yn(){return Ue=Qn(),Ue}async function Qn(){let e=j.value,t=++ut,r=I,n=ne,o=me,i=()=>t===ut&&r===I&&j.value===e;if(Ne.value=!!e,Fe.value=null,b.value=e?l.get(`setup:${e}`)??"":"",T.value=e?l.get(`check:${e}`)??"":"",fe.value="",!e)return;let s=null;try{s=await q(`/api/repo-config?repo=${encodeURIComponent(e)}`)}catch{}if(!i())return;Fe.value=s;let u=Fe.value?.config??{};o===me&&l.get(`setup:${e}`)===null&&!b.value&&u.setup&&(b.value=u.setup),u.trust&&!l.get("trust")&&(B.value=u.trust);let c=l.get(`check:${e}`),g=o===me&&!b.value&&l.get(`setup:${e}`)===null;if(c!==null||u.check){if(n===ne&&(T.value=c??u.check,fe.value=c!==null?"":"From .codeflow/config.json."),!g){Ne.value=!1;return}}else n===ne&&(T.value="");try{let f=await q(`/api/check?repo=${encodeURIComponent(e)}`);if(!i()||(g&&o===me&&f.setup&&!b.value&&l.get(`setup:${e}`)===null&&(b.value=f.setup),n!==ne||c!==null||u.check||l.get(`check:${e}`)!==null||T.value))return;T.value=f.command??"",fe.value=f.command?`Detected from ${f.source}${f.setup?`; each worktree is set up with \u201C${f.setup}\u201D (Settings)`:""}.`:"No test command found in this repo."}catch{i()&&n===ne&&c===null&&!u.check&&(fe.value="")}finally{i()&&(Ne.value=!1)}}async function zo(){try{Yt.value=await Z("/api/models")}catch{Yt.value={}}}var We=new Set;function Xn(e){let t=!We.has(e),r=x.value.get(e);We.add(e);let n=new Map(x.value);n.delete(e),x.value=n,t&&Y.value!==null&&(!L()||r&&ir(r))&&(Y.value=Math.max(0,Y.value-1)),(y.value.view==="run"||y.value.view==="review")&&y.value.id===e&&(y.value={view:"composer"})}function Zn(e){if(e.deleted){Xn(e.id);return}if(We.has(e.id))return;let t=new Map(x.value);t.set(e.id,e),x.value=t}var m={epoch:"",seq:0,runSeq:new Map},Y=a(null),er=a(null),tr=a(!1),le=a(null),Ve=a(!1),he=a(!1),ue=a(""),mt="",ze=new Set;function L(){let e=F.value,t=new URLSearchParams;return e.q.trim()&&t.set("q",e.q.trim()),e.status!=="all"&&t.set("status",e.status),e.pattern&&t.set("pattern",e.pattern),e.agent&&t.set("agent",e.agent),e.thisRepo&&j.value&&t.set("repo",j.value),t.toString()}var C=0,$=0,$e=0,tn;function It(e){e!==mt&&(mt=e,ze.clear(),C++,$=0,Y.value=null,le.value=null,he.value=!1,ue.value="")}var oe=a({state:"connecting",since:Date.now()});function nr(e){oe.value={...oe.value,state:e,since:oe.value.state===e?oe.value.since:Date.now()}}var re;function kn(e,t){re&&(e?.status==="running"&&t.status!=="running"||t.awaiting&&!e?.awaiting||Gt(t)&&t.team.awaitingRequestId!==e?.team?.awaitingRequestId||rn(t)&&!rn(e))&&re(t)}function Ke(e,t,r=!1){let n=x.value,o=r?new Map(n):new Map;for(let i of e)We.has(i.id)||o.set(i.id,t(i.id)&&n.has(i.id)?n.get(i.id):i);for(let[i,s]of n)!o.has(i)&&t(i)&&o.set(i,s);x.value=o,wt.value=!0;for(let i of o.values())kn(n.get(i.id),i)}async function Ko(e){for(let t=0;t<2;t++){let{epoch:r,seq:n}=m,o=await q(`/api/runs/${encodeURIComponent(e)}/chats`);if(m.epoch===r){Ke(o,i=>(m.runSeq.get(i)??0)>n,!0);return}}throw new Error("The connection changed while loading chats. Reopen the task to retry.")}var De=a(l.json("lastAgentTabs",{})),ge=a(l.json("closedAgentTabs",{})),rr=e=>ge.value[U(e)]?.includes(e.id)??!1;function or(e,t){if(e.pattern!=="solo"||e.chatLink?.kind==="side"||rr(e)===t)return;let r=U(e),n=new Set(ge.value[r]);t?n.add(e.id):n.delete(e.id);let o={...ge.value};delete o[r],n.size&&(o[r]=[...n]),ge.value=Object.fromEntries(Object.entries(o).slice(-200)),l.set("closedAgentTabs",JSON.stringify(ge.value))}function Go(e){if(e.pattern!=="solo"||e.chatLink?.kind==="side")return;or(e,!1);let t=U(e);if(De.value[t]===e.id)return;let r={...De.value};delete r[t],r[t]=e.id;let n=Object.entries(r).slice(-200);De.value=Object.fromEntries(n),l.set("lastAgentTabs",JSON.stringify(De.value))}async function Mt(){let{epoch:e,seq:t}=m,r=L();It(r);let n=C,o=++$e;Ve.value=!0;try{let i=await q(`/api/runs?limit=100${r?`&${r}`:""}`);if(m.epoch!==e||n!==C||r!==L()||o!==$e)return;let s=Array.isArray(i)?i:i.runs;for(let u of s)ze.add(u.id);Ke([...s,...Array.isArray(i)?[]:i.related??[]],u=>(m.runSeq.get(u)??0)>t,!0),Y.value=Array.isArray(i)?i.length:i.total,$<=1&&(le.value=Array.isArray(i)?null:i.nextCursor??null),$=Math.max(1,$),ue.value=""}catch(i){n===C&&o===$e&&(ue.value=i.message)}finally{n===C&&o===$e&&(Ve.value=!1)}}async function Yo(){let e=L();It(e);let t=le.value;if(!t||he.value||Ve.value)return;let r=C,{epoch:n,seq:o}=m;he.value=!0,ue.value="";try{let i=await q(`/api/runs?limit=100&cursor=${encodeURIComponent(t)}${e?`&${e}`:""}`);if(r!==C||e!==L()||m.epoch!==n)return;for(let s of i.runs)ze.add(s.id);Ke([...i.runs,...i.related??[]],s=>(m.runSeq.get(s)??0)>o,!0),le.value=i.nextCursor??null,Y.value=i.total,$++}catch(i){r===C&&(ue.value=i.message)}finally{r===C&&(he.value=!1)}}var Qo=h(()=>[...x.value.values()].filter(ee).length),F=a({status:"all",pattern:"",agent:"",thisRepo:!1,...l.json("runFilter",{}),q:""});function Xo(e){F.value={...F.value,...e};let{q:t,...r}=F.value;l.set("runFilter",JSON.stringify(r)),It(L()),clearTimeout(tn),tn=setTimeout(()=>void Mt(),250)}var Zo=h(()=>{let e=F.value;return!!(e.q.trim()||e.status!=="all"||e.pattern||e.agent||e.thisRepo)});function ir(e,t=F.value){if(!Wt(e,{...t,repo:t.thisRepo?j.value:void 0}))return!1;let r=t.q.trim().toLowerCase();if(!r||e.cold&&t===F.value&&mt===L()&&ze.has(e.id))return!0;let n=[e.task,e.id,e.repo,e.pattern,e.branchPrefix,e.source?`#${e.source.number} ${e.source.title}`:"",e.trigger?.name??"",e.group?.label??"",e.externalSource?.title??""].join(`
|
|
2
|
+
`).toLowerCase();return r.split(/\s+/).every(o=>n.includes(o))}var it=a({group:"project",archived:!1,collapsed:[],...l.json("railView",{})});function ei(e){it.value={...it.value,...e},l.set("railView",JSON.stringify(it.value))}var nn=new Set;function ti(e){re=e;let t=Bt(n=>{nr(n.state),n.lastReceived!==void 0&&(oe.value={...oe.value,lastReceived:n.lastReceived})}),r=Lt("runs",n=>{if(n?.type==="error"){ue.value=n.message;return}if(!n||n.type!=="hello"&&n.type!=="run"||!Number.isSafeInteger(n.seq)||n.type==="hello"&&typeof n.epoch!="string"||n.type==="run"&&!n.run?.id)return;if(n.type==="hello"){typeof n.attentionTotal=="number"&&(er.value=n.attentionTotal),typeof n.attentionTruncated=="boolean"&&(tr.value=n.attentionTruncated);let u=!!m.epoch&&n.epoch!==m.epoch;if(n.epoch!==m.epoch&&m.runSeq.clear(),m.epoch=n.epoch,u&&(m.seq=n.seq,C++,$=0,le.value=null,Ve.value=!1,he.value=!1),n.runs){for(let c of n.runs)m.runSeq.set(c.id,n.seq);Ke(n.runs,()=>!1,!u),L()?u&&Mt():(typeof n.total=="number"&&(Y.value=n.total),$<=1&&(le.value=n.nextCursor??null),$=Math.max(1,$))}n.runs&&(m.seq=n.seq);return}let{run:o,seq:i}=n;if(i<=(m.runSeq.get(o.id)??0))return;m.runSeq.set(o.id,i),m.seq=Math.max(m.seq,i);let s=x.value.get(o.id);Zn(o),!o.deleted&&(o.project&&!v.value.some(u=>u.id===o.project)&&!nn.has(o.project)&&(nn.add(o.project),gn()),kn(s,o))},()=>m.epoch?`${m.epoch}:${m.seq}`:void 0);return()=>{r(),t()}}var rn=e=>Object.values(e?.watches??{}).find(t=>t.state==="needs-you"),ni=a([]),ri=a(null),Te=a(null),Re=a(null),oi=a(null);function ii(e,t){Re.value=null,bn(e.pattern),Gn((n=>t?n.replace(/\{number\}/g,String(t.number)).replace(/\{title\}/g,t.title):n)(e.task)),zn([]),Te.value=t?{...t,ciLogs:!!e.ciLogs}:null}var si=e=>Nt(`/api/runs/${e}/seen`).catch(()=>{});function He(){return{contextBudget:de.value,contextBudgetOrigin:te.value,intent:qe.value,journey:pe.value,version:1,repository:Le.value,task:Je.value,acceptance:ke.value,paths:[...Se.value.entries()],attachments:Et.value,pattern:Ae.value,roles:R.value,models:A.value,settings:M.value,options:z.value,base:K.value,branch:qt.value,check:T.value,setup:b.value,limits:ae.value,trust:B.value,approvals:G.value,origins:O.value,selectedTemplate:N.value,source:Te.value,externalSource:Re.value,runOptions:xe.value,rerun:P.value}}var H=new Ie(Xe("project-draft-v1:")),gt=0,on=Promise.resolve(!0),st=!1;function vt(){let e=H.unsavedKeys.map(t=>v.value.find(r=>r.id===t)?.name??(t||"Unassigned draft"));return e.length?`Not saved: ${e.join(", ")}. Keep this tab open, return to the draft and retry saving.`:""}async function ht(){if(!(!kt.value||_.value))try{await H.write(k.value,He()),se.value=vt()}catch{se.value="This draft is kept in this tab, but could not be saved. Keep the tab open and retry saving."}}function Sn(e){Ye(()=>{de.value=e.contextBudget,te.value=e.contextBudgetOrigin??"Application default",qe.value=e.intent,pe.value=e.journey,Je.value=e.task,ke.value=e.acceptance,Se.value=new Map(e.paths),Et.value=e.attachments,Ae.value=e.pattern,R.value=e.roles,A.value=e.models,M.value=e.settings,z.value=e.options,K.value=e.base,qt.value=e.branch,T.value=e.check,b.value=e.setup,ae.value=e.limits,B.value=e.trust,G.value=e.approvals,O.value=e.origins,Te.value=e.source,Re.value=e.externalSource,N.value=e.selectedTemplate??null,xe.value=e.runOptions??{},P.value=e.rerun??null})}function yt(e,t={}){let r=y.value,n=e??(r.view==="project"?r.id:r.view==="workspace"&&r.project?r.project:k.value),o=++gt,i=on.then(()=>o===gt?sr(n,t,o):!1);return on=i.catch(()=>!1),i}async function sr(e,t,r){if(!kt.value)return!1;let n=v.value.find(u=>u.id===e);if(e===k.value&&!t.repository)return t.stay||(y.value={view:"composer",project:e}),!0;let o=He(),i=!k.value&&t.carryUnassigned?o:void 0,s=ht();_.value=!0,await s;try{let u=await H.read(e);if(u&&u.version!==1)throw new Error("This draft uses an unsupported format. It has been retained.");let c=u??i,g=t.repository??c?.repository??(n?Tt(n):"");P.value=null,await pn(g);let f=T.value,Ge=b.value,d=B.value;return Ye(()=>{c?Sn(c):(qe.value=void 0,pe.value=void 0,de.value=void 0,te.value="Application default",Je.value="",ke.value=[],Et.value=[],Se.value=new Map,Te.value=null,Re.value=null,qt.value="",K.value="",R.value=l.json("roleSel",{}),A.value=l.json("roleModels",{}),Ae.value=l.get("pattern")??"solo",M.value=l.json("agentSettings",{}),z.value={},ae.value=l.json("limits",tt),G.value=l.json("approvePlanByPattern",{}),N.value=null,xe.value={},P.value=null,n?.defaults&&Un(n.defaults)),c&&g!==c.repository&&(Se.value=new Map,Te.value=null,Re.value=null,K.value="",pe.value=void 0,T.value=f,b.value=Ge,B.value=d,N.value=null,xe.value={},P.value=null),k.value=e,l.set("composerProject",e)}),n&&n.repos.includes(g)&&l.set(`projectRepo:${e}`,g),!t.stay&&r===gt&&(y.value={view:"composer",project:e}),!0}catch(u){return se.value=`Could not open the draft: ${u.message}`,!1}finally{_.value=!1}}function ar(e){return e===j.value&&!_.value?Promise.resolve(!0):v.value.find(t=>t.id===k.value)?.repos.includes(e)?yt(k.value,{repository:e,stay:!0}):Promise.resolve(!1)}async function ai(){if(!st){_.value=!0;try{let e=l.get("composerProject")??"";if(l.get("projectDraftVersion")!=="1"){let n=He();n.repository=ie.value?.repo??Le.value,e=Ht(v.value,l.get("project")??"",n.repository),await H.write("legacy-backup",n),await H.write(e,n),l.set("composerProject",e),l.set("projectDraftVersion","1")}let t=await H.read(e);if(t&&t.version!==1)throw new Error("Saved draft format is unavailable.");k.value=e;let r=t?.repository??l.get("repo")??"";(ie.value?.repo??"")!==r&&await pn(r,!1),t&&Sn(t),kt.value=!0,st=!0}catch(e){se.value=`Could not restore saved drafts: ${e.message}. Reload to retry.`}finally{_.value=!1}st&&(Ce(()=>{if(_.value)return;let e=He(),t=k.value;H.write(t,e).then(()=>{se.value=vt()},()=>{se.value=vt()})}),window.addEventListener("pagehide",()=>{ht()}),document.addEventListener("visibilitychange",()=>{document.hidden&&ht()}))}}var X=a([]),lr=0;function pi(e,t){return new Promise(r=>{X.value=[...X.value,{...t,message:e,id:++lr,resolve:r}]})}function fi(e,t){let r=X.value[0];!r||r.id!==e||(X.value=X.value.slice(1),r.resolve(t))}function mi(){let e=X.value;X.value=[];for(let t of e)t.resolve(!1)}export{U as a,Rn as b,ur as c,et as d,jn as e,Pn as f,ee as g,Ut as h,tt as i,pr as j,P as k,gr as l,nt as m,de as n,te as o,br as p,qe as q,pe as r,_t as s,Me as t,Cn as u,Jt as v,Pr as w,N as x,Mr as y,$r as z,Gt as A,Dr as B,Nr as C,Fr as D,xt as E,to as F,at as G,Yt as H,x as I,qn as J,no as K,y as L,ro as M,oo as N,sn as O,io as P,so as Q,bt as R,an as S,ln as T,ao as U,un as V,lo as W,cn as X,uo as Y,co as Z,po as _,In as $,fo as aa,ve as ba,Mn as ca,mo as da,go as ea,vo as fa,ho as ga,yo as ha,ie as ia,Qt as ja,rt as ka,Ne as la,j as ma,pn as na,Dn as oa,xo as pa,ye as qa,fn as ra,v as sa,mn as ta,je as ua,wo as va,k as wa,_ as xa,kt as ya,se as za,Nn as Aa,Fn as Ba,xe as Ca,Bn as Da,Ln as Ea,bo as Fa,gn as Ga,_e as Ha,ko as Ia,So as Ja,To as Ka,Wn as La,Ro as Ma,dt as Na,Q as Oa,jo as Pa,Hn as Qa,Po as Ra,yn as Sa,Ct as Ta,Ao as Ua,_n as Va,Co as Wa,Je as Xa,ke as Ya,zn as Za,O as _a,Se as $a,Et as ab,Oo as bb,Ae as cb,Eo as db,z as eb,M as fb,K as gb,qt as hb,T as ib,fe as jb,b as kb,ae as lb,B as mb,qo as nb,A as ob,Io as pb,Fe as qb,wn as rb,Kn as sb,Mo as tb,$o as ub,Do as vb,No as wb,Fo as xb,Gn as yb,bn as zb,Bo as Ab,Lo as Bb,Uo as Cb,Wo as Db,Vo as Eb,Ho as Fb,_o as Gb,Jo as Hb,Yn as Ib,zo as Jb,Xn as Kb,Y as Lb,er as Mb,tr as Nb,le as Ob,Ve as Pb,he as Qb,ue as Rb,oe as Sb,Ko as Tb,De as Ub,rr as Vb,or as Wb,Go as Xb,Mt as Yb,Yo as Zb,Qo as _b,F as $b,Xo as ac,Zo as bc,ir as cc,it as dc,ei as ec,ti as fc,rn as gc,ni as hc,ri as ic,Te as jc,Re as kc,oi as lc,ii as mc,si as nc,ht as oc,yt as pc,ar as qc,ai as rc,X as sc,pi as tc,fi as uc,mi as vc};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={shellReadyMs:0,longTasks:0,longTaskMs:0,longestTaskMs:0},n=()=>({...e});function t(){e.shellReadyMs=performance.now()}typeof PerformanceObserver<"u"&&PerformanceObserver.supportedEntryTypes?.includes("longtask")&&new PerformanceObserver(r=>{for(let s of r.getEntries())e.longTasks++,e.longTaskMs+=s.duration,e.longestTaskMs=Math.max(e.longestTaskMs,s.duration)}).observe({type:"longtask",buffered:!0});export{n as a,t as b};
|