@tickernelz/paperclip-pro-server 2026.930.0 → 2026.930.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/dist/build-info.json +1 -1
- package/dist/modules/wake-queue/adapters/postgres.d.ts.map +1 -1
- package/dist/modules/wake-queue/adapters/postgres.js +16 -3
- package/dist/modules/wake-queue/adapters/postgres.js.map +1 -1
- package/dist/modules/wake-queue/adapters/postgres.test.js +33 -0
- package/dist/modules/wake-queue/adapters/postgres.test.js.map +1 -1
- package/dist/modules/wake-queue/application/ports.d.ts +3 -0
- package/dist/modules/wake-queue/application/ports.d.ts.map +1 -1
- package/dist/modules/wake-queue/application/ports.js.map +1 -1
- package/dist/modules/wake-queue/application/use-cases.d.ts.map +1 -1
- package/dist/modules/wake-queue/application/use-cases.js +6 -3
- package/dist/modules/wake-queue/application/use-cases.js.map +1 -1
- package/dist/modules/wake-queue/application/use-cases.test.js +52 -2
- package/dist/modules/wake-queue/application/use-cases.test.js.map +1 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +59 -2
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/openapi.js +1 -1
- package/dist/routes/openapi.js.map +1 -1
- package/dist/services/run-identity.d.ts +1 -0
- package/dist/services/run-identity.d.ts.map +1 -1
- package/dist/services/run-identity.js +12 -2
- package/dist/services/run-identity.js.map +1 -1
- package/package.json +21 -21
- package/skills/paperclip/SKILL.md +3 -1
- package/skills/paperclip/references/api-reference.md +2 -0
- package/ui-dist/assets/{Agents.production-DliAMRoL.js → Agents.production-T8untZn6.js} +2 -2
- package/ui-dist/assets/{CompanyActivity.production-CsjQRSmS.js → CompanyActivity.production-Cr4M1ZEK.js} +1 -1
- package/ui-dist/assets/{CompanyExport-BXp4zw2p.js → CompanyExport-p04ns6Xl.js} +1 -1
- package/ui-dist/assets/{CompanySkills.production-B2l6UOIJ.js → CompanySkills.production-PSbLuKmV.js} +1 -1
- package/ui-dist/assets/{Costs.production-047yqnbv.js → Costs.production-1J4q1eUe.js} +1 -1
- package/ui-dist/assets/{MarkdownEditor-DfrwLv1M.js → MarkdownEditor-BN7aGwIv.js} +1 -1
- package/ui-dist/assets/{OrgChart.production-Dra8gERf.js → OrgChart.production-BNeUJho5.js} +1 -1
- package/ui-dist/assets/{RoutineDetail.production-BEm4SWdn.js → RoutineDetail.production-B5RS5N7-.js} +1 -1
- package/ui-dist/assets/{RoutineRunVariablesDialog-B1KRZJIl.js → RoutineRunVariablesDialog-DO1hY6dt.js} +1 -1
- package/ui-dist/assets/{Routines.production-D5ZeqW2N.js → Routines.production-Dn91nmsp.js} +1 -1
- package/ui-dist/assets/{checkbox-757DLJRS.js → checkbox-D66RYMkN.js} +1 -1
- package/ui-dist/assets/{definition-DAlumvlT.js → definition-D6egFwaP.js} +1 -1
- package/ui-dist/assets/{index-BQSShVPL.js → index-BqF0txu7.js} +6 -6
- package/ui-dist/assets/{label-BueB30Ch.js → label-BjzFqp93.js} +1 -1
- package/ui-dist/assets/{sheet-CQJe5sfn.js → sheet-ASM5ba9D.js} +1 -1
- package/ui-dist/index.html +6 -6
- package/ui-dist/sw.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-identity.d.ts","sourceRoot":"","sources":["../../src/services/run-identity.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,EAKb,mBAAmB,EACnB,KAAK,EAAE,EACR,MAAM,8BAA8B,CAAC;AAKtC,kGAAkG;AAClG,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,EAC5B,GAAG,EAAE,IAAI,CAAC,OAAO,aAAa,CAAC,YAAY,EAAE,IAAI,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;;;UAoCrH;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAC;AACzE,KAAK,QAAQ,GAAG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ClB,OAAO,EAAE,kBAAkB,iBAc5B;AAED,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,EAAE,EACN,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqD7D;AAED,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;KAYd;AAED,4FAA4F;AAC5F,wBAAsB,wBAAwB,CAC5C,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,kBAAkB,iBAiB5B;AAED,uFAAuF;AACvF,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,EAC5B,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,OAAO,GAAG,WAAW,CAAC;;UAmBvE"}
|
|
@@ -189,9 +189,19 @@ export async function prepareSteeredIdentity(executor, input) {
|
|
|
189
189
|
.from(issueComments)
|
|
190
190
|
.where(and(eq(issueComments.id, input.messageId), eq(issueComments.companyId, input.companyId), eq(issueComments.issueId, input.issueId)));
|
|
191
191
|
const [interaction] = input.source === "interaction" ? await executor.select().from(issueThreadInteractions).where(and(eq(issueThreadInteractions.id, input.messageId), eq(issueThreadInteractions.companyId, input.companyId), eq(issueThreadInteractions.issueId, input.issueId), inArray(issueThreadInteractions.status, ["accepted", "answered", "rejected"]))) : [];
|
|
192
|
-
const
|
|
192
|
+
const agentAuthored = Boolean(comment && !comment.authorUserId);
|
|
193
|
+
const runAnswersToMessage = run?.responsibleUserId != null &&
|
|
194
|
+
(comment?.onBehalfOfUserId === run.responsibleUserId ||
|
|
195
|
+
input.actorUserId === run.responsibleUserId);
|
|
196
|
+
const responsibleUserId = interaction?.resolvedByUserId ??
|
|
197
|
+
(agentAuthored
|
|
198
|
+
? (runAnswersToMessage ? run?.responsibleUserId ?? null : null)
|
|
199
|
+
: comment?.authorUserId);
|
|
200
|
+
if (run && agentAuthored && !responsibleUserId) {
|
|
201
|
+
throw conflict("This message answers to a different user than the running turn does", { code: "steering_identity_mismatch" });
|
|
202
|
+
}
|
|
193
203
|
if (!run || !responsibleUserId)
|
|
194
|
-
throw forbidden("Steering requires
|
|
204
|
+
throw forbidden("Steering requires a message author the running turn already answers to");
|
|
195
205
|
if (run.status !== "running" ||
|
|
196
206
|
(run.contextSnapshot?.issueId !== input.issueId &&
|
|
197
207
|
run.contextSnapshot?.taskId !== input.issueId)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-identity.js","sourceRoot":"","sources":["../../src/services/run-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,MAAM,EACN,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAElH,kGAAkG;AAClG,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,QAA4B,EAC5B,GAAoH;IAEpH,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,KAAK,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,IAAI,CAAC;IACpC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,QAAQ;SAC7B,MAAM,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,CAAC;SAC/C,IAAI,CAAC,kBAAkB,CAAC;SACxB,KAAK,CACJ,GAAG,CACD,EAAE,CAAC,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,EACnD,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAC3C,EAAE,CAAC,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAClD,GAAG,CAAA,GAAG,kBAAkB,CAAC,aAAa,cAAc,EACpD,GAAG,CAAA,GAAG,kBAAkB,CAAC,OAAO,+DAA+D,EAC/F,GAAG,CAAA,GAAG,kBAAkB,CAAC,OAAO,gCAAgC,WAAW,OAAO,CAAC,SAAS,EAAE,EAAE,CACjG,CACF;SACA,KAAK,CAAC,CAAC,CAAC,CAAC;IACZ,MAAM,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,QAA2C,CAAC;IAC5E,OAAO,OAAO,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tickernelz/paperclip-pro-server",
|
|
3
|
-
"version": "2026.930.
|
|
3
|
+
"version": "2026.930.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/tickernelz/paperclip-pro",
|
|
6
6
|
"bugs": {
|
|
@@ -45,25 +45,25 @@
|
|
|
45
45
|
"@discordjs/ws": "1.2.3",
|
|
46
46
|
"@grpc/grpc-js": "1.14.4",
|
|
47
47
|
"@opentelemetry/api": "^1.9.0",
|
|
48
|
-
"@tickernelz/paperclip-pro-adapter-claude-local": "2026.930.
|
|
49
|
-
"@tickernelz/paperclip-pro-adapter-codex-local": "2026.930.
|
|
50
|
-
"@tickernelz/paperclip-pro-adapter-cursor-cloud": "2026.930.
|
|
51
|
-
"@tickernelz/paperclip-pro-adapter-cursor-local": "2026.930.
|
|
52
|
-
"@tickernelz/paperclip-pro-adapter-gemini-local": "2026.930.
|
|
53
|
-
"@tickernelz/paperclip-pro-adapter-grok-local": "2026.930.
|
|
54
|
-
"@tickernelz/paperclip-pro-adapter-kimi-local": "2026.930.
|
|
55
|
-
"@tickernelz/paperclip-pro-adapter-openclaw-gateway": "2026.930.
|
|
56
|
-
"@tickernelz/paperclip-pro-adapter-omp-local": "2026.930.
|
|
57
|
-
"@tickernelz/paperclip-pro-adapter-opencode-local": "2026.930.
|
|
58
|
-
"@tickernelz/paperclip-pro-adapter-pi-local": "2026.930.
|
|
59
|
-
"@tickernelz/paperclip-pro-adapter-utils": "2026.930.
|
|
60
|
-
"@tickernelz/paperclip-pro-db": "2026.930.
|
|
61
|
-
"@tickernelz/paperclip-pro-hermes-paperclip-adapter": "2026.930.
|
|
62
|
-
"@tickernelz/paperclip-pro-mcp-server": "2026.930.
|
|
63
|
-
"@tickernelz/paperclip-pro-plugin-sdk": "2026.930.
|
|
64
|
-
"@tickernelz/paperclip-pro-shared": "2026.930.
|
|
65
|
-
"@tickernelz/paperclip-pro-teams-catalog": "2026.930.
|
|
66
|
-
"@tickernelz/paperclip-pro-skills-catalog": "2026.930.
|
|
48
|
+
"@tickernelz/paperclip-pro-adapter-claude-local": "2026.930.2",
|
|
49
|
+
"@tickernelz/paperclip-pro-adapter-codex-local": "2026.930.2",
|
|
50
|
+
"@tickernelz/paperclip-pro-adapter-cursor-cloud": "2026.930.2",
|
|
51
|
+
"@tickernelz/paperclip-pro-adapter-cursor-local": "2026.930.2",
|
|
52
|
+
"@tickernelz/paperclip-pro-adapter-gemini-local": "2026.930.2",
|
|
53
|
+
"@tickernelz/paperclip-pro-adapter-grok-local": "2026.930.2",
|
|
54
|
+
"@tickernelz/paperclip-pro-adapter-kimi-local": "2026.930.2",
|
|
55
|
+
"@tickernelz/paperclip-pro-adapter-openclaw-gateway": "2026.930.2",
|
|
56
|
+
"@tickernelz/paperclip-pro-adapter-omp-local": "2026.930.2",
|
|
57
|
+
"@tickernelz/paperclip-pro-adapter-opencode-local": "2026.930.2",
|
|
58
|
+
"@tickernelz/paperclip-pro-adapter-pi-local": "2026.930.2",
|
|
59
|
+
"@tickernelz/paperclip-pro-adapter-utils": "2026.930.2",
|
|
60
|
+
"@tickernelz/paperclip-pro-db": "2026.930.2",
|
|
61
|
+
"@tickernelz/paperclip-pro-hermes-paperclip-adapter": "2026.930.2",
|
|
62
|
+
"@tickernelz/paperclip-pro-mcp-server": "2026.930.2",
|
|
63
|
+
"@tickernelz/paperclip-pro-plugin-sdk": "2026.930.2",
|
|
64
|
+
"@tickernelz/paperclip-pro-shared": "2026.930.2",
|
|
65
|
+
"@tickernelz/paperclip-pro-teams-catalog": "2026.930.2",
|
|
66
|
+
"@tickernelz/paperclip-pro-skills-catalog": "2026.930.2",
|
|
67
67
|
"@photon-ai/advanced-imessage": "2.1.0",
|
|
68
68
|
"@vercel/connect": "0.6.1",
|
|
69
69
|
"acorn": "8.18.0",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"acpx"
|
|
114
114
|
],
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@tickernelz/paperclip-pro-paperclip-runner": "2026.930.
|
|
116
|
+
"@tickernelz/paperclip-pro-paperclip-runner": "2026.930.2",
|
|
117
117
|
"@types/express": "^5.0.0",
|
|
118
118
|
"@types/express-serve-static-core": "^5.1.3",
|
|
119
119
|
"@types/jsdom": "^30.0.0",
|
|
@@ -255,6 +255,8 @@ This is the only way an agent hands its own work to a reviewer: create the revie
|
|
|
255
255
|
|
|
256
256
|
**Courier pattern (lateral coordination):** to nudge or hand context to an agent whose issues you cannot write to, create a new issue assigned to that agent carrying complete, self-contained instructions. Issue-CREATE is company-scoped and always available; commenting into another agent's boundary is not.
|
|
257
257
|
|
|
258
|
+
**Messages into a running turn:** a comment you post on another agent's task is steered into its current turn by default, so a scope change or correction lands while that agent is still working instead of after it finishes. Pass `deliver: "queue"` only when the message must wait for the current turn to end. Check `deliveredAs` in the result: `queued` with `steeringUnavailable` names why a steer did not land. A queued message is read at the assignee's next turn, and an unsteered message from another agent reopens a task that was closed as `done` in the meantime; on a `cancelled` task it stays in the thread and is never delivered, so raise anything urgent on a live task instead.
|
|
259
|
+
|
|
258
260
|
## Managing A User's Inbox
|
|
259
261
|
|
|
260
262
|
Agents may archive an issue from a user's Mine inbox with `paperclipInboxArchiveIssue` and reverse it with `paperclipDeleteIssueInboxArchive`. Both are available when the operator enables `PAPERCLIP_MCP_TOOLSETS=full`; otherwise use `paperclipApiRequest` with `method: "POST"` or `method: "DELETE"` and `path: "/issues/<issueId>/inbox-archive"`. Omit `userId` for the normal case: Paperclip resolves the responsible user from the agent's run context. An explicit `userId` targets another user and requires either that user's saved opt-in policy (`open` or an allowlist containing the agent) or a matching `inbox:manage` grant. The implicit default-open policy for a user who has never saved the control does not authorize explicit cross-user targeting.
|
|
@@ -647,7 +649,7 @@ If `plan` already exists, first call `paperclipGetDocument` (`issueId`, `key: "p
|
|
|
647
649
|
| Compact heartbeat context | `paperclipGetHeartbeatContext` |
|
|
648
650
|
| Update task | `paperclipUpdateIssue` (optional `comment` argument) |
|
|
649
651
|
| Get comments / delta / single | `paperclipListComments` • `paperclipGetComment` |
|
|
650
|
-
| Add comment | `paperclipAddComment` (
|
|
652
|
+
| Add comment | `paperclipAddComment` (a message on another agent's task steers its running turn by default; `deliver: "queue"` makes it wait for the turn boundary; read `deliveredAs` in the result) |
|
|
651
653
|
| Issue-thread interactions | `paperclipListIssueInteractions` • `paperclipAskUserQuestions` • `paperclipRequestConfirmation` • `paperclipRequestCheckboxConfirmation` • `paperclipSuggestTasks` |
|
|
652
654
|
| Create task / subtask | `paperclipCreateIssue` • `paperclipCreateChildIssue` |
|
|
653
655
|
| Release task | `paperclipReleaseIssue` |
|
|
@@ -640,6 +640,8 @@ The reliable machine-authored format is `[@Display Name](agent://<agent-id>)`. T
|
|
|
640
640
|
|
|
641
641
|
Raw `@AgentName` text may still work for some single-token names, but treat it as a fallback only, not the default.
|
|
642
642
|
|
|
643
|
+
**Message delivery:** a comment on a task assigned to another agent steers into that agent's running turn by default, so cross-task corrections and scope changes are read immediately. Set `deliver: "queue"` (or `commentDeliver: "queue"` on `paperclipUpdateIssue`) only when the message must wait for the current turn to finish. Comments on your own assigned task always wait for your next turn. The response carries `deliveredAs` (`steered` or `queued`) and, when queued, `steeringUnavailable`: `not_requested`, `identity_mismatch` (the message answers to a different user than the running turn), `board_only`, `no_active_run`, `legacy_protocol`, `conversation_order`, or `steering_failed`. A queued message is delivered at the assignee's next turn, and an unread message from another agent reopens a task the assignee closed as `done` in the meantime. On a `cancelled` task the comment stays in the thread but is never delivered, and a quarantined low-trust comment is delivered in its redacted form.
|
|
644
|
+
|
|
643
645
|
**Do NOT:**
|
|
644
646
|
|
|
645
647
|
- Use @-mentions as your default assignment mechanism. If you need someone to do work, create/assign a task.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
var Pe=Object.defineProperty;var n=(e,a)=>Pe(e,"name",{value:a,configurable:!0});import{i as oe}from"./rolldown-runtime-ZpX3ckPj.js";import{En as ke,Fr as qe,Lr as Me,S as B,U as Fe,Y as j,_ as ce,g as U,nr as N,z as Re}from"./createLucideIcon-r3v6fbGz.js";import{t as $e}from"./preload-helper-CceJXRIF.js";import{it as Be,o as ze,t as de}from"./router-Bb8nJWyv.js";import{S as Ke}from"./zap-P-cXfK28.js";import{t as ue}from"./AgentAvatar-PT82VwmU.js";import{t as Oe}from"./tabs-DWRZjksg.js";import{t as ae}from"./agents-BlSzFh-1.js";import{r as De,t as re}from"./EmptyState-DPcc0zYh.js";import{t as ie}from"./bot-DZDpMzjD.js";import{k as Ue,t as V}from"./button-CAPbz11u.js";import{i as Ve,o as He,t as Ge}from"./heartbeats-CK_aXmx5.js";import{t as me}from"./triangle-alert-CgJcxSQX.js";import{n as Qe}from"./SidebarContext-D01pu4wh.js";import{n as Je,t as le}from"./environments-BVeNFanj.js";import{t as Ye}from"./PageSkeleton-DHjTwRT3.js";import{$t as We,It as Xe,Jt as Ze,Lt as pe,Wt as H,Yt as et,an as ge,cn as tt,dn as st,in as nt,nn as xe,on as G,rn as at,sn as rt,un as fe}from"./index-BQSShVPL.js";var g=oe(Me(),1),t=oe(qe(),1),he=ke,it=(0,g.lazy)(()=>$e(()=>import("./index-BQSShVPL.js").then(e=>e.wt).then(e=>({default:e.ConfigureBuiltInAgentModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48]))),lt=["all","active","paused","error","builtin"],ot=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"error",label:"Error"},{value:"builtin",label:"Built-in"}];function ct(e){return lt.includes(e)}n(ct,"isFilterTab");var J={label:"Local",detail:"Paperclip host",title:"Local - Paperclip host"},ve={label:"—",detail:"Loading environment",title:"Loading environment"},be=new Set(["terminated","pending_approval"]);function je(e,a){return a==="all"?!0:a==="active"?e==="active"||e==="running"||e==="idle":a==="paused"?e==="paused":a==="error"?e==="error":!0}n(je,"matchesFilter");function dt(e,a,i){return e.filter(r=>be.has(r.status)?!1:a==="builtin"?i.has(r.id):je(r.status,a)).sort((r,o)=>r.name.localeCompare(o.name))}n(dt,"filterAgents");function ut(e){const a=e.adapterConfig?.model;if(typeof a!="string")return null;const i=a.trim();return i.length>0?i:null}n(ut,"getConfiguredModel");function mt(e){return e==="ssh"?"SSH":e.charAt(0).toUpperCase()+e.slice(1)}n(mt,"formatEnvironmentDriver");function pt(e,a){const i=typeof e.config.provider=="string"?e.config.provider.trim():"";return i?a?.sandboxProviders?.[i]?.displayName??i:"Sandbox"}n(pt,"getSandboxProviderLabel");function gt(e,a){const i=Ze(e)?"Managed by Paperclip":e.driver==="sandbox"?`${pt(e,a)} sandbox provider`:e.driver==="local"?"Paperclip host":mt(e.driver);return{label:e.name,detail:i,title:`${e.name} - ${i}`}}n(gt,"describeEnvironment");function xt(e){return{label:"Unknown environment",detail:e.slice(0,8),title:`Unknown environment - ${e}`}}n(xt,"describeMissingEnvironment");function ft(e,a,i,r){const o=e.defaultEnvironmentId??i;if(!o)return J;const x=a.get(o);return x?gt(x,r):xt(o)}n(ft,"resolveAgentEnvironment");function Ne(e,a,i){return e.reduce((r,o)=>{const x=Ne(o.reports,a,i);return be.has(o.status)?(r.push(...x),r):(((a==="builtin"?i.has(o.id):je(o.status,a))||x.length>0)&&r.push({...o,reports:x}),r)},[]).sort((r,o)=>r.name.localeCompare(o.name))}n(Ne,"filterOrgTree");function Mt(){const{selectedCompanyId:e}=Fe(),{openNewAgent:a}=Ve(),{setBreadcrumbs:i}=De(),r=ze(),o=Be(),{isMobile:x}=Qe(),C=o.pathname.split("/").pop()??"all",v=ct(C)?C:"all",[S,m]=(0,g.useState)("org"),A=x,p=A?"list":S,{data:l}=N({queryKey:j.instance.settings,queryFn:n(()=>Je.get(),"queryFn"),enabled:!!e}),u=l?.experimental.enableBuiltInAgents===!0,h=v==="builtin"&&!u?"all":v,z=(0,g.useMemo)(()=>ot.filter(s=>s.value!=="builtin"||u),[u]),{data:E}=N({queryKey:j.builtInAgents.list(e),queryFn:n(()=>st.list(e),"queryFn"),enabled:!!e&&u}),b=(0,g.useMemo)(()=>{const s=new Map;if(!u)return s;for(const c of E??[])c.agentId&&s.set(c.agentId,c);return s},[E,u]),k=(0,g.useMemo)(()=>new Set(b.keys()),[b]),[y,_]=(0,g.useState)(null),{data:d,isLoading:Ie,error:Y}=N({queryKey:j.agents.list(e),queryFn:n(()=>ae.list(e),"queryFn"),enabled:!!e}),{data:T}=N({queryKey:j.org(e),queryFn:n(()=>ae.org(e),"queryFn"),enabled:!!e&&p==="org"}),q=l?.experimental.enableEnvironments===!0,{data:L}=N({queryKey:j.environments.list(e),queryFn:n(()=>le.list(e),"queryFn"),enabled:!!e&&q}),{data:W}=N({queryKey:j.environments.capabilities(e),queryFn:n(()=>le.capabilities(e),"queryFn"),enabled:!!e&&q}),X=[...j.liveRuns(e),"agents-page"],K=nt({companyId:e,resourceKey:"live-runs:agents-page",queryKey:X,enabled:!!e,refetchInterval:15e3,leaderOnly:!0}),{data:O,dataUpdatedAt:Ce}=N({queryKey:X,queryFn:n(()=>Ge.liveRunsForCompany(e),"queryFn"),enabled:K.enabled,refetchInterval:K.refetchInterval});at(K,O,Ce);const M=tt(e),f=rt(e),F=(0,g.useMemo)(()=>{const s=new Map;for(const c of O??[]){if(c.status!=="running"&&c.status!=="queued")continue;const P=s.get(c.agentId);if(P){P.liveCount+=1;continue}s.set(c.agentId,{runId:c.id,liveCount:1})}return s},[O]),Se=(0,g.useMemo)(()=>{const s=new Map;for(const c of d??[])s.set(c.id,c);return s},[d]),Z=(0,g.useMemo)(()=>{const s=new Map;for(const c of L??[])s.set(c.id,c);return s},[L]),ee=(0,g.useMemo)(()=>{const s=new Map;for(const c of d??[])s.set(c.id,ft(c,Z,l?.defaultEnvironmentId??null,W));return s},[d,Z,W,l?.defaultEnvironmentId]);if((0,g.useEffect)(()=>{i([{label:"Agents"}])},[i]),(0,g.useEffect)(()=>{e&&v==="builtin"&&l&&!u&&r("/agents/all",{replace:!0})},[u,l,r,v,e]),!e)return(0,t.jsx)(re,{icon:ie,message:"Select a company to view agents."});if(Ie)return(0,t.jsx)(Ye,{variant:"list"});const w=dt(d??[],h,k),D=Ne(T??[],h,k),te=q&&L===void 0,se=q&&(L===void 0||L.length>1),Ae=n(s=>te?ve:ee.get(s)??J,"resolveRenderedEnvironment"),Ee=n(s=>{const c=s.orgChainHealth?.status==="invalid_org_chain",P=f.isPending&&f.variables?.resourceType==="agent"&&f.variables.resourceId===s.id,_e=P&&f.variables?.starred!==void 0,ne=P&&f.variables?.starred===void 0,Te=ge(M.data,"agent",s.id),I=b.get(s.id),Le=I?.status==="needs_setup"||I?.status==="pending_approval",R=I&&Le?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(fe,{status:I.status}),I.status==="needs_setup"&&(0,t.jsx)("span",{onClick:n($=>{$.preventDefault(),$.stopPropagation()},"onClick"),children:(0,t.jsx)(V,{size:"xs",variant:"outline",onClick:n(()=>_(I),"onClick"),children:"Set up"})})]}):null;return(0,t.jsx)(Xe,{title:s.name,titleClassName:"flex-1 xl:flex-none xl:w-56",titleTextClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitleClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitle:`${he[s.role]??s.role}${s.title?` - ${s.title}`:""}`,to:ce(s),className:B("group",s.pausedAt&&h!=="paused"?"opacity-50":"",G(M.data,"agent",s.id)==="left"?"sm:text-foreground/55":""),leading:c?(0,t.jsx)(me,{className:"h-3.5 w-3.5 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(ue,{agent:s,size:32}),secondaryRow:R?(0,t.jsx)("div",{className:"xl:hidden flex flex-wrap items-center gap-1.5",children:R}):void 0,meta:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[R&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-1.5",children:R}),(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(we,{agent:s,environment:Ae(s.id),showEnvironment:se})})]}),metaSpacerClassName:"hidden xl:block",trailing:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[F.has(s.id)&&(0,t.jsx)(Q,{agentRef:U(s),runId:F.get(s.id).runId,liveCount:F.get(s.id).liveCount}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(H,{status:s.status})}),(0,t.jsx)(xe,{size:"row",starred:Te,pending:_e,resourceName:s.name,onToggle:n($=>f.mutate({resourceType:"agent",resourceId:s.id,resourceName:s.name,starred:$}),"onToggle")})]}),(0,t.jsx)(pe,{state:G(M.data,"agent",s.id),pending:ne,pendingState:ne?f.variables?.state??null:null,resourceName:s.name,onJoin:n(()=>f.mutate({resourceType:"agent",resourceId:s.id,resourceName:s.name,state:"joined"}),"onJoin"),onLeave:n(()=>f.mutate({resourceType:"agent",resourceId:s.id,resourceName:s.name,state:"left"}),"onLeave")})]})},s.id)},"renderAgentRow");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)(Oe,{value:h,onValueChange:n(s=>r(`/agents/${s}`),"onValueChange"),children:(0,t.jsx)(We,{items:z,value:h,onValueChange:n(s=>r(`/agents/${s}`),"onValueChange")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center border border-border",role:"group","aria-label":"View mode",children:[(0,t.jsx)("button",{className:B("p-1.5 transition-colors",p==="list"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:n(()=>m("list"),"onClick"),title:"List view","aria-label":"List view","aria-pressed":p==="list",children:(0,t.jsx)(He,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{className:B("p-1.5 transition-colors",p==="org"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:n(()=>m("org"),"onClick"),title:"Org chart view","aria-label":"Org chart view","aria-pressed":p==="org",children:(0,t.jsx)(Ke,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)(V,{size:"sm",variant:"outline",onClick:a,children:[(0,t.jsx)(Ue,{className:"h-3.5 w-3.5 mr-1.5"}),"New Agent"]})]})]}),w.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[w.length," agent",w.length!==1?"s":""]}),Y&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:Y.message}),d&&d.length===0&&(0,t.jsx)(re,{icon:ie,message:"Create your first agent to get started.",action:"New Agent",onAction:a}),p==="list"&&w.length>0&&(0,t.jsx)("div",{children:w.map(Ee)}),p==="list"&&d&&d.length>0&&w.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),p==="org"&&D.length>0&&(0,t.jsx)("div",{className:"py-1",children:D.map(s=>(0,t.jsx)(ye,{node:s,depth:0,agentMap:Se,liveRunByAgent:F,environmentByAgentId:ee,environmentDataLoading:te,showEnvironment:se,tab:h,memberships:M.data,membershipMutation:f,builtInByAgentId:b,onConfigureBuiltIn:_},s.id))}),p==="org"&&T&&T.length>0&&D.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),p==="org"&&T&&T.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No organizational hierarchy defined."}),y&&e&&(0,t.jsx)(g.Suspense,{fallback:null,children:(0,t.jsx)(it,{companyId:e,state:y,open:y!==null,onOpenChange:n(s=>{s||_(null)},"onOpenChange")})})]})}n(Mt,"Agents");function ye({node:e,depth:a,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:x,showEnvironment:C,tab:v,memberships:S,membershipMutation:m,builtInByAgentId:A,onConfigureBuiltIn:p}){const l=i.get(e.id),u=A.get(e.id),h=u?.status==="needs_setup"||u?.status==="pending_approval",z=!!(l&&l.orgChainHealth?.status==="invalid_org_chain"),E=G(S,"agent",e.id),b=m.isPending&&m.variables?.resourceType==="agent"&&m.variables.resourceId===e.id,k=b&&m.variables?.starred!==void 0,y=b&&m.variables?.starred===void 0,_=ge(S,"agent",e.id);return(0,t.jsxs)("div",{style:{paddingLeft:a*24},children:[(0,t.jsxs)(de,{to:l?ce(l):`/agents/${e.id}`,className:B("group flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-accent/50 transition-colors w-full text-left no-underline text-inherit",l?.pausedAt&&v!=="paused"&&"opacity-50",E==="left"&&"sm:text-foreground/55"),children:[z?(0,t.jsx)(me,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(ue,{agent:l??e,size:24}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-(--sz-7rem) truncate",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[he[e.role]??e.role,l?.title?` - ${l.title}`:""]})]}),u&&h&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)(fe,{status:u.status}),u.status==="needs_setup"&&(0,t.jsx)("span",{onClick:n(d=>{d.preventDefault(),d.stopPropagation()},"onClick"),children:(0,t.jsx)(V,{size:"xs",variant:"outline",onClick:n(()=>p(u),"onClick"),children:"Set up"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,t.jsx)("span",{className:"sm:hidden",children:r.has(e.id)?(0,t.jsx)(Q,{agentRef:l?U(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}):(0,t.jsx)(H,{status:e.status})}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[r.has(e.id)&&(0,t.jsx)(Q,{agentRef:l?U(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}),l&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(we,{agent:l,environment:x?ve:o.get(l.id)??J,showEnvironment:C})}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(H,{status:e.status})})]}),(0,t.jsx)(pe,{state:E,pending:y,pendingState:y?m.variables?.state:null,resourceName:e.name,onJoin:n(()=>m.mutate({resourceType:"agent",resourceId:e.id,resourceName:e.name,state:"joined"}),"onJoin"),onLeave:n(()=>m.mutate({resourceType:"agent",resourceId:e.id,resourceName:e.name,state:"left"}),"onLeave")}),(0,t.jsx)("div",{className:"hidden sm:flex items-center gap-3",children:(0,t.jsx)(xe,{size:"row",starred:_,pending:k,resourceName:e.name,onToggle:n(d=>m.mutate({resourceType:"agent",resourceId:e.id,resourceName:e.name,starred:d}),"onToggle")})})]})]}),e.reports&&e.reports.length>0&&(0,t.jsx)("div",{className:"border-l border-border ml-4",children:e.reports.map(d=>(0,t.jsx)(ye,{node:d,depth:a+1,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:x,showEnvironment:C,tab:v,memberships:S,membershipMutation:m,builtInByAgentId:A,onConfigureBuiltIn:p},d.id))})]})}n(ye,"OrgTreeNode");function we({agent:e,environment:a,showEnvironment:i}){const r=ut(e),o=et(e.adapterType);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate font-mono text-xs text-muted-foreground",title:r??void 0,children:r??"—"}),(0,t.jsx)("div",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground/70",title:o,children:o})]}),i&&(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",title:a.title,children:a.label}),(0,t.jsx)("div",{className:"truncate text-(length:--text-micro) text-muted-foreground/70",children:a.detail})]}),(0,t.jsx)("span",{className:"w-24 whitespace-nowrap text-right text-xs text-muted-foreground",children:e.lastHeartbeatAt?Re(e.lastHeartbeatAt):"—"})]})}n(we,"AgentMetaColumns");function Q({agentRef:e,runId:a,liveCount:i}){return(0,t.jsxs)(de,{to:`/agents/${e}/runs/${a}`,className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-blue-500/10 hover:bg-blue-500/20 transition-colors no-underline",onClick:n(r=>r.stopPropagation(),"onClick"),children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),(0,t.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:["Live",i>1?` (${i})`:""]})]})}n(Q,"LiveRunIndicator");export{Mt as Agents};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BqF0txu7.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/createLucideIcon-r3v6fbGz.js","assets/preload-helper-CceJXRIF.js","assets/router-Bb8nJWyv.js","assets/zap-P-cXfK28.js","assets/agents-BlSzFh-1.js","assets/EmptyState-DPcc0zYh.js","assets/button-CAPbz11u.js","assets/RoutineRunVariablesDialog-DO1hY6dt.js","assets/mention-chips-DXumPrOR.js","assets/bot-DZDpMzjD.js","assets/MarkdownEditor-BN7aGwIv.js","assets/dist-D1zgkcBw.js","assets/dist-5v80Jc6A.js","assets/AgentAvatar-PT82VwmU.js","assets/dist-DCJXgQu0.js","assets/sheet-ASM5ba9D.js","assets/checkbox-D66RYMkN.js","assets/check-DDiXDm2i.js","assets/chevron-right-B9JUOr38.js","assets/label-BjzFqp93.js","assets/StatusIcon-DgMlA1TU.js","assets/clipboard-CYJ5Q78m.js","assets/loader-circle-BD9wx-lw.js","assets/octagon-alert-rGMwyrWA.js","assets/select-mS22eY6T.js","assets/chevron-down-F9aZv-V7.js","assets/heartbeats-CK_aXmx5.js","assets/useHiddenSettings-2JpxuJV7.js","assets/health-DeeeogeJ.js","assets/rotate-ccw-CRAQ3Xng.js","assets/triangle-alert-CgJcxSQX.js","assets/badge-Cf7ihb3q.js","assets/environments-BVeNFanj.js","assets/input-DpsS9it-.js","assets/company-members-BcZm1g8Q.js","assets/AgentIdentity-MCshmbhZ.js","assets/card-dmVcp3AX.js","assets/PageSkeleton-DHjTwRT3.js","assets/skeleton-CKir8TUW.js","assets/tabs-DWRZjksg.js","assets/use-adapter-capabilities-BiWYK4zJ.js","assets/save-DUnPDT6R.js","assets/external-link-0lrOvZWO.js","assets/MarkdownBody-NJwkQWmo.js","assets/file-text-C9vgFckt.js","assets/SidebarContext-D01pu4wh.js","assets/index-DLfVxJmv.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Pe=Object.defineProperty;var n=(e,a)=>Pe(e,"name",{value:a,configurable:!0});import{i as oe}from"./rolldown-runtime-ZpX3ckPj.js";import{En as ke,Fr as qe,Lr as Me,S as B,U as Fe,Y as j,_ as ce,g as U,nr as N,z as Re}from"./createLucideIcon-r3v6fbGz.js";import{t as $e}from"./preload-helper-CceJXRIF.js";import{it as Be,o as ze,t as de}from"./router-Bb8nJWyv.js";import{S as Ke}from"./zap-P-cXfK28.js";import{t as ue}from"./AgentAvatar-PT82VwmU.js";import{t as Oe}from"./tabs-DWRZjksg.js";import{t as ae}from"./agents-BlSzFh-1.js";import{r as De,t as re}from"./EmptyState-DPcc0zYh.js";import{t as ie}from"./bot-DZDpMzjD.js";import{k as Ue,t as V}from"./button-CAPbz11u.js";import{i as Ve,o as He,t as Ge}from"./heartbeats-CK_aXmx5.js";import{t as me}from"./triangle-alert-CgJcxSQX.js";import{n as Qe}from"./SidebarContext-D01pu4wh.js";import{n as Je,t as le}from"./environments-BVeNFanj.js";import{t as Ye}from"./PageSkeleton-DHjTwRT3.js";import{$t as We,It as Xe,Jt as Ze,Lt as pe,Wt as H,Yt as et,an as ge,cn as tt,dn as st,in as nt,nn as xe,on as G,rn as at,sn as rt,un as fe}from"./index-BqF0txu7.js";var g=oe(Me(),1),t=oe(qe(),1),he=ke,it=(0,g.lazy)(()=>$e(()=>import("./index-BqF0txu7.js").then(e=>e.wt).then(e=>({default:e.ConfigureBuiltInAgentModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48]))),lt=["all","active","paused","error","builtin"],ot=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"error",label:"Error"},{value:"builtin",label:"Built-in"}];function ct(e){return lt.includes(e)}n(ct,"isFilterTab");var J={label:"Local",detail:"Paperclip host",title:"Local - Paperclip host"},ve={label:"—",detail:"Loading environment",title:"Loading environment"},be=new Set(["terminated","pending_approval"]);function je(e,a){return a==="all"?!0:a==="active"?e==="active"||e==="running"||e==="idle":a==="paused"?e==="paused":a==="error"?e==="error":!0}n(je,"matchesFilter");function dt(e,a,i){return e.filter(r=>be.has(r.status)?!1:a==="builtin"?i.has(r.id):je(r.status,a)).sort((r,o)=>r.name.localeCompare(o.name))}n(dt,"filterAgents");function ut(e){const a=e.adapterConfig?.model;if(typeof a!="string")return null;const i=a.trim();return i.length>0?i:null}n(ut,"getConfiguredModel");function mt(e){return e==="ssh"?"SSH":e.charAt(0).toUpperCase()+e.slice(1)}n(mt,"formatEnvironmentDriver");function pt(e,a){const i=typeof e.config.provider=="string"?e.config.provider.trim():"";return i?a?.sandboxProviders?.[i]?.displayName??i:"Sandbox"}n(pt,"getSandboxProviderLabel");function gt(e,a){const i=Ze(e)?"Managed by Paperclip":e.driver==="sandbox"?`${pt(e,a)} sandbox provider`:e.driver==="local"?"Paperclip host":mt(e.driver);return{label:e.name,detail:i,title:`${e.name} - ${i}`}}n(gt,"describeEnvironment");function xt(e){return{label:"Unknown environment",detail:e.slice(0,8),title:`Unknown environment - ${e}`}}n(xt,"describeMissingEnvironment");function ft(e,a,i,r){const o=e.defaultEnvironmentId??i;if(!o)return J;const x=a.get(o);return x?gt(x,r):xt(o)}n(ft,"resolveAgentEnvironment");function Ne(e,a,i){return e.reduce((r,o)=>{const x=Ne(o.reports,a,i);return be.has(o.status)?(r.push(...x),r):(((a==="builtin"?i.has(o.id):je(o.status,a))||x.length>0)&&r.push({...o,reports:x}),r)},[]).sort((r,o)=>r.name.localeCompare(o.name))}n(Ne,"filterOrgTree");function Mt(){const{selectedCompanyId:e}=Fe(),{openNewAgent:a}=Ve(),{setBreadcrumbs:i}=De(),r=ze(),o=Be(),{isMobile:x}=Qe(),C=o.pathname.split("/").pop()??"all",v=ct(C)?C:"all",[S,m]=(0,g.useState)("org"),A=x,p=A?"list":S,{data:l}=N({queryKey:j.instance.settings,queryFn:n(()=>Je.get(),"queryFn"),enabled:!!e}),u=l?.experimental.enableBuiltInAgents===!0,h=v==="builtin"&&!u?"all":v,z=(0,g.useMemo)(()=>ot.filter(s=>s.value!=="builtin"||u),[u]),{data:E}=N({queryKey:j.builtInAgents.list(e),queryFn:n(()=>st.list(e),"queryFn"),enabled:!!e&&u}),b=(0,g.useMemo)(()=>{const s=new Map;if(!u)return s;for(const c of E??[])c.agentId&&s.set(c.agentId,c);return s},[E,u]),k=(0,g.useMemo)(()=>new Set(b.keys()),[b]),[y,_]=(0,g.useState)(null),{data:d,isLoading:Ie,error:Y}=N({queryKey:j.agents.list(e),queryFn:n(()=>ae.list(e),"queryFn"),enabled:!!e}),{data:T}=N({queryKey:j.org(e),queryFn:n(()=>ae.org(e),"queryFn"),enabled:!!e&&p==="org"}),q=l?.experimental.enableEnvironments===!0,{data:L}=N({queryKey:j.environments.list(e),queryFn:n(()=>le.list(e),"queryFn"),enabled:!!e&&q}),{data:W}=N({queryKey:j.environments.capabilities(e),queryFn:n(()=>le.capabilities(e),"queryFn"),enabled:!!e&&q}),X=[...j.liveRuns(e),"agents-page"],K=nt({companyId:e,resourceKey:"live-runs:agents-page",queryKey:X,enabled:!!e,refetchInterval:15e3,leaderOnly:!0}),{data:O,dataUpdatedAt:Ce}=N({queryKey:X,queryFn:n(()=>Ge.liveRunsForCompany(e),"queryFn"),enabled:K.enabled,refetchInterval:K.refetchInterval});at(K,O,Ce);const M=tt(e),f=rt(e),F=(0,g.useMemo)(()=>{const s=new Map;for(const c of O??[]){if(c.status!=="running"&&c.status!=="queued")continue;const P=s.get(c.agentId);if(P){P.liveCount+=1;continue}s.set(c.agentId,{runId:c.id,liveCount:1})}return s},[O]),Se=(0,g.useMemo)(()=>{const s=new Map;for(const c of d??[])s.set(c.id,c);return s},[d]),Z=(0,g.useMemo)(()=>{const s=new Map;for(const c of L??[])s.set(c.id,c);return s},[L]),ee=(0,g.useMemo)(()=>{const s=new Map;for(const c of d??[])s.set(c.id,ft(c,Z,l?.defaultEnvironmentId??null,W));return s},[d,Z,W,l?.defaultEnvironmentId]);if((0,g.useEffect)(()=>{i([{label:"Agents"}])},[i]),(0,g.useEffect)(()=>{e&&v==="builtin"&&l&&!u&&r("/agents/all",{replace:!0})},[u,l,r,v,e]),!e)return(0,t.jsx)(re,{icon:ie,message:"Select a company to view agents."});if(Ie)return(0,t.jsx)(Ye,{variant:"list"});const w=dt(d??[],h,k),D=Ne(T??[],h,k),te=q&&L===void 0,se=q&&(L===void 0||L.length>1),Ae=n(s=>te?ve:ee.get(s)??J,"resolveRenderedEnvironment"),Ee=n(s=>{const c=s.orgChainHealth?.status==="invalid_org_chain",P=f.isPending&&f.variables?.resourceType==="agent"&&f.variables.resourceId===s.id,_e=P&&f.variables?.starred!==void 0,ne=P&&f.variables?.starred===void 0,Te=ge(M.data,"agent",s.id),I=b.get(s.id),Le=I?.status==="needs_setup"||I?.status==="pending_approval",R=I&&Le?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(fe,{status:I.status}),I.status==="needs_setup"&&(0,t.jsx)("span",{onClick:n($=>{$.preventDefault(),$.stopPropagation()},"onClick"),children:(0,t.jsx)(V,{size:"xs",variant:"outline",onClick:n(()=>_(I),"onClick"),children:"Set up"})})]}):null;return(0,t.jsx)(Xe,{title:s.name,titleClassName:"flex-1 xl:flex-none xl:w-56",titleTextClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitleClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitle:`${he[s.role]??s.role}${s.title?` - ${s.title}`:""}`,to:ce(s),className:B("group",s.pausedAt&&h!=="paused"?"opacity-50":"",G(M.data,"agent",s.id)==="left"?"sm:text-foreground/55":""),leading:c?(0,t.jsx)(me,{className:"h-3.5 w-3.5 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(ue,{agent:s,size:32}),secondaryRow:R?(0,t.jsx)("div",{className:"xl:hidden flex flex-wrap items-center gap-1.5",children:R}):void 0,meta:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[R&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-1.5",children:R}),(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(we,{agent:s,environment:Ae(s.id),showEnvironment:se})})]}),metaSpacerClassName:"hidden xl:block",trailing:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[F.has(s.id)&&(0,t.jsx)(Q,{agentRef:U(s),runId:F.get(s.id).runId,liveCount:F.get(s.id).liveCount}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(H,{status:s.status})}),(0,t.jsx)(xe,{size:"row",starred:Te,pending:_e,resourceName:s.name,onToggle:n($=>f.mutate({resourceType:"agent",resourceId:s.id,resourceName:s.name,starred:$}),"onToggle")})]}),(0,t.jsx)(pe,{state:G(M.data,"agent",s.id),pending:ne,pendingState:ne?f.variables?.state??null:null,resourceName:s.name,onJoin:n(()=>f.mutate({resourceType:"agent",resourceId:s.id,resourceName:s.name,state:"joined"}),"onJoin"),onLeave:n(()=>f.mutate({resourceType:"agent",resourceId:s.id,resourceName:s.name,state:"left"}),"onLeave")})]})},s.id)},"renderAgentRow");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)(Oe,{value:h,onValueChange:n(s=>r(`/agents/${s}`),"onValueChange"),children:(0,t.jsx)(We,{items:z,value:h,onValueChange:n(s=>r(`/agents/${s}`),"onValueChange")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center border border-border",role:"group","aria-label":"View mode",children:[(0,t.jsx)("button",{className:B("p-1.5 transition-colors",p==="list"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:n(()=>m("list"),"onClick"),title:"List view","aria-label":"List view","aria-pressed":p==="list",children:(0,t.jsx)(He,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{className:B("p-1.5 transition-colors",p==="org"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:n(()=>m("org"),"onClick"),title:"Org chart view","aria-label":"Org chart view","aria-pressed":p==="org",children:(0,t.jsx)(Ke,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)(V,{size:"sm",variant:"outline",onClick:a,children:[(0,t.jsx)(Ue,{className:"h-3.5 w-3.5 mr-1.5"}),"New Agent"]})]})]}),w.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[w.length," agent",w.length!==1?"s":""]}),Y&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:Y.message}),d&&d.length===0&&(0,t.jsx)(re,{icon:ie,message:"Create your first agent to get started.",action:"New Agent",onAction:a}),p==="list"&&w.length>0&&(0,t.jsx)("div",{children:w.map(Ee)}),p==="list"&&d&&d.length>0&&w.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),p==="org"&&D.length>0&&(0,t.jsx)("div",{className:"py-1",children:D.map(s=>(0,t.jsx)(ye,{node:s,depth:0,agentMap:Se,liveRunByAgent:F,environmentByAgentId:ee,environmentDataLoading:te,showEnvironment:se,tab:h,memberships:M.data,membershipMutation:f,builtInByAgentId:b,onConfigureBuiltIn:_},s.id))}),p==="org"&&T&&T.length>0&&D.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),p==="org"&&T&&T.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No organizational hierarchy defined."}),y&&e&&(0,t.jsx)(g.Suspense,{fallback:null,children:(0,t.jsx)(it,{companyId:e,state:y,open:y!==null,onOpenChange:n(s=>{s||_(null)},"onOpenChange")})})]})}n(Mt,"Agents");function ye({node:e,depth:a,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:x,showEnvironment:C,tab:v,memberships:S,membershipMutation:m,builtInByAgentId:A,onConfigureBuiltIn:p}){const l=i.get(e.id),u=A.get(e.id),h=u?.status==="needs_setup"||u?.status==="pending_approval",z=!!(l&&l.orgChainHealth?.status==="invalid_org_chain"),E=G(S,"agent",e.id),b=m.isPending&&m.variables?.resourceType==="agent"&&m.variables.resourceId===e.id,k=b&&m.variables?.starred!==void 0,y=b&&m.variables?.starred===void 0,_=ge(S,"agent",e.id);return(0,t.jsxs)("div",{style:{paddingLeft:a*24},children:[(0,t.jsxs)(de,{to:l?ce(l):`/agents/${e.id}`,className:B("group flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-accent/50 transition-colors w-full text-left no-underline text-inherit",l?.pausedAt&&v!=="paused"&&"opacity-50",E==="left"&&"sm:text-foreground/55"),children:[z?(0,t.jsx)(me,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(ue,{agent:l??e,size:24}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-(--sz-7rem) truncate",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[he[e.role]??e.role,l?.title?` - ${l.title}`:""]})]}),u&&h&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)(fe,{status:u.status}),u.status==="needs_setup"&&(0,t.jsx)("span",{onClick:n(d=>{d.preventDefault(),d.stopPropagation()},"onClick"),children:(0,t.jsx)(V,{size:"xs",variant:"outline",onClick:n(()=>p(u),"onClick"),children:"Set up"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,t.jsx)("span",{className:"sm:hidden",children:r.has(e.id)?(0,t.jsx)(Q,{agentRef:l?U(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}):(0,t.jsx)(H,{status:e.status})}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[r.has(e.id)&&(0,t.jsx)(Q,{agentRef:l?U(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}),l&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(we,{agent:l,environment:x?ve:o.get(l.id)??J,showEnvironment:C})}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(H,{status:e.status})})]}),(0,t.jsx)(pe,{state:E,pending:y,pendingState:y?m.variables?.state:null,resourceName:e.name,onJoin:n(()=>m.mutate({resourceType:"agent",resourceId:e.id,resourceName:e.name,state:"joined"}),"onJoin"),onLeave:n(()=>m.mutate({resourceType:"agent",resourceId:e.id,resourceName:e.name,state:"left"}),"onLeave")}),(0,t.jsx)("div",{className:"hidden sm:flex items-center gap-3",children:(0,t.jsx)(xe,{size:"row",starred:_,pending:k,resourceName:e.name,onToggle:n(d=>m.mutate({resourceType:"agent",resourceId:e.id,resourceName:e.name,starred:d}),"onToggle")})})]})]}),e.reports&&e.reports.length>0&&(0,t.jsx)("div",{className:"border-l border-border ml-4",children:e.reports.map(d=>(0,t.jsx)(ye,{node:d,depth:a+1,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:x,showEnvironment:C,tab:v,memberships:S,membershipMutation:m,builtInByAgentId:A,onConfigureBuiltIn:p},d.id))})]})}n(ye,"OrgTreeNode");function we({agent:e,environment:a,showEnvironment:i}){const r=ut(e),o=et(e.adapterType);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate font-mono text-xs text-muted-foreground",title:r??void 0,children:r??"—"}),(0,t.jsx)("div",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground/70",title:o,children:o})]}),i&&(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",title:a.title,children:a.label}),(0,t.jsx)("div",{className:"truncate text-(length:--text-micro) text-muted-foreground/70",children:a.detail})]}),(0,t.jsx)("span",{className:"w-24 whitespace-nowrap text-right text-xs text-muted-foreground",children:e.lastHeartbeatAt?Re(e.lastHeartbeatAt):"—"})]})}n(we,"AgentMetaColumns");function Q({agentRef:e,runId:a,liveCount:i}){return(0,t.jsxs)(de,{to:`/agents/${e}/runs/${a}`,className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-blue-500/10 hover:bg-blue-500/20 transition-colors no-underline",onClick:n(r=>r.stopPropagation(),"onClick"),children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),(0,t.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:["Live",i>1?` (${i})`:""]})]})}n(Q,"LiveRunIndicator");export{Mt as Agents};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var xe=Object.defineProperty;var r=(t,a)=>xe(t,"name",{value:a,configurable:!0});import{i as ne}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as pe,Lr as he,S as ge,U as fe,Y as G,Yn as W,nr as X,z as ye}from"./createLucideIcon-r3v6fbGz.js";import{ct as ve,t as re}from"./router-Bb8nJWyv.js";import{r as ee,t as je}from"./AgentAvatar-PT82VwmU.js";import{i as te,r as be,t as Ne}from"./tabs-DWRZjksg.js";import{t as we}from"./agents-BlSzFh-1.js";import{r as Ae,t as Te}from"./EmptyState-DPcc0zYh.js";import{c as _,i as y,n as D,s as F,t as k}from"./select-mS22eY6T.js";import{t as T}from"./button-CAPbz11u.js";import{t as se}from"./input-DpsS9it-.js";import{o as Se,r as Ce}from"./company-members-BcZm1g8Q.js";import{r as v,t as j}from"./card-dmVcp3AX.js";import{Gn as Ee,O as ae,Pn as Ie,Rt as Ue,_n as Pe,bn as Le,fn as Re,yn as _e}from"./index-BQSShVPL.js";var l=ne(he(),1),e=ne(pe(),1),De=50,n="__all",Fe=[{value:n,label:"All actions"},{value:"issue.",label:"Tasks"},{value:"agent.",label:"Agents"},{value:"heartbeat.",label:"Runs"},{value:"approval.",label:"Approvals"},{value:"project.",label:"Projects"},{value:"goal.",label:"Goals"},{value:"tool_gateway.",label:"Tools"},{value:"cost.",label:"Costs"},{value:"company.",label:"Company"}],ke=[{value:n,label:"All entities"},{value:"issue",label:"Task"},{value:"agent",label:"Agent"},{value:"project",label:"Project"},{value:"goal",label:"Goal"},{value:"company",label:"Company"}];function Be(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Be,"toStartIso");function Ve(t){if(!t)return;const a=new Date(`${t}T23:59:59.999Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Ve,"toEndIso");function $e({record:t,agentMap:a,userProfileMap:d}){const u=t.agentId??(t.actorType==="agent"?t.actorId:null),c=u?a.get(u):null;if(c)return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",title:c.name,children:[(0,e.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,e.jsx)(je,{agent:c,size:16,className:"h-3 w-3"})}),(0,e.jsx)("span",{className:"truncate font-medium text-foreground",children:c.name})]});if(t.actorType==="user"&&t.actorId){const m=d.get(t.actorId);return(0,e.jsx)(ee,{name:m?.label??"User",avatarUrl:m?.image??null,size:"sm",className:"font-medium text-foreground"})}const h=t.actorType==="plugin"?"Plugin":t.actorType==="agent"?"Agent":t.actorType==="user"?"User":"System";return(0,e.jsx)(ee,{name:h,size:"sm",className:"font-medium text-foreground"})}r($e,"AuditActor");function qe({record:t}){const{issue:a,document:d}=t.entity,u=a?.identifier??a?.id??null;return u?(0,e.jsx)(re,{to:`/issues/${u}`,className:"font-medium text-primary hover:underline",children:a?.identifier?`${a.identifier}${a.title?` · ${a.title}`:""}`:"the task"}):d?(0,e.jsx)("span",{className:"font-medium text-foreground",children:d.key}):(0,e.jsx)("span",{className:"text-muted-foreground",children:t.entityType})}r(qe,"AuditEntityNode");function ze({record:t,agentMap:a,userProfileMap:d}){const u=Ue(t.action,t.details,{agentMap:a,userProfileMap:d}),c=t.responsibleUserId?d.get(t.responsibleUserId):null,h=!!(t.responsibleUserId&&!(t.actorType==="user"&&t.actorId===t.responsibleUserId)),m=c?.label??(t.responsibleUserId?"a user":null),g=t.entity.comment?.excerpt?.trim(),x=t.entity.issue&&t.entity.document?t.entity.document.key:null;return(0,e.jsx)("li",{className:"px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground",children:[(0,e.jsx)($e,{record:t,agentMap:a,userProfileMap:d}),(0,e.jsx)("span",{className:"text-muted-foreground",children:u}),(0,e.jsx)(qe,{record:t})]}),g?(0,e.jsxs)("p",{className:"line-clamp-2 border-l-2 border-border pl-2 text-muted-foreground",children:["“",g,"”"]}):null,x?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Document ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:x})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[h&&m?(0,e.jsxs)("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5",children:["on behalf of ",m]}):null,t.runId&&t.agentId?(0,e.jsx)(re,{to:`/agents/${t.agentId}/runs/${t.runId}`,className:"text-primary hover:underline",children:"View run"}):null,(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) opacity-70",children:t.action})]})]}),(0,e.jsx)("time",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),children:ye(t.createdAt)})]})})}r(ze,"AuditRow");function Me(){return(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(Pe,{className:"h-10 w-10 text-muted-foreground/50"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Agent audit is a Paperclip Enterprise view"}),(0,e.jsxs)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:["The agent audit log gives you a searchable, exportable record of everything your agents did — every comment, task change, approval, and run — with the responsible person for each action. Ask an administrator to grant you the"," ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:"audit:view_agent_actions"})," ","permission to view it."]})]})]})})}r(Me,"AuditUpsell");function Oe({companyId:t,lockedAgentId:a,hideHeader:d,mode:u,onModeChange:c}){const{pushToast:h}=Re(),[m,g]=(0,l.useState)(n),[x,B]=(0,l.useState)(n),[S,V]=(0,l.useState)(n),[C,$]=(0,l.useState)(n),[E,q]=(0,l.useState)(""),[I,z]=(0,l.useState)(""),[Z,Q]=(0,l.useState)(!1),[U,H]=(0,l.useState)(!1),M=X({queryKey:G.agents.list(t),queryFn:r(()=>we.list(t),"queryFn")}),O=X({queryKey:G.access.companyUserDirectory(t),queryFn:r(()=>Se.listUserDirectory(t),"queryFn"),retry:!1}),ie=(0,l.useMemo)(()=>new Map((M.data??[]).map(s=>[s.id,s])),[M.data]),le=(0,l.useMemo)(()=>Ce(O.data?.users),[O.data]),f=a?"agents":u??"all",o={actorScope:f,agentId:a??(m===n?void 0:m),responsibleUserId:x===n?void 0:x,action:S===n?void 0:S,entityType:C===n?void 0:C,from:Be(E),to:Ve(I)},b=!!(!a&&m!==n||x!==n||S!==n||C!==n||E||I),i=Ee({queryKey:G.audit.agentActions(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),queryFn:r(({pageParam:s})=>ae.listAgentActions(t,{...o,limit:De,cursor:s??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:r(s=>s.nextCursor??void 0,"getNextPageParam"),retry:r((s,p)=>!(p instanceof W&&p.status===403)&&s<2,"retry")}),K=i.error instanceof W&&i.error.status===403,P=i.data?.pages.some(s=>s.accessTier==="basic")??!1,oe=i.data?.pages.some(s=>s.accessTier==="full")??!1,Y=(0,l.useMemo)(()=>{const s=i.data?.pages??[];return(P?s.filter(p=>p.accessTier!=="full"):s).flatMap(p=>p.items)},[i.data,P]),L=P?"basic":i.data?.pages[0]?.accessTier,N=P&&oe,ce=a?!0:L==="full",de=!!(N&&U&&!i.isFetching),R=!!(!a&&!de&&(K&&b||N)),w=!!(K&&!a&&f==="agents"&&c),ue=!!(!a&&c&&!w&&(f==="agents"||L==="full"));(0,l.useEffect)(()=>{w&&c?.("all")},[w,c]),(0,l.useEffect)(()=>{!a&&(L==="basic"||R)&&(g(n),B(n),V(n),$(n),q(""),z(""))},[L,N,a,R]),(0,l.useEffect)(()=>{if(!N){U&&H(!1);return}U||(H(!0),i.refetch())},[U,i,N]);const J=r(()=>{g(n),B(n),V(n),$(n),q(""),z("")},"clearFilters"),me=r(async()=>{Q(!0);try{const s=await ae.exportAgentActionsCsv(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),p=URL.createObjectURL(s),A=document.createElement("a");A.href=p,A.download=`${f==="agents"?"agent-audit":"activity"}-${t}.csv`,document.body.appendChild(A),A.click(),A.remove(),window.setTimeout(()=>URL.revokeObjectURL(p),5e3),h({title:"Audit exported",body:"Your CSV download has started.",tone:"success"})}catch(s){h({title:"Export failed",body:s instanceof Error?s.message:"Could not export the audit log.",tone:"error"})}finally{Q(!1)}},"handleExport");return K&&!R&&!w?(0,e.jsx)(Me,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[d?null:(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Activity"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:f==="agents"?"Every recorded agent action, newest first — with the responsible person and run behind each one.":"Everything happening in your company, newest first — people, agents, and the system. Each line is one recorded action."})]})}),ue?(0,e.jsx)(Ne,{value:f,onValueChange:r(s=>c?.(s),"onValueChange"),children:(0,e.jsxs)(be,{"aria-label":"Activity scope",children:[(0,e.jsx)(te,{value:"all",children:"All activity"}),(0,e.jsx)(te,{value:"agents",children:"Agent actions"})]})}):null,ce?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a?null:(0,e.jsxs)(k,{value:m,onValueChange:g,children:[(0,e.jsx)(F,{className:"w-40",children:(0,e.jsx)(_,{placeholder:"Agent"})}),(0,e.jsxs)(D,{children:[(0,e.jsx)(y,{value:n,children:"All agents"}),(M.data??[]).map(s=>(0,e.jsx)(y,{value:s.id,children:s.name},s.id))]})]}),(0,e.jsxs)(k,{value:x,onValueChange:B,children:[(0,e.jsx)(F,{className:"w-52",children:(0,e.jsx)(_,{placeholder:"Responsible user"})}),(0,e.jsxs)(D,{children:[(0,e.jsx)(y,{value:n,children:"All responsible users"}),(O.data?.users??[]).map(s=>(0,e.jsx)(y,{value:s.principalId,children:s.user?.name??s.user?.email??s.principalId.slice(0,8)},s.principalId))]})]}),(0,e.jsxs)(k,{value:S,onValueChange:V,children:[(0,e.jsx)(F,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Action"})}),(0,e.jsx)(D,{children:Fe.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsxs)(k,{value:C,onValueChange:$,children:[(0,e.jsx)(F,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Entity"})}),(0,e.jsx)(D,{children:ke.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsx)(se,{type:"date","aria-label":"From date",value:E,max:I||void 0,onChange:r(s=>q(s.target.value),"onChange"),className:"w-36"}),(0,e.jsx)(se,{type:"date","aria-label":"To date",value:I,min:E||void 0,onChange:r(s=>z(s.target.value),"onChange"),className:"w-36"}),b?(0,e.jsx)(T,{variant:"ghost",size:"sm",onClick:J,children:"Clear filters"}):null,(0,e.jsxs)(T,{variant:"outline",size:"sm",className:"ml-auto",onClick:me,disabled:Z||i.isLoading||Y.length===0,children:[(0,e.jsx)(Ie,{className:"mr-1.5 h-4 w-4"}),Z?"Exporting…":"Export CSV"]})]}):null,R||w?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Refreshing audit access…"})}):i.isLoading?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Loading…"})}):i.error?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i.error instanceof Error?i.error.message:"Failed to load the audit log."}),(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.refetch(),"onClick"),children:"Try again"})]})}):Y.length===0?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(_e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:b?"No actions match these filters":"Nothing here yet"}),(0,e.jsx)("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:b?"Try a wider date range or different filters.":f==="agents"?"As soon as your agents start doing things, their actions show up here.":"As soon as anyone in your company does something, it shows up here."})]}),b?(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:J,children:"Clear filters"}):null]})}):(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"px-0 py-0",children:(0,e.jsx)("ul",{className:ge("divide-y divide-border"),children:Y.map(s=>(0,e.jsx)(ze,{record:s,agentMap:ie,userProfileMap:le},s.id))})})}),i.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.fetchNextPage(),"onClick"),disabled:i.isFetchingNextPage,children:i.isFetchingNextPage?"Loading…":"Load more"})}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Recorded by Paperclip — entries can't be edited. Sensitive values are never stored."})]})}r(Oe,"AuditFeed");function rt(){const{selectedCompanyId:t}=fe(),{setBreadcrumbs:a}=Ae(),[d,u]=ve(),c=d.get("mode")==="agents"?"agents":"all";(0,l.useEffect)(()=>{a([{label:"Activity"}])},[a]);const h=(0,l.useCallback)(m=>{u(g=>{const x=new URLSearchParams(g);return m==="agents"?x.set("mode","agents"):x.delete("mode"),x},{replace:!0})},[u]);return t?(0,e.jsx)(Oe,{companyId:t,mode:c,onModeChange:h}):(0,e.jsx)(Te,{icon:Le,message:"Select a company to view activity."})}r(rt,"CompanyActivity");export{rt as CompanyActivity};
|
|
1
|
+
var xe=Object.defineProperty;var r=(t,a)=>xe(t,"name",{value:a,configurable:!0});import{i as ne}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as pe,Lr as he,S as ge,U as fe,Y as G,Yn as W,nr as X,z as ye}from"./createLucideIcon-r3v6fbGz.js";import{ct as ve,t as re}from"./router-Bb8nJWyv.js";import{r as ee,t as je}from"./AgentAvatar-PT82VwmU.js";import{i as te,r as be,t as Ne}from"./tabs-DWRZjksg.js";import{t as we}from"./agents-BlSzFh-1.js";import{r as Ae,t as Te}from"./EmptyState-DPcc0zYh.js";import{c as _,i as y,n as D,s as F,t as k}from"./select-mS22eY6T.js";import{t as T}from"./button-CAPbz11u.js";import{t as se}from"./input-DpsS9it-.js";import{o as Se,r as Ce}from"./company-members-BcZm1g8Q.js";import{r as v,t as j}from"./card-dmVcp3AX.js";import{Gn as Ee,O as ae,Pn as Ie,Rt as Ue,_n as Pe,bn as Le,fn as Re,yn as _e}from"./index-BqF0txu7.js";var l=ne(he(),1),e=ne(pe(),1),De=50,n="__all",Fe=[{value:n,label:"All actions"},{value:"issue.",label:"Tasks"},{value:"agent.",label:"Agents"},{value:"heartbeat.",label:"Runs"},{value:"approval.",label:"Approvals"},{value:"project.",label:"Projects"},{value:"goal.",label:"Goals"},{value:"tool_gateway.",label:"Tools"},{value:"cost.",label:"Costs"},{value:"company.",label:"Company"}],ke=[{value:n,label:"All entities"},{value:"issue",label:"Task"},{value:"agent",label:"Agent"},{value:"project",label:"Project"},{value:"goal",label:"Goal"},{value:"company",label:"Company"}];function Be(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Be,"toStartIso");function Ve(t){if(!t)return;const a=new Date(`${t}T23:59:59.999Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Ve,"toEndIso");function $e({record:t,agentMap:a,userProfileMap:d}){const u=t.agentId??(t.actorType==="agent"?t.actorId:null),c=u?a.get(u):null;if(c)return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",title:c.name,children:[(0,e.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,e.jsx)(je,{agent:c,size:16,className:"h-3 w-3"})}),(0,e.jsx)("span",{className:"truncate font-medium text-foreground",children:c.name})]});if(t.actorType==="user"&&t.actorId){const m=d.get(t.actorId);return(0,e.jsx)(ee,{name:m?.label??"User",avatarUrl:m?.image??null,size:"sm",className:"font-medium text-foreground"})}const h=t.actorType==="plugin"?"Plugin":t.actorType==="agent"?"Agent":t.actorType==="user"?"User":"System";return(0,e.jsx)(ee,{name:h,size:"sm",className:"font-medium text-foreground"})}r($e,"AuditActor");function qe({record:t}){const{issue:a,document:d}=t.entity,u=a?.identifier??a?.id??null;return u?(0,e.jsx)(re,{to:`/issues/${u}`,className:"font-medium text-primary hover:underline",children:a?.identifier?`${a.identifier}${a.title?` · ${a.title}`:""}`:"the task"}):d?(0,e.jsx)("span",{className:"font-medium text-foreground",children:d.key}):(0,e.jsx)("span",{className:"text-muted-foreground",children:t.entityType})}r(qe,"AuditEntityNode");function ze({record:t,agentMap:a,userProfileMap:d}){const u=Ue(t.action,t.details,{agentMap:a,userProfileMap:d}),c=t.responsibleUserId?d.get(t.responsibleUserId):null,h=!!(t.responsibleUserId&&!(t.actorType==="user"&&t.actorId===t.responsibleUserId)),m=c?.label??(t.responsibleUserId?"a user":null),g=t.entity.comment?.excerpt?.trim(),x=t.entity.issue&&t.entity.document?t.entity.document.key:null;return(0,e.jsx)("li",{className:"px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground",children:[(0,e.jsx)($e,{record:t,agentMap:a,userProfileMap:d}),(0,e.jsx)("span",{className:"text-muted-foreground",children:u}),(0,e.jsx)(qe,{record:t})]}),g?(0,e.jsxs)("p",{className:"line-clamp-2 border-l-2 border-border pl-2 text-muted-foreground",children:["“",g,"”"]}):null,x?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Document ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:x})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[h&&m?(0,e.jsxs)("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5",children:["on behalf of ",m]}):null,t.runId&&t.agentId?(0,e.jsx)(re,{to:`/agents/${t.agentId}/runs/${t.runId}`,className:"text-primary hover:underline",children:"View run"}):null,(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) opacity-70",children:t.action})]})]}),(0,e.jsx)("time",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),children:ye(t.createdAt)})]})})}r(ze,"AuditRow");function Me(){return(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(Pe,{className:"h-10 w-10 text-muted-foreground/50"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Agent audit is a Paperclip Enterprise view"}),(0,e.jsxs)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:["The agent audit log gives you a searchable, exportable record of everything your agents did — every comment, task change, approval, and run — with the responsible person for each action. Ask an administrator to grant you the"," ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:"audit:view_agent_actions"})," ","permission to view it."]})]})]})})}r(Me,"AuditUpsell");function Oe({companyId:t,lockedAgentId:a,hideHeader:d,mode:u,onModeChange:c}){const{pushToast:h}=Re(),[m,g]=(0,l.useState)(n),[x,B]=(0,l.useState)(n),[S,V]=(0,l.useState)(n),[C,$]=(0,l.useState)(n),[E,q]=(0,l.useState)(""),[I,z]=(0,l.useState)(""),[Z,Q]=(0,l.useState)(!1),[U,H]=(0,l.useState)(!1),M=X({queryKey:G.agents.list(t),queryFn:r(()=>we.list(t),"queryFn")}),O=X({queryKey:G.access.companyUserDirectory(t),queryFn:r(()=>Se.listUserDirectory(t),"queryFn"),retry:!1}),ie=(0,l.useMemo)(()=>new Map((M.data??[]).map(s=>[s.id,s])),[M.data]),le=(0,l.useMemo)(()=>Ce(O.data?.users),[O.data]),f=a?"agents":u??"all",o={actorScope:f,agentId:a??(m===n?void 0:m),responsibleUserId:x===n?void 0:x,action:S===n?void 0:S,entityType:C===n?void 0:C,from:Be(E),to:Ve(I)},b=!!(!a&&m!==n||x!==n||S!==n||C!==n||E||I),i=Ee({queryKey:G.audit.agentActions(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),queryFn:r(({pageParam:s})=>ae.listAgentActions(t,{...o,limit:De,cursor:s??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:r(s=>s.nextCursor??void 0,"getNextPageParam"),retry:r((s,p)=>!(p instanceof W&&p.status===403)&&s<2,"retry")}),K=i.error instanceof W&&i.error.status===403,P=i.data?.pages.some(s=>s.accessTier==="basic")??!1,oe=i.data?.pages.some(s=>s.accessTier==="full")??!1,Y=(0,l.useMemo)(()=>{const s=i.data?.pages??[];return(P?s.filter(p=>p.accessTier!=="full"):s).flatMap(p=>p.items)},[i.data,P]),L=P?"basic":i.data?.pages[0]?.accessTier,N=P&&oe,ce=a?!0:L==="full",de=!!(N&&U&&!i.isFetching),R=!!(!a&&!de&&(K&&b||N)),w=!!(K&&!a&&f==="agents"&&c),ue=!!(!a&&c&&!w&&(f==="agents"||L==="full"));(0,l.useEffect)(()=>{w&&c?.("all")},[w,c]),(0,l.useEffect)(()=>{!a&&(L==="basic"||R)&&(g(n),B(n),V(n),$(n),q(""),z(""))},[L,N,a,R]),(0,l.useEffect)(()=>{if(!N){U&&H(!1);return}U||(H(!0),i.refetch())},[U,i,N]);const J=r(()=>{g(n),B(n),V(n),$(n),q(""),z("")},"clearFilters"),me=r(async()=>{Q(!0);try{const s=await ae.exportAgentActionsCsv(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),p=URL.createObjectURL(s),A=document.createElement("a");A.href=p,A.download=`${f==="agents"?"agent-audit":"activity"}-${t}.csv`,document.body.appendChild(A),A.click(),A.remove(),window.setTimeout(()=>URL.revokeObjectURL(p),5e3),h({title:"Audit exported",body:"Your CSV download has started.",tone:"success"})}catch(s){h({title:"Export failed",body:s instanceof Error?s.message:"Could not export the audit log.",tone:"error"})}finally{Q(!1)}},"handleExport");return K&&!R&&!w?(0,e.jsx)(Me,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[d?null:(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Activity"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:f==="agents"?"Every recorded agent action, newest first — with the responsible person and run behind each one.":"Everything happening in your company, newest first — people, agents, and the system. Each line is one recorded action."})]})}),ue?(0,e.jsx)(Ne,{value:f,onValueChange:r(s=>c?.(s),"onValueChange"),children:(0,e.jsxs)(be,{"aria-label":"Activity scope",children:[(0,e.jsx)(te,{value:"all",children:"All activity"}),(0,e.jsx)(te,{value:"agents",children:"Agent actions"})]})}):null,ce?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a?null:(0,e.jsxs)(k,{value:m,onValueChange:g,children:[(0,e.jsx)(F,{className:"w-40",children:(0,e.jsx)(_,{placeholder:"Agent"})}),(0,e.jsxs)(D,{children:[(0,e.jsx)(y,{value:n,children:"All agents"}),(M.data??[]).map(s=>(0,e.jsx)(y,{value:s.id,children:s.name},s.id))]})]}),(0,e.jsxs)(k,{value:x,onValueChange:B,children:[(0,e.jsx)(F,{className:"w-52",children:(0,e.jsx)(_,{placeholder:"Responsible user"})}),(0,e.jsxs)(D,{children:[(0,e.jsx)(y,{value:n,children:"All responsible users"}),(O.data?.users??[]).map(s=>(0,e.jsx)(y,{value:s.principalId,children:s.user?.name??s.user?.email??s.principalId.slice(0,8)},s.principalId))]})]}),(0,e.jsxs)(k,{value:S,onValueChange:V,children:[(0,e.jsx)(F,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Action"})}),(0,e.jsx)(D,{children:Fe.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsxs)(k,{value:C,onValueChange:$,children:[(0,e.jsx)(F,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Entity"})}),(0,e.jsx)(D,{children:ke.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsx)(se,{type:"date","aria-label":"From date",value:E,max:I||void 0,onChange:r(s=>q(s.target.value),"onChange"),className:"w-36"}),(0,e.jsx)(se,{type:"date","aria-label":"To date",value:I,min:E||void 0,onChange:r(s=>z(s.target.value),"onChange"),className:"w-36"}),b?(0,e.jsx)(T,{variant:"ghost",size:"sm",onClick:J,children:"Clear filters"}):null,(0,e.jsxs)(T,{variant:"outline",size:"sm",className:"ml-auto",onClick:me,disabled:Z||i.isLoading||Y.length===0,children:[(0,e.jsx)(Ie,{className:"mr-1.5 h-4 w-4"}),Z?"Exporting…":"Export CSV"]})]}):null,R||w?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Refreshing audit access…"})}):i.isLoading?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Loading…"})}):i.error?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i.error instanceof Error?i.error.message:"Failed to load the audit log."}),(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.refetch(),"onClick"),children:"Try again"})]})}):Y.length===0?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(_e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:b?"No actions match these filters":"Nothing here yet"}),(0,e.jsx)("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:b?"Try a wider date range or different filters.":f==="agents"?"As soon as your agents start doing things, their actions show up here.":"As soon as anyone in your company does something, it shows up here."})]}),b?(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:J,children:"Clear filters"}):null]})}):(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"px-0 py-0",children:(0,e.jsx)("ul",{className:ge("divide-y divide-border"),children:Y.map(s=>(0,e.jsx)(ze,{record:s,agentMap:ie,userProfileMap:le},s.id))})})}),i.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.fetchNextPage(),"onClick"),disabled:i.isFetchingNextPage,children:i.isFetchingNextPage?"Loading…":"Load more"})}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Recorded by Paperclip — entries can't be edited. Sensitive values are never stored."})]})}r(Oe,"AuditFeed");function rt(){const{selectedCompanyId:t}=fe(),{setBreadcrumbs:a}=Ae(),[d,u]=ve(),c=d.get("mode")==="agents"?"agents":"all";(0,l.useEffect)(()=>{a([{label:"Activity"}])},[a]);const h=(0,l.useCallback)(m=>{u(g=>{const x=new URLSearchParams(g);return m==="agents"?x.set("mode","agents"):x.delete("mode"),x},{replace:!0})},[u]);return t?(0,e.jsx)(Oe,{companyId:t,mode:c,onModeChange:h}):(0,e.jsx)(Te,{icon:Le,message:"Select a company to view activity."})}r(rt,"CompanyActivity");export{rt as CompanyActivity};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ze=Object.defineProperty;var d=(e,r)=>ze(e,"name",{value:r,configurable:!0});import{i as we}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as De,Ht as _e,Jn as te,Lr as Ue,S as ne,U as We,X as qe,Y as G,at as Ke,nr as X,tr as pe}from"./createLucideIcon-r3v6fbGz.js";import{it as Ye,o as Ze,p as Ge}from"./router-Bb8nJWyv.js";import{Q as Xe}from"./mention-chips-DXumPrOR.js";import{l as He,p as z}from"./zap-P-cXfK28.js";import{t as Je}from"./agents-BlSzFh-1.js";import{g as Qe}from"./StatusIcon-DgMlA1TU.js";import{r as Ve,t as D}from"./EmptyState-DPcc0zYh.js";import{t as H}from"./button-CAPbz11u.js";import{t as fe}from"./MarkdownBody-NJwkQWmo.js";import{t as et}from"./loader-circle-BD9wx-lw.js";import{t as me}from"./rotate-ccw-CRAQ3Xng.js";import{t as tt}from"./PageSkeleton-DHjTwRT3.js";import{Ct as st,Pn as nt,St as rt,Ut as ot,a as at,bt as he,fn as it,i as ct,ln as lt,n as dt,r as ut,t as je,tn as pt,vt as ft,xt as mt,yt as ht}from"./index-
|
|
1
|
+
var ze=Object.defineProperty;var d=(e,r)=>ze(e,"name",{value:r,configurable:!0});import{i as we}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as De,Ht as _e,Jn as te,Lr as Ue,S as ne,U as We,X as qe,Y as G,at as Ke,nr as X,tr as pe}from"./createLucideIcon-r3v6fbGz.js";import{it as Ye,o as Ze,p as Ge}from"./router-Bb8nJWyv.js";import{Q as Xe}from"./mention-chips-DXumPrOR.js";import{l as He,p as z}from"./zap-P-cXfK28.js";import{t as Je}from"./agents-BlSzFh-1.js";import{g as Qe}from"./StatusIcon-DgMlA1TU.js";import{r as Ve,t as D}from"./EmptyState-DPcc0zYh.js";import{t as H}from"./button-CAPbz11u.js";import{t as fe}from"./MarkdownBody-NJwkQWmo.js";import{t as et}from"./loader-circle-BD9wx-lw.js";import{t as me}from"./rotate-ccw-CRAQ3Xng.js";import{t as tt}from"./PageSkeleton-DHjTwRT3.js";import{Ct as st,Pn as nt,St as rt,Ut as ot,a as at,bt as he,fn as it,i as ct,ln as lt,n as dt,r as ut,t as je,tn as pt,vt as ft,xt as mt,yt as ht}from"./index-BqF0txu7.js";var h=we(Ue(),1),xt=["agents","projects","skills","routines","tasks","attachments"],gt={agents:"Agents",projects:"Projects",skills:"Skills",routines:"Routines",tasks:"Tasks",attachments:"Attachments"};function bt(){return{agents:!0,projects:!0,skills:!0,routines:!0,tasks:!0,attachments:!0}}d(bt,"buildDefaultExportCategorySelection");function ye(e){return e.tasks||e.routines}d(ye,"isAttachmentsCategoryEnabled");function ve(e){const r=new Set;for(const a of e){if(!a.recurring)continue;const n=a.path.trim();if(!n)continue;r.add(n);const o=n.lastIndexOf("/");o>=0&&r.add(`${n.slice(0,o+1)}`)}return r}d(ve,"buildRecurringTaskPrefixes");function wt(e,r){for(const a of r)if(e===a||e.startsWith(a))return!0;return!1}d(wt,"isRecurringTaskFile");function jt(e){const r=new Set,a=new Set;for(const n of e)for(const o of n.attachments??[]){const c=o.sha256.trim().toLowerCase();c&&(n.recurring?r:a).add(c)}return{recurring:r,oneOff:a}}d(jt,"buildAttachmentShaOwnership");var yt=new Set(["agents","projects","skills","routines","tasks"]);function vt(e){const r=new Map;for(const a of e){const n=a.sha256.trim().toLowerCase();if(!n)continue;const o=r.get(n)??new Set,c=a.ownedBy&&a.ownedBy.length>0?a.ownedBy:["always"];for(const p of c)o.add(p);r.set(n,o)}return r}d(vt,"buildEmbeddedAssetShaOwnership");function kt(e,r){for(const a of e)if(!yt.has(a)||r[a])return!0;return!1}d(kt,"isEmbeddedAssetBlobIncluded");function ke(e,r){return e.startsWith("agents/")?"agents":e.startsWith("projects/")?"projects":e.startsWith("skills/")?"skills":e.startsWith("tasks/")?wt(e,r)?"routines":"tasks":e.startsWith("blobs/")?"attachments":null}d(ke,"categorizeExportFile");function St(e,r){const a=ve(r),n={agents:0,projects:0,skills:0,routines:0,tasks:0,attachments:0};for(const o of e){const c=ke(o,a);c&&(n[c]+=1)}return n}d(St,"countExportFilesByCategory");function Ct(e){const{filePaths:r,issues:a,categories:n}=e,o=ve(a),c=jt(a),p=vt(e.embeddedAssets??[]),f=n.attachments&&ye(n),x=new Set;for(const l of r){const b=ke(l,o);if(b===null){x.add(l);continue}if(b==="attachments"){const i=l.slice(6).trim().toLowerCase(),g=p.get(i);if(g&&kt(g,n)){x.add(l);continue}if(!f)continue;const j=c.recurring.has(i),y=c.oneOff.has(i);!j&&!y?g||x.add(l):(y&&n.tasks||j&&n.routines)&&x.add(l);continue}n[b]&&x.add(l)}return x}d(Ct,"buildExportCheckedFiles");function Se(e,r){if(!r.has(e))return r.add(e),e;let a=2;for(;;){const n=`${e}-${a}`;if(!r.has(n))return r.add(n),n;a+=1}}d(Se,"uniqueSlug");function Et(e){const r=new Set,a=new Map,n=[...e].sort((o,c)=>o.name.localeCompare(c.name));for(const o of n){const c=_e(o.name)??"agent";a.set(o.id,Se(c,r))}return a}d(Et,"buildPortableAgentSlugMap");function Nt(e){const r=new Set,a=new Map,n=[...e].sort((o,c)=>o.name.localeCompare(c.name));for(const o of n){const c=Ke(o.name,o.name);a.set(o.id,Se(c,r))}return a}d(Nt,"buildPortableProjectSlugMap");function At(e){const r=Et(e.agents),a=Nt(e.projects),n={agents:e.orderedAgents.map(o=>r.get(o.id)).filter(o=>!!o),projects:e.orderedProjects.map(o=>a.get(o.id)).filter(o=>!!o)};return n.agents.length>0||n.projects.length>0?n:void 0}d(At,"buildPortableSidebarOrder");var t=we(De(),1);function Ce(e){const r=new Set,a=new Set,n=new Set;for(const o of e){const c=o.match(/^agents\/([^/]+)\//);c&&r.add(c[1]);const p=o.match(/^projects\/([^/]+)\//);p&&a.add(p[1]);const f=o.match(/^tasks\/([^/]+)\//);f&&n.add(f[1])}return{agents:r,projects:a,tasks:n,routines:new Set(n)}}d(Ce,"checkedSlugs");function Pt(e,r){const a=Ce(r),n=e.split(`
|
|
2
2
|
`),o=[],c=new Set(["agents","projects","tasks","routines"]),p=new Set(["agents","projects"]);let f=null,x=null,l=!0,b=null,i=null,g=[],j=null,y=[];function T(){i!==null&&g.length>0&&(y.push(i),y.push(...g)),i=null,g=[]}d(T,"flushSidebarSection");function N(){T(),j!==null&&y.length>0&&(o.push(j),o.push(...y)),j=null,y=[]}d(N,"flushSection");for(const w of n){const U=w.match(/^([a-zA-Z_][\w-]*):\s*(.*)$/);if(U&&!w.startsWith(" ")){N(),x=null,l=!0;const E=U[0].split(":")[0];if(c.has(E)){f=E,j=w;continue}else if(E==="sidebar"){f=E,b=null,j=w;continue}else{f=null,o.push(w);continue}}if(f==="sidebar"){const E=w.match(/^ ([\w-]+):\s*$/);if(E&&!w.startsWith(" ")){T();const A=E[1];b=A&&p.has(A)?A:null,i=b?w:null;continue}const L=w.match(/^ - ["']?([^"'\n]+)["']?\s*$/);if(L&&b){const A=L[1],W=a[b];A&&W.has(A)&&g.push(w);continue}if(b){g.push(w);continue}}if(f&&c.has(f)){const E=w.match(/^ ([\w][\w-]*):\s*(.*)$/);if(E&&!w.startsWith(" ")){const L=E[1];x=L,l=a[f].has(L),l&&y.push(w);continue}if(x!==null){l&&y.push(w);continue}y.push(w);continue}o.push(w)}N();let C=o.join(`
|
|
3
3
|
`);const _=C.match(/^\s{2}logoPath:\s*["']?([^"'\n]+)["']?\s*$/m);return _&&!r.has(_[1])&&(C=C.replace(/^\s{2}logoPath:\s*["']?([^"'\n]+)["']?\s*\n?/m,"")),C}d(Pt,"filterPaperclipYaml");function Ee(e,r){if(!r)return e;const a=r.toLowerCase();return e.map(n=>{if(n.kind==="file")return n.name.toLowerCase().includes(a)||n.path.toLowerCase().includes(a)?n:null;const o=Ee(n.children,r);return o.length>0?{...n,children:o}:null}).filter(n=>n!==null)}d(Ee,"filterTree");function Rt(e,r){const a=new Set,n=r.toLowerCase();function o(c,p){if(c.kind==="file"){if(c.name.toLowerCase().includes(n)||c.path.toLowerCase().includes(n))for(const f of p)a.add(f)}else for(const f of c.children)o(f,[...p,c.path])}d(o,"walk");for(const c of e)o(c,[]);return a}d(Rt,"collectMatchedParentDirs");var xe=10;function Tt(e,r,a,n){let o=0,c=0;return{nodes:e.map(p=>{if(p.kind==="dir"&&p.name==="tasks"){o=p.children.length;const f=[],x=[],l=a.toLowerCase();for(const g of p.children){const j=mt([g],"file"),y=n!==null&&j.has(n),T=a&&(g.name.toLowerCase().includes(l)||g.path.toLowerCase().includes(l)||[...j].some(N=>N.toLowerCase().includes(l)));y||T?f.push(g):x.push(g)}const b=Math.max(0,r-f.length),i=[...f,...x.slice(0,b)];return c=i.length,{...p,children:i}}return p}),totalTaskChildren:o,visibleTaskChildren:c}}d(Tt,"paginateTaskNodes");function Ne(e,r,a){const n={};for(const o of Object.keys(e))r.has(o)&&(n[o]=a[o]??e[o]);return n}d(Ne,"filterExportForDownload");function Lt(e,r,a){const n=Ne(e.files,r,a),o=ct(n,e.rootPath),c=new ArrayBuffer(o.byteLength);new Uint8Array(c).set(o);const p=new Blob([c],{type:"application/zip"}),f=URL.createObjectURL(p),x=document.createElement("a");x.href=f,x.download=`${e.rootPath}.zip`,document.body.appendChild(x),x.click(),x.remove(),window.setTimeout(()=>URL.revokeObjectURL(f),1e3)}d(Lt,"downloadZip");function Ot({data:e,onSkillClick:r}){return(0,t.jsx)("div",{className:"rounded-md border border-border bg-accent/20 px-4 py-3 mb-4",children:(0,t.jsx)("dl",{className:"grid grid-cols-(--gtc-5) gap-x-4 gap-y-1.5 text-sm",children:Object.entries(e).map(([a,n])=>(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-muted-foreground whitespace-nowrap py-0.5",children:ft[a]??a}),(0,t.jsx)("dd",{className:"py-0.5",children:Array.isArray(n)?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(o=>(0,t.jsx)("button",{type:"button",className:ne("inline-flex items-center rounded-md border border-border bg-background px-2 py-0.5 text-xs",a==="skills"&&r&&"cursor-pointer hover:bg-accent/50 hover:border-foreground/30 transition-colors"),onClick:d(()=>a==="skills"&&r?.(o),"onClick"),children:o},o))}):(0,t.jsx)("span",{children:n})})]},a))})})}d(Ot,"FrontmatterCard");var Mt={ceo:"CEO",cto:"CTO",cmo:"CMO",cfo:"CFO",coo:"COO",vp:"VP",manager:"Manager",engineer:"Engineer",agent:"Agent"};function Ft(e,r,a,n){const o=Ce(r),c=e.agents.filter(i=>o.agents.has(i.slug)),p=e.projects.filter(i=>o.projects.has(i.slug)),f=e.issues.filter(i=>o.tasks.has(i.slug)),x=e.skills.filter(i=>[...r].some(g=>g.startsWith(`skills/${i.key}/`)||g.startsWith("skills/")&&g.includes(`/${i.slug}/`))),l=[];l.push(`# ${a}`),l.push(""),n&&(l.push(`> ${n}`),l.push("")),c.length>0&&(l.push(""),l.push("")),l.push("## What's Inside"),l.push(""),l.push("This is an [Agent Company](https://paperclip.ing) package."),l.push("");const b=[];if(c.length>0&&b.push(["Agents",c.length]),p.length>0&&b.push(["Projects",p.length]),x.length>0&&b.push(["Skills",x.length]),f.length>0&&b.push(["Tasks",f.length]),b.length>0){l.push("| Content | Count |"),l.push("|---------|-------|");for(const[i,g]of b)l.push(`| ${i} | ${g} |`);l.push("")}if(c.length>0){l.push("### Agents"),l.push(""),l.push("| Agent | Role | Reports To |"),l.push("|-------|------|------------|");for(const i of c){const g=Mt[i.role]??i.role,j=i.reportsToSlug??"—";l.push(`| ${i.name} | ${g} | ${j} |`)}l.push("")}if(p.length>0){l.push("### Projects"),l.push("");for(const i of p){const g=i.description?` — ${i.description}`:"";l.push(`- **${i.name}**${g}`)}l.push("")}return l.push("## Getting Started"),l.push(""),l.push("```bash"),l.push("npx @tickernelz/paperclip-pro company import this-github-url-or-folder"),l.push("```"),l.push(""),l.push("See [Paperclip](https://paperclip.ing) for more information."),l.push(""),l.push("---"),l.push(`Exported from [Paperclip](https://paperclip.ing) on ${new Date().toISOString().split("T")[0]}`),l.push(""),l.join(`
|
|
4
4
|
`)}d(Ft,"generateReadmeFromSelection");function It(e){const{src:r,selectedFile:a,allFiles:n,orgChartPreviewUrl:o}=e;if(/^(?:https?:|data:)/i.test(r))return null;if(r.replace(/^\.\//,"")==="images/org-chart.png"&&o)return o;const c=(a.includes("/")?a.slice(0,a.lastIndexOf("/")+1):"")+r,p=n[c]??n[r];return p?je(c in n?c:r,p):null}d(It,"resolveExportPreviewImageSrc");function $t({selectedFile:e,content:r,allFiles:a,orgChartPreviewUrl:n,onSkillClick:o}){if(!e||r===null)return(0,t.jsx)(D,{icon:z,message:"Select a file to preview its contents."});const c=dt(r),p=e.endsWith(".md")&&c!==null,f=p&&c?st(c):null,x=ut(e,r)?je(e,r):null,l=p?b=>It({src:b,selectedFile:e,allFiles:a,orgChartPreviewUrl:n}):void 0;return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"border-b border-border px-5 py-3",children:(0,t.jsx)("div",{className:"truncate font-mono text-sm",children:e})}),(0,t.jsx)("div",{className:"min-h-(--sz-560px) px-5 py-5",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ot,{data:f.data,onSkillClick:o}),f.body.trim()&&(0,t.jsx)(fe,{resolveImageSrc:l,softBreaks:!1,linkIssueReferences:!1,children:f.body})]}):p?(0,t.jsx)(fe,{resolveImageSrc:l,softBreaks:!1,linkIssueReferences:!1,children:c??""}):x?(0,t.jsx)("div",{className:"flex min-h-(--sz-520px) items-center justify-center rounded-lg border border-border bg-accent/10 p-6",children:(0,t.jsx)("img",{src:x,alt:e,className:"max-h-(--sz-480px) max-w-full object-contain"})}):c!==null?(0,t.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words border-0 bg-transparent p-0 font-mono text-sm text-foreground",children:(0,t.jsx)("code",{children:c})}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-accent/10 px-4 py-3 text-sm text-muted-foreground",children:"Binary asset preview is not available for this file type."})})]})}d($t,"ExportPreviewPane");function ge(e){const r="/company/export/files/",a=Ge(e),n=a.indexOf(r);return n===-1?null:decodeURIComponent(a.slice(n+22))||null}d(ge,"filePathFromLocation");function be(e){const r=e.split("/").slice(0,-1),a=[];let n="";for(const o of r)n=n?`${n}/${o}`:o,a.push(n);return a}d(be,"expandAncestors");function Bt(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}d(Bt,"isAbortError");function se(e){return e instanceof Error?e.message:"Failed to load export data."}d(se,"previewErrorMessage");function es(){const{selectedCompanyId:e,selectedCompany:r}=We(),{setBreadcrumbs:a}=Ve(),{pushToast:n}=it(),o=Ze(),c=Ye(),p=(0,h.useRef)(ge(c.pathname)),{data:f}=X({queryKey:G.auth.session,queryFn:d(()=>qe.getSession(),"queryFn")}),{data:x=[]}=X({queryKey:G.agents.list(e),queryFn:d(()=>Je.list(e),"queryFn"),enabled:!!e}),{data:l=[]}=X({queryKey:G.projects.list(e),queryFn:d(()=>Qe.list(e),"queryFn"),enabled:!!e}),{data:b}=X({queryKey:G.companies.exportFidelity(e),queryFn:d(()=>te.exportFidelity(e),"queryFn"),enabled:!!e}),[i,g]=(0,h.useState)(null),[j,y]=(0,h.useState)(null),[T,N]=(0,h.useState)(new Set),[C,_]=(0,h.useState)(()=>({...bt(),tasks:!1,routines:!1,attachments:!1})),[w,U]=(0,h.useState)(""),[E,L]=(0,h.useState)(xe),[A,W]=(0,h.useState)(!1),q=(0,h.useRef)(null),I=(0,h.useRef)(null),M=(0,h.useRef)(0),re=(0,h.useRef)(null),oe=f?.user?.id??f?.session?.userId??null,J=(0,h.useMemo)(()=>x.filter(s=>s.status!=="terminated"),[x]),Q=(0,h.useMemo)(()=>l,[l]),{orderedAgents:ae}=lt({agents:J,companyId:e,userId:oe}),{orderedProjects:ie}=pt({projects:Q,companyId:e,userId:oe}),ce=(0,h.useMemo)(()=>At({agents:J,orderedAgents:ae,projects:Q,orderedProjects:ie}),[ae,ie,J,Q]),V=C.tasks||C.routines,ee=(0,h.useCallback)((s,u=!1)=>{y(s),s?o(`/company/export/files/${encodeURI(s)}`,{replace:u}):o("/company/export",{replace:u})},[o]);(0,h.useEffect)(()=>{if(!i)return;const s=ge(c.pathname);s&&s in i.files&&s!==j?(y(s),N(u=>{const m=new Set(u);for(const v of be(s))m.add(v);return m})):!s&&j&&y(null)},[c.pathname,i]),(0,h.useEffect)(()=>{a([{label:r?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Export"}])},[r?.name,a]);const P=pe({mutationFn:d(({includeIssues:s,includeSkills:u,signal:m})=>te.exportPreview(e,{include:{company:!0,agents:!0,projects:!0,issues:s,skills:u},sidebarOrder:ce},{signal:m}),"mutationFn"),onSuccess:d((s,u)=>{if(u.requestId!==M.current)return;g(s);const m=he(s.files),v=new Set;for(const k of m)k.kind==="dir"&&k.name!=="tasks"&&v.add(k.path);const S=p.current;if(S&&S in s.files){y(S);const k=be(S);N(new Set([...v,...k]))}else{const k="README.md"in s.files?"README.md":Object.keys(s.files)[0];k&&ee(k,!0),N(v)}},"onSuccess"),onError:d((s,u)=>{u.requestId!==M.current||Bt(s)||n({tone:"error",title:"Export failed",body:se(s)})},"onError")});function F(){if(!e)return;I.current?.abort();const s=new AbortController,u=M.current+1;M.current=u,I.current=s,W(!1),P.mutate({includeIssues:V,includeSkills:C.skills,requestId:u,signal:s.signal})}d(F,"startPreviewRequest");const K=pe({mutationFn:d(()=>te.exportBundle(e,{include:{company:!0,agents:!0,projects:!0,issues:V,skills:C.skills},selectedFiles:Array.from(R).sort(),sidebarOrder:ce}),"mutationFn"),onSuccess:d(s=>{const u=new Set(Object.keys(s.files));Lt(s,u,s.files),n({tone:"success",title:"Export downloaded",body:`${u.size} file${u.size===1?"":"s"} exported as ${s.rootPath}.zip`})},"onSuccess"),onError:d(s=>{n({tone:"error",title:"Export failed",body:s instanceof Error?s.message:"Failed to build export package."})},"onError")});(0,h.useEffect)(()=>{e&&(re.current!==e&&(re.current=e,g(null),y(null)),F())},[e,V,C.skills]),(0,h.useEffect)(()=>()=>{M.current+=1,I.current?.abort()},[]);const O=(0,h.useMemo)(()=>i?he(i.files):[],[i]),R=(0,h.useMemo)(()=>i?Ct({filePaths:Object.keys(i.files),issues:i.manifest.issues,categories:C,embeddedAssets:i.manifest.embeddedAssets??[]}):new Set,[i,C]),Ae=(0,h.useMemo)(()=>i?St(Object.keys(i.files),i.manifest.issues):null,[i]),{displayTree:Pe,totalTaskChildren:le,visibleTaskChildren:de}=(0,h.useMemo)(()=>{let s=O;w&&(s=Ee(s,w));const u=Tt(s,E,w,j);return{displayTree:u.nodes,totalTaskChildren:u.totalTaskChildren,visibleTaskChildren:u.visibleTaskChildren}},[O,w,E,j]),Re=(0,h.useMemo)(()=>{const s={};function u(m){if(m.kind==="file"){const S=R.has(m.path);return S||(s[m.path]="muted"),S}let v=!1;for(const S of m.children)u(S)&&(v=!0);return v||(s[m.path]="muted"),v}d(u,"walk");for(const m of O)u(m);return s},[O,R]),Y=(0,h.useMemo)(()=>{if(!i)return{};const s={...i.files},u=i.paperclipExtensionPath;if(u&&typeof i.files[u]=="string"&&(s[u]=Pt(i.files[u],R)),typeof i.files["README.md"]=="string"){const m=i.manifest.company?.name??r?.name??"Company",v=i.manifest.company?.description??null;s["README.md"]=Ft(i.manifest,R,m,v)}return s},[i,R,r?.name]),Te=(0,h.useMemo)(()=>i?at(Ne(i.files,R,Y),i.rootPath):0,[i,R,Y]),ue=(0,h.useMemo)(()=>rt(O),[O]),$=R.size,B=(0,h.useMemo)(()=>i?i.warnings.filter(s=>!/terminated agent/i.test(s)):[],[i]);function Le(s){N(u=>{const m=new Set(u);return m.has(s)?m.delete(s):m.add(s),m})}d(Le,"handleToggleDir");function Oe(s){_(u=>({...u,[s]:!u[s]}))}d(Oe,"handleToggleCategory");function Me(s){const u=w.length>0,m=s.length>0;if(m&&!u&&(q.current=new Set(T)),U(s),m){const v=Rt(O,s);N(S=>{const k=new Set(S);for(const Z of v)k.add(Z);return k})}else u&&q.current&&(N(q.current),q.current=null)}d(Me,"handleSearchChange");function Fe(s){if(!i)return;const u=i.manifest.skills.find(m=>m.key===s||m.slug===s)?.path??`skills/${s}/SKILL.md`;u in i.files&&(ee(u),N(m=>{const v=new Set(m);v.add("skills");const S=u.split("/").slice(0,-1);let k="";for(const Z of S)k=k?`${k}/${Z}`:Z,v.add(k);return v}))}d(Fe,"handleSkillClick");function Ie(){!i||R.size===0||K.isPending||K.mutate()}d(Ie,"handleDownload");function $e(){M.current+=1,I.current?.abort(),I.current=null,P.reset(),W(!0)}if(d($e,"handleCancelPreview"),!e)return(0,t.jsx)(D,{icon:z,message:"Select an organization to export."});if(P.isPending&&!i)return(0,t.jsx)(tt,{variant:"detail"});if(A&&!i)return(0,t.jsx)(D,{icon:z,title:"Export preview cancelled",message:"The preview request was cancelled. Your export settings are unchanged.",action:"Retry preview",onAction:F,hideActionIcon:!0});if(P.isError&&!i)return(0,t.jsx)(D,{icon:z,title:"Export preview failed",message:se(P.error),description:"Retry the preview. You do not need to reload this page.",action:"Retry preview",onAction:F,hideActionIcon:!0});if(!i)return(0,t.jsx)(D,{icon:z,title:"Export preview unavailable",message:"No export preview is loaded.",action:"Load preview",onAction:F,hideActionIcon:!0});const Be=j?Y[j]??null:null;return(0,t.jsxs)("div",{className:"max-w-6xl",children:[(0,t.jsx)("div",{className:"sticky top-0 z-10 border-b border-border bg-background px-5 py-3",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[(0,t.jsxs)("span",{className:"font-medium",children:[r?.name??"Organization"," export"]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Exporting ",$.toLocaleString()," of ",ue.toLocaleString()," file",ue===1?"":"s",$>0&&` (~${ot(Te)})`]}),B.length>0&&(0,t.jsxs)("span",{className:"text-amber-500",children:[B.length," warning",B.length===1?"":"s"]})]}),(0,t.jsxs)(H,{size:"sm",onClick:Ie,disabled:$===0||K.isPending||P.isPending||P.isError||A,children:[(0,t.jsx)(nt,{className:"mr-1.5 h-3.5 w-3.5"}),K.isPending?"Building export...":`Export ${$.toLocaleString()} file${$===1?"":"s"}`]})]})}),B.length>0&&(0,t.jsx)("div",{className:"mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:B.map(s=>(0,t.jsx)("div",{className:"text-xs text-amber-500",children:s},s))}),b&&b.warnings.length>0&&(0,t.jsxs)("div",{className:"mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:[(0,t.jsx)("h3",{className:"mb-1.5 text-xs font-medium",children:"Not included in this export"}),b.warnings.map(s=>(0,t.jsx)("div",{className:ne("text-xs",s.severity==="blocker"?"font-medium text-destructive":"text-amber-500"),children:s.message},s.code))]}),(0,t.jsxs)("div",{className:"grid gap-4 xl:h-(--sz-calc-30) xl:grid-cols-(--gtc-25) xl:gap-0",children:[(0,t.jsxs)("aside",{className:"flex max-h-(--sz-24rem) flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r",children:[(0,t.jsx)("div",{className:"border-b border-border px-4 py-3 shrink-0",children:(0,t.jsx)("h2",{className:"text-base font-semibold",children:"Package files"})}),(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3 shrink-0",children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"What to include"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",role:"group","aria-label":"What to include",children:xt.map(s=>{const u=s==="attachments"&&!ye(C),m=C[s]&&!u,v=Ae?.[s]??0,S=i.manifest.includes.issues||s!=="tasks"&&s!=="routines"&&s!=="attachments";return(0,t.jsxs)("label",{className:ne("flex items-center gap-2 text-sm",u?"cursor-not-allowed opacity-50":"cursor-pointer"),title:u?"Attachments travel with tasks and routines; re-enable one of them to include attachments.":void 0,children:[(0,t.jsx)("input",{type:"checkbox",checked:m,disabled:u,onChange:d(()=>Oe(s),"onChange"),className:"accent-foreground","data-export-category":s}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:gt[s]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:S?v.toLocaleString():"—"})]},s)})}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Task and routine history is opt-in because it can be large."})]}),(0,t.jsx)("div",{className:"border-b border-border px-3 py-2 shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-2 py-1",children:[(0,t.jsx)(He,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("input",{type:"text",value:w,onChange:d(s=>Me(s.target.value),"onChange"),placeholder:"Search files...",className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-page-search-target":"true"})]})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,t.jsx)(ht,{nodes:Pe,selectedFile:j,expandedDirs:T,onToggleDir:Le,onSelectFile:ee,fileTones:Re,showCheckboxes:!1,wrapLabels:!1}),le>de&&!w&&(0,t.jsx)("div",{className:"px-4 py-2",children:(0,t.jsxs)("button",{type:"button",onClick:d(()=>L(s=>s+xe),"onClick"),className:"w-full rounded-md border border-border px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/30 hover:text-foreground transition-colors",children:["Show more tasks (",de," of ",le,")"]})})]})]}),(0,t.jsxs)("div",{className:"relative min-w-0 overflow-y-auto xl:pl-6",children:[(0,t.jsx)($t,{selectedFile:j,content:Be,allFiles:Y,orgChartPreviewUrl:`/api/companies/${encodeURIComponent(e)}/org.svg`,onSkillClick:Fe}),P.isPending?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center",role:"status","aria-live":"polite","aria-busy":"true","data-export-preview-state":"loading",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsx)(et,{className:"h-6 w-6 animate-spin text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Updating export preview…"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Large task histories can take a minute. You can untick Tasks or cancel this update."})]}),(0,t.jsxs)(H,{type:"button",variant:"outline",size:"sm",onClick:$e,children:[(0,t.jsx)(Xe,{}),"Cancel update"]})]})}):A?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center","data-export-preview-state":"cancelled",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Preview update cancelled"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"The previous preview remains available. Retry when you are ready."})]}),(0,t.jsxs)(H,{type:"button",variant:"outline",size:"sm",onClick:F,children:[(0,t.jsx)(me,{}),"Retry preview"]})]})}):P.isError?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center",role:"alert","data-export-preview-state":"error",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-destructive",children:"Export preview failed"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:se(P.error)})]}),(0,t.jsxs)(H,{type:"button",variant:"outline",size:"sm",onClick:F,children:[(0,t.jsx)(me,{}),"Retry preview"]})]})}):null]})]})]})}d(es,"CompanyExport");export{es as CompanyExport};
|
package/ui-dist/assets/{CompanySkills.production-B2l6UOIJ.js → CompanySkills.production-PSbLuKmV.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var gr=Object.defineProperty;var n=(t,l)=>gr(t,"name",{value:l,configurable:!0});import{i as vn}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as fr,Lr as br,Pr as jr,S as M,U as vr,Y as f,nr as xe,tr as Y,z as yr}from"./createLucideIcon-r3v6fbGz.js";import{ct as kr,o as Nr,st as wr,t as Je}from"./router-Bb8nJWyv.js";import{Q as Sr,tt as Cr}from"./mention-chips-DXumPrOR.js";import{N as pe,g as Fr,l as Ir,o as yn,x as Dr}from"./zap-P-cXfK28.js";import{c as _,f as Lr,t as Br}from"./MarkdownEditor-
|
|
1
|
+
var gr=Object.defineProperty;var n=(t,l)=>gr(t,"name",{value:l,configurable:!0});import{i as vn}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as fr,Lr as br,Pr as jr,S as M,U as vr,Y as f,nr as xe,tr as Y,z as yr}from"./createLucideIcon-r3v6fbGz.js";import{ct as kr,o as Nr,st as wr,t as Je}from"./router-Bb8nJWyv.js";import{Q as Sr,tt as Cr}from"./mention-chips-DXumPrOR.js";import{N as pe,g as Fr,l as Ir,o as yn,x as Dr}from"./zap-P-cXfK28.js";import{c as _,f as Lr,t as Br}from"./MarkdownEditor-BN7aGwIv.js";import{b as Pr,v as Ws,y as kn}from"./sheet-ASM5ba9D.js";import{t as nn}from"./AgentAvatar-PT82VwmU.js";import{A as Er,C as Ar,O as Ls,S as Ds,a as fs,c as bs,f as qe,g as Bs,h as Re,k as Tr,n as jt,o as Ts,p as $e,r as js,s as vt,t as Kr,u as vs,v as Ps,x as xt,y as Es}from"./checkbox-D66RYMkN.js";import{i as As,r as Nn,t as wn}from"./tabs-DWRZjksg.js";import{n as Ft,t as Hs}from"./agents-BlSzFh-1.js";import{m as Sn}from"./StatusIcon-DgMlA1TU.js";import{t as Mr}from"./use-adapter-capabilities-BiWYK4zJ.js";import{r as qr,t as Ze}from"./EmptyState-DPcc0zYh.js";import{t as Cn}from"./check-DDiXDm2i.js";import{t as ps}from"./chevron-down-F9aZv-V7.js";import{t as Fn}from"./chevron-right-B9JUOr38.js";import{n as Rr,t as ht}from"./save-DUnPDT6R.js";import{k as yt,t as k}from"./button-CAPbz11u.js";import{i as In,r as It}from"./clipboard-CYJ5Q78m.js";import{t as gs}from"./external-link-0lrOvZWO.js";import{b as $r,t as kt}from"./MarkdownBody-NJwkQWmo.js";import{t as Dt}from"./file-text-C9vgFckt.js";import{t as Dn}from"./triangle-alert-CgJcxSQX.js";import{t as le}from"./badge-Cf7ihb3q.js";import{t as Me}from"./input-DpsS9it-.js";import"./AgentIdentity-MCshmbhZ.js";import{t as Le}from"./PageSkeleton-DHjTwRT3.js";import{An as zr,At as _r,Bn as rn,Bt as Ur,Dt as Lt,En as Or,Et as Vr,Ft as Ln,J as Qr,Kt as Hr,Ln as Gr,Mn as Bn,Mt as pt,Nn as Pn,Nt as Wr,Ot as Yr,Pn as Nt,Pt as En,Q as Xr,Sn as Zr,Tn as Jr,X as ea,Y as sa,Z as ta,Zt as An,_ as na,bn as Tn,c as ra,ct as aa,d as la,dt as an,et as ia,f as Ks,fn as oa,ft as Xe,g as da,gn as ca,h as ua,ht as he,it as ma,jn as ys,jt as Gs,kn as xa,kt as gt,l as ha,lt as pa,m as Kn,mn as ga,nt as fa,o as ba,ot as ja,p as ft,rt as va,s as ya,st as ka,tt as Na,u as wa,ut as Mn,vn as Sa,wn as wt,zn as St}from"./index-BqF0txu7.js";var c=vn(br(),1),e=vn(fr(),1),ln=16,on=24,dn="min-h-9";function cn(t){return(0,e.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:(0,e.jsx)("path",{d:"M12 4 21 19H3z"})})}n(cn,"VercelMark");function qn(t){const l=t.replace(/\r\n/g,`
|
|
2
2
|
`);if(!l.startsWith(`---
|
|
3
3
|
`))return l.trim();const a=l.indexOf(`
|
|
4
4
|
---
|