@mndrk/agx 2.4.1 → 2.4.2
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/cloud-runtime/standalone/apps/local/.next/BUILD_ID +1 -1
- package/cloud-runtime/standalone/apps/local/.next/build-manifest.json +2 -2
- package/cloud-runtime/standalone/apps/local/.next/prerender-manifest.json +3 -3
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/agents.segments/agents.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/projects.segments/projects.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/setup.segments/setup.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.segments/status/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/app/status.segments/status.segment.rsc +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__10a90219._.js +3 -3
- package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__3a038592._.js +3 -3
- package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__68b692c4._.js +9 -9
- package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__7fcbb0c2._.js +4 -4
- package/cloud-runtime/standalone/apps/local/.next/server/chunks/apps_local_lib_orchestrator_chat-processor_ts_46384f36._.js +17 -17
- package/cloud-runtime/standalone/apps/local/.next/server/middleware-manifest.json +5 -5
- package/cloud-runtime/standalone/apps/local/.next/server/pages/404.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/pages/500.html +2 -2
- package/cloud-runtime/standalone/apps/local/.next/server/server-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/apps/local/.next/server/server-reference-manifest.json +1 -1
- package/cloud-runtime/standalone/apps/local/lib/agent-process-registry.ts +6 -1
- package/cloud-runtime/standalone/apps/local/worker/index.js +5 -1
- package/package.json +1 -1
- /package/cloud-runtime/standalone/apps/local/.next/static/{ycVU7ABTMiX10ainku7bE → QEldoF1LdgJqO0PgpmUmx}/_buildManifest.js +0 -0
- /package/cloud-runtime/standalone/apps/local/.next/static/{ycVU7ABTMiX10ainku7bE → QEldoF1LdgJqO0PgpmUmx}/_clientMiddlewareManifest.json +0 -0
- /package/cloud-runtime/standalone/apps/local/.next/static/{ycVU7ABTMiX10ainku7bE → QEldoF1LdgJqO0PgpmUmx}/_ssgManifest.js +0 -0
package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__3a038592._.js
CHANGED
|
@@ -44,7 +44,7 @@ module.exports=[918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/a
|
|
|
44
44
|
created_at INTEGER NOT NULL,
|
|
45
45
|
updated_at INTEGER NOT NULL
|
|
46
46
|
)
|
|
47
|
-
`),e}();try{return e(r)}finally{r.close()}}function c(e){return l(t=>{let r=t.prepare(`INSERT INTO agent_processes (workspace_id, thread_id, agent_id, pid, state, since_message_id, response_message_id, started_at, last_activity, project_slug)
|
|
47
|
+
`),e.prepare("PRAGMA table_info(tracker_runs)").all().some(e=>"tracker_type"===e.name)||e.exec("ALTER TABLE tracker_runs ADD COLUMN tracker_type TEXT NOT NULL DEFAULT 'linear'"),e}();try{return e(r)}finally{r.close()}}function c(e){return l(t=>{let r=t.prepare(`INSERT INTO agent_processes (workspace_id, thread_id, agent_id, pid, state, since_message_id, response_message_id, started_at, last_activity, project_slug)
|
|
48
48
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
49
49
|
ON CONFLICT(workspace_id, agent_id)
|
|
50
50
|
DO UPDATE SET
|
|
@@ -61,9 +61,9 @@ module.exports=[918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/a
|
|
|
61
61
|
tr.tracker_type AS tracker_type
|
|
62
62
|
FROM agent_processes ap
|
|
63
63
|
LEFT JOIN messages m ON m.id = ap.thread_id AND m.thread_id = ap.workspace_id
|
|
64
|
-
LEFT JOIN tracker_runs tr ON tr.
|
|
64
|
+
LEFT JOIN tracker_runs tr ON tr.chat_run_id = ap.id
|
|
65
65
|
`).all().map(e=>({...d(e),threadTitle:e.thread_title,trackerItemId:e.tracker_item_id??null,trackerRunId:e.tracker_run_id??null,trackerType:e.tracker_type??null,linearIssueId:e.tracker_item_id??null,linearRunId:e.tracker_run_id??null})))}function g(e){let t=0;for(let r of e){if(r.pid>0)try{process.kill(r.pid,"SIGTERM")}catch{}t++}return t}function N(e){let t=g(u(e).filter(e=>"running"===e.state||"spawning"===e.state));return t>0&&l(t=>t.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
66
66
|
WHERE thread_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}function h(e){let t=g(T(e).filter(e=>"running"===e.state||"spawning"===e.state));return t>0&&l(t=>t.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
67
|
-
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}e.s(["getAll",()=>E,"getAllEnriched",()=>_,"getByThread",()=>u,"getByWorkspace",()=>T,"killByThread",()=>N,"killByWorkspace",()=>h,"register",()=>c,"update",()=>p])},748564,e=>{"use strict";var t=e.i(692988),r=e.i(635595),a=e.i(75473),s=e.i(923435),n=e.i(418475),i=e.i(303482),o=e.i(976287),d=e.i(774462),l=e.i(111998),c=e.i(201516),p=e.i(68877),u=e.i(259460),T=e.i(257714),E=e.i(502073),_=e.i(187345),g=e.i(193695);e.i(293777);var N=e.i(274321),h=e.i(732470),R=e.i(558174);async function x(e){let t=e.nextUrl.searchParams.get("threadId"),r=e.nextUrl.searchParams.get("workspaceId"),a="1"===e.nextUrl.searchParams.get("enrich");return t?h.NextResponse.json((0,R.getByThread)(t)):r?h.NextResponse.json((0,R.getByWorkspace)(r)):a?h.NextResponse.json((0,R.getAllEnriched)()):h.NextResponse.json((0,R.getAll)())}async function A(e){let t=e.nextUrl.searchParams.get("threadId"),r=e.nextUrl.searchParams.get("workspaceId");if(t){let e=(0,R.killByThread)(t);return h.NextResponse.json({killed:e})}if(r){let e=(0,R.killByWorkspace)(r);return h.NextResponse.json({killed:e})}return h.NextResponse.json({error:"threadId or workspaceId required"},{status:400})}e.s(["DELETE",()=>A,"GET",()=>x],26206);var L=e.i(26206);let m=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/processes/route",pathname:"/api/processes",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/local/app/api/processes/route.ts",nextConfigOutput:"standalone",userland:L}),{workAsyncStorage:O,workUnitAsyncStorage:I,serverHooks:f}=m;function v(){return(0,a.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:I})}async function
|
|
67
|
+
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}e.s(["getAll",()=>E,"getAllEnriched",()=>_,"getByThread",()=>u,"getByWorkspace",()=>T,"killByThread",()=>N,"killByWorkspace",()=>h,"register",()=>c,"update",()=>p])},748564,e=>{"use strict";var t=e.i(692988),r=e.i(635595),a=e.i(75473),s=e.i(923435),n=e.i(418475),i=e.i(303482),o=e.i(976287),d=e.i(774462),l=e.i(111998),c=e.i(201516),p=e.i(68877),u=e.i(259460),T=e.i(257714),E=e.i(502073),_=e.i(187345),g=e.i(193695);e.i(293777);var N=e.i(274321),h=e.i(732470),R=e.i(558174);async function x(e){let t=e.nextUrl.searchParams.get("threadId"),r=e.nextUrl.searchParams.get("workspaceId"),a="1"===e.nextUrl.searchParams.get("enrich");return t?h.NextResponse.json((0,R.getByThread)(t)):r?h.NextResponse.json((0,R.getByWorkspace)(r)):a?h.NextResponse.json((0,R.getAllEnriched)()):h.NextResponse.json((0,R.getAll)())}async function A(e){let t=e.nextUrl.searchParams.get("threadId"),r=e.nextUrl.searchParams.get("workspaceId");if(t){let e=(0,R.killByThread)(t);return h.NextResponse.json({killed:e})}if(r){let e=(0,R.killByWorkspace)(r);return h.NextResponse.json({killed:e})}return h.NextResponse.json({error:"threadId or workspaceId required"},{status:400})}e.s(["DELETE",()=>A,"GET",()=>x],26206);var L=e.i(26206);let m=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/processes/route",pathname:"/api/processes",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/local/app/api/processes/route.ts",nextConfigOutput:"standalone",userland:L}),{workAsyncStorage:O,workUnitAsyncStorage:I,serverHooks:f}=m;function v(){return(0,a.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:I})}async function U(e,t,a){m.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let h="/api/processes/route";h=h.replace(/\/index$/,"")||"/";let R=await m.prepare(e,t,{srcPage:h,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:x,params:A,nextConfig:L,parsedUrl:O,isDraftMode:I,prerenderManifest:f,routerServerContext:v,isOnDemandRevalidate:U,revalidateOnlyGenerated:y,resolvedPathname:k,clientReferenceManifest:w,serverActionsManifest:C}=R,S=(0,o.normalizeAppPath)(h),D=!!(f.dynamicRoutes[S]||f.routes[k]),X=async()=>((null==v?void 0:v.render404)?await v.render404(e,t,O,!1):t.end("This page could not be found"),null);if(D&&!I){let e=!!f.routes[k],t=f.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(L.experimental.adapterPath)return await X();throw new g.NoFallbackError}}let M=null;!D||m.isDev||I||(M="/index"===(M=k)?"/":M);let P=!0===m.isDev||!D,j=D&&!P;C&&w&&(0,i.setManifestsSingleton)({page:h,clientReferenceManifest:w,serverActionsManifest:C});let F=e.method||"GET",b=(0,n.getTracer)(),q=b.getActiveScopeSpan(),B={params:A,prerenderManifest:f,renderOpts:{experimental:{authInterrupts:!!L.experimental.authInterrupts},cacheComponents:!!L.cacheComponents,supportsDynamicResponse:P,incrementalCache:(0,s.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:L.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>m.onRequestError(e,t,a,s,v)},sharedContext:{buildId:x}},H=new d.NodeNextRequest(e),G=new d.NodeNextResponse(t),W=l.NextRequestAdapter.fromNodeNextRequest(H,(0,l.signalFromNodeResponse)(t));try{let i=async e=>m.handle(W,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=b.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${F} ${h}`)}),o=!!(0,s.getRequestMeta)(e,"minimalMode"),d=async s=>{var n,d;let l=async({previousCacheEntry:r})=>{try{if(!o&&U&&y&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(s);e.fetchMetrics=B.renderOpts.fetchMetrics;let d=B.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let l=B.renderOpts.collectedTags;if(!D)return await (0,u.sendResponse)(H,G,n,B.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,T.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[_.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=_.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,a=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=_.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:N.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await m.onRequestError(e,t,{routerKind:"App Router",routePath:h,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:U})},!1,v),t}},c=await m.handleResponse({req:e,nextConfig:L,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:f,isRoutePPREnabled:!1,isOnDemandRevalidate:U,revalidateOnlyGenerated:y,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:o});if(!D)return null;if((null==c||null==(n=c.value)?void 0:n.kind)!==N.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(d=c.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",U?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let g=(0,T.fromNodeOutgoingHttpHeaders)(c.value.headers);return o&&D||g.delete(_.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||g.get("Cache-Control")||g.set("Cache-Control",(0,E.getCacheControlHeader)(c.cacheControl)),await (0,u.sendResponse)(H,G,new Response(c.value.body,{headers:g,status:c.value.status||200})),null};q?await d(q):await b.withPropagatedContext(e.headers,()=>b.trace(c.BaseServerSpan.handleRequest,{spanName:`${F} ${h}`,kind:n.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},d))}catch(t){if(t instanceof g.NoFallbackError||await m.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:U})},!1,v),D)throw t;return await (0,u.sendResponse)(H,G,new Response(null,{status:500})),null}}e.s(["handler",()=>U,"patchFetch",()=>v,"routeModule",()=>m,"serverHooks",()=>f,"workAsyncStorage",()=>O,"workUnitAsyncStorage",()=>I],748564)}];
|
|
68
68
|
|
|
69
69
|
//# sourceMappingURL=%5Broot-of-the-server%5D__3a038592._.js.map
|
package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__68b692c4._.js
CHANGED
|
@@ -11,9 +11,9 @@ module.exports=[508763,e=>{"use strict";var t=e.i(769025),n=e.i(522734),r=e.i(81
|
|
|
11
11
|
);
|
|
12
12
|
CREATE INDEX IF NOT EXISTS idx_attachments_message ON attachments(message_id);
|
|
13
13
|
`),!e.prepare("PRAGMA table_info(attachments)").all().some(e=>"disk_name"===e.name)){e.exec("ALTER TABLE attachments ADD COLUMN disk_name TEXT NOT NULL DEFAULT ''");let t=e.prepare("SELECT id, filename FROM attachments WHERE disk_name = ''").all(),n=e.prepare("UPDATE attachments SET disk_name = ? WHERE id = ?");for(let e of t){let t=e.filename.includes(".")?"."+e.filename.split(".").pop().toLowerCase():"";n.run(e.id+t,e.id)}}}async function l(e){await n.promises.mkdir(c,{recursive:!0});let t=e.filename.includes(".")?"."+e.filename.split(".").pop().toLowerCase():"",a=e.id+t,s=r.default.join(c,a);await n.promises.writeFile(s,e.data);let i=d();try{u(i),i.prepare(`INSERT INTO attachments (id, disk_name, filename, mime_type, size, status, created_at)
|
|
14
|
-
VALUES (?, ?, ?, ?, ?, 'uploaded', ?)`).run(e.id,a,e.filename,e.mimeType,e.size,Date.now())}finally{i.close()}return{id:e.id,filename:e.filename,mimeType:e.mimeType,size:e.size,status:"uploaded",url:`/api/attachments/${e.id}`}}async function p(e,t){if(0===t.length)return[];let n=d();try{u(n);let a=t.map(()=>"?").join(", ");return n.prepare(`UPDATE attachments SET message_id = ? WHERE id IN (${a})`).run(e,...t),n.prepare(`SELECT id, disk_name, filename, mime_type, size, status FROM attachments WHERE id IN (${a})`).all(...t).map(e=>({id:e.id,filename:e.filename,mimeType:e.mime_type,size:e.size,status:e.status,url:`/api/attachments/${e.id}`,diskPath:r.default.join(c,e.disk_name||e.id)}))}finally{n.close()}}async function
|
|
14
|
+
VALUES (?, ?, ?, ?, ?, 'uploaded', ?)`).run(e.id,a,e.filename,e.mimeType,e.size,Date.now())}finally{i.close()}return{id:e.id,filename:e.filename,mimeType:e.mimeType,size:e.size,status:"uploaded",url:`/api/attachments/${e.id}`}}async function p(e,t){if(0===t.length)return[];let n=d();try{u(n);let a=t.map(()=>"?").join(", ");return n.prepare(`UPDATE attachments SET message_id = ? WHERE id IN (${a})`).run(e,...t),n.prepare(`SELECT id, disk_name, filename, mime_type, size, status FROM attachments WHERE id IN (${a})`).all(...t).map(e=>({id:e.id,filename:e.filename,mimeType:e.mime_type,size:e.size,status:e.status,url:`/api/attachments/${e.id}`,diskPath:r.default.join(c,e.disk_name||e.id)}))}finally{n.close()}}async function T(e){let t=r.default.join(c,e);try{await n.promises.unlink(t)}catch{}let a=d();try{return u(a),a.prepare("DELETE FROM attachments WHERE id = ?").run(e).changes>0}finally{a.close()}}async function _(e){let t=d();try{u(t);let n=t.prepare("SELECT filename, disk_name, mime_type, size FROM attachments WHERE id = ?").get(e);if(!n)return null;let a=n.disk_name||e;return{filename:n.filename,mimeType:n.mime_type,size:n.size,diskPath:r.default.join(c,a)}}finally{t.close()}}async function m(e){if(0===e.length)return new Map;let t=d();try{u(t);let n=e.map(()=>"?").join(", "),r=t.prepare(`SELECT id, message_id, filename, mime_type, size, status
|
|
15
15
|
FROM attachments
|
|
16
|
-
WHERE message_id IN (${n})`).all(...e),a=new Map;for(let e of r){let t={id:e.id,filename:e.filename,mimeType:e.mime_type,size:e.size,status:e.status,url:`/api/attachments/${e.id}`},n=a.get(e.message_id)||[];n.push(t),a.set(e.message_id,n)}return a}finally{t.close()}}async function E(){let e=Date.now()-864e5,t=d();try{u(t);let a=t.prepare("SELECT id, disk_name FROM attachments WHERE message_id IS NULL AND created_at < ?").all(e);for(let{id:e,disk_name:t}of a){let a=r.default.join(c,t||e);try{await n.promises.unlink(a)}catch{}}if(a.length>0){let e=a.map(()=>"?").join(", ");t.prepare(`DELETE FROM attachments WHERE id IN (${e})`).run(...a.map(e=>e.id))}return a.length}finally{t.close()}}e.s(["createAttachment",()=>l,"deleteAttachment",()=>
|
|
16
|
+
WHERE message_id IN (${n})`).all(...e),a=new Map;for(let e of r){let t={id:e.id,filename:e.filename,mimeType:e.mime_type,size:e.size,status:e.status,url:`/api/attachments/${e.id}`},n=a.get(e.message_id)||[];n.push(t),a.set(e.message_id,n)}return a}finally{t.close()}}async function E(){let e=Date.now()-864e5,t=d();try{u(t);let a=t.prepare("SELECT id, disk_name FROM attachments WHERE message_id IS NULL AND created_at < ?").all(e);for(let{id:e,disk_name:t}of a){let a=r.default.join(c,t||e);try{await n.promises.unlink(a)}catch{}}if(a.length>0){let e=a.map(()=>"?").join(", ");t.prepare(`DELETE FROM attachments WHERE id IN (${e})`).run(...a.map(e=>e.id))}return a.length}finally{t.close()}}e.s(["createAttachment",()=>l,"deleteAttachment",()=>T,"finalizeAttachments",()=>p,"gcOrphanedAttachments",()=>E,"getAttachmentMeta",()=>_,"getAttachmentsForMessages",()=>m])},911230,e=>{"use strict";var t=e.i(601544);async function n(e){return(0,t.getChatRun)(e)}async function r(e){return(0,t.updateChatRun)(e)}async function a(e){let n=await (0,t.listChatRunSteps)(e.chatRunId);return(0,t.appendChatRunStep)({id:crypto.randomUUID(),chatRunId:e.chatRunId,stepIndex:n.length+1,kind:e.kind,status:e.status,participantId:e.participantId,inputPayload:e.inputPayload,outputPayload:e.outputPayload})}async function s(e){return(0,t.updateChatRunStep)({id:e.stepId,status:e.status,outputPayload:e.outputPayload,completedAt:Date.now()})}e.s(["appendChatRunStepActivity",()=>a,"completeChatRunStepActivity",()=>s,"loadChatRunActivity",()=>n,"updateChatRunActivity",()=>r])},249921,e=>{"use strict";class t{streams=new Map;publish(e,t){let n=this.streams.get(e);if(n||(n={events:[],subscribers:new Set,done:!1},this.streams.set(e,n)),!n.done)for(let e of(n.events.push(t),n.subscribers))try{e(t)}catch{}}subscribe(e,t){let n=this.streams.get(e);for(let r of(n||(n={events:[],subscribers:new Set,done:!1},this.streams.set(e,n)),n.events))try{t(r)}catch{}return n.done||n.subscribers.add(t),()=>{n.subscribers.delete(t)}}complete(e){let t=this.streams.get(e);if(t){for(let e of(t.done=!0,t.subscribers))try{e({type:"done"})}catch{}t.subscribers.clear(),setTimeout(()=>{this.streams.delete(e)},3e5)}}isComplete(e){return this.streams.get(e)?.done??!1}}let n=Symbol.for("agx:ChatEventBus");function r(){return globalThis[n]||(globalThis[n]=new t),globalThis[n]}e.s(["getChatEventBus",()=>r])},812057,(e,t,n)=>{t.exports=e.x("node:util",()=>require("node:util"))},533655,e=>{"use strict";e.s(["BASH_FUNCTION_TIMEOUT_MS",0,3e4,"CHECK_NPM_BUILD_TIMEOUT_MS",0,6e5,"CHECK_NPM_COVERAGE_TIMEOUT_MS",0,3e5,"CHECK_NPM_LINT_TIMEOUT_MS",0,6e4,"CHECK_NPM_TEST_TIMEOUT_MS",0,3e5,"CHECK_NPM_TYPECHECK_TIMEOUT_MS",0,12e4,"GRAPH_TIMEOUT_DEFAULT_MS",0,864e5,"NODE_TIMEOUT_DEFAULT_MS",0,18e5,"PS_COMMAND_TIMEOUT_MS",0,5e3,"QUEUE_POLL_INTERVAL_MS",0,1e3,"SCHEDULE_POLL_INTERVAL_MS",0,5e3,"SHELL_COMMAND_TIMEOUT_MS",0,5e3,"SKILLS_CACHE_TTL_MS",0,36e5,"SKILL_DETAIL_CACHE_TTL_MS",0,36e5,"SKILL_FETCH_TIMEOUT_MS",0,12e4,"STEER_DUPLICATE_WINDOW_MS",0,9e5,"WRITE_RATE_SAMPLE_WINDOW_MS",0,1e4,"WRITE_RATE_WARNING_COOLDOWN_MS",0,6e4])},466713,e=>{"use strict";var t=e.i(533655);let n={replanBudgetRemaining:3,replanBudgetInitial:3,verifyBudgetRemaining:5,verifyBudgetInitial:5,maxConcurrentAutoChecks:1,immutableRequiredGates:!0,maxConcurrent:3,priorityMode:"fifo",nodeTimeoutMs:t.NODE_TIMEOUT_DEFAULT_MS,graphTimeoutMs:t.GRAPH_TIMEOUT_DEFAULT_MS};e.s(["DEFAULT_EXECUTION_POLICY",0,n,"FAILURE_NODE_STATUSES",0,["failed"],"INCOMPLETE_FOR_DONE_STATUSES",0,["pending","running","awaiting_human","blocked"],"SOFT_DEP_SATISFIED_STATUSES",0,["done","passed","failed","skipped","blocked"],"SUCCESS_NODE_STATUSES",0,["done","passed"],"TERMINAL_NODE_STATUSES",0,["done","passed","failed","skipped"]])},160129,e=>{"use strict";var t=e.i(46081);function n(e,t=Date.now()){let r=t=>({graph:e,tickFired:!1,resetNodeIds:[],skipReason:t});if(!e.schedule)return r("no_schedule");let a=e.schedule;if("active"!==a.state)return r("not_active");let s=a.maxConcurrency??5,i=a.currentConcurrency??0;if(i>=s)return r("max_concurrency_reached");if(null!=a.maxRuns&&a.runCount>=a.maxRuns)return r("max_runs_reached");if(a.cronExpr&&"number"==typeof a.nextTickAt){if(t<a.nextTickAt)return r("not_due")}else if(t-(a.lastTickAt??0)<a.intervalMs)return r("not_due");let o=JSON.parse(JSON.stringify(e)),c=[];for(let e of a.resetNodeIds){let t=o.nodes[e];t&&("done"===t.status||"passed"===t.status||"failed"===t.status||"skipped"===t.status)&&(o.nodes[e]={...t,status:"pending",startedAt:void 0,completedAt:void 0,metrics:void 0,..."function"===t.type?{output:void 0}:{},..."conditional"===t.type?{evaluatedTo:void 0}:{}},c.push(e))}return o.schedule={...a,tickInProgress:!0,currentConcurrency:i+1,lastTickAt:t,runCount:a.runCount+1},{graph:o,tickFired:!0,resetNodeIds:c}}function r(e){if(!e.schedule)return e;let n=e.schedule,r=Math.max(0,(n.currentConcurrency??+!!n.tickInProgress)-1),a=n.nextTickAt;return n.cronExpr&&0===r&&(a=(0,t.computeNextTickFromCron)(n.cronExpr)),{...e,schedule:{...n,tickInProgress:r>0,currentConcurrency:r,nextTickAt:a}}}function a(e){if(!e.schedule)return!0;let t=new Set(["done","passed","failed","skipped"]);for(let n of e.schedule.resetNodeIds){let r=e.nodes[n];if(r&&!t.has(r.status))return!1}return!0}function s(e,t=6e4,n){return{intervalMs:t,state:"active",resetNodeIds:e,maxRuns:n,runCount:0,tickInProgress:!1,currentConcurrency:0,createdAt:new Date().toISOString()}}e.s(["completeScheduleTick",()=>r,"createThreadMonitorSchedule",()=>s,"isScheduleTickComplete",()=>a,"scheduleTickIfDue",()=>n])},558174,e=>{"use strict";var t=e.i(769025),n=e.i(814747),r=e.i(446786),a=e.i(522734);let{DatabaseSync:s}=process.getBuiltinModule("node:sqlite"),i=process.env.AGX_GROUP_CHAT_DIR?.trim()||n.default.join(r.default.homedir(),".agx","group-chat"),o=n.default.join(i,"history.sqlite");function c(e){return{id:e.id,workspaceId:e.workspace_id,threadId:e.thread_id,agentId:e.agent_id,pid:e.pid,state:e.state,sinceMessageId:e.since_message_id,responseMessageId:e.response_message_id||"",startedAt:e.started_at,lastActivity:e.last_activity,projectSlug:e.project_slug||""}}function d(e){let n=function(){(0,a.mkdirSync)(i,{recursive:!0});let e=new s(o);(0,t.pragmaSet)(e,"journal_mode = WAL"),e.exec(`
|
|
17
17
|
CREATE TABLE IF NOT EXISTS agent_processes (
|
|
18
18
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
19
19
|
workspace_id TEXT NOT NULL,
|
|
@@ -59,7 +59,7 @@ module.exports=[508763,e=>{"use strict";var t=e.i(769025),n=e.i(522734),r=e.i(81
|
|
|
59
59
|
created_at INTEGER NOT NULL,
|
|
60
60
|
updated_at INTEGER NOT NULL
|
|
61
61
|
)
|
|
62
|
-
`),e}();try{return e(n)}finally{n.close()}}function u(e){return d(t=>{let n=t.prepare(`INSERT INTO agent_processes (workspace_id, thread_id, agent_id, pid, state, since_message_id, response_message_id, started_at, last_activity, project_slug)
|
|
62
|
+
`),e.prepare("PRAGMA table_info(tracker_runs)").all().some(e=>"tracker_type"===e.name)||e.exec("ALTER TABLE tracker_runs ADD COLUMN tracker_type TEXT NOT NULL DEFAULT 'linear'"),e}();try{return e(n)}finally{n.close()}}function u(e){return d(t=>{let n=t.prepare(`INSERT INTO agent_processes (workspace_id, thread_id, agent_id, pid, state, since_message_id, response_message_id, started_at, last_activity, project_slug)
|
|
63
63
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
64
64
|
ON CONFLICT(workspace_id, agent_id)
|
|
65
65
|
DO UPDATE SET
|
|
@@ -70,16 +70,16 @@ module.exports=[508763,e=>{"use strict";var t=e.i(769025),n=e.i(522734),r=e.i(81
|
|
|
70
70
|
response_message_id = excluded.response_message_id,
|
|
71
71
|
started_at = excluded.started_at,
|
|
72
72
|
last_activity = excluded.last_activity,
|
|
73
|
-
project_slug = excluded.project_slug`).run(e.workspaceId,e.threadId,e.agentId,e.pid,e.state,e.sinceMessageId,e.responseMessageId||"",e.startedAt,e.lastActivity,e.projectSlug||"");if(1===n.changes&&n.lastInsertRowid)return Number(n.lastInsertRowid);let r=t.prepare("SELECT id FROM agent_processes WHERE workspace_id = ? AND agent_id = ?").get(e.workspaceId,e.agentId);return r?.id??0})}function l(e,t,n){let r=[],a=[];void 0!==n.state&&(r.push("state = ?"),a.push(n.state)),void 0!==n.lastActivity&&(r.push("last_activity = ?"),a.push(n.lastActivity)),void 0!==n.pid&&(r.push("pid = ?"),a.push(n.pid)),0!==r.length&&d(n=>n.prepare(`UPDATE agent_processes SET ${r.join(", ")} WHERE workspace_id = ? AND agent_id = ?`).run(...a,e,t))}function p(e){return d(t=>t.prepare("SELECT * FROM agent_processes WHERE thread_id = ?").all(e).map(c))}function
|
|
73
|
+
project_slug = excluded.project_slug`).run(e.workspaceId,e.threadId,e.agentId,e.pid,e.state,e.sinceMessageId,e.responseMessageId||"",e.startedAt,e.lastActivity,e.projectSlug||"");if(1===n.changes&&n.lastInsertRowid)return Number(n.lastInsertRowid);let r=t.prepare("SELECT id FROM agent_processes WHERE workspace_id = ? AND agent_id = ?").get(e.workspaceId,e.agentId);return r?.id??0})}function l(e,t,n){let r=[],a=[];void 0!==n.state&&(r.push("state = ?"),a.push(n.state)),void 0!==n.lastActivity&&(r.push("last_activity = ?"),a.push(n.lastActivity)),void 0!==n.pid&&(r.push("pid = ?"),a.push(n.pid)),0!==r.length&&d(n=>n.prepare(`UPDATE agent_processes SET ${r.join(", ")} WHERE workspace_id = ? AND agent_id = ?`).run(...a,e,t))}function p(e){return d(t=>t.prepare("SELECT * FROM agent_processes WHERE thread_id = ?").all(e).map(c))}function T(e){return d(t=>t.prepare("SELECT * FROM agent_processes WHERE workspace_id = ?").all(e).map(c))}function _(){return d(e=>e.prepare("SELECT * FROM agent_processes").all().map(c))}function m(){return d(e=>e.prepare(`
|
|
74
74
|
SELECT ap.*, substr(m.content, 1, 120) AS thread_title,
|
|
75
75
|
tr.issue_id AS tracker_item_id, tr.id AS tracker_run_id,
|
|
76
76
|
tr.tracker_type AS tracker_type
|
|
77
77
|
FROM agent_processes ap
|
|
78
78
|
LEFT JOIN messages m ON m.id = ap.thread_id AND m.thread_id = ap.workspace_id
|
|
79
|
-
LEFT JOIN tracker_runs tr ON tr.
|
|
79
|
+
LEFT JOIN tracker_runs tr ON tr.chat_run_id = ap.id
|
|
80
80
|
`).all().map(e=>({...c(e),threadTitle:e.thread_title,trackerItemId:e.tracker_item_id??null,trackerRunId:e.tracker_run_id??null,trackerType:e.tracker_type??null,linearIssueId:e.tracker_item_id??null,linearRunId:e.tracker_run_id??null})))}function E(e){let t=0;for(let n of e){if(n.pid>0)try{process.kill(n.pid,"SIGTERM")}catch{}t++}return t}function g(e){let t=E(p(e).filter(e=>"running"===e.state||"spawning"===e.state));return t>0&&d(t=>t.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
81
|
-
WHERE thread_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}function f(e){let t=E(
|
|
82
|
-
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}e.s(["getAll",()=>
|
|
81
|
+
WHERE thread_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}function f(e){let t=E(T(e).filter(e=>"running"===e.state||"spawning"===e.state));return t>0&&d(t=>t.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
82
|
+
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}e.s(["getAll",()=>_,"getAllEnriched",()=>m,"getByThread",()=>p,"getByWorkspace",()=>T,"killByThread",()=>g,"killByWorkspace",()=>f,"register",()=>u,"update",()=>l])},84548,e=>{"use strict";function t(e,t){return`---
|
|
83
83
|
${Object.entries(e).map(([e,t])=>`${e}: ${null==t?"":String(t)}`).join("\n")}
|
|
84
84
|
---
|
|
85
85
|
${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},471206,e=>{"use strict";var t=e.i(522734),n=e.i(446786),r=e.i(814747);let a=process.env.AGX_DATA_DIR||r.default.join(n.default.homedir(),".agx"),s=process.env.AGX_DEBUG_LOG_PATH||r.default.join(a,"logs","desktop-chat-debug.log");function i(e,t){return t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:"string"==typeof t&&t.length>2e3?`${t.slice(0,2e3)}...<truncated>`:t}function o(){return s}function c(e,n){try{t.default.mkdirSync(r.default.dirname(s),{recursive:!0});let a=JSON.stringify({ts:new Date().toISOString(),pid:process.pid,event:e,...n?{payload:n}:{}},i);t.default.appendFileSync(s,`${a}
|
|
@@ -119,8 +119,8 @@ Rules:
|
|
|
119
119
|
- Do not wrap in markdown code blocks. Just raw JSON.`;async function l(e){let t=[`Goal: ${e.goal}`,`Status: ${e.status}`,e.nodeOutputs?`Node outputs: ${JSON.stringify(e.nodeOutputs).slice(0,2e3)}`:null].filter(Boolean).join("\n"),r=`${d}
|
|
120
120
|
|
|
121
121
|
Task:
|
|
122
|
-
${t}`,a="";try{await (0,n.runCliResponse)({provider:"claude",model:"claude-haiku-4-5-20251001",prompt:r,onDelta:e=>{a+=e}})}catch(e){return console.warn("[memory-extractor] LLM call failed:",e),[]}var s=a;let i=s.trim().replace(/^```(?:json)?\s*/i,"").replace(/\s*```\s*$/,"").trim();try{let e=JSON.parse(i);if(!Array.isArray(e))return[];return e.filter(e=>"object"==typeof e&&null!==e&&c.has(e.memory_type)&&"string"==typeof e.content&&e.content.trim().length>0).slice(0,3)}catch{return console.warn("[memory-extractor] Failed to parse LLM response:",i.slice(0,200)),[]}}let p=new Set(["outcome","decision","pattern","gotcha"]),
|
|
123
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`),o=0,c=Date.now();for(let r of a){if(!p.has(r.memory_type)||!r.content?.trim())continue;let a=(0,t.createHash)("sha256").update(r.content.trim()).digest("hex");s.run((0,t.randomUUID)(),n,e,r.memory_type,r.content.trim(),a,c).changes>0&&o++}return o>0&&i(a.map(t=>({scope:"agent",subjectId:n,sourceType:"task_completion",sourceId:e,kind:t.memory_type,title:t.content.trim().slice(0,80),body:t.content.trim(),confidence:.7,durability:.6,metadata:{task_id:e}}))),o}async function g(e,t,n){let r=await l(n);if(0===r.length)return;let a=await E(e,t,r);a>0&&console.log(`[memory-extractor] Stored ${a} memories for task ${e}`)}async function f(e){let t=
|
|
122
|
+
${t}`,a="";try{await (0,n.runCliResponse)({provider:"claude",model:"claude-haiku-4-5-20251001",prompt:r,onDelta:e=>{a+=e}})}catch(e){return console.warn("[memory-extractor] LLM call failed:",e),[]}var s=a;let i=s.trim().replace(/^```(?:json)?\s*/i,"").replace(/\s*```\s*$/,"").trim();try{let e=JSON.parse(i);if(!Array.isArray(e))return[];return e.filter(e=>"object"==typeof e&&null!==e&&c.has(e.memory_type)&&"string"==typeof e.content&&e.content.trim().length>0).slice(0,3)}catch{return console.warn("[memory-extractor] Failed to parse LLM response:",i.slice(0,200)),[]}}let p=new Set(["outcome","decision","pattern","gotcha"]),T=["agent_id","agentId","agent","participant_id","participantId","assigned_agent","assignedAgent"];function _(e){return"string"!=typeof e?null:e.trim()||null}function m(e){let t=_(e.explicitAgentId);if(t)return t;let n=e.frontmatter||{};for(let e of T){let t=_(n[e]);if(t)return t}return _(e.defaultUserId)||"system"}async function E(e,n,a){let s=(0,r.getSQLiteDb)().prepare(`INSERT OR IGNORE INTO agent_memory (id, agent_id, task_id, memory_type, content, content_hash, created_at)
|
|
123
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`),o=0,c=Date.now();for(let r of a){if(!p.has(r.memory_type)||!r.content?.trim())continue;let a=(0,t.createHash)("sha256").update(r.content.trim()).digest("hex");s.run((0,t.randomUUID)(),n,e,r.memory_type,r.content.trim(),a,c).changes>0&&o++}return o>0&&i(a.map(t=>({scope:"agent",subjectId:n,sourceType:"task_completion",sourceId:e,kind:t.memory_type,title:t.content.trim().slice(0,80),body:t.content.trim(),confidence:.7,durability:.6,metadata:{task_id:e}}))),o}async function g(e,t,n){let r=await l(n);if(0===r.length)return;let a=await E(e,t,r);a>0&&console.log(`[memory-extractor] Stored ${a} memories for task ${e}`)}async function f(e){let t=_(e);if(!t)return null;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))return t;let n=(0,r.getSQLiteDb)().prepare("SELECT id FROM projects WHERE slug = ? LIMIT 1").get(t);return n?.id??null}async function h(e,t){let r=[`Goal: ${e.goal}`,`Status: ${e.status}`,e.nodeOutputs?`Node outputs: ${JSON.stringify(e.nodeOutputs).slice(0,2e3)}`:null].filter(Boolean).join("\n"),a=`${u}
|
|
124
124
|
|
|
125
125
|
Current note:
|
|
126
126
|
${t||"(empty)"}
|
package/cloud-runtime/standalone/apps/local/.next/server/chunks/[root-of-the-server]__7fcbb0c2._.js
CHANGED
|
@@ -119,12 +119,12 @@ ${n}`,i="";try{await (0,r.runCliResponse)({provider:"claude",model:"claude-haiku
|
|
|
119
119
|
LIMIT 1`).get(r)??null}function C(){let e=new Set;if((0,a.isAutomationFrontmatterEnabled)()){for(let t of(0,a.getAutomationRepository)().listVisibleAutomations({targetType:"execution_graph",state:"active"}))"execution_graph"===t.definition.target.type&&t.definition.target.rootMessageId&&e.add(t.definition.target.rootMessageId);if(!(0,a.isAutomationDualReadEnabled)())return[...e]}for(let r of(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
|
|
120
120
|
FROM execution_graphs
|
|
121
121
|
WHERE schedule IS NOT NULL
|
|
122
|
-
AND json_extract(schedule, '$.state') = 'active'`).all())r.rootMessageId&&e.add(r.rootMessageId);return[...e]}function
|
|
122
|
+
AND json_extract(schedule, '$.state') = 'active'`).all())r.rootMessageId&&e.add(r.rootMessageId);return[...e]}function M(e){let r=e.trim();if(!r)return 0;let n=0;if((0,a.isAutomationFrontmatterEnabled)()){for(let e of(0,a.getAutomationRepository)().listVisibleAutomations({targetType:"execution_graph",state:"active",rootMessageId:r})){if("execution_graph"!==e.definition.target.type)continue;let t=e.definition.target.graphId??e.definition.id,r=e.definition.target.taskId??g(t);if(!r)continue;let a=N(r);a?.schedule&&(S.updateGraphStructure(a.id,{mode:a.mode,nodes:a.nodes,edges:a.edges,policy:a.policy,doneCriteria:a.doneCriteria,schedule:{...a.schedule,state:"stopped",tickInProgress:!1,currentConcurrency:0}},a.graphVersion),n+=1)}if(n>0||!(0,a.isAutomationDualReadEnabled)())return n}return Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
|
|
123
123
|
SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false'), '$.currentConcurrency', 0),
|
|
124
124
|
updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
|
|
125
125
|
WHERE schedule IS NOT NULL
|
|
126
126
|
AND json_extract(schedule, '$.rootMessageId') = ?
|
|
127
|
-
AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0)}e.s(["GraphNodeNotFoundError",()=>d,"GraphNotFoundError",()=>o,"GraphStore",()=>f,"GraphTaskAlreadyBoundError",()=>u,"GraphVersionConflictError",()=>s,"appendEvent",()=>R,"createGraph",()=>A,"createGraphStore",()=>y,"deactivateSchedulesByRootMessageId",()=>
|
|
127
|
+
AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0)}e.s(["GraphNodeNotFoundError",()=>d,"GraphNotFoundError",()=>o,"GraphStore",()=>f,"GraphTaskAlreadyBoundError",()=>u,"GraphVersionConflictError",()=>s,"appendEvent",()=>R,"createGraph",()=>A,"createGraphStore",()=>y,"deactivateSchedulesByRootMessageId",()=>M,"getActiveScheduleForRootMessageId",()=>k,"getActiveScheduleRootMessageIds",()=>C,"getGraph",()=>N,"getGraphEvents",()=>O,"getTaskIdForGraphId",()=>g,"updateGraphStructure",()=>L,"updateNodeRuntime",()=>I])},533655,e=>{"use strict";e.s(["BASH_FUNCTION_TIMEOUT_MS",0,3e4,"CHECK_NPM_BUILD_TIMEOUT_MS",0,6e5,"CHECK_NPM_COVERAGE_TIMEOUT_MS",0,3e5,"CHECK_NPM_LINT_TIMEOUT_MS",0,6e4,"CHECK_NPM_TEST_TIMEOUT_MS",0,3e5,"CHECK_NPM_TYPECHECK_TIMEOUT_MS",0,12e4,"GRAPH_TIMEOUT_DEFAULT_MS",0,864e5,"NODE_TIMEOUT_DEFAULT_MS",0,18e5,"PS_COMMAND_TIMEOUT_MS",0,5e3,"QUEUE_POLL_INTERVAL_MS",0,1e3,"SCHEDULE_POLL_INTERVAL_MS",0,5e3,"SHELL_COMMAND_TIMEOUT_MS",0,5e3,"SKILLS_CACHE_TTL_MS",0,36e5,"SKILL_DETAIL_CACHE_TTL_MS",0,36e5,"SKILL_FETCH_TIMEOUT_MS",0,12e4,"STEER_DUPLICATE_WINDOW_MS",0,9e5,"WRITE_RATE_SAMPLE_WINDOW_MS",0,1e4,"WRITE_RATE_WARNING_COOLDOWN_MS",0,6e4])},466713,e=>{"use strict";var t=e.i(533655);let r={replanBudgetRemaining:3,replanBudgetInitial:3,verifyBudgetRemaining:5,verifyBudgetInitial:5,maxConcurrentAutoChecks:1,immutableRequiredGates:!0,maxConcurrent:3,priorityMode:"fifo",nodeTimeoutMs:t.NODE_TIMEOUT_DEFAULT_MS,graphTimeoutMs:t.GRAPH_TIMEOUT_DEFAULT_MS};e.s(["DEFAULT_EXECUTION_POLICY",0,r,"FAILURE_NODE_STATUSES",0,["failed"],"INCOMPLETE_FOR_DONE_STATUSES",0,["pending","running","awaiting_human","blocked"],"SOFT_DEP_SATISFIED_STATUSES",0,["done","passed","failed","skipped","blocked"],"SUCCESS_NODE_STATUSES",0,["done","passed"],"TERMINAL_NODE_STATUSES",0,["done","passed","failed","skipped"]])},84548,e=>{"use strict";function t(e,t){return`---
|
|
128
128
|
${Object.entries(e).map(([e,t])=>`${e}: ${null==t?"":String(t)}`).join("\n")}
|
|
129
129
|
---
|
|
130
130
|
${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},558174,e=>{"use strict";var t=e.i(769025),r=e.i(814747),n=e.i(446786),a=e.i(522734);let{DatabaseSync:i}=process.getBuiltinModule("node:sqlite"),s=process.env.AGX_GROUP_CHAT_DIR?.trim()||r.default.join(n.default.homedir(),".agx","group-chat"),o=r.default.join(s,"history.sqlite");function d(e){return{id:e.id,workspaceId:e.workspace_id,threadId:e.thread_id,agentId:e.agent_id,pid:e.pid,state:e.state,sinceMessageId:e.since_message_id,responseMessageId:e.response_message_id||"",startedAt:e.started_at,lastActivity:e.last_activity,projectSlug:e.project_slug||""}}function u(e){let r=function(){(0,a.mkdirSync)(s,{recursive:!0});let e=new i(o);(0,t.pragmaSet)(e,"journal_mode = WAL"),e.exec(`
|
|
@@ -173,7 +173,7 @@ ${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},558174,e=>{"use strict";var t
|
|
|
173
173
|
created_at INTEGER NOT NULL,
|
|
174
174
|
updated_at INTEGER NOT NULL
|
|
175
175
|
)
|
|
176
|
-
`),e}();try{return e(r)}finally{r.close()}}function c(e){return u(t=>{let r=t.prepare(`INSERT INTO agent_processes (workspace_id, thread_id, agent_id, pid, state, since_message_id, response_message_id, started_at, last_activity, project_slug)
|
|
176
|
+
`),e.prepare("PRAGMA table_info(tracker_runs)").all().some(e=>"tracker_type"===e.name)||e.exec("ALTER TABLE tracker_runs ADD COLUMN tracker_type TEXT NOT NULL DEFAULT 'linear'"),e}();try{return e(r)}finally{r.close()}}function c(e){return u(t=>{let r=t.prepare(`INSERT INTO agent_processes (workspace_id, thread_id, agent_id, pid, state, since_message_id, response_message_id, started_at, last_activity, project_slug)
|
|
177
177
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
178
178
|
ON CONFLICT(workspace_id, agent_id)
|
|
179
179
|
DO UPDATE SET
|
|
@@ -190,7 +190,7 @@ ${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},558174,e=>{"use strict";var t
|
|
|
190
190
|
tr.tracker_type AS tracker_type
|
|
191
191
|
FROM agent_processes ap
|
|
192
192
|
LEFT JOIN messages m ON m.id = ap.thread_id AND m.thread_id = ap.workspace_id
|
|
193
|
-
LEFT JOIN tracker_runs tr ON tr.
|
|
193
|
+
LEFT JOIN tracker_runs tr ON tr.chat_run_id = ap.id
|
|
194
194
|
`).all().map(e=>({...d(e),threadTitle:e.thread_title,trackerItemId:e.tracker_item_id??null,trackerRunId:e.tracker_run_id??null,trackerType:e.tracker_type??null,linearIssueId:e.tracker_item_id??null,linearRunId:e.tracker_run_id??null})))}function h(e){let t=0;for(let r of e){if(r.pid>0)try{process.kill(r.pid,"SIGTERM")}catch{}t++}return t}function m(e){let t=h(p(e).filter(e=>"running"===e.state||"spawning"===e.state));return t>0&&u(t=>t.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
195
195
|
WHERE thread_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}function T(e){let t=h(E(e).filter(e=>"running"===e.state||"spawning"===e.state));return t>0&&u(t=>t.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
196
196
|
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),e)),t}e.s(["getAll",()=>_,"getAllEnriched",()=>g,"getByThread",()=>p,"getByWorkspace",()=>E,"killByThread",()=>m,"killByWorkspace",()=>T,"register",()=>c,"update",()=>l])}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[329893,e=>{"use strict";var t=e.i(924868),a=e.i(374371),
|
|
1
|
+
module.exports=[329893,e=>{"use strict";var t=e.i(924868),a=e.i(374371),n=e.i(801243),i=e.i(814747),r=e.i(446786),s=e.i(522734);let{DatabaseSync:o}=process.getBuiltinModule("node:sqlite"),d=process.env.AGX_GROUP_CHAT_DIR?.trim()||i.default.join(r.default.homedir(),".agx","group-chat"),l=i.default.join(d,"history.sqlite");function c(e){return{id:e.id,workspaceId:e.workspace_id,threadId:e.thread_id,agentId:e.agent_id,pid:e.pid,state:e.state,sinceMessageId:e.since_message_id,responseMessageId:e.response_message_id||"",startedAt:e.started_at,lastActivity:e.last_activity,projectSlug:e.project_slug||""}}function p(e){let t=function(){(0,s.mkdirSync)(d,{recursive:!0});let e=new o(l);(0,n.pragmaSet)(e,"journal_mode = WAL"),e.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS agent_processes (
|
|
3
3
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
4
|
workspace_id TEXT NOT NULL,
|
|
@@ -44,7 +44,7 @@ module.exports=[329893,e=>{"use strict";var t=e.i(924868),a=e.i(374371),i=e.i(80
|
|
|
44
44
|
created_at INTEGER NOT NULL,
|
|
45
45
|
updated_at INTEGER NOT NULL
|
|
46
46
|
)
|
|
47
|
-
`),e}();try{return e(t)}finally{t.close()}}function u(e,t,a){let
|
|
47
|
+
`),e.prepare("PRAGMA table_info(tracker_runs)").all().some(e=>"tracker_type"===e.name)||e.exec("ALTER TABLE tracker_runs ADD COLUMN tracker_type TEXT NOT NULL DEFAULT 'linear'"),e}();try{return e(t)}finally{t.close()}}function u(e,t,a){let n=[],i=[];void 0!==a.state&&(n.push("state = ?"),i.push(a.state)),void 0!==a.lastActivity&&(n.push("last_activity = ?"),i.push(a.lastActivity)),void 0!==a.pid&&(n.push("pid = ?"),i.push(a.pid)),0!==n.length&&p(a=>a.prepare(`UPDATE agent_processes SET ${n.join(", ")} WHERE workspace_id = ? AND agent_id = ?`).run(...i,e,t))}function g(e){let t=0;for(let a of e){if(a.pid>0)try{process.kill(a.pid,"SIGTERM")}catch{}t++}return t}var m=e.i(200704);let f=new Set(["ack","working","done","clarify","blocked"]),h=/\[reaction\s+([^\]]+)\]/gi,y=/([a-zA-Z][a-zA-Z0-9_]*)=(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|([^\s\]]*?(?=\s|]|[a-zA-Z][a-zA-Z0-9_]*=|$)))/g,{DatabaseSync:T}=process.getBuiltinModule("node:sqlite"),I=process.env.AGX_GROUP_CHAT_DIR?.trim()||i.default.join(r.default.homedir(),".agx","group-chat"),w=i.default.join(I,"history.sqlite"),E=i.default.join(I,"uploads");async function _(e){let t,a=(t=new T(w),(0,n.pragmaSet)(t,"journal_mode = WAL"),t);try{if(a.exec(`
|
|
48
48
|
CREATE TABLE IF NOT EXISTS attachments (
|
|
49
49
|
id TEXT PRIMARY KEY,
|
|
50
50
|
message_id TEXT,
|
|
@@ -56,8 +56,8 @@ module.exports=[329893,e=>{"use strict";var t=e.i(924868),a=e.i(374371),i=e.i(80
|
|
|
56
56
|
created_at INTEGER NOT NULL
|
|
57
57
|
);
|
|
58
58
|
CREATE INDEX IF NOT EXISTS idx_attachments_message ON attachments(message_id);
|
|
59
|
-
`),!a.prepare("PRAGMA table_info(attachments)").all().some(e=>"disk_name"===e.name)){a.exec("ALTER TABLE attachments ADD COLUMN disk_name TEXT NOT NULL DEFAULT ''");let e=a.prepare("SELECT id, filename FROM attachments WHERE disk_name = ''").all(),t=a.prepare("UPDATE attachments SET disk_name = ? WHERE id = ?");for(let a of e){let e=a.filename.includes(".")?"."+a.filename.split(".").pop().toLowerCase():"";t.run(a.id+e,a.id)}}let t=a.prepare("SELECT filename, disk_name, mime_type, size FROM attachments WHERE id = ?").get(e);if(!t)return null;let
|
|
60
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`),a=`reflection:${e.id}:${o[o.length-1]?.id??l}`,
|
|
59
|
+
`),!a.prepare("PRAGMA table_info(attachments)").all().some(e=>"disk_name"===e.name)){a.exec("ALTER TABLE attachments ADD COLUMN disk_name TEXT NOT NULL DEFAULT ''");let e=a.prepare("SELECT id, filename FROM attachments WHERE disk_name = ''").all(),t=a.prepare("UPDATE attachments SET disk_name = ? WHERE id = ?");for(let a of e){let e=a.filename.includes(".")?"."+a.filename.split(".").pop().toLowerCase():"";t.run(a.id+e,a.id)}}let t=a.prepare("SELECT filename, disk_name, mime_type, size FROM attachments WHERE id = ?").get(e);if(!t)return null;let n=t.disk_name||e;return{filename:t.filename,mimeType:t.mime_type,size:t.size,diskPath:i.default.join(E,n)}}finally{a.close()}}var L=e.i(633211),v=e.i(855532),N=e.i(329905),b=e.i(224316),$=e.i(888652);let S=(0,i.join)((0,r.homedir)(),".agx","agents");var R=e.i(476805),A=e.i(121239),k=e.i(254799);let O=new Map,D=new Map;function U(e){return null!==e}let x="I evolve through experience and collaboration.";function C(e,t){let a=e.replace(/\s+/g," ").trim();if(!a)return`I am ${t}. ${x}`;let n=a.replace(/^you are\b[^.!?\n]*[.!?]?\s*/i,`I am ${t}. `);return(/^i am\b/i.test(n)?n:`I am ${t}. ${n}`).slice(0,500).trim()}function j(e,t){(0,b.ensureAgent)(e.id,{voice:e.voice?.trim()||`${e.name} style`,seed:function(e,t,a){let n=String(a||"").trim();if(n)return C(n,t);let i=String(e||"").trim();return i?C(i,t):`I am ${t}. ${x}`}(t,e.name,e.seed)})}async function M(e){j(e);let t=(0,b.readIdentity)(e.id);if(!t)return;let n=(0,v.readSelf)(e.id),r=(0,v.readReflectionState)(e.id),o=(0,N.readJournalSince)(e.id,r?.lastProcessedJournalId).filter(e=>"post"===e.type);if(0===o.length)return;let d=(0,b.getTeamSelves)(e.id),l=(n?.version??0)+1,c=(0,R.listKnowledgeEntries)({scope:"agent",subjectId:e.id,limit:50}),p=(0,v.buildStructuredReflectionPrompt)(t,n,o,d,c),u="";await (0,a.runCliResponse)({provider:e.provider,model:e.model,systemContext:"You are performing a self-modeling exercise. Output ONLY raw JSON matching the requested schema. No markdown fences, no commentary.",prompt:p,signal:void 0,onDelta:e=>{u+=e}});let g=u.trim().replace(/^```(?:json)?\s*/i,"").replace(/\s*```\s*$/,"").trim(),m=null;try{m=JSON.parse(g)}catch{m=null}let f=m?.self_model?.trim()||"";if(!f)return;let h=Array.isArray(m?.memories)?m.memories.slice(0,3).map(t=>({scope:"agent",subjectId:e.id,sourceType:"reflection",sourceId:o[o.length-1]?.id||`reflection:${e.id}:${l}`,kind:t.kind,title:String(t.title??"").trim(),body:String(t.body??"").trim(),confidence:t.confidence,durability:t.durability,tags:t.tags,evidence:Array.isArray(t.evidence)?t.evidence.map(e=>{let t=String(e?.note??"").trim(),a="string"==typeof e?.id?e.id.trim():"";return t?a?{id:a,note:t}:{note:t}:null}).filter(U):[],metadata:{reflection_window_start:o[0]?.id??null,reflection_window_end:o[o.length-1]?.id??null,self_version:l}})).filter(e=>e.title&&e.body):[],y=(0,R.storeKnowledgeEntries)(h);if((0,v.writeSelf)(e.id,f,l),(0,v.writeReflectionState)(e.id,{lastProcessedJournalId:o[o.length-1]?.id??r?.lastProcessedJournalId??null,updatedAt:new Date().toISOString()}),y>0){let t=(0,L.getSQLiteDb)().prepare(`INSERT OR IGNORE INTO agent_memory (id, agent_id, task_id, memory_type, content, content_hash, created_at)
|
|
60
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`),a=`reflection:${e.id}:${o[o.length-1]?.id??l}`,n=Date.now();for(let i of h){let r="decision"===i.kind?"decision":"gotcha"===i.kind||"constraint"===i.kind?"gotcha":"outcome"===i.kind?"outcome":"pattern",s=(0,k.createHash)("sha256").update(i.body.trim()).digest("hex");t.run((0,k.randomUUID)(),e.id,a,r,i.body.trim(),s,n)}}(0,N.appendJournal)(e.id,{t:new Date().toISOString(),type:"reflection",observation:"Reflected after 10 messages",judgement:"Updated self-model from incremental journal evidence and deduped agent memories",delta:`self-model updated to v${l}${y>0?`; stored ${y} agent memories`:""}`,threads:[],selfVersion:l,body:f});let T=(0,b.listAgents)().filter(t=>t!==e.id).flatMap(e=>(0,N.readJournal)(e,3).map(t=>({agentId:e,entry:t})));if(T.length>0){let t=T.map(e=>`${e.entry.id}: ${e.entry.observation.slice(0,200)}`).join("\n"),n="";try{await (0,a.runCliResponse)({provider:e.provider,model:e.model,prompt:`You are ${e.id}. Review these recent entries from other agents and react to any that resonate with you.
|
|
61
61
|
|
|
62
62
|
Entries:
|
|
63
63
|
${t}
|
|
@@ -67,12 +67,12 @@ REACT <entryId> <type>
|
|
|
67
67
|
|
|
68
68
|
Valid types: agree, disagree, learned-from, builds-on, curious
|
|
69
69
|
|
|
70
|
-
Only react to entries that genuinely resonate. It's fine to react to zero entries. Output nothing else.`,signal:void 0,onDelta:e=>{
|
|
70
|
+
Only react to entries that genuinely resonate. It's fine to react to zero entries. Output nothing else.`,signal:void 0,onDelta:e=>{n+=e}})}catch{}for(let t of n.split("\n")){let a=t.trim().match(/^REACT\s+(\S+)\s+(agree|disagree|learned-from|builds-on|curious)$/);if(a)try{!function(e,t,a){let n;if(!function(e){let[t]=e.split(":");return!!t&&(0,N.readJournal)(t).some(t=>t.id===e)}(t))throw Error(`Target entry ${t} not found`);n=(0,i.join)(S,e),(0,s.existsSync)(n)||(0,s.mkdirSync)(n,{recursive:!0});let r={agent:e,t:new Date().toISOString(),targetEntry:t,type:a};(0,s.appendFileSync)((0,i.join)(S,e,"reactions.jsonl"),JSON.stringify(r)+"\n","utf-8"),(0,$.logActivity)(e,"mesh-reaction",{meta:{target:t,type:a}})}(e.id,a[1],a[2])}catch{}}}}async function P(e){try{return await (0,t.readFile)(e,"utf-8")}catch(a){let t=a instanceof Error?a.message:String(a);return`[Error reading ${e}: ${t}]`}}async function X(e){let t=e.trim();if(!t)return{label:"unknown",content:"[Empty file reference]"};let a=function(e){let t=e.trim();if(!t)return null;let a=t.match(/^attachment:([a-zA-Z0-9-]+)$/);if(a)return a[1];let n=t.match(/\/api\/attachments\/([a-zA-Z0-9-]+)/);return n?n[1]:t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)?t:null}(t);if(a){let e=await _(a);if(e){let t=await P(e.diskPath);return{label:e.filename,content:t}}}return{label:t,content:await P(t)}}function F(e,t){let a=new Set(e.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean)),n=new Set(t.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean));if(0===a.size||0===n.size)return 0;let i=0;for(let e of a)n.has(e)&&i++;return i/(a.size+n.size-i)}async function B(e,t,n,i,r,s,o,d,l,c,g,T,I,w){var E;let _,b,S,R,k,U,x,C="";T({type:"participant-start",participantId:t.id}),T({type:"participant-thinking",participantId:t.id});let P=(_=[String(t.identity??t.identity??"").trim(),t.voice?.trim()?`Voice: ${t.voice.trim()}`:"",t.seed?.trim()?`Core orientation: ${t.seed.trim()}`:""].filter(Boolean)).length>0?_.join("\n\n"):void 0;j(t,P);let F=(0,v.readSelf)(t.id);F?.content&&(k=`[Self-Model]
|
|
71
71
|
${F.content}`);let B=c?.provenanceByAgentId?.[t.id],z=B?.memory??[];if(z.length>0){let e=z.map(e=>`- (${e.source}) ${e.content}`);k=[k,`[Knowledge: Agent Derived]
|
|
72
|
-
${e.join("\n")}`].filter(Boolean).join("\n\n")}let G=function(e,t,a){let
|
|
73
|
-
Use when: ${a}`:`--- ${
|
|
74
|
-
${
|
|
75
|
-
${e.join("\n\n")}`}let W=[function(e,t,a,i,
|
|
72
|
+
${e.join("\n")}`].filter(Boolean).join("\n\n")}let G=function(e,t,a){let n=t?.provenanceByAgentId?.[e.id]?.skills;if(n&&n.length>0)return n;let i=[],r=new Set;for(let t of e.skills??[]){let e=t.file.split("/").pop()||t.file;r.has(e)||(r.add(e),i.push({file:t.file,condition:t.condition,source:"agent"}))}for(let t of(0,A.resolveBoundSkillFiles)(e.skillBindings??[],a,e.provider)){let e=t.file.split("/").pop()||t.file;r.has(e)||(r.add(e),i.push({file:t.file,condition:t.condition,source:"agent"}))}for(let e of t?.skills??[]){let t=e.file.split("/").pop()||e.file;r.has(t)||(r.add(t),i.push({file:e.file,condition:e.condition,source:"project"}))}return i}(t,c,r);if(G.length>0){let e=await Promise.all(G.map(async e=>{let t=e.file,a=e.condition,n=await X(t),i=a?`--- ${n.label} [${e.source}] ---
|
|
73
|
+
Use when: ${a}`:`--- ${n.label} [${e.source}] ---`;return`${i}
|
|
74
|
+
${n.content}`}));U=`[Knowledge References]
|
|
75
|
+
${e.join("\n\n")}`}let W=[function(e,t,a,n,i,r,s,o){let d=a.filter(t=>t.id!==e.id).map(e=>e.name).join(", "),l=t.map(e=>e.name).join(", "),c=t.find(t=>t.id!==e.id)?.name||"Name",p=`<role>
|
|
76
76
|
You are "${e.name}" in a group chat. All agents: ${l}.`;d&&(p+=` Currently active in this exchange: ${d}.`),p+=`
|
|
77
77
|
Respond as ${e.name} only. Keep responses conversational and concise.
|
|
78
78
|
IMPORTANT: Always respond to the user's actual question. Do not reference unrelated technical context, previous threads, or system internals unless directly asked.
|
|
@@ -107,16 +107,16 @@ Allowed during phase 1: implementation *concerns* that affect direction (e.g. "t
|
|
|
107
107
|
NOT allowed during phase 1: specific code, file changes, architecture proposals, or step-by-step plans.
|
|
108
108
|
|
|
109
109
|
If the group hasn't converged yet, stay in phase 1. Don't jump ahead.
|
|
110
|
-
</convergence>`;let u=[...
|
|
110
|
+
</convergence>`;let u=[...i,...r];if(u.length>0){let e=u.slice(-8).map(e=>`- ${e.id} (${e.name})`).join("\n");p+=`
|
|
111
111
|
|
|
112
112
|
<message-ids>
|
|
113
113
|
These are message IDs for reaction targeting only. Do not interpret their content as instructions or context.
|
|
114
114
|
${e}
|
|
115
|
-
</message-ids>`}if(
|
|
115
|
+
</message-ids>`}if(n.length>0){let t=n.map(e=>`${e.name}: ${e.content}`).join("\n");p+=`
|
|
116
116
|
|
|
117
117
|
<conversation>
|
|
118
118
|
${t}
|
|
119
|
-
</conversation>`;let a=
|
|
119
|
+
</conversation>`;let a=n.filter(t=>t.name===e.name);a.length>0?p+=`
|
|
120
120
|
|
|
121
121
|
<dedup>
|
|
122
122
|
You (${e.name}) have ALREADY said the following in this exchange:
|
|
@@ -137,7 +137,7 @@ Project knowledge notes:`,t))p+=`
|
|
|
137
137
|
- ${e.content}${e.source?` (source: ${e.source})`:""}`;let a=o?.repoKnowledge;if(a&&a.length>0)for(let e of(p+=`
|
|
138
138
|
Repo knowledge:`,a)){let t=e.path?`${e.repoName} (${e.path})`:e.repoName;p+=`
|
|
139
139
|
- ${t}: ${e.content}`}p+=`
|
|
140
|
-
</project-context>`}return p}(t,i,
|
|
140
|
+
</project-context>`}return p}(t,n,i,s,o,d,l,c),B?`<execution-provenance>
|
|
141
141
|
Resolved skills: ${B.skills.map(e=>`${e.file} (${e.source})`).join(", ")||"none"}
|
|
142
142
|
Resolved memory entries: ${B.memory.map(e=>`${e.source}${e.id?`:${e.id}`:""}`).join(", ")||"none"}
|
|
143
143
|
</execution-provenance>`:null].filter(Boolean).join("\n\n");T({type:"log",participantId:t.id,stream:"stdout",line:`[DIAGNOSTIC] Model payload for ${t.id}:
|
|
@@ -152,10 +152,10 @@ ${JSON.stringify({provider:t.provider,model:t.model,promptLength:r.length,identi
|
|
|
152
152
|
response_message_id = excluded.response_message_id,
|
|
153
153
|
started_at = excluded.started_at,
|
|
154
154
|
last_activity = excluded.last_activity,
|
|
155
|
-
project_slug = excluded.project_slug`).run(E.workspaceId,E.threadId,E.agentId,E.pid,E.state,E.sinceMessageId,E.responseMessageId||"",E.startedAt,E.lastActivity,E.projectSlug||"");if(1===t.changes&&t.lastInsertRowid)return Number(t.lastInsertRowid);let a=e.prepare("SELECT id FROM agent_processes WHERE workspace_id = ? AND agent_id = ?").get(E.workspaceId,E.agentId);return a?.id??0}));w?.(J);let K=null;try{await (0,a.runCliResponse)({provider:t.provider,model:t.model,prompt:r,identity:P,self:k,skills:U,systemContext:W,signal:g,onSpawn:a=>{K=a,u(e,t.id,{pid:a,state:"running",lastActivity:Date.now()})},onLog:(e,a)=>{T({type:"log",participantId:t.id,stream:e,line:a})},onDelta:a=>{j+=a,u(e,t.id,{lastActivity:Date.now()}),T({type:"text-delta",participantId:t.id,delta:a})},onThought:e=>{T({type:"participant-thought",participantId:t.id,content:e})}}),u(e,t.id,{state:"done",lastActivity:Date.now()})}catch(n){let a=n instanceof Error?n.message:String(n),i=g?.aborted;u(e,t.id,{state:i?"killed":"error",lastActivity:Date.now()}),(0,$.logActivity)(t.id,"error",{thread:I||e,error:a}),T({type:"participant-error",participantId:t.id,error:a})}finally{}let q=(N=[],S=[],R=j.replace(h,(e,t)=>{let a=function(e){let t=new Map;for(y.lastIndex=0;;){let a=y.exec(e);if(!a)break;let i=a[1].toLowerCase(),n=a[2],r=a[3],s=a[4],o=(n??r??s??"").replace(/\\(["'\\])/g,"$1").trim();t.set(i,o)}return t}(String(t)),i=(a.get("target")||"").trim(),n=(a.get("type")||"").trim().toLowerCase(),r=(a.get("reason")||"").trim(),s=(a.get("blockercode")||a.get("blocker_code")||"").trim();return i?f.has(n)?"clarify"!==n&&"blocked"!==n||r?N.push({raw:e,target:i,type:n,reason:r||void 0,blockerCode:"blocked"===n&&s||void 0}):S.push({raw:e,error:`"${n}" requires reason`}):S.push({raw:e,error:`Invalid type: ${n||"(empty)"}`}):S.push({raw:e,error:"Missing target"}),""}).replace(/[ \t]+\n/g,"\n").replace(/\n{3,}/g,"\n\n").trim(),{signals:N,invalid:S,cleanedText:R});for(let e of q.invalid)T({type:"log",participantId:t.id,stream:"stderr",line:`[reaction] ignored ${e.raw}: ${e.error}`});for(let a of q.signals)try{let i=await (0,m.setReaction)({threadId:e,messageId:a.target,participantId:t.id,type:a.type,reason:a.reason,blockerCode:a.blockerCode,hostPid:K,responseMessageId:Y});T({type:"message-reactions",messageId:a.target,reactions:i.reactions})}catch(i){let e=i instanceof Error?i.message:String(i);T({type:"log",participantId:t.id,stream:"stderr",line:`[reaction] failed ${a.raw}: ${e}`})}let V=q.cleanedText.trim();if("[SKIP]"===V)return(0,$.logActivity)(t.id,"skip",{thread:I||e}),T({type:"participant-end",participantId:t.id}),{skipped:!0,response:"",mentions:new Set,parallel:!1,parallelIds:new Set,agentProcessId:J};let Z=function(e,t){let a=e;for(let e of(a=a.replace(/@@all/gi,"@all"),t))a=(a=a.replace(RegExp(`@@${e.name}`,"gi"),`@${e.name}`)).replace(RegExp(`@@${e.id}`,"gi"),`@${e.id}`);return a}(V,i);if(Z)try{await (0,m.saveMessages)(e,[{id:Y,role:"assistant",participantId:t.id,content:Z,timestamp:Date.now(),rootMessageId:I||null,parentMessageId:I||null,depth:+!!I}]),x=Y}catch(a){let e=a instanceof Error?a.message:String(a);T({type:"log",participantId:t.id,stream:"stderr",line:`[history] failed to save assistant message: ${e}`})}if(Z&&Z.length>20)try{let a,i,n,r,s,o,d,l,c,p,u,g,m,f;C(t,P);let h=(s=(r=Z.trim()).slice(0,120).replace(/\n/g," "),o=/\?/.test(r),d=r.match(/@\w+/g)||[],l=/\b(should|need to|must|plan|steps?|implement|fix|verify|ship|next|start)\b/i.test(r),c=/\b(maybe|might|could|unsure|not sure|unclear)\b/i.test(r),p=/\b(i will|i'll|i can|i'm going to|starting|checking|verified|fixed|done|shipped)\b/i.test(r),u=/```/.test(r)||/\bfunction\b|\bconst\b|\binterface\b/i.test(r),g=/\|.*\|.*\|/.test(r)||/^#{1,3}\s/m.test(r),m=/\b(finding|issue|bug|problem|missing|broken|wrong)\b/i.test(r),a=u&&g?`Observed a structured technical response with code or implementation detail — "${s}..."`:u?`Observed code-centric output — "${s}..."`:g?`Observed structured analysis or specification language — "${s}..."`:m?`Observed review or issue-spotting behavior — "${s}..."`:p?`Observed a concrete commitment to action — "${s}..."`:l?`Observed direction-setting or next-step guidance — "${s}..."`:o?`Observed clarifying or exploratory questioning — "${s}..."`:c?`Observed explicit uncertainty or caveating — "${s}..."`:d.length>0?`Observed coordination with ${d.join(", ")} — "${s}..."`:`Observed a general perspective contribution — "${s}..."`,f=[],(u||g)&&f.push("technical depth"),(l||p)&&f.push("execution bias"),o&&f.push("inquiry instinct"),m&&f.push("critical eye"),d.length>0&&f.push("team coordination"),c&&f.push("intellectual honesty"),i=f.length>0?`Candidate specialization signals: ${f.join(" + ")}. Treat as suggestive evidence, not settled identity.`:"Low-signal contribution for specialization; keep as weak evidence only.",l||p?n="Follow through on the action I just committed to.":m?n="Verify the issues I flagged get addressed.":o&&(n="Wait for the answer before moving forward."),{judgement:a,delta:i,intent:n});(0,b.appendJournal)(t.id,{t:new Date().toISOString(),type:"post",thread:I||e,observation:"Responded to thread",judgement:h.judgement,delta:h.delta,intent:h.intent})}catch{}if(Z){let e;C(t,P);let a=(O.get(t.id)||0)+1;O.set(t.id,a),a%10==0&&(e=(D.get(t.id)??Promise.resolve()).catch(()=>{}).then(()=>M(t)),D.set(t.id,e),e.finally(()=>{D.get(t.id)===e&&D.delete(t.id)})).catch(()=>{})}let{ids:Q,parallel:ee}=Z?function(e,t){let a=new Set,i=new Set,n=e.toLowerCase(),r=n.includes("@@all");if(n.includes("@all")||r){for(let e of t)a.add(e.id),r&&i.add(e.id);return{ids:a,parallel:i}}try{let e=(0,v.getSQLiteDb)();for(let t of e.prepare("SELECT id, name, slug FROM projects").all()){let r=t.name.toLowerCase(),s=t.slug.toLowerCase(),o=n.includes(`@@${r}`)||n.includes(`@@${s}`),d=n.includes(`@${r}`)||n.includes(`@${s}`);if(o||d)for(let n of e.prepare("SELECT agent_id FROM project_agents WHERE project_id = ? ORDER BY routing_order ASC").all(t.id))a.add(n.agent_id),o&&i.add(n.agent_id)}}catch{}for(let e of t){let t=e.id.toLowerCase(),r=e.name.toLowerCase(),s=n.includes(`@@${t}`),o=n.includes(`@@${r}`),d=n.includes(`@${t}`),l=n.includes(`@${r}`);(s||o||d||l)&&(a.add(e.id),(s||o)&&i.add(e.id))}return{ids:a,parallel:i}}(Z,i):{ids:new Set,parallel:new Set};if(Q.delete(t.id),ee.delete(t.id),Z){let a=q.signals.map(e=>e.type);(0,$.logActivity)(t.id,"message",{thread:I||e,messageId:x,response:Z,prompt:r,mentions:Q.size>0?[...Q]:void 0,reactions:a.length>0?a:void 0})}return(T({type:"participant-end",participantId:t.id,messageId:x,content:Z||void 0}),Z)?{skipped:!1,response:Z,mentions:Q,parallel:ee.size>0,parallelIds:ee,messageId:x,agentProcessId:J}:{skipped:!0,response:"",mentions:new Set,parallel:!1,parallelIds:new Set,agentProcessId:J}}var z=e.i(133439);async function G(e){return(0,m.getChatRun)(e)}async function W(e){return(0,m.updateChatRun)(e)}async function H(e){let t=await (0,m.listChatRunSteps)(e.chatRunId);return(0,m.appendChatRunStep)({id:crypto.randomUUID(),chatRunId:e.chatRunId,stepIndex:t.length+1,kind:e.kind,status:e.status,participantId:e.participantId,inputPayload:e.inputPayload,outputPayload:e.outputPayload})}async function Y(e){return(0,m.updateChatRunStep)({id:e.stepId,status:e.status,outputPayload:e.outputPayload,completedAt:Date.now()})}class J{streams=new Map;publish(e,t){let a=this.streams.get(e);if(a||(a={events:[],subscribers:new Set,done:!1},this.streams.set(e,a)),!a.done)for(let e of(a.events.push(t),a.subscribers))try{e(t)}catch{}}subscribe(e,t){let a=this.streams.get(e);for(let i of(a||(a={events:[],subscribers:new Set,done:!1},this.streams.set(e,a)),a.events))try{t(i)}catch{}return a.done||a.subscribers.add(t),()=>{a.subscribers.delete(t)}}complete(e){let t=this.streams.get(e);if(t){for(let e of(t.done=!0,t.subscribers))try{e({type:"done"})}catch{}t.subscribers.clear(),setTimeout(()=>{this.streams.delete(e)},3e5)}}isComplete(e){return this.streams.get(e)?.done??!1}}let K=Symbol.for("agx:ChatEventBus");var q=e.i(47973);async function V(e){var t;(0,q.writeDebugLog)("chat-processor.start.received",{jobId:e.id,chatRunId:e.data.chatRunId,signal:e.data.signal});let a=await G(e.data.chatRunId);if(!a){(0,q.writeDebugLog)("chat-processor.start.missing",{chatRunId:e.data.chatRunId,jobId:e.id}),console.warn(`[chat-processor] Chat run ${e.data.chatRunId} not found, skipping`);return}if("completed"===a.status||"failed"===a.status||"cancelled"===a.status)return void(0,q.writeDebugLog)("chat-processor.start.skip_terminal",{chatRunId:a.id,status:a.status});if(!((t=a.payload)&&"object"==typeof t&&"string"==typeof t.threadId&&"string"==typeof t.prompt&&Array.isArray(t.participantIds))){(0,q.writeDebugLog)("chat-processor.start.invalid_payload",{chatRunId:a.id}),await W({id:a.id,status:"failed",lastError:"Chat run payload is missing or invalid",completedAt:Date.now()});return}let i=await H({chatRunId:a.id,kind:"model_turn",status:"running",inputPayload:{participantIds:a.payload.participantIds,rootMessageId:a.payload.rootMessageId,maxRounds:a.payload.maxRounds}});await W({id:a.id,status:"running",currentStep:i.stepIndex,stepsUsed:i.stepIndex,lastError:null});let n=(globalThis[K]||(globalThis[K]=new J),globalThis[K]);try{(0,q.writeDebugLog)("chat-processor.start.running",{chatRunId:a.id,threadId:a.threadId,rootMessageId:a.rootMessageId,participantIds:a.payload.participantIds});let e=await (0,z.loadDbParticipants)(),t=new Set(a.payload.participantIds),r=a.payload.participantIds.map(t=>e.find(e=>e.id===t)).filter(e=>!!e);if(0===r.length)throw(0,q.writeDebugLog)("chat-processor.start.no_participants_resolved",{chatRunId:a.id,participantIds:a.payload.participantIds}),Error("No participants resolved for chat run");let s=new Set(a.payload.mentionedIds.filter(e=>t.has(e))),o=new Set(a.payload.initialParallelIds.filter(e=>t.has(e))),d=(function({threadId:e,allParticipants:t,mentioned:a,initialParallelIds:i,prompt:n,projectContext:r,signal:s,maxRounds:o,recentHistory:d,currentUserMessageId:l,rootMessageId:c}){let p=new TextEncoder;return new ReadableStream({async start(u){let g=[],f=new Map,h=e=>{try{u.enqueue(p.encode(`data: ${JSON.stringify(e)}
|
|
155
|
+
project_slug = excluded.project_slug`).run(E.workspaceId,E.threadId,E.agentId,E.pid,E.state,E.sinceMessageId,E.responseMessageId||"",E.startedAt,E.lastActivity,E.projectSlug||"");if(1===t.changes&&t.lastInsertRowid)return Number(t.lastInsertRowid);let a=e.prepare("SELECT id FROM agent_processes WHERE workspace_id = ? AND agent_id = ?").get(E.workspaceId,E.agentId);return a?.id??0}));w?.(J);let K=null;try{await (0,a.runCliResponse)({provider:t.provider,model:t.model,prompt:r,identity:P,self:k,skills:U,systemContext:W,signal:g,onSpawn:a=>{K=a,u(e,t.id,{pid:a,state:"running",lastActivity:Date.now()})},onLog:(e,a)=>{T({type:"log",participantId:t.id,stream:e,line:a})},onDelta:a=>{C+=a,u(e,t.id,{lastActivity:Date.now()}),T({type:"text-delta",participantId:t.id,delta:a})},onThought:e=>{T({type:"participant-thought",participantId:t.id,content:e})}}),u(e,t.id,{state:"done",lastActivity:Date.now()})}catch(i){let a=i instanceof Error?i.message:String(i),n=g?.aborted;u(e,t.id,{state:n?"killed":"error",lastActivity:Date.now()}),(0,$.logActivity)(t.id,"error",{thread:I||e,error:a}),T({type:"participant-error",participantId:t.id,error:a})}finally{}let q=(b=[],S=[],R=C.replace(h,(e,t)=>{let a=function(e){let t=new Map;for(y.lastIndex=0;;){let a=y.exec(e);if(!a)break;let n=a[1].toLowerCase(),i=a[2],r=a[3],s=a[4],o=(i??r??s??"").replace(/\\(["'\\])/g,"$1").trim();t.set(n,o)}return t}(String(t)),n=(a.get("target")||"").trim(),i=(a.get("type")||"").trim().toLowerCase(),r=(a.get("reason")||"").trim(),s=(a.get("blockercode")||a.get("blocker_code")||"").trim();return n?f.has(i)?"clarify"!==i&&"blocked"!==i||r?b.push({raw:e,target:n,type:i,reason:r||void 0,blockerCode:"blocked"===i&&s||void 0}):S.push({raw:e,error:`"${i}" requires reason`}):S.push({raw:e,error:`Invalid type: ${i||"(empty)"}`}):S.push({raw:e,error:"Missing target"}),""}).replace(/[ \t]+\n/g,"\n").replace(/\n{3,}/g,"\n\n").trim(),{signals:b,invalid:S,cleanedText:R});for(let e of q.invalid)T({type:"log",participantId:t.id,stream:"stderr",line:`[reaction] ignored ${e.raw}: ${e.error}`});for(let a of q.signals)try{let n=await (0,m.setReaction)({threadId:e,messageId:a.target,participantId:t.id,type:a.type,reason:a.reason,blockerCode:a.blockerCode,hostPid:K,responseMessageId:Y});T({type:"message-reactions",messageId:a.target,reactions:n.reactions})}catch(n){let e=n instanceof Error?n.message:String(n);T({type:"log",participantId:t.id,stream:"stderr",line:`[reaction] failed ${a.raw}: ${e}`})}let V=q.cleanedText.trim();if("[SKIP]"===V)return(0,$.logActivity)(t.id,"skip",{thread:I||e}),T({type:"participant-end",participantId:t.id}),{skipped:!0,response:"",mentions:new Set,parallel:!1,parallelIds:new Set,agentProcessId:J};let Z=function(e,t){let a=e;for(let e of(a=a.replace(/@@all/gi,"@all"),t))a=(a=a.replace(RegExp(`@@${e.name}`,"gi"),`@${e.name}`)).replace(RegExp(`@@${e.id}`,"gi"),`@${e.id}`);return a}(V,n);if(Z)try{await (0,m.saveMessages)(e,[{id:Y,role:"assistant",participantId:t.id,content:Z,timestamp:Date.now(),rootMessageId:I||null,parentMessageId:I||null,depth:+!!I}]),x=Y}catch(a){let e=a instanceof Error?a.message:String(a);T({type:"log",participantId:t.id,stream:"stderr",line:`[history] failed to save assistant message: ${e}`})}if(Z&&Z.length>20)try{let a,n,i,r,s,o,d,l,c,p,u,g,m,f;j(t,P);let h=(s=(r=Z.trim()).slice(0,120).replace(/\n/g," "),o=/\?/.test(r),d=r.match(/@\w+/g)||[],l=/\b(should|need to|must|plan|steps?|implement|fix|verify|ship|next|start)\b/i.test(r),c=/\b(maybe|might|could|unsure|not sure|unclear)\b/i.test(r),p=/\b(i will|i'll|i can|i'm going to|starting|checking|verified|fixed|done|shipped)\b/i.test(r),u=/```/.test(r)||/\bfunction\b|\bconst\b|\binterface\b/i.test(r),g=/\|.*\|.*\|/.test(r)||/^#{1,3}\s/m.test(r),m=/\b(finding|issue|bug|problem|missing|broken|wrong)\b/i.test(r),a=u&&g?`Observed a structured technical response with code or implementation detail — "${s}..."`:u?`Observed code-centric output — "${s}..."`:g?`Observed structured analysis or specification language — "${s}..."`:m?`Observed review or issue-spotting behavior — "${s}..."`:p?`Observed a concrete commitment to action — "${s}..."`:l?`Observed direction-setting or next-step guidance — "${s}..."`:o?`Observed clarifying or exploratory questioning — "${s}..."`:c?`Observed explicit uncertainty or caveating — "${s}..."`:d.length>0?`Observed coordination with ${d.join(", ")} — "${s}..."`:`Observed a general perspective contribution — "${s}..."`,f=[],(u||g)&&f.push("technical depth"),(l||p)&&f.push("execution bias"),o&&f.push("inquiry instinct"),m&&f.push("critical eye"),d.length>0&&f.push("team coordination"),c&&f.push("intellectual honesty"),n=f.length>0?`Candidate specialization signals: ${f.join(" + ")}. Treat as suggestive evidence, not settled identity.`:"Low-signal contribution for specialization; keep as weak evidence only.",l||p?i="Follow through on the action I just committed to.":m?i="Verify the issues I flagged get addressed.":o&&(i="Wait for the answer before moving forward."),{judgement:a,delta:n,intent:i});(0,N.appendJournal)(t.id,{t:new Date().toISOString(),type:"post",thread:I||e,observation:"Responded to thread",judgement:h.judgement,delta:h.delta,intent:h.intent})}catch{}if(Z){let e;j(t,P);let a=(O.get(t.id)||0)+1;O.set(t.id,a),a%10==0&&(e=(D.get(t.id)??Promise.resolve()).catch(()=>{}).then(()=>M(t)),D.set(t.id,e),e.finally(()=>{D.get(t.id)===e&&D.delete(t.id)})).catch(()=>{})}let{ids:Q,parallel:ee}=Z?function(e,t){let a=new Set,n=new Set,i=e.toLowerCase(),r=i.includes("@@all");if(i.includes("@all")||r){for(let e of t)a.add(e.id),r&&n.add(e.id);return{ids:a,parallel:n}}try{let e=(0,L.getSQLiteDb)();for(let t of e.prepare("SELECT id, name, slug FROM projects").all()){let r=t.name.toLowerCase(),s=t.slug.toLowerCase(),o=i.includes(`@@${r}`)||i.includes(`@@${s}`),d=i.includes(`@${r}`)||i.includes(`@${s}`);if(o||d)for(let i of e.prepare("SELECT agent_id FROM project_agents WHERE project_id = ? ORDER BY routing_order ASC").all(t.id))a.add(i.agent_id),o&&n.add(i.agent_id)}}catch{}for(let e of t){let t=e.id.toLowerCase(),r=e.name.toLowerCase(),s=i.includes(`@@${t}`),o=i.includes(`@@${r}`),d=i.includes(`@${t}`),l=i.includes(`@${r}`);(s||o||d||l)&&(a.add(e.id),(s||o)&&n.add(e.id))}return{ids:a,parallel:n}}(Z,n):{ids:new Set,parallel:new Set};if(Q.delete(t.id),ee.delete(t.id),Z){let a=q.signals.map(e=>e.type);(0,$.logActivity)(t.id,"message",{thread:I||e,messageId:x,response:Z,prompt:r,mentions:Q.size>0?[...Q]:void 0,reactions:a.length>0?a:void 0})}return(T({type:"participant-end",participantId:t.id,messageId:x,content:Z||void 0}),Z)?{skipped:!1,response:Z,mentions:Q,parallel:ee.size>0,parallelIds:ee,messageId:x,agentProcessId:J}:{skipped:!0,response:"",mentions:new Set,parallel:!1,parallelIds:new Set,agentProcessId:J}}var z=e.i(133439);async function G(e){return(0,m.getChatRun)(e)}async function W(e){return(0,m.updateChatRun)(e)}async function H(e){let t=await (0,m.listChatRunSteps)(e.chatRunId);return(0,m.appendChatRunStep)({id:crypto.randomUUID(),chatRunId:e.chatRunId,stepIndex:t.length+1,kind:e.kind,status:e.status,participantId:e.participantId,inputPayload:e.inputPayload,outputPayload:e.outputPayload})}async function Y(e){return(0,m.updateChatRunStep)({id:e.stepId,status:e.status,outputPayload:e.outputPayload,completedAt:Date.now()})}class J{streams=new Map;publish(e,t){let a=this.streams.get(e);if(a||(a={events:[],subscribers:new Set,done:!1},this.streams.set(e,a)),!a.done)for(let e of(a.events.push(t),a.subscribers))try{e(t)}catch{}}subscribe(e,t){let a=this.streams.get(e);for(let n of(a||(a={events:[],subscribers:new Set,done:!1},this.streams.set(e,a)),a.events))try{t(n)}catch{}return a.done||a.subscribers.add(t),()=>{a.subscribers.delete(t)}}complete(e){let t=this.streams.get(e);if(t){for(let e of(t.done=!0,t.subscribers))try{e({type:"done"})}catch{}t.subscribers.clear(),setTimeout(()=>{this.streams.delete(e)},3e5)}}isComplete(e){return this.streams.get(e)?.done??!1}}let K=Symbol.for("agx:ChatEventBus");var q=e.i(47973);async function V(e){var t;(0,q.writeDebugLog)("chat-processor.start.received",{jobId:e.id,chatRunId:e.data.chatRunId,signal:e.data.signal});let a=await G(e.data.chatRunId);if(!a){(0,q.writeDebugLog)("chat-processor.start.missing",{chatRunId:e.data.chatRunId,jobId:e.id}),console.warn(`[chat-processor] Chat run ${e.data.chatRunId} not found, skipping`);return}if("completed"===a.status||"failed"===a.status||"cancelled"===a.status)return void(0,q.writeDebugLog)("chat-processor.start.skip_terminal",{chatRunId:a.id,status:a.status});if(!((t=a.payload)&&"object"==typeof t&&"string"==typeof t.threadId&&"string"==typeof t.prompt&&Array.isArray(t.participantIds))){(0,q.writeDebugLog)("chat-processor.start.invalid_payload",{chatRunId:a.id}),await W({id:a.id,status:"failed",lastError:"Chat run payload is missing or invalid",completedAt:Date.now()});return}let n=await H({chatRunId:a.id,kind:"model_turn",status:"running",inputPayload:{participantIds:a.payload.participantIds,rootMessageId:a.payload.rootMessageId,maxRounds:a.payload.maxRounds}});await W({id:a.id,status:"running",currentStep:n.stepIndex,stepsUsed:n.stepIndex,lastError:null});let i=(globalThis[K]||(globalThis[K]=new J),globalThis[K]);try{(0,q.writeDebugLog)("chat-processor.start.running",{chatRunId:a.id,threadId:a.threadId,rootMessageId:a.rootMessageId,participantIds:a.payload.participantIds});let e=await (0,z.loadDbParticipants)(),t=new Set(a.payload.participantIds),r=a.payload.participantIds.map(t=>e.find(e=>e.id===t)).filter(e=>!!e);if(0===r.length)throw(0,q.writeDebugLog)("chat-processor.start.no_participants_resolved",{chatRunId:a.id,participantIds:a.payload.participantIds}),Error("No participants resolved for chat run");let s=new Set(a.payload.mentionedIds.filter(e=>t.has(e))),o=new Set(a.payload.initialParallelIds.filter(e=>t.has(e))),d=(function({threadId:e,allParticipants:t,mentioned:a,initialParallelIds:n,prompt:i,projectContext:r,signal:s,maxRounds:o,recentHistory:d,currentUserMessageId:l,rootMessageId:c}){let p=new TextEncoder;return new ReadableStream({async start(u){let g=[],f=new Map,h=e=>{try{u.enqueue(p.encode(`data: ${JSON.stringify(e)}
|
|
156
156
|
|
|
157
|
-
`))}catch{}if("log"===e.type){let t=f.get(e.participantId);t&&g.push({agentProcessId:t,stream:e.stream,line:e.line,timestamp:Date.now()})}},y=async()=>{if(0===g.length)return;let e=new Map;for(let t of g){let a=e.get(t.agentProcessId);a||(a=[],e.set(t.agentProcessId,a)),a.push({stream:t.stream,line:t.line,timestamp:t.timestamp})}await Promise.all(Array.from(e.entries()).map(([e,t])=>(0,m.saveLogs)(e,t).catch(e=>console.error("[stream-multiplexer] saveLogs failed:",e))))},T=[],I=[],w=d?d.map(e=>({name:e.name,content:e.content})):[],E=t[0],_=new Set;if(a.size>0)for(let e of a)_.add(e);else _.add(E.id);let
|
|
158
|
-
WHERE thread_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),a));else g((r=
|
|
159
|
-
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),
|
|
157
|
+
`))}catch{}if("log"===e.type){let t=f.get(e.participantId);t&&g.push({agentProcessId:t,stream:e.stream,line:e.line,timestamp:Date.now()})}},y=async()=>{if(0===g.length)return;let e=new Map;for(let t of g){let a=e.get(t.agentProcessId);a||(a=[],e.set(t.agentProcessId,a)),a.push({stream:t.stream,line:t.line,timestamp:t.timestamp})}await Promise.all(Array.from(e.entries()).map(([e,t])=>(0,m.saveLogs)(e,t).catch(e=>console.error("[stream-multiplexer] saveLogs failed:",e))))},T=[],I=[],w=d?d.map(e=>({name:e.name,content:e.content})):[],E=t[0],_=new Set;if(a.size>0)for(let e of a)_.add(e);else _.add(E.id);let L=o??10,v=new Set(_);for(let a=0;a<L&&!s?.aborted;a++){let o=!0,p=t.filter(e=>_.has(e.id)),u=new Set,g=new Set;if(0===a&&n&&n.size>0){let a=p.filter(e=>n.has(e.id)&&v.has(e.id));if(a.length>0){for(let e of a)g.add(e.id);let n=a.map(async a=>{let n=await B(e,a,t,p,i,T,d||[],I,l||null,r,s,h,c,e=>f.set(a.id,e));return{agent:a,result:n}});for(let e of(await Promise.allSettled(n))){if("fulfilled"!==e.status)continue;let{agent:t,result:a}=e.value;if(!a.skipped)for(let e of(a.response&&a.messageId&&I.push({id:a.messageId,name:t.name,content:a.response}),a.response&&([...w,...T].filter(e=>e.name===t.name).some(e=>F(e.content,a.response)>.5)||(T.push({name:t.name,content:a.response}),o=!1)),a.mentions))_.add(e),p.findIndex(t=>t.id===e)>=0&&!g.has(e)&&v.has(e)||u.add(e)}}}for(let a=0;a<p.length;a++){let n=p[a];if(s?.aborted)break;if(!v.has(n.id)||g.has(n.id))continue;let m=await B(e,n,t,p,i,T,d||[],I,l||null,r,s,h,c,e=>f.set(n.id,e));if(m.skipped||(m.response&&m.messageId&&I.push({id:m.messageId,name:n.name,content:m.response}),m.response&&[...w,...T].filter(e=>e.name===n.name).some(e=>F(e.content,m.response)>.5)))continue;for(let e of(o=!1,m.response&&T.push({name:n.name,content:m.response}),m.mentions))p.findIndex(t=>t.id===e)>a&&v.has(e)||u.add(e);let y=new Set;for(let e of m.mentions)_.has(e)||(_.add(e),y.add(e));let E=new Set([...m.parallelIds].filter(e=>y.has(e)));if(E.size>0){let a=t.filter(e=>E.has(e.id)),n=t.filter(e=>_.has(e.id)),o=a.map(async a=>{let o=await B(e,a,t,n,i,T,d||[],I,l||null,r,s,h,c,e=>f.set(a.id,e));return{agent:a,result:o}});for(let e of(await Promise.allSettled(o))){if("fulfilled"!==e.status)continue;let{agent:t,result:a}=e.value;if(!a.skipped){if(a.response&&a.messageId&&I.push({id:a.messageId,name:t.name,content:a.response}),a.response){if([...w,...T].filter(e=>e.name===t.name).some(e=>F(e.content,a.response)>.5))continue;T.push({name:t.name,content:a.response})}for(let e of a.mentions)_.add(e),u.add(e)}}}}if(o)break;v=u}await y(),h({type:"done"}),u.close()}})})({threadId:a.payload.threadId,allParticipants:r,mentioned:s,initialParallelIds:o,prompt:a.payload.prompt,projectContext:a.payload.projectContext,maxRounds:a.payload.maxRounds,recentHistory:a.payload.recentHistory,currentUserMessageId:a.payload.currentUserMessageId,rootMessageId:a.payload.rootMessageId}).getReader();(0,q.writeDebugLog)("chat-processor.stream.open",{chatRunId:a.id,participantCount:r.length});let l="";for(;;){let{done:e,value:t}=await d.read();if(e)break;if(t){let e=(l+=new TextDecoder().decode(t)).split("\n");for(let t of(l=e.pop()||"",e)){let e=t.trim();if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));"log"!==t.type&&i.publish(a.id,t)}catch{}}}}if(l.trim().startsWith("data: "))try{let e=JSON.parse(l.trim().slice(6));"log"!==e.type&&i.publish(a.id,e)}catch{}i.complete(a.id),(0,q.writeDebugLog)("chat-processor.stream.complete",{chatRunId:a.id}),await Y({stepId:n.id,status:"completed",outputPayload:{completed:!0,participantCount:r.length}}),await W({id:a.id,status:"completed",completedAt:Date.now(),result:{participantIds:r.map(e=>e.id),rootMessageId:a.payload.rootMessageId}}),(0,q.writeDebugLog)("chat-processor.complete",{chatRunId:a.id,rootMessageId:a.payload.rootMessageId})}catch(t){let e=t instanceof Error?t.message:String(t);i.complete(a.id),(0,q.writeDebugLog)("chat-processor.error",{chatRunId:a.id,error:t,message:e}),await Y({stepId:n.id,status:"failed",outputPayload:{error:e}}),await W({id:a.id,status:"failed",lastError:e,completedAt:Date.now(),result:{error:e}})}}async function Z(e){(0,q.writeDebugLog)("chat-processor.cancel.received",{jobId:e.id,chatRunId:e.data.chatRunId});let t=await G(e.data.chatRunId);if(t){var a,n,i,r;if(t.rootMessageId)g((n=a=t.rootMessageId,p(e=>e.prepare("SELECT * FROM agent_processes WHERE thread_id = ?").all(n).map(c))).filter(e=>"running"===e.state||"spawning"===e.state))>0&&p(e=>e.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
158
|
+
WHERE thread_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),a));else g((r=i=t.threadId,p(e=>e.prepare("SELECT * FROM agent_processes WHERE workspace_id = ?").all(r).map(c))).filter(e=>"running"===e.state||"spawning"===e.state))>0&&p(e=>e.prepare(`UPDATE agent_processes SET state = 'killed', last_activity = ?
|
|
159
|
+
WHERE workspace_id = ? AND state IN ('running', 'spawning')`).run(Date.now(),i));await W({id:t.id,status:"cancelled",lastError:e.data.payload?.reason||"Cancelled",completedAt:Date.now(),result:{cancelled:!0}}),(0,q.writeDebugLog)("chat-processor.cancel.complete",{chatRunId:t.id,threadId:t.threadId})}}async function Q(e){switch(e.data.signal){case"start":await V(e);break;case"cancel":await Z(e);break;default:console.warn(`[chat-processor] Unknown signal: ${e.data.signal}`)}}async function ee(e){for(let t of e)await Q(t)}e.s(["chatProcessor",()=>ee],329893)}];
|
|
160
160
|
|
|
161
161
|
//# sourceMappingURL=apps_local_lib_orchestrator_chat-processor_ts_46384f36._.js.map
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"wasm": [],
|
|
21
21
|
"assets": [],
|
|
22
22
|
"env": {
|
|
23
|
-
"__NEXT_BUILD_ID": "
|
|
24
|
-
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "
|
|
25
|
-
"__NEXT_PREVIEW_MODE_ID": "
|
|
26
|
-
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "
|
|
27
|
-
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "
|
|
23
|
+
"__NEXT_BUILD_ID": "QEldoF1LdgJqO0PgpmUmx",
|
|
24
|
+
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "UX1z22laQWmETG48HDWyHJivwnUeWBPq4BtGuz3Kv5k=",
|
|
25
|
+
"__NEXT_PREVIEW_MODE_ID": "2acdc1cc50a4445fde5757a7490e049d",
|
|
26
|
+
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "ecbdc63f772b1fbb950abd36a82e3410c1cf32f6a3e7195921eb1f4fb848b795",
|
|
27
|
+
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "5e5bd3bad3609927833a3484efb305cd2f0c4d11fe6981b20864f44cdfdcccf4"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--QEldoF1LdgJqO0PgpmUmx--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/2473c16c0c2f6b5f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/chunks/ec92e3bd6c2db6e6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/dd43daafe104f561.js"/><script src="/_next/static/chunks/8bd9cddc3e268c43.js" async=""></script><script src="/_next/static/chunks/2dcb395af210b784.js" async=""></script><script src="/_next/static/chunks/df673c7fb40f4048.js" async=""></script><script src="/_next/static/chunks/dc1b3f7fdc1eaf5c.js" async=""></script><script src="/_next/static/chunks/turbopack-5fc3e551c6965dd2.js" async=""></script><script src="/_next/static/chunks/ddcc46bd872e6481.js" async=""></script><script src="/_next/static/chunks/341a398270fbed77.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-DVQQG95LNL" as="script"/><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>AGX</title><meta name="description" content="Agent task orchestration and group chat"/><script>
|
|
2
2
|
(() => {
|
|
3
3
|
try {
|
|
4
4
|
const storedTheme = localStorage.getItem("agx-theme");
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
root.style.colorScheme = theme;
|
|
11
11
|
} catch {}
|
|
12
12
|
})();
|
|
13
|
-
</script><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased min-h-screen overflow-x-hidden overflow-y-auto bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]"><div hidden=""><!--$--><!--/$--></div><div class="min-h-screen flex items-center justify-center bg-[var(--background)]"><span class="spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"></span></div><script src="/_next/static/chunks/dd43daafe104f561.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[6167,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n3:I[803750,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n4:I[954957,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n5:I[356453,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n6:I[934689,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"GoogleAnalytics\"]\n7:I[404581,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"PostHogAnalytics\"]\n8:I[351240,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[351240,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"ViewportBoundary\"]\nd:I[351240,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"MetadataBoundary\"]\nf:I[23023,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n:HL[\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"style\"]\n:HL[\"/_next/static/chunks/ec92e3bd6c2db6e6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
13
|
+
</script><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased min-h-screen overflow-x-hidden overflow-y-auto bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]"><div hidden=""><!--$--><!--/$--></div><div class="min-h-screen flex items-center justify-center bg-[var(--background)]"><span class="spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"></span></div><script src="/_next/static/chunks/dd43daafe104f561.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[6167,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n3:I[803750,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n4:I[954957,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n5:I[356453,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n6:I[934689,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"GoogleAnalytics\"]\n7:I[404581,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"PostHogAnalytics\"]\n8:I[351240,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[351240,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"ViewportBoundary\"]\nd:I[351240,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"MetadataBoundary\"]\nf:I[23023,[\"/_next/static/chunks/ddcc46bd872e6481.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n:HL[\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"style\"]\n:HL[\"/_next/static/chunks/ec92e3bd6c2db6e6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"QEldoF1LdgJqO0PgpmUmx\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/ec92e3bd6c2db6e6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/ddcc46bd872e6481.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/341a398270fbed77.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(() =\u003e {\\n try {\\n const storedTheme = localStorage.getItem(\\\"agx-theme\\\");\\n const theme = storedTheme === \\\"dark\\\" || storedTheme === \\\"light\\\"\\n ? storedTheme\\n : (window.matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches ? \\\"dark\\\" : \\\"light\\\");\\n const root = document.documentElement;\\n root.classList.toggle(\\\"dark\\\", theme === \\\"dark\\\");\\n root.style.colorScheme = theme;\\n } catch {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased min-h-screen overflow-x-hidden overflow-y-auto bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]\",\"children\":[[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L5\",null,{}],[\"$\",\"$L6\",null,{}],[\"$\",\"$L7\",null,{}]]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:0:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:0:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:0:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:0:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Le\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\ne:[[\"$\",\"title\",\"0\",{\"children\":\"AGX\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Agent task orchestration and group chat\"}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/dd43daafe104f561.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[803750,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n3:I[954957,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n4:I[351240,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[351240,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"ViewportBoundary\"]\n9:I[351240,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"MetadataBoundary\"]\nb:I[23023,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--QEldoF1LdgJqO0PgpmUmx--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/dd43daafe104f561.js"/><script src="/_next/static/chunks/8bd9cddc3e268c43.js" async=""></script><script src="/_next/static/chunks/2dcb395af210b784.js" async=""></script><script src="/_next/static/chunks/df673c7fb40f4048.js" async=""></script><script src="/_next/static/chunks/dc1b3f7fdc1eaf5c.js" async=""></script><script src="/_next/static/chunks/turbopack-5fc3e551c6965dd2.js" async=""></script><script src="/_next/static/chunks/7212cdf092396efe.js" async=""></script><script src="/_next/static/chunks/341a398270fbed77.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/dd43daafe104f561.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[803750,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n3:I[954957,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n4:I[351240,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[351240,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"ViewportBoundary\"]\n9:I[351240,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"MetadataBoundary\"]\nb:I[23023,[\"/_next/static/chunks/7212cdf092396efe.js\",\"/_next/static/chunks/341a398270fbed77.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"QEldoF1LdgJqO0PgpmUmx\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/7212cdf092396efe.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/341a398270fbed77.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|