@ours.network/fleet 2.4.3 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -32
- package/contrib/.claude-plugin/marketplace.json +1 -1
- package/contrib/claude-native/hooks/register.js +108 -31
- package/dist/agent-ours/mcp-endpoint.d.ts +3 -0
- package/dist/agent-ours/mcp-endpoint.js +3 -0
- package/dist/agent-ours/service.d.ts +3 -0
- package/dist/agent-ours/service.js +19 -2
- package/dist/application/conversation-history.js +2 -2
- package/dist/application/fleet-query-service.js +6 -3
- package/dist/application/native-claude-conversation.js +13 -2
- package/dist/application/native-conversation.d.ts +5 -0
- package/dist/application/native-conversation.js +30 -5
- package/dist/application/native-conversations.d.ts +3 -0
- package/dist/application/native-conversations.js +2 -0
- package/dist/application/role-creation-service.js +0 -3
- package/dist/application/session-control.d.ts +3 -0
- package/dist/application/session-control.js +5 -0
- package/dist/application/types.d.ts +5 -0
- package/dist/build-info.json +4 -4
- package/dist/cli.js +2 -3
- package/dist/config.d.ts +9 -2
- package/dist/config.js +15 -4
- package/dist/docs.d.ts +5 -7
- package/dist/docs.js +38 -46
- package/dist/doctor.js +4 -6
- package/dist/file-delivery/store.d.ts +12 -0
- package/dist/file-delivery/store.js +24 -2
- package/dist/fleet-command-audit.js +3 -2
- package/dist/fleet-proxy.js +0 -1
- package/dist/harness/hermes-permissions.js +1 -1
- package/dist/harness/hermes-session.js +0 -1
- package/dist/init-wizard.js +2 -2
- package/dist/lifecycle-summary.d.ts +3 -2
- package/dist/lifecycle-summary.js +2 -3
- package/dist/native-participation-cli.js +55 -10
- package/dist/native-participation.d.ts +174 -0
- package/dist/native-participation.js +67 -0
- package/dist/notifications/status-producer.d.ts +37 -0
- package/dist/notifications/status-producer.js +146 -0
- package/dist/permissions.d.ts +2 -3
- package/dist/permissions.js +3 -3
- package/dist/preset-migration.js +12 -0
- package/dist/rooms-tasks/cli.js +2 -6
- package/dist/rooms-tasks/deletion.js +3 -0
- package/dist/rooms-tasks/member-overrides.d.ts +2 -1
- package/dist/rooms-tasks/member-overrides.js +1 -4
- package/dist/rooms-tasks/task-contributions.d.ts +15 -0
- package/dist/rooms-tasks/task-contributions.js +13 -2
- package/dist/runner.js +24 -8
- package/dist/session/acp.d.ts +9 -29
- package/dist/session/acp.js +31 -308
- package/dist/session/codex-app-server.d.ts +9 -6
- package/dist/session/codex-app-server.js +19 -58
- package/dist/session/control.d.ts +5 -0
- package/dist/session/control.js +19 -3
- package/dist/session/conversation-types.d.ts +3 -2
- package/dist/session/status-notice.d.ts +24 -0
- package/dist/session/status-notice.js +38 -0
- package/dist/session/types.d.ts +2 -0
- package/dist/spawn.d.ts +1 -2
- package/dist/spawn.js +2 -6
- package/dist/statuses/permission-projection.d.ts +53 -0
- package/dist/statuses/permission-projection.js +317 -0
- package/dist/statuses/status-answers.d.ts +31 -0
- package/dist/statuses/status-answers.js +85 -0
- package/dist/statuses/status-feed.d.ts +85 -0
- package/dist/statuses/status-feed.js +122 -0
- package/dist/statuses/status-kinds.d.ts +15 -0
- package/dist/statuses/status-kinds.js +12 -0
- package/dist/statuses/status-ledger.d.ts +21 -0
- package/dist/statuses/status-ledger.js +80 -0
- package/dist/statuses/status-routes.d.ts +43 -0
- package/dist/statuses/status-routes.js +140 -0
- package/dist/statuses/status-store.d.ts +257 -0
- package/dist/statuses/status-store.js +605 -0
- package/dist/statuses/status-tools.d.ts +21 -0
- package/dist/statuses/status-tools.js +126 -0
- package/dist/supervisor/manager.js +11 -0
- package/dist/web/resource-views.d.ts +3 -1
- package/dist/web/resource-views.js +6 -2
- package/dist/web/runtime.js +21 -0
- package/dist/web/server.js +15 -0
- package/docs/acp-files.md +9 -7
- package/docs/native-session-participation.md +14 -0
- package/docs/validation/managed-cli-permissions.md +1 -1
- package/examples/fleet/agents/Alice.yaml +1 -1
- package/examples/fleet/agents/FleetCoordinator.yaml +1 -1
- package/examples/fleet.yaml +0 -1
- package/package.json +2 -2
- package/presets/fleet/agent_templates/Critic.yaml +1 -1
- package/presets/fleet/agent_templates/Developer.yaml +1 -1
- package/presets/fleet/agent_templates/Engineer.yaml +1 -1
- package/presets/fleet/agent_templates/LocalCoordinator.yaml +1 -1
- package/presets/fleet/agents/FleetCoordinator.yaml +1 -1
- package/presets/fleet.yaml +1 -1
- package/presets/manifest.json +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { verifiedTaskAuthor } from '../rooms-tasks/task-tools.js';
|
|
3
|
+
import { TaskReviewError } from '../rooms-tasks/task-review.js';
|
|
4
|
+
import { TaskStateError } from '../rooms-tasks/task-state.js';
|
|
5
|
+
import { PUBLISHABLE_STATUS_KINDS } from './status-kinds.js';
|
|
6
|
+
import { closeStatus, findStatus, publishStatus, StatusError, STATUS_ATTACHMENTS_MAX, STATUS_BODY_MAX_BYTES, STATUS_TITLE_MAX, } from './status-store.js';
|
|
7
|
+
export const STATUS_TOOL_NAMES = Object.freeze(['fleet_status_publish', 'fleet_status_close', 'fleet_status_get']);
|
|
8
|
+
const result = (value) => ({
|
|
9
|
+
content: [{ type: 'text', text: JSON.stringify(value) }], structuredContent: value, isError: false,
|
|
10
|
+
});
|
|
11
|
+
const failure = (code, message) => ({ content: [{ type: 'text', text: JSON.stringify({ error: code, message }) }], isError: true });
|
|
12
|
+
/** Author from the binding; the mission only from a verified task binding. A refused task binding is an error, never silently dropped. */
|
|
13
|
+
function author(bound) {
|
|
14
|
+
if (!bound.identityCid)
|
|
15
|
+
throw new StatusError('forbidden', 'this agent has no verified identity CID yet; nothing was published');
|
|
16
|
+
if (bound.task)
|
|
17
|
+
verifiedTaskAuthor(bound.task);
|
|
18
|
+
return { identityCid: bound.identityCid, role: bound.role, ...(bound.displayName ? { displayName: bound.displayName } : {}),
|
|
19
|
+
...(bound.task ? { taskId: bound.task.taskId } : {}) };
|
|
20
|
+
}
|
|
21
|
+
/** What the agent sees of its status: the stored envelope. */
|
|
22
|
+
const publicStatus = (status) => {
|
|
23
|
+
const { version: _version, request_key: _key, seen_revision: _seen, notification_events: _events, ...visible } = status;
|
|
24
|
+
return visible;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Status tools on the agent's own managed MCP endpoint. Every agent can publish, with or without a mission; the
|
|
28
|
+
* author is the agent's identity and the mission comes only from its supervisor's task binding.
|
|
29
|
+
*/
|
|
30
|
+
export function registerStatusTools(server, binding, admit) {
|
|
31
|
+
/** `storeFailure` describes what an unexpected store error may have left behind for this operation. */
|
|
32
|
+
const run = async (operation, storeFailure) => {
|
|
33
|
+
let release;
|
|
34
|
+
try {
|
|
35
|
+
release = await admit();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return failure('runtime_not_ready', 'the managed runtime is not admitting tool calls right now; nothing was read or changed');
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const bound = binding();
|
|
42
|
+
if (!bound)
|
|
43
|
+
return failure('status_unavailable', 'statuses are not available to this agent');
|
|
44
|
+
try {
|
|
45
|
+
return result(await operation(bound));
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (error instanceof StatusError)
|
|
49
|
+
return failure(error.code, error.message);
|
|
50
|
+
if (error instanceof TaskReviewError)
|
|
51
|
+
return failure(error.code, error.message);
|
|
52
|
+
if (error instanceof TaskStateError)
|
|
53
|
+
return failure('task_unavailable', error.message);
|
|
54
|
+
return failure('status_store_failed', storeFailure);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
release();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const refused = z.unknown().optional().describe('Not accepted: the author and mission come from your launch binding. Setting it fails.');
|
|
62
|
+
server.registerTool('fleet_status_publish', {
|
|
63
|
+
description: 'Publish ONE self-contained status to the Owner\'s feed and devices: an "update" (progress worth knowing), an "alert" '
|
|
64
|
+
+ '(blocked or failed, needs attention) or a "question" (you need the Owner\'s input). Works with or without a mission. '
|
|
65
|
+
+ 'Every status is pushed to the Owner, so do not post routine chatter. A question waits for the Owner\'s answer, which is '
|
|
66
|
+
+ 'delivered to your session as a message and is readable with fleet_status_get. To replace your own open question, '
|
|
67
|
+
+ 'publish a new question with supersedes. Repeating a call with the same request_key and content returns the original status.',
|
|
68
|
+
inputSchema: {
|
|
69
|
+
kind: z.string().describe(`One of ${PUBLISHABLE_STATUS_KINDS.join(', ')}.`),
|
|
70
|
+
title: z.string().describe(`One line, at most ${STATUS_TITLE_MAX} characters; the card heading and push title.`),
|
|
71
|
+
body: z.string().describe(`Markdown body, at most ${STATUS_BODY_MAX_BYTES / 1024} KiB. Longer content is refused, not cut.`),
|
|
72
|
+
attachment_ids: z.array(z.string()).optional().describe(`Up to ${STATUS_ATTACHMENTS_MAX} IDs of files you already sent in this conversation with send_file (send each file first; up to 20 MiB). The Owner sees photos (PNG, JPEG, GIF, WebP) inline, previews Markdown and HTML, and can download any file.`),
|
|
73
|
+
interaction: z.object({
|
|
74
|
+
mode: z.enum(['text', 'single', 'multi']),
|
|
75
|
+
options: z.array(z.object({ id: z.string(), label: z.string(), description: z.string().optional(), recommended: z.boolean().optional() })).optional(),
|
|
76
|
+
allowOther: z.boolean().optional(),
|
|
77
|
+
placeholder: z.string().optional(),
|
|
78
|
+
}).optional().describe('Required for a question: free text, or single/multi choice with 2-12 options with unique ids.'),
|
|
79
|
+
supersedes: z.string().optional().describe('ID of your own earlier question that this question replaces; it is closed.'),
|
|
80
|
+
request_key: z.string().optional().describe('Stable key so a retried call cannot publish twice.'),
|
|
81
|
+
author: refused, task_id: refused, taskId: refused,
|
|
82
|
+
},
|
|
83
|
+
}, async (args) => run(async (bound) => {
|
|
84
|
+
const { attachment_ids: ids, ...input } = args;
|
|
85
|
+
for (const key of ['author', 'task_id', 'taskId'])
|
|
86
|
+
if (input[key] === undefined)
|
|
87
|
+
delete input[key];
|
|
88
|
+
if (ids !== undefined && ids.length > STATUS_ATTACHMENTS_MAX)
|
|
89
|
+
throw new StatusError('limit_exceeded', `a status can have at most ${STATUS_ATTACHMENTS_MAX} attachments`);
|
|
90
|
+
const who = author(bound);
|
|
91
|
+
const resolved = ids === undefined ? undefined : await Promise.all(ids.map(async (id) => {
|
|
92
|
+
try {
|
|
93
|
+
return await bound.attachment(id);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
throw new StatusError('invalid_request', `attachment ${id} is not a file you sent in this conversation`);
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
const attachments = resolved?.map(({ store: _store, ...attachment }) => attachment);
|
|
100
|
+
const attachmentStores = Object.fromEntries((resolved ?? []).flatMap(a => a.store ? [[a.id, a.store]] : []));
|
|
101
|
+
const published = publishStatus({ ...who, ...(Object.keys(attachmentStores).length ? { attachmentStores } : {}) }, { ...input, ...(attachments ? { attachments } : {}) });
|
|
102
|
+
return { status: publicStatus(published.status), replayed: published.replayed,
|
|
103
|
+
...(published.superseded ? { superseded: publicStatus(published.superseded) } : {}) };
|
|
104
|
+
}, 'the status store failed while publishing; the status (and any supersede) may have been stored in part. '
|
|
105
|
+
+ 'Repeat the same call with the same request_key to complete it without a duplicate, or check with fleet_status_get.'));
|
|
106
|
+
server.registerTool('fleet_status_close', {
|
|
107
|
+
description: 'Close one of your own statuses with a short reason, e.g. a question that is no longer needed. Closing does not notify '
|
|
108
|
+
+ 'the Owner. You cannot close another agent\'s status.',
|
|
109
|
+
inputSchema: { status_id: z.string(), reason: z.string().describe('Why it is closed, one line.') },
|
|
110
|
+
}, async (args) => run(bound => {
|
|
111
|
+
const closed = closeStatus(author({ ...bound, task: undefined }), args.status_id, args.reason);
|
|
112
|
+
return { status: publicStatus(closed.status), changed: closed.changed };
|
|
113
|
+
}, 'the status store failed while closing; the status may or may not be closed. Check with fleet_status_get; closing again is safe.'));
|
|
114
|
+
server.registerTool('fleet_status_get', {
|
|
115
|
+
description: 'Read one of your own statuses, including a question\'s current state and the Owner\'s answer when there is one.',
|
|
116
|
+
inputSchema: { status_id: z.string() },
|
|
117
|
+
}, async (args) => run(bound => {
|
|
118
|
+
const who = author({ ...bound, task: undefined });
|
|
119
|
+
const status = findStatus(args.status_id);
|
|
120
|
+
if (!status)
|
|
121
|
+
throw new StatusError('not_found', `status ${args.status_id} not found`);
|
|
122
|
+
if (status.author.identity_cid !== who.identityCid.toUpperCase())
|
|
123
|
+
throw new StatusError('forbidden', 'an agent can read only its own statuses');
|
|
124
|
+
return { status: publicStatus(status) };
|
|
125
|
+
}, 'the status store could not be read; nothing was changed.'));
|
|
126
|
+
}
|
|
@@ -4,6 +4,7 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
import { producerConfig } from '../notifications/outbox.js';
|
|
6
6
|
import { TaskNotificationProducer } from '../notifications/task-producer.js';
|
|
7
|
+
import { StatusNotificationProducer } from '../notifications/status-producer.js';
|
|
7
8
|
import { acquireOwnerBinderLease } from '../owner-channel/binder.js';
|
|
8
9
|
import { stateRoot } from '../paths.js';
|
|
9
10
|
import { readRestartLedger, writeRestartLedger, backoffFor, RESTART_FAIL_THRESHOLD } from '../runner.js';
|
|
@@ -37,6 +38,7 @@ export async function runFleetManager(entrypoint, deps = {}) {
|
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
let notifications;
|
|
41
|
+
let statusNotifications;
|
|
40
42
|
async function reconcile(key) {
|
|
41
43
|
await withMemberLock(key, async () => {
|
|
42
44
|
const member = readMember(key);
|
|
@@ -173,6 +175,14 @@ export async function runFleetManager(entrypoint, deps = {}) {
|
|
|
173
175
|
catch {
|
|
174
176
|
log('[fleet] task notifications unavailable; committed events retained');
|
|
175
177
|
}
|
|
178
|
+
try {
|
|
179
|
+
const config = producerConfig(process.env, undefined, log);
|
|
180
|
+
if (config)
|
|
181
|
+
statusNotifications = new StatusNotificationProducer(config, log);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
log('[fleet] status notifications unavailable; committed events retained');
|
|
185
|
+
}
|
|
176
186
|
try {
|
|
177
187
|
const { resumeFleetTransfers } = await import('./adoption.js');
|
|
178
188
|
await resumeFleetTransfers(entrypoint, exec);
|
|
@@ -197,6 +207,7 @@ export async function runFleetManager(entrypoint, deps = {}) {
|
|
|
197
207
|
finally {
|
|
198
208
|
stopping = true;
|
|
199
209
|
await notifications?.close();
|
|
210
|
+
await statusNotifications?.close();
|
|
200
211
|
// Shutdown preserves desired intent; the successor resumes the same catalog.
|
|
201
212
|
const deadline = Date.now() + 17_000;
|
|
202
213
|
while (children.size && Date.now() < deadline) {
|
|
@@ -80,7 +80,7 @@ export declare class ResourceOutput {
|
|
|
80
80
|
}
|
|
81
81
|
export interface ResourceDescriptor {
|
|
82
82
|
viewId: string;
|
|
83
|
-
resource: 'directory' | 'roles' | 'tasks' | 'task-lists' | 'configuration' | 'previews' | 'task-layout' | 'creation-action' | 'action' | 'member-addition' | 'login' | 'onboarding-health' | 'subscriptions';
|
|
83
|
+
resource: 'directory' | 'roles' | 'tasks' | 'task-lists' | 'configuration' | 'previews' | 'task-layout' | 'creation-action' | 'action' | 'member-addition' | 'login' | 'onboarding-health' | 'subscriptions' | 'statuses';
|
|
84
84
|
entityId?: string;
|
|
85
85
|
receiptId?: string;
|
|
86
86
|
provider?: 'claude' | 'codex';
|
|
@@ -93,6 +93,8 @@ export interface ResourceDescriptor {
|
|
|
93
93
|
includeDeleting?: boolean;
|
|
94
94
|
/** Previews: each agent's newest assistant message time only, without its text. */
|
|
95
95
|
activityOnly?: boolean;
|
|
96
|
+
/** Statuses: the feed scope; `entityId` is the agent's identity CID or the mission's task ID. */
|
|
97
|
+
scope?: 'global' | 'agent' | 'mission';
|
|
96
98
|
}
|
|
97
99
|
export declare function canonicalResourceDescriptor(input: unknown): ResourceDescriptor;
|
|
98
100
|
interface BoundProjection {
|
|
@@ -155,9 +155,13 @@ export function canonicalResourceDescriptor(input) {
|
|
|
155
155
|
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
156
156
|
throw Error('invalid resource descriptor');
|
|
157
157
|
const value = input;
|
|
158
|
-
if (!/^[A-Za-z0-9_-]{1,128}$/.test(value.viewId) || !['directory', 'roles', 'tasks', 'task-lists', 'configuration', 'previews', 'task-layout', 'creation-action', 'action', 'member-addition', 'login', 'onboarding-health', 'subscriptions'].includes(value.resource)
|
|
159
|
-
|| Object.keys(value).some(key => !['viewId', 'resource', 'includeTemporary', 'includeDefinitions', 'ids', 'state', 'list', 'groupByList', 'includeDeleting', 'entityId', 'receiptId', 'provider', 'activityOnly'].includes(key)))
|
|
158
|
+
if (!/^[A-Za-z0-9_-]{1,128}$/.test(value.viewId) || !['directory', 'roles', 'tasks', 'task-lists', 'configuration', 'previews', 'task-layout', 'creation-action', 'action', 'member-addition', 'login', 'onboarding-health', 'subscriptions', 'statuses'].includes(value.resource)
|
|
159
|
+
|| Object.keys(value).some(key => !['viewId', 'resource', 'includeTemporary', 'includeDefinitions', 'ids', 'state', 'list', 'groupByList', 'includeDeleting', 'entityId', 'receiptId', 'provider', 'activityOnly', 'scope'].includes(key)))
|
|
160
160
|
throw Error('invalid resource descriptor');
|
|
161
|
+
if (value.scope !== undefined && value.resource !== 'statuses')
|
|
162
|
+
throw Error('invalid resource descriptor');
|
|
163
|
+
if (value.resource === 'statuses' && ((value.scope ?? 'global') === 'global' ? value.entityId !== undefined : !['agent', 'mission'].includes(value.scope) || !value.entityId))
|
|
164
|
+
throw Error('invalid statuses scope');
|
|
161
165
|
if (value.activityOnly !== undefined && value.resource !== 'previews')
|
|
162
166
|
throw Error('invalid resource descriptor');
|
|
163
167
|
for (const key of ['includeTemporary', 'includeDefinitions', 'groupByList', 'includeDeleting', 'activityOnly'])
|
package/dist/web/runtime.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NativeConversations } from '../application/native-conversations.js';
|
|
2
|
+
import { SupervisorOursTools } from '../application/supervisor-ours-tools.js';
|
|
2
3
|
import { NativeParticipation, nativeHostProfile, nativeParticipationRoot } from '../native-participation.js';
|
|
3
4
|
import { ConversationRoleObserver } from '../application/conversation-role-observer.js';
|
|
4
5
|
import { replaceFileAtomically } from '../atomic-file.js';
|
|
@@ -118,6 +119,7 @@ export async function startWebConsole(options) {
|
|
|
118
119
|
const signalRoleMutation = () => { for (const listener of roleMutations)
|
|
119
120
|
listener(); };
|
|
120
121
|
const native = new NativeConversations();
|
|
122
|
+
const supervisorTools = new SupervisorOursTools();
|
|
121
123
|
try {
|
|
122
124
|
if (existsSync(nativeParticipationRoot()))
|
|
123
125
|
await native.initialize();
|
|
@@ -242,6 +244,25 @@ export async function startWebConsole(options) {
|
|
|
242
244
|
})),
|
|
243
245
|
onChange: () => events.publish('subscription.changed', {}),
|
|
244
246
|
}),
|
|
247
|
+
// Native terminal participants have no supervisor; their tools run over the session's own attachment.
|
|
248
|
+
oursTools: {
|
|
249
|
+
async list(roleId) {
|
|
250
|
+
if (!await repository.get(roleId)) {
|
|
251
|
+
const registry = await native.oursTools(roleId);
|
|
252
|
+
if (registry)
|
|
253
|
+
return registry.listOursTools(roleId);
|
|
254
|
+
}
|
|
255
|
+
return supervisorTools.list(roleId);
|
|
256
|
+
},
|
|
257
|
+
async call(roleId, request) {
|
|
258
|
+
if (!await repository.get(roleId)) {
|
|
259
|
+
const registry = await native.oursTools(roleId);
|
|
260
|
+
if (registry)
|
|
261
|
+
return registry.callOursTool(roleId, request);
|
|
262
|
+
}
|
|
263
|
+
return supervisorTools.call(roleId, request);
|
|
264
|
+
},
|
|
265
|
+
},
|
|
245
266
|
async session(roleId) {
|
|
246
267
|
const role = await repository.get(roleId);
|
|
247
268
|
if (!role) {
|
package/dist/web/server.js
CHANGED
|
@@ -30,6 +30,8 @@ import { CONTRIBUTION_CUTOFF_MAX, CONTRIBUTION_PAGE_MAX, listTaskContributions,
|
|
|
30
30
|
import { MissionKeyError } from '../rooms-tasks/mission-keys.js';
|
|
31
31
|
import { appendTaskProgress, getTaskReview, taskProgressSnapshot, publicProgressEntry, publicReview, readTaskReviewArtifact, setTaskReviewMarkdown, taskContributionSummary, TaskReviewError, } from '../rooms-tasks/task-review.js';
|
|
32
32
|
import { isProvider } from '../subscriptions/store.js';
|
|
33
|
+
import { registerStatusAnswerRoutes, statusFleetError } from '../statuses/status-routes.js';
|
|
34
|
+
import { feedScope, listFeed } from '../statuses/status-feed.js';
|
|
33
35
|
const ONBOARDING_WORK = ['coordination', 'development', 'review'];
|
|
34
36
|
const statusFor = (code) => ({
|
|
35
37
|
role_not_found: 404, resource_not_found: 404, unauthorized: 401, forbidden: 403, conflict: 409,
|
|
@@ -40,6 +42,10 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
40
42
|
const app = Fastify({
|
|
41
43
|
trustProxy: false, bodyLimit: 512 * 1024, logger: false,
|
|
42
44
|
requestIdHeader: false, genReqId: () => cryptoRandomId(),
|
|
45
|
+
// Status IDs are route parameters. A permission status ID (CID, harness generation and permission ID) is
|
|
46
|
+
// about 150 characters for UUIDs and up to ~400 URL-encoded; the router's default of 100 answers 414.
|
|
47
|
+
// (routerOptions needs fastify >= 5.5; the top-level option is deprecated.)
|
|
48
|
+
routerOptions: { maxParamLength: 1024 },
|
|
43
49
|
});
|
|
44
50
|
const auth = options.auth ?? new WebAuth(boundary.origin, boundary.host);
|
|
45
51
|
const audit = services.audit ?? new AuditSink();
|
|
@@ -106,6 +112,7 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
106
112
|
reply.code(statusFor(fleetError.code)).send({ error: fleetError.toJSON() });
|
|
107
113
|
});
|
|
108
114
|
registerConversationStream(app, services, auth);
|
|
115
|
+
registerStatusAnswerRoutes(app, services, auth, digestKey);
|
|
109
116
|
app.post('/api/v1/auth/exchange', async (request, reply) => {
|
|
110
117
|
const { session, device } = auth.exchange(request);
|
|
111
118
|
setAuthCookies(reply, session.id, device.token, auth.secureCookies);
|
|
@@ -471,6 +478,14 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
471
478
|
case 'roles': return { roles: await services.query.list(descriptor.includeTemporary ?? false, true) };
|
|
472
479
|
case 'tasks': return projectTasks({ state: descriptor.state, list: descriptor.list, groupByList: String(descriptor.groupByList ?? false), includeDeleting: String(descriptor.includeDeleting ?? false) });
|
|
473
480
|
case 'task-lists': return { lists: requireTaskRooms().listTaskLists() };
|
|
481
|
+
// The first feed page of one scope; every committed status, Progress or review change re-projects it.
|
|
482
|
+
case 'statuses': try {
|
|
483
|
+
const scope = descriptor.scope ?? 'global';
|
|
484
|
+
return listFeed(feedScope({ scope, ...(scope === 'agent' ? { agent: descriptor.entityId } : scope === 'mission' ? { task: descriptor.entityId } : {}) }));
|
|
485
|
+
}
|
|
486
|
+
catch (error) {
|
|
487
|
+
throw statusFleetError(error);
|
|
488
|
+
}
|
|
474
489
|
case 'configuration':
|
|
475
490
|
if (!services.configuration)
|
|
476
491
|
throw new FleetError('capability_unavailable', 'fleet configuration editing is unavailable');
|
package/docs/acp-files.md
CHANGED
|
@@ -80,13 +80,15 @@ similarly named connectors neither enable nor block delivery.
|
|
|
80
80
|
|
|
81
81
|
## Permissions
|
|
82
82
|
|
|
83
|
-
Existing native tool approval
|
|
84
|
-
before bytes are read
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
Existing native tool approval applies before Fleet receives the call. Fleet then
|
|
84
|
+
asks the Owner before any bytes are read: the "Send file to this ACP chat"
|
|
85
|
+
request is raised like any other permission request and waits for the Owner's
|
|
86
|
+
answer, in the session or the feed, whether or not anyone is attached and
|
|
87
|
+
whatever the role's `approval` (D6: Fleet never approves or denies a raised
|
|
88
|
+
request itself, not even inside the role's `filesystem` boundary). Only the
|
|
89
|
+
deprecated `deny` alias still refuses up front, before any request is raised,
|
|
90
|
+
with `CURRENT_CHAT_DELIVERY_UNAVAILABLE`; a declined request returns
|
|
91
|
+
`FILE_SEND_DENIED`, and a request whose turn ends first is cancelled. A native policy that refuses MCP
|
|
90
92
|
execution (including Codex `never` without a native tool allowance) can still
|
|
91
93
|
refuse before Fleet receives the call.
|
|
92
94
|
|
|
@@ -144,6 +144,20 @@ Install it once from the local packaged marketplace:
|
|
|
144
144
|
claude plugin install ours-fleet-native --marketplace /absolute/path/to/fleet/contrib --scope user
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
The marketplace is named `ours-fleet`. Claude Code records it by directory, so
|
|
148
|
+
after Fleet moves to a new directory, remove the old registration first with
|
|
149
|
+
`claude plugin marketplace remove ours-fleet`; the Ours installer does this for
|
|
150
|
+
its own install directories. Releases before 2.4.4 named it
|
|
151
|
+
`ours-fleet-experiment`; remove that registration the same way.
|
|
152
|
+
|
|
153
|
+
The plugin does not poll. Per session it keeps one long-lived
|
|
154
|
+
`ours-fleet participation claude-watch` child, which reports when the App
|
|
155
|
+
queues input and writes a heartbeat (`alive.json`) every five seconds. It runs
|
|
156
|
+
the one-shot `claude-bridge` state exchange only on session start, turn start
|
|
157
|
+
and end, appended messages and queued input. It starts Fleet with the absolute
|
|
158
|
+
Node and entry from the installed `participation hook` command, not with
|
|
159
|
+
`ours-fleet` from `PATH`, which can resolve a Node release Fleet refuses.
|
|
160
|
+
|
|
147
161
|
Then start ordinary `claude`, without launch flags. Existing Claude sessions
|
|
148
162
|
must reload the plugin or be restarted/resumed; the old mail-wake hook alone
|
|
149
163
|
cannot provide shared Human input. The plugin submits through `prompt.submit`,
|
|
@@ -232,7 +232,7 @@ identify which policy denied access.
|
|
|
232
232
|
|
|
233
233
|
## Background: hand-written native execution rules
|
|
234
234
|
|
|
235
|
-
Keep the role's `approval: auto
|
|
235
|
+
Keep the role's `approval: auto` and `filesystem: workspace` (the former `unattended` key is retired and ignored).
|
|
236
236
|
For an operator authorized to manage rooms, explicitly approve the necessary CLI
|
|
237
237
|
operations using Codex's standard execution rules. A matching operation executes
|
|
238
238
|
outside Codex's command sandbox, retaining the normal CLI, supervisor audit,
|
|
@@ -3,7 +3,7 @@ brain: { ref: claude-default }
|
|
|
3
3
|
identity: Alice
|
|
4
4
|
coordinator: FleetCoordinator
|
|
5
5
|
cwd: ${work_root}/alice
|
|
6
|
-
permissions: { approval: ask, filesystem: workspace
|
|
6
|
+
permissions: { approval: ask, filesystem: workspace }
|
|
7
7
|
env:
|
|
8
8
|
EXAMPLE_FLAG: "1"
|
|
9
9
|
monitor:
|
|
@@ -2,6 +2,6 @@ role: { ref: coordinator }
|
|
|
2
2
|
brain: { ref: claude-default }
|
|
3
3
|
identity: FleetCoordinator
|
|
4
4
|
cwd: ${work_root}
|
|
5
|
-
permissions: { approval: ask, filesystem: workspace
|
|
5
|
+
permissions: { approval: ask, filesystem: workspace }
|
|
6
6
|
oversee:
|
|
7
7
|
- { agent: Alice, interval: 5m }
|
package/examples/fleet.yaml
CHANGED
|
@@ -32,7 +32,6 @@ defaults:
|
|
|
32
32
|
permissions: # common intent translated to each harness/backend
|
|
33
33
|
approval: ask # ask | allow | deny
|
|
34
34
|
filesystem: workspace # read-only | workspace | unrestricted
|
|
35
|
-
unattended: deny # deny | wait when no ACP console is attached
|
|
36
35
|
monitor:
|
|
37
36
|
mode: fleet # fleet (default): ours-fleet supervisor; native: harness-owned monitor
|
|
38
37
|
interrupt: false # false: queue; true: cancel; after_tool: steer at an ACP tool boundary
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ours.network/fleet",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Harness-agnostic fleet of persistent, identity-bound AI agents. Declarative fleet.yaml, managed native/ACP sessions, supervision, and ours.network messaging.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "FSL-1.1-Apache-2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@ours.network/mcp": "2.0.6",
|
|
55
55
|
"@ours.network/sdk": "6.1.0",
|
|
56
56
|
"commander": "^12.1.0",
|
|
57
|
-
"fastify": "^5.
|
|
57
|
+
"fastify": "^5.5.0",
|
|
58
58
|
"qrcode": "1.5.4",
|
|
59
59
|
"secure-json-parse": "^4.1.0",
|
|
60
60
|
"ws": "^8.18.3",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
role: { ref: Critic }
|
|
2
2
|
brain: { ref: claude-default }
|
|
3
3
|
coordinator: FleetCoordinator
|
|
4
|
-
permissions: { approval: allow, filesystem: unrestricted
|
|
4
|
+
permissions: { approval: allow, filesystem: unrestricted }
|
|
5
5
|
monitor: { mode: fleet, interrupt: after_tool }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
role: { ref: Developer }
|
|
2
2
|
brain: { ref: claude-default }
|
|
3
3
|
coordinator: FleetCoordinator
|
|
4
|
-
permissions: { approval: allow, filesystem: unrestricted
|
|
4
|
+
permissions: { approval: allow, filesystem: unrestricted }
|
|
5
5
|
monitor: { mode: fleet, interrupt: after_tool }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
role: { ref: Engineer }
|
|
2
2
|
brain: { ref: claude-default }
|
|
3
3
|
coordinator: FleetCoordinator
|
|
4
|
-
permissions: { approval: allow, filesystem: unrestricted
|
|
4
|
+
permissions: { approval: allow, filesystem: unrestricted }
|
|
5
5
|
monitor: { mode: fleet, interrupt: after_tool }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
role: { ref: LocalCoordinator }
|
|
2
2
|
brain: { ref: claude-default }
|
|
3
3
|
coordinator: FleetCoordinator
|
|
4
|
-
permissions: { approval: allow, filesystem: unrestricted
|
|
4
|
+
permissions: { approval: allow, filesystem: unrestricted }
|
|
5
5
|
monitor: { mode: fleet, interrupt: after_tool }
|
|
6
6
|
loops:
|
|
7
7
|
continuity:
|
package/presets/fleet.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
api_version: ours.network/fleet/v2
|
|
2
2
|
|
|
3
3
|
defaults:
|
|
4
|
-
permissions: { approval: ask, filesystem: workspace
|
|
4
|
+
permissions: { approval: ask, filesystem: workspace }
|
|
5
5
|
|
|
6
6
|
# Rooms require an authenticated owner CID/invite before they can be started.
|
|
7
7
|
# See `ours-fleet docs`, then add `rooms:` and `tasks:` here.
|