aimeat 1.20.2 → 1.20.4

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.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/dist/locales/en.json +60 -0
  3. package/dist/locales/fi.json +60 -0
  4. package/dist/public/css/views/agents-detail.css +4 -0
  5. package/dist/public/css/views/profile.css +9 -0
  6. package/dist/public/css/views/public-workspace-viewer.css +23 -3
  7. package/dist/public/js/services/organisms.js +79 -3
  8. package/dist/public/views/profile/agents-tab.js +1 -1
  9. package/dist/public/views/profile/organisms-tab.js +355 -3
  10. package/dist/public/views/public-workspace-viewer.js +74 -11
  11. package/dist/src/cli/connect/auth.js +1 -1
  12. package/dist/src/cli/connect/auth.js.map +1 -1
  13. package/dist/src/cli/connect/config.d.ts +1 -1
  14. package/dist/src/cli/connect/config.d.ts.map +1 -1
  15. package/dist/src/cli/connect/mcp/server.d.ts.map +1 -1
  16. package/dist/src/cli/connect/mcp/server.js +5 -1
  17. package/dist/src/cli/connect/mcp/server.js.map +1 -1
  18. package/dist/src/cli/connect/mcp/tools/agent-management.js +1 -1
  19. package/dist/src/cli/connect/mcp/tools/agent-management.js.map +1 -1
  20. package/dist/src/cli/connect/mcp/tools/index.d.ts.map +1 -1
  21. package/dist/src/cli/connect/mcp/tools/index.js +2 -0
  22. package/dist/src/cli/connect/mcp/tools/index.js.map +1 -1
  23. package/dist/src/cli/connect/mcp/tools/organisms.d.ts.map +1 -1
  24. package/dist/src/cli/connect/mcp/tools/organisms.js +57 -0
  25. package/dist/src/cli/connect/mcp/tools/organisms.js.map +1 -1
  26. package/dist/src/cli/connect/mcp/tools/schedules.d.ts +15 -0
  27. package/dist/src/cli/connect/mcp/tools/schedules.d.ts.map +1 -0
  28. package/dist/src/cli/connect/mcp/tools/schedules.js +66 -0
  29. package/dist/src/cli/connect/mcp/tools/schedules.js.map +1 -0
  30. package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
  31. package/dist/src/cli/connect/tool-call.js +81 -2
  32. package/dist/src/cli/connect/tool-call.js.map +1 -1
  33. package/dist/src/cli/init-wizard.d.ts.map +1 -1
  34. package/dist/src/cli/init-wizard.js +11 -3
  35. package/dist/src/cli/init-wizard.js.map +1 -1
  36. package/dist/src/generated/api-types.d.ts +540 -0
  37. package/dist/src/generated/api-types.d.ts.map +1 -1
  38. package/dist/src/index.js +1 -1
  39. package/dist/src/mcp/agent-management.d.ts.map +1 -1
  40. package/dist/src/mcp/agent-management.js +4 -3
  41. package/dist/src/mcp/agent-management.js.map +1 -1
  42. package/dist/src/mcp/annotations.d.ts.map +1 -1
  43. package/dist/src/mcp/annotations.js +6 -0
  44. package/dist/src/mcp/annotations.js.map +1 -1
  45. package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
  46. package/dist/src/mcp/catalog/definitions.js +67 -2
  47. package/dist/src/mcp/catalog/definitions.js.map +1 -1
  48. package/dist/src/mcp/catalog/scopes.d.ts +3 -2
  49. package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
  50. package/dist/src/mcp/catalog/scopes.js +4 -2
  51. package/dist/src/mcp/catalog/scopes.js.map +1 -1
  52. package/dist/src/mcp/catalog/surfaces.js +6 -6
  53. package/dist/src/mcp/catalog/surfaces.js.map +1 -1
  54. package/dist/src/mcp/organisms.d.ts.map +1 -1
  55. package/dist/src/mcp/organisms.js +145 -0
  56. package/dist/src/mcp/organisms.js.map +1 -1
  57. package/dist/src/models/agent-onboarding-schemas.d.ts +8 -1
  58. package/dist/src/models/agent-onboarding-schemas.d.ts.map +1 -1
  59. package/dist/src/models/agent-onboarding-schemas.js +30 -1
  60. package/dist/src/models/agent-onboarding-schemas.js.map +1 -1
  61. package/dist/src/models/schemas.d.ts +1 -0
  62. package/dist/src/models/schemas.d.ts.map +1 -1
  63. package/dist/src/models/schemas.js +1 -1
  64. package/dist/src/models/schemas.js.map +1 -1
  65. package/dist/src/routes/agents.d.ts.map +1 -1
  66. package/dist/src/routes/agents.js +4 -3
  67. package/dist/src/routes/agents.js.map +1 -1
  68. package/dist/src/routes/organisms.d.ts +3 -0
  69. package/dist/src/routes/organisms.d.ts.map +1 -1
  70. package/dist/src/routes/organisms.js +475 -0
  71. package/dist/src/routes/organisms.js.map +1 -1
  72. package/dist/src/services/handbooks/admin.d.ts +1 -1
  73. package/dist/src/services/handbooks/admin.d.ts.map +1 -1
  74. package/dist/src/services/handbooks/admin.js +1 -1
  75. package/dist/src/services/organism-comments.d.ts +30 -0
  76. package/dist/src/services/organism-comments.d.ts.map +1 -0
  77. package/dist/src/services/organism-comments.js +74 -0
  78. package/dist/src/services/organism-comments.js.map +1 -0
  79. package/dist/src/services/organism-search.d.ts +27 -0
  80. package/dist/src/services/organism-search.d.ts.map +1 -0
  81. package/dist/src/services/organism-search.js +84 -0
  82. package/dist/src/services/organism-search.js.map +1 -0
  83. package/dist/src/storage/interface.d.ts +13 -4
  84. package/dist/src/storage/interface.d.ts.map +1 -1
  85. package/dist/src/storage/interface.js.map +1 -1
  86. package/dist/src/storage/providers/sqlite/index.js.map +1 -1
  87. package/dist/src/storage/providers/sqlite/schema.js +1 -1
  88. package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
  89. package/package.json +1 -1
package/README.md CHANGED
@@ -164,7 +164,7 @@ For MCP-capable runtimes (Claude Desktop, MCP-aware IDEs), run `aimeat connect s
164
164
 
165
165
  **Multi-agent connector.** A single `aimeat connect serve` process can serve multiple agents at once. Add more agents with `aimeat connect add --agent <name> --url ... --owner ...`; list them with `aimeat connect list`; remove with `aimeat connect remove <name>`. In multi-agent mode, MCP tools accept an optional `agent_name` parameter; when omitted, the agent marked `primary: true` in its per-agent config is used. This is the path for connecting one interactive agent (Claude Code) plus several **task-runner** agents (e.g. CrewAI crews) from one connector process -- see [docs/integrations/crewai.md](docs/integrations/crewai.md) for the task-runner pattern.
166
166
 
167
- **Agent modes.** Every agent declares a mode at registration: `autonomous` (continuous), `interactive` (chat/IDE, default), `task-runner` (triggered, runs one task, exits), or `coordinator` (orchestrates others). Mode picks the Hello Integration flow -- `task-runner` agents get a reduced 5-step onboarding instead of the full 13 because they have no interactive command surface. Combine modes with owner-managed **tags** (`crew:*`, `source:*`, `role:*`, `project:*`) for filtering and grouping in the profile UI. Details: [docs/coding-guidelines/agent-tags.md](docs/coding-guidelines/agent-tags.md).
167
+ **Agent modes.** Every agent declares a mode at registration: `autonomous` (continuous), `interactive` (chat/IDE, default), `task-runner` (triggered, runs one task, exits), `coordinator` (orchestrates others), or `workstation` (a node-visiting agent that lives in the user's own environment -- VSCode, Claude Desktop -- and uses MCP directly). Mode picks the Hello Integration flow: `task-runner` agents get a reduced 7-step onboarding (no command surface, but the test-task pair is kept as a smoke test), and `workstation` agents get the narrowest 4-step flow (auth + platform + capabilities + directives) because they are not node-resident -- no runtime config, slash commands, telemetry, or task queue. The others run the full 13 steps. Combine modes with owner-managed **tags** (`crew:*`, `source:*`, `role:*`, `project:*`) for filtering and grouping in the profile UI. Details: [docs/coding-guidelines/agent-tags.md](docs/coding-guidelines/agent-tags.md).
168
168
 
169
169
  **2. Copy the prompt from your profile.** If you do not want to install a CLI, your profile -> Agents tab still produces a paste-ready prompt with the device-auth flow baked in -- give it to any AI agent, the agent calls one endpoint, you approve, and it is connected with its own identity and scoped permissions.
170
170
 
@@ -483,6 +483,7 @@
483
483
  "interactive": "Interactive",
484
484
  "task-runner": "Task runner",
485
485
  "coordinator": "Coordinator",
486
+ "workstation": "Workstation",
486
487
  "tooltip": "Operational mode — affects how the agent is onboarded and how it consumes work."
487
488
  },
488
489
  "taskRunner": {
@@ -2893,6 +2894,7 @@
2893
2894
  "useCaseCustomDesc": "Skip to full configuration",
2894
2895
  "nodeId": "Node ID",
2895
2896
  "nodeIdHint": "Unique name for this node on the network",
2897
+ "nodeIdInvalid": "Node ID must match format: aimeat-{region}-{number}-{name} (e.g. aimeat-fi-001-home)",
2896
2898
  "port": "Port",
2897
2899
  "portHint": "HTTP port the server listens on",
2898
2900
  "portInvalid": "Port must be between 1 and 65535",
@@ -5503,6 +5505,62 @@
5503
5505
  "deny": "Deny",
5504
5506
  "approved": "approved",
5505
5507
  "revoke": "Revoke",
5508
+ "manageMembers": "Manage members",
5509
+ "manageMembersDesc": "Invite, approve, block and revoke member access.",
5510
+ "membersRoster": "Members",
5511
+ "pendingRequests": "Pending join requests",
5512
+ "noPendingRequests": "No pending requests.",
5513
+ "confirmRemoveMember": "Revoke {member}’s access to this organism?",
5514
+ "memberRemoved": "Member removed",
5515
+ "removeFailed": "Could not remove member",
5516
+ "reviewFailed": "Could not update request",
5517
+ "joinApproved": "Request approved",
5518
+ "joinRejected": "Request declined",
5519
+ "inviteMember": "Invite a member",
5520
+ "inviteePlaceholder": "owner name",
5521
+ "invite": "Invite",
5522
+ "outstandingInvites": "Awaiting acceptance",
5523
+ "invitationSent": "Invitation sent",
5524
+ "inviteFailed": "Could not send invitation",
5525
+ "makeCreator": "Make creator",
5526
+ "block": "Block",
5527
+ "blockedMembers": "Blocked",
5528
+ "unblock": "Unblock",
5529
+ "confirmBlockMember": "Block {member} and remove them from this organism?",
5530
+ "memberBlocked": "Member blocked",
5531
+ "banLifted": "Block lifted",
5532
+ "confirmTransfer": "Make {member} the creator? You will become an admin.",
5533
+ "ownershipTransferred": "Ownership transferred",
5534
+ "transferFailed": "Could not transfer ownership",
5535
+ "attachedAgents": "Attached agents",
5536
+ "noAgents": "No agents attached.",
5537
+ "detach": "Detach",
5538
+ "agentGaiiPlaceholder": "agent#you@node",
5539
+ "attachAgent": "Attach agent",
5540
+ "agentAttached": "Agent attached",
5541
+ "agentDetached": "Agent detached",
5542
+ "agentFailed": "Agent action failed",
5543
+ "youAreInvited": "You’re invited",
5544
+ "invitedByLabel": "invited by {who}",
5545
+ "acceptInvite": "Accept",
5546
+ "declineInvite": "Decline",
5547
+ "invitationAccepted": "Joined",
5548
+ "invitationDeclined": "Declined",
5549
+ "inviteActionFailed": "Could not update invitation",
5550
+ "searchContent": "Search content",
5551
+ "searchPlaceholder": "Find records & documents…",
5552
+ "search": "Search",
5553
+ "searchNoResults": "No matches.",
5554
+ "commentsHeading": "Comments",
5555
+ "noComments": "No comments yet.",
5556
+ "commentPlaceholder": "Add a comment…",
5557
+ "anchorQuotePlaceholder": "Optional: quote a passage to anchor the comment",
5558
+ "postComment": "Comment",
5559
+ "reply": "Reply",
5560
+ "replyingTo": "Replying to",
5561
+ "inReply": "reply",
5562
+ "commentFailed": "Could not post comment",
5563
+ "commentDeleteFailed": "Could not delete comment",
5506
5564
  "editFlow": "How editing works here",
5507
5565
  "activity": "Activity",
5508
5566
  "draftEdit": "Draft edit",
@@ -6230,6 +6288,8 @@
6230
6288
  "sharedDocuments": "Shared documents",
6231
6289
  "publicBadge": "Public document",
6232
6290
  "print": "Print / Save as PDF",
6291
+ "copyAiLink": "Copy AI link (Markdown)",
6292
+ "copied": "Copied!",
6233
6293
  "selectDocument": "Select a document.",
6234
6294
  "unavailableTitle": "Nothing to show here",
6235
6295
  "unavailableDesc": "This workspace has no publicly shared documents, or the link is incomplete."
@@ -483,6 +483,7 @@
483
483
  "interactive": "Interaktiivinen",
484
484
  "task-runner": "Tehtäväajuri",
485
485
  "coordinator": "Koordinaattori",
486
+ "workstation": "Työasema",
486
487
  "tooltip": "Toimintatila — vaikuttaa siihen, miten agentti läpäisee Hello Integrationin ja kuluttaa työtä."
487
488
  },
488
489
  "taskRunner": {
@@ -2893,6 +2894,7 @@
2893
2894
  "useCaseCustomDesc": "Siirry suoraan kaikkiin asetuksiin",
2894
2895
  "nodeId": "Solmun tunnus",
2895
2896
  "nodeIdHint": "Uniikki nimi tälle solmulle verkossa",
2897
+ "nodeIdInvalid": "Solmun tunnuksen täytyy olla muotoa: aimeat-{alue}-{numero}-{nimi} (esim. aimeat-fi-001-home)",
2896
2898
  "port": "Portti",
2897
2899
  "portHint": "HTTP-portti jota palvelin kuuntelee",
2898
2900
  "portInvalid": "Portin pitää olla välillä 1–65535",
@@ -5503,6 +5505,62 @@
5503
5505
  "deny": "Hylkää",
5504
5506
  "approved": "hyväksytty",
5505
5507
  "revoke": "Peru",
5508
+ "manageMembers": "Hallitse jäseniä",
5509
+ "manageMembersDesc": "Kutsu, hyväksy, estä ja peru jäsenten pääsy.",
5510
+ "membersRoster": "Jäsenet",
5511
+ "pendingRequests": "Odottavat liittymispyynnöt",
5512
+ "noPendingRequests": "Ei odottavia pyyntöjä.",
5513
+ "confirmRemoveMember": "Peru käyttäjän {member} pääsy tähän organismiin?",
5514
+ "memberRemoved": "Jäsen poistettu",
5515
+ "removeFailed": "Jäsenen poisto epäonnistui",
5516
+ "reviewFailed": "Pyynnön päivitys epäonnistui",
5517
+ "joinApproved": "Pyyntö hyväksytty",
5518
+ "joinRejected": "Pyyntö hylätty",
5519
+ "inviteMember": "Kutsu jäsen",
5520
+ "inviteePlaceholder": "omistajan nimi",
5521
+ "invite": "Kutsu",
5522
+ "outstandingInvites": "Odottaa hyväksyntää",
5523
+ "invitationSent": "Kutsu lähetetty",
5524
+ "inviteFailed": "Kutsun lähetys epäonnistui",
5525
+ "makeCreator": "Tee luojaksi",
5526
+ "block": "Estä",
5527
+ "blockedMembers": "Estetyt",
5528
+ "unblock": "Poista esto",
5529
+ "confirmBlockMember": "Estä {member} ja poista hänet tästä organismista?",
5530
+ "memberBlocked": "Jäsen estetty",
5531
+ "banLifted": "Esto poistettu",
5532
+ "confirmTransfer": "Tee käyttäjästä {member} luoja? Sinusta tulee ylläpitäjä.",
5533
+ "ownershipTransferred": "Omistajuus siirretty",
5534
+ "transferFailed": "Omistajuuden siirto epäonnistui",
5535
+ "attachedAgents": "Liitetyt agentit",
5536
+ "noAgents": "Ei liitettyjä agentteja.",
5537
+ "detach": "Irrota",
5538
+ "agentGaiiPlaceholder": "agentti#sinä@node",
5539
+ "attachAgent": "Liitä agentti",
5540
+ "agentAttached": "Agentti liitetty",
5541
+ "agentDetached": "Agentti irrotettu",
5542
+ "agentFailed": "Agenttitoiminto epäonnistui",
5543
+ "youAreInvited": "Sinut on kutsuttu",
5544
+ "invitedByLabel": "kutsui {who}",
5545
+ "acceptInvite": "Hyväksy",
5546
+ "declineInvite": "Hylkää",
5547
+ "invitationAccepted": "Liityit",
5548
+ "invitationDeclined": "Hylätty",
5549
+ "inviteActionFailed": "Kutsun päivitys epäonnistui",
5550
+ "searchContent": "Hae sisältöä",
5551
+ "searchPlaceholder": "Etsi tietueita ja dokumentteja…",
5552
+ "search": "Hae",
5553
+ "searchNoResults": "Ei osumia.",
5554
+ "commentsHeading": "Kommentit",
5555
+ "noComments": "Ei vielä kommentteja.",
5556
+ "commentPlaceholder": "Lisää kommentti…",
5557
+ "anchorQuotePlaceholder": "Valinnainen: lainaa kohta, johon kommentti ankkuroidaan",
5558
+ "postComment": "Kommentoi",
5559
+ "reply": "Vastaa",
5560
+ "replyingTo": "Vastataan",
5561
+ "inReply": "vastaus",
5562
+ "commentFailed": "Kommentin lähetys epäonnistui",
5563
+ "commentDeleteFailed": "Kommentin poisto epäonnistui",
5506
5564
  "editFlow": "Miten muokkaus toimii täällä",
5507
5565
  "activity": "Aktiivisuus",
5508
5566
  "draftEdit": "Luonnoksen muokkaus",
@@ -6232,6 +6290,8 @@
6232
6290
  "sharedDocuments": "Jaetut dokumentit",
6233
6291
  "publicBadge": "Julkinen dokumentti",
6234
6292
  "print": "Tulosta / Tallenna PDF:nä",
6293
+ "copyAiLink": "Kopioi AI-linkki (Markdown)",
6294
+ "copied": "Kopioitu!",
6235
6295
  "selectDocument": "Valitse dokumentti.",
6236
6296
  "unavailableTitle": "Ei näytettävää",
6237
6297
  "unavailableDesc": "Tällä työtilalla ei ole julkisesti jaettuja dokumentteja, tai linkki on puutteellinen."
@@ -1551,6 +1551,10 @@
1551
1551
  background: var(--accent-subtle, rgba(16, 185, 129, 0.1));
1552
1552
  color: var(--success, #10b981);
1553
1553
  }
1554
+ .pf .pf-agd-badge--mode-workstation {
1555
+ background: var(--accent-subtle, rgba(20, 184, 166, 0.1));
1556
+ color: var(--teal, #14b8a6);
1557
+ }
1554
1558
 
1555
1559
  /* Tag chip strip on expanded card */
1556
1560
  .pf .pf-agd-tag-strip {
@@ -2079,6 +2079,15 @@
2079
2079
  .pj-rec-title { flex: 1; text-align: left; background: none; border: none; cursor: pointer; font-size: 0.9rem; color: var(--text); padding: 0; }
2080
2080
  .pj-rec-title:hover { color: var(--accent); }
2081
2081
  .pj-rec-fields { margin: 0.1rem 0 0.4rem 0.6rem; padding: 0.2rem 0.6rem; border-left: 2px solid var(--border); background: var(--bg-dim); border-radius: 0 6px 6px 0; }
2082
+ /* Comment thread on a workspace object (record/document) */
2083
+ .pj-comments { margin: 0.5rem 0 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
2084
+ .pj-comment { padding: 0.4rem 0.5rem; margin: 0.3rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
2085
+ .pj-comment-reply { margin-left: 1.2rem; border-left: 2px solid var(--accent, var(--border)); }
2086
+ .pj-comment-head { font-size: 0.85rem; color: var(--muted); }
2087
+ .pj-comment-body { white-space: pre-wrap; margin: 0.2rem 0; }
2088
+ .pj-comment-actions { display: flex; gap: 0.3rem; }
2089
+ .pj-comment-compose { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }
2090
+ .pj-comment-compose textarea { resize: vertical; }
2082
2091
  /* Dotted leader between each field label and its value — ties the two ends of a
2083
2092
  long row together so you can follow which value belongs to which key. */
2084
2093
  .pj-rec-fields .kv-row { align-items: baseline; gap: 0; }
@@ -6,6 +6,8 @@
6
6
  * All colors/spacing come from theme.css variables (no dark-only rgba, no hardcoded hex).
7
7
  * @version-history
8
8
  * v1.0.0 — 2026-06-09 — Initial: slice 2 of the workspace public-sharing plan.
9
+ * v1.1.0 — 2026-06-09 — Continuous stacked-page layout (scroll-margin + per-page spacing so every
10
+ * shared page prints in one go); action-button group for "Copy AI link" + "Print".
9
11
  */
10
12
 
11
13
  .pwv-container {
@@ -92,17 +94,29 @@
92
94
  padding: 0.2rem 0.7rem;
93
95
  }
94
96
 
95
- /* Card fill + shadow so the print button stands out against the page (matches the in-app toolbar). */
96
- .pwv-print { background: var(--card); box-shadow: var(--shadow-sm); }
97
- .pwv-print:hover { background: var(--bg-surface); border-color: var(--text-muted); }
97
+ .pwv-bar-actions {
98
+ display: flex;
99
+ align-items: center;
100
+ gap: 0.5rem;
101
+ flex-wrap: wrap;
102
+ }
103
+
104
+ /* Card fill + shadow so the action buttons stand out against the page (matches the in-app toolbar). */
105
+ .pwv-action { background: var(--card); box-shadow: var(--shadow-sm); }
106
+ .pwv-action:hover { background: var(--bg-surface); border-color: var(--text-muted); }
98
107
 
99
108
  .pwv-doc {
100
109
  background: var(--card);
101
110
  border: 1px solid var(--border);
102
111
  border-radius: 10px;
103
112
  padding: 1.75rem 2rem;
113
+ /* Offset for the sticky-free window scroll so a scrolled-to page isn't hidden under the top nav. */
114
+ scroll-margin-top: 1.5rem;
104
115
  }
105
116
 
117
+ /* Stacked pages in the continuous whole-space view: space them out so the seam between pages reads. */
118
+ .pwv-doc + .pwv-doc { margin-top: 1.5rem; }
119
+
106
120
  /* ── Markdown typography (scoped to the viewer; mirrors the in-app document view) ── */
107
121
  .pwv-doc .md-body { font-size: 0.95rem; line-height: 1.7; color: var(--text); max-width: 78ch; overflow-wrap: break-word; }
108
122
  .pwv-doc .md-body > :first-child { margin-top: 0; }
@@ -203,4 +217,10 @@
203
217
  padding: 0;
204
218
  }
205
219
  body.pwv-active .pwv-doc .md-body { max-width: none; }
220
+ /* Continuous whole-space print: start each shared page on a fresh sheet, and don't split a page's
221
+ * heading off from its body across a sheet boundary. */
222
+ body.pwv-active .pwv-doc + .pwv-doc { margin-top: 0; padding-top: 0; break-before: page; }
223
+ body.pwv-active .pwv-doc .md-body h1,
224
+ body.pwv-active .pwv-doc .md-body h2,
225
+ body.pwv-active .pwv-doc .md-body h3 { break-after: avoid; }
206
226
  }
@@ -50,9 +50,10 @@ export async function leaveOrganism(id) {
50
50
  return apiPost(`/v1/organisms/${encodeURIComponent(id)}/leave`, {});
51
51
  }
52
52
 
53
- /** List members. */
54
- export async function listMembers(id) {
55
- return apiGet(`/v1/organisms/${encodeURIComponent(id)}/members`);
53
+ /** List members. Optional status filter ('active' | 'banned' | 'invited' | 'pending'). */
54
+ export async function listMembers(id, status) {
55
+ const q = status ? `?status=${encodeURIComponent(status)}` : '';
56
+ return apiGet(`/v1/organisms/${encodeURIComponent(id)}/members${q}`);
56
57
  }
57
58
 
58
59
  /** List join requests (admin only). */
@@ -65,6 +66,81 @@ export async function reviewJoinRequest(organismId, requestId, decision) {
65
66
  return apiPost(`/v1/organisms/${encodeURIComponent(organismId)}/join-requests/${encodeURIComponent(requestId)}/review`, { decision });
66
67
  }
67
68
 
69
+ /** List the comment thread on a workspace object (record or document). */
70
+ export async function listComments(orgId, ws, space, instanceId) {
71
+ const params = new URLSearchParams({ ws, space, instance_id: instanceId });
72
+ return apiGet(`/v1/organisms/${encodeURIComponent(orgId)}/comments?${params.toString()}`);
73
+ }
74
+
75
+ /** Add a comment to a workspace object. anchor: { section?|quote? }; parentId for a threaded reply. */
76
+ export async function addComment(orgId, { ws, space, instanceId, body, anchor, parentId }) {
77
+ return apiPost(`/v1/organisms/${encodeURIComponent(orgId)}/comments`, { ws, space, instance_id: instanceId, body, anchor, parent_id: parentId });
78
+ }
79
+
80
+ /** Delete a comment (author or creator/admin). */
81
+ export async function deleteComment(orgId, commentId, ws, space, instanceId) {
82
+ const params = new URLSearchParams({ ws, space, instance_id: instanceId });
83
+ return apiDelete(`/v1/organisms/${encodeURIComponent(orgId)}/comments/${encodeURIComponent(commentId)}?${params.toString()}`);
84
+ }
85
+
86
+ /** Search records + documents across the organism's readable workspaces. Optional ws filter. */
87
+ export async function searchOrganism(id, q, ws) {
88
+ const params = new URLSearchParams({ q });
89
+ if (ws) params.set('ws', ws);
90
+ return apiGet(`/v1/organisms/${encodeURIComponent(id)}/search?${params.toString()}`);
91
+ }
92
+
93
+ /** Remove (revoke) a member's organism access. Creator/admin only. Pass ban=true to block re-join. */
94
+ export async function removeMember(id, memberGhii, ban = false) {
95
+ const suffix = ban ? '?ban=1' : '';
96
+ return apiDelete(`/v1/organisms/${encodeURIComponent(id)}/members/${encodeURIComponent(memberGhii)}${suffix}`);
97
+ }
98
+
99
+ /** Lift a ban on a previously-blocked owner. Creator/admin only. */
100
+ export async function unbanMember(id, memberGhii) {
101
+ return apiPost(`/v1/organisms/${encodeURIComponent(id)}/members/${encodeURIComponent(memberGhii)}/unban`, {});
102
+ }
103
+
104
+ /** Transfer ownership to an existing active member. Creator only. */
105
+ export async function transferOwnership(id, toGhii) {
106
+ return apiPost(`/v1/organisms/${encodeURIComponent(id)}/transfer`, { to: toGhii });
107
+ }
108
+
109
+ /** Invite an owner by bare name. Creator/admin only. */
110
+ export async function inviteMember(id, invitee) {
111
+ return apiPost(`/v1/organisms/${encodeURIComponent(id)}/invitations`, { invitee });
112
+ }
113
+
114
+ /** List outstanding (pending) invitations for an organism. Creator/admin only. */
115
+ export async function listInvitations(id) {
116
+ return apiGet(`/v1/organisms/${encodeURIComponent(id)}/invitations`);
117
+ }
118
+
119
+ /** The caller's own pending invitations across all organisms. */
120
+ export async function listMyInvitations() {
121
+ return apiGet('/v1/organisms/invitations/mine');
122
+ }
123
+
124
+ /** Accept an invitation to an organism. */
125
+ export async function acceptInvitation(id) {
126
+ return apiPost(`/v1/organisms/${encodeURIComponent(id)}/invitations/accept`, {});
127
+ }
128
+
129
+ /** Decline an invitation to an organism. */
130
+ export async function declineInvitation(id) {
131
+ return apiPost(`/v1/organisms/${encodeURIComponent(id)}/invitations/decline`, {});
132
+ }
133
+
134
+ /** Attach one of your own agents (GAII) to an organism you belong to. */
135
+ export async function attachAgent(id, agentGaii) {
136
+ return apiPost(`/v1/organisms/${encodeURIComponent(id)}/agents`, { agent_gaii: agentGaii });
137
+ }
138
+
139
+ /** Detach an agent from an organism. Agent owner or organism admin. */
140
+ export async function detachAgent(id, agentGaii) {
141
+ return apiDelete(`/v1/organisms/${encodeURIComponent(id)}/agents/${encodeURIComponent(agentGaii)}`);
142
+ }
143
+
68
144
  /** Add admin. */
69
145
  export async function addAdmin(id, targetGhii) {
70
146
  return apiPost(`/v1/organisms/${encodeURIComponent(id)}/admins`, { target_ghii: targetGhii });
@@ -1015,7 +1015,7 @@ export default function AgentsTab({ session, showToast, onStats }) {
1015
1015
  `;
1016
1016
  }
1017
1017
 
1018
- const AGENT_MODES = ['autonomous', 'interactive', 'task-runner', 'coordinator'];
1018
+ const AGENT_MODES = ['autonomous', 'interactive', 'task-runner', 'coordinator', 'workstation'];
1019
1019
 
1020
1020
  function collectTags(agents) {
1021
1021
  const set = new Set();