@ours.network/fleet 2.4.0-nightly.2 → 2.4.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/dist/application/model-catalog.d.ts +1 -1
- package/dist/application/model-catalog.js +2 -2
- package/dist/application/task-room-service.d.ts +8 -0
- package/dist/application/task-room-service.js +15 -0
- package/dist/build-info.json +5 -5
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +22 -0
- package/dist/doctor.js +2 -2
- package/dist/harness/codex-runtime.d.ts +2 -0
- package/dist/harness/codex-runtime.js +7 -1
- package/dist/harness/codex.js +2 -3
- package/dist/ops.js +6 -0
- package/dist/rooms-tasks/cli.js +24 -0
- package/dist/rooms-tasks/deletion.js +4 -0
- package/dist/rooms-tasks/task-review.js +2 -0
- package/dist/rooms-tasks/task-state.d.ts +6 -1
- package/dist/rooms-tasks/task-state.js +20 -1
- package/dist/rooms-tasks/types.d.ts +17 -0
- package/dist/rooms-tasks/workspace-removal.d.ts +85 -0
- package/dist/rooms-tasks/workspace-removal.js +633 -0
- package/dist/rooms-tasks/workspace.d.ts +9 -1
- package/dist/rooms-tasks/workspace.js +13 -1
- package/dist/spawn.js +2 -0
- package/dist/web/resource-views.d.ts +1 -1
- package/dist/web/resource-views.js +1 -7
- package/dist/web/runtime.js +0 -13
- package/dist/web/server.d.ts +0 -3
- package/dist/web/server.js +10 -24
- package/docs/task-workspaces.md +51 -1
- package/package.json +7 -7
- package/presets/brain-catalog.json +5 -2
- package/dist/channels/identity-reads.d.ts +0 -69
- package/dist/channels/identity-reads.js +0 -47
- package/dist/channels/indexer.d.ts +0 -55
- package/dist/channels/indexer.js +0 -214
- package/dist/channels/runtime.d.ts +0 -30
- package/dist/channels/runtime.js +0 -125
- package/dist/channels/service.d.ts +0 -61
- package/dist/channels/service.js +0 -88
- package/dist/channels/sources.d.ts +0 -46
- package/dist/channels/sources.js +0 -68
- package/dist/channels/store.d.ts +0 -103
- package/dist/channels/store.js +0 -204
package/dist/spawn.js
CHANGED
|
@@ -2,6 +2,7 @@ import { taskSupervisorMayRun } from './task-supervision.js';
|
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { storeRoomSecret, storeTemporaryLaunch, preparePermanentAssignment } from './agent-ours/service.js';
|
|
4
4
|
import { ensureWorkspace } from './rooms-tasks/workspace.js';
|
|
5
|
+
import { assertCwdNotInRemovedTaskFolder } from './rooms-tasks/workspace-removal.js';
|
|
5
6
|
import { spawn as spawnChild } from 'node:child_process';
|
|
6
7
|
import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
7
8
|
import { join } from 'node:path';
|
|
@@ -324,6 +325,7 @@ export async function spawnTemp(o, binPath, launch = independentSupervisor, crea
|
|
|
324
325
|
if (o.isolationFile)
|
|
325
326
|
readIsolationFile(o.isolationFile); // fail before reserving
|
|
326
327
|
const prepared = resolvedSpawn(o); // canonical validation before mutation
|
|
328
|
+
assertCwdNotInRemovedTaskFolder(prepared.role.cwd);
|
|
327
329
|
if ((o.taskOwner || o.roomMemberStartup?.task_id) && !getAdapter(prepared.role.harness).supportsResume)
|
|
328
330
|
throw Error('TASK_HARNESS_RESUME_UNSUPPORTED: task agents require a resumable harness');
|
|
329
331
|
if (o.roomMemberStartup?.workspace) {
|
|
@@ -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';
|
|
84
84
|
entityId?: string;
|
|
85
85
|
receiptId?: string;
|
|
86
86
|
provider?: 'claude' | 'codex';
|
|
@@ -155,7 +155,7 @@ 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'
|
|
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
159
|
|| Object.keys(value).some(key => !['viewId', 'resource', 'includeTemporary', 'includeDefinitions', 'ids', 'state', 'list', 'groupByList', 'includeDeleting', 'entityId', 'receiptId', 'provider', 'activityOnly'].includes(key)))
|
|
160
160
|
throw Error('invalid resource descriptor');
|
|
161
161
|
if (value.activityOnly !== undefined && value.resource !== 'previews')
|
|
@@ -381,12 +381,6 @@ export class FleetResourceViews {
|
|
|
381
381
|
|| this.configurationInputs().some(input => within(resolve(input), changed));
|
|
382
382
|
}
|
|
383
383
|
affects(descriptor, path, structural = false) {
|
|
384
|
-
// The Channels projection commits only its own private database; no other view reads it.
|
|
385
|
-
const channelsRoot = resolve(stateRoot(), 'private-channels'), channelsPath = path === channelsRoot || path.startsWith(channelsRoot + sep);
|
|
386
|
-
if (descriptor.resource === 'channels')
|
|
387
|
-
return channelsPath || channelsRoot.startsWith(resolve(path) + sep);
|
|
388
|
-
if (channelsPath)
|
|
389
|
-
return false;
|
|
390
384
|
if (descriptor.resource === 'configuration')
|
|
391
385
|
return this.configurationDependency(path);
|
|
392
386
|
// An explicitly selected manifest may use any pathname, including one
|
package/dist/web/runtime.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createChannels } from '../channels/runtime.js';
|
|
2
1
|
import { ConversationRoleObserver } from '../application/conversation-role-observer.js';
|
|
3
2
|
import { replaceFileAtomically } from '../atomic-file.js';
|
|
4
3
|
import { validateAccountOrigin } from '../account-origin.js';
|
|
@@ -197,15 +196,6 @@ export async function startWebConsole(options) {
|
|
|
197
196
|
const taskRooms = new TaskRoomApplicationService(options.configPath, { binPath: () => options.binPath });
|
|
198
197
|
// One-time, lock-guarded mission key migration before serving; failure leaves it to the next mutation.
|
|
199
198
|
await taskRooms.prepareMissionKeys().catch(error => console.warn(`mission key migration deferred: ${error.message}`));
|
|
200
|
-
// Ours Channels runs only where a daemon client profile exists.
|
|
201
|
-
let channels;
|
|
202
|
-
try {
|
|
203
|
-
channels = createChannels({ configPath: configuration.path, repository });
|
|
204
|
-
}
|
|
205
|
-
catch (error) {
|
|
206
|
-
console.warn(`Ours Channels unavailable: ${error.message}`);
|
|
207
|
-
channels = undefined;
|
|
208
|
-
}
|
|
209
199
|
let server;
|
|
210
200
|
try {
|
|
211
201
|
server = await buildWebServer({
|
|
@@ -229,7 +219,6 @@ export async function startWebConsole(options) {
|
|
|
229
219
|
});
|
|
230
220
|
},
|
|
231
221
|
codexModels: createCodexModelDiscovery(),
|
|
232
|
-
...(channels ? { channels: channels.service } : {}),
|
|
233
222
|
subscriptions: new SubscriptionService({
|
|
234
223
|
agents: async () => (await query.list(true)).map(({ role, status }) => ({
|
|
235
224
|
roleId: role.id, stateDir: repository.stateDir(role), running: status.supervisor.liveness === 'running',
|
|
@@ -252,7 +241,6 @@ export async function startWebConsole(options) {
|
|
|
252
241
|
}, { origin: `http://127.0.0.1:${requestedPort}`, host: `127.0.0.1:${requestedPort}` }, { auth });
|
|
253
242
|
}
|
|
254
243
|
catch (error) {
|
|
255
|
-
channels?.close();
|
|
256
244
|
lock.release();
|
|
257
245
|
throw error;
|
|
258
246
|
}
|
|
@@ -348,7 +336,6 @@ export async function startWebConsole(options) {
|
|
|
348
336
|
await control?.close();
|
|
349
337
|
await gateway?.close();
|
|
350
338
|
await server.close();
|
|
351
|
-
channels?.close();
|
|
352
339
|
}
|
|
353
340
|
finally {
|
|
354
341
|
lock.release();
|
package/dist/web/server.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ import type { PresetProvenance } from '../application/preset-provenance.js';
|
|
|
24
24
|
import type { OfferedModels } from '../subscriptions/cli.js';
|
|
25
25
|
import type { SubscriptionService } from '../subscriptions/service.js';
|
|
26
26
|
import type { LayoutBindingGrants } from '../rooms-tasks/layout-binding-grants.js';
|
|
27
|
-
import type { ChannelsService } from '../channels/service.js';
|
|
28
27
|
export interface WebServices {
|
|
29
28
|
resourceScope?: FleetResourceScope;
|
|
30
29
|
invalidateResourceCaches?(): void;
|
|
@@ -49,8 +48,6 @@ export interface WebServices {
|
|
|
49
48
|
presetProvenance?: PresetProvenance;
|
|
50
49
|
oursTools?: Pick<SupervisorOursTools, 'list' | 'call'>;
|
|
51
50
|
subscriptions?: SubscriptionService;
|
|
52
|
-
/** Ours Channels: Owner-only cross-identity external contacts. Absent: not configured. */
|
|
53
|
-
channels?: ChannelsService;
|
|
54
51
|
/** First-time setup from the packaged presets; the account App supplies only the model choices. */
|
|
55
52
|
onboardingSetup?(answers: InitAnswers): Promise<void>;
|
|
56
53
|
/** The Codex models the runtime that sessions will use offers the active account. Absent: this server cannot tell, and filters nothing. */
|
package/dist/web/server.js
CHANGED
|
@@ -23,6 +23,7 @@ import { AuditSink } from './audit.js';
|
|
|
23
23
|
import { WebAuth } from './auth.js';
|
|
24
24
|
import { FleetEventBus } from './events.js';
|
|
25
25
|
import { ROLE_NAME_RE } from '../config.js';
|
|
26
|
+
import { workingFilesSummary } from '../rooms-tasks/workspace-removal.js';
|
|
26
27
|
import { TaskListError } from '../rooms-tasks/task-lists.js';
|
|
27
28
|
import { acknowledgeTaskProgress, acknowledgeTaskReview, contributionUnread, resolveTaskRef, TaskStateError } from '../rooms-tasks/task-state.js';
|
|
28
29
|
import { CONTRIBUTION_CUTOFF_MAX, CONTRIBUTION_PAGE_MAX, listTaskContributions, readTaskContributions } from '../rooms-tasks/task-contributions.js';
|
|
@@ -390,7 +391,7 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
390
391
|
/** Browser task payloads carry Progress/To review counts; bodies have their own routes. */
|
|
391
392
|
const wireTask = (task) => {
|
|
392
393
|
const { progress: _progress, review: _review, member_naming: _naming, ...rest } = task;
|
|
393
|
-
return { ...rest, ...taskContributionSummary(task) };
|
|
394
|
+
return { ...rest, ...taskContributionSummary(task), working_files: workingFilesSummary(task) };
|
|
394
395
|
};
|
|
395
396
|
const wireTaskResult = (result) => {
|
|
396
397
|
const value = result;
|
|
@@ -460,10 +461,6 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
460
461
|
throw error;
|
|
461
462
|
}
|
|
462
463
|
case 'subscriptions': return { providers: await subscriptions().list(true) };
|
|
463
|
-
case 'channels':
|
|
464
|
-
if (!services.channels)
|
|
465
|
-
throw new FleetError('capability_unavailable', 'Ours Channels is not configured on this server');
|
|
466
|
-
return services.channels.snapshot();
|
|
467
464
|
case 'onboarding-health': {
|
|
468
465
|
const revision = services.configuration?.read().revision;
|
|
469
466
|
if (onboardingObserved && onboardingObserved.revision !== revision)
|
|
@@ -560,25 +557,6 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
560
557
|
});
|
|
561
558
|
for (const resource of ['task-layout', 'creation-action', 'action', 'member-addition', 'login', 'onboarding-health'])
|
|
562
559
|
app.get('/api/v1/' + resource, async () => { throw new ResourceBindingError(409, 'resource binding required'); });
|
|
563
|
-
const channels = () => { if (!services.channels)
|
|
564
|
-
throw new FleetError('capability_unavailable', 'Ours Channels is not configured on this server'); return services.channels; };
|
|
565
|
-
const channelCid = (value) => { const cid = String(value ?? ''); if (!/^[0-9A-Fa-f]{64}$/.test(cid))
|
|
566
|
-
throw new FleetError('invalid_request', 'a 64-hex container id is required'); return cid.toUpperCase(); };
|
|
567
|
-
const optionalInt = (value, name, max = Number.MAX_SAFE_INTEGER) => { if (value === undefined || value === '')
|
|
568
|
-
return undefined; const n = Number(value); if (!Number.isSafeInteger(n) || n < 1 || n > max)
|
|
569
|
-
throw new FleetError('invalid_request', `${name} must be an integer from 1 to ${max}`); return n; };
|
|
570
|
-
app.get('/api/v1/channels', async (request) => {
|
|
571
|
-
auth.authenticate(request);
|
|
572
|
-
const query = request.query;
|
|
573
|
-
return channels().list({ ...(query.cursor ? { cursor: String(query.cursor) } : {}), ...(query.q ? { q: String(query.q).slice(0, 200) } : {}), ...(query.root ? { root: channelCid(query.root) } : {}), ...(query.limit ? { limit: optionalInt(query.limit, 'limit', 200) } : {}) });
|
|
574
|
-
});
|
|
575
|
-
app.get('/api/v1/channels-status', async (request) => { auth.authenticate(request); return channels().status(); });
|
|
576
|
-
app.get('/api/v1/channels/:cid', async (request) => { auth.authenticate(request); return channels().get(channelCid(request.params.cid)); });
|
|
577
|
-
app.get('/api/v1/channels/:cid/perspectives/:source/messages', async (request) => {
|
|
578
|
-
auth.authenticate(request);
|
|
579
|
-
const before = optionalInt(request.query.before_seq, 'before_seq'), limit = optionalInt(request.query.limit, 'limit', 200);
|
|
580
|
-
return channels().history(channelCid(request.params.cid), channelCid(request.params.source), { ...(before !== undefined ? { before_seq: before } : {}), ...(limit !== undefined ? { limit } : {}) });
|
|
581
|
-
});
|
|
582
560
|
app.get('/api/v1/directory', async (request) => { auth.authenticate(request); return project({ viewId: 'read', resource: 'directory' }, new AbortController().signal); });
|
|
583
561
|
app.get('/api/v1/previews', async (request) => { auth.authenticate(request); const query = request.query, ids = String(query.ids ?? '').split(',').filter(Boolean); return project(canonicalResourceDescriptor({ viewId: 'read', resource: 'previews', ids, ...(query.activityOnly === 'true' ? { activityOnly: true } : {}) }), new AbortController().signal); });
|
|
584
562
|
app.get('/api/v1/task-lists', async (request) => {
|
|
@@ -648,6 +626,14 @@ export async function buildWebServer(services, boundary, options = {}) {
|
|
|
648
626
|
recovery: `Repeat DELETE /api/v1/tasks/${submitted}?confirm=${submitted}.`,
|
|
649
627
|
};
|
|
650
628
|
});
|
|
629
|
+
// Removes only the Done task's own working folder; the task, Progress, To review files and chat history stay.
|
|
630
|
+
app.post('/api/v1/tasks/:id/working-files/remove', async (request) => {
|
|
631
|
+
auth.authenticate(request, true);
|
|
632
|
+
const result = await taskApi(() => requireTaskRooms().removeTaskWorkingFiles({
|
|
633
|
+
actor: { kind: 'local_control', surface: 'web' }, taskId: taskRef(request),
|
|
634
|
+
}));
|
|
635
|
+
return { task: wireTask(result.task), result: result.result, mentions: result.mentions };
|
|
636
|
+
});
|
|
651
637
|
app.post('/api/v1/tasks', async (request, reply) => {
|
|
652
638
|
auth.authenticate(request, true);
|
|
653
639
|
const body = request.body;
|
package/docs/task-workspaces.md
CHANGED
|
@@ -30,6 +30,7 @@ complete internal worktree registries, including dirty and stale owned entries.
|
|
|
30
30
|
| Operation | Workspace and execution artifacts | Member runtime evidence |
|
|
31
31
|
| --- | --- | --- |
|
|
32
32
|
| Complete, fail, cancel | Retained while Task is recorded | Retained in Fleet recovery archives |
|
|
33
|
+
| Explicit working-files removal (Done Task only) | Task workspace removed; Task, Progress and To review files retained | Retained in Fleet recovery archives |
|
|
33
34
|
| Linked Room retirement or deletion | Task workspace retained | Retained |
|
|
34
35
|
| Internal standalone Room retirement | Room workspace retained | Retained |
|
|
35
36
|
| Explicit Task deletion | Removed after member retirement, with the task's retained To review files | All proven owned retired launches removed |
|
|
@@ -39,7 +40,8 @@ Internal room close means retirement, not destructive Task deletion.
|
|
|
39
40
|
The existing CLI `room close ID ID` remains a deprecated alias for explicit
|
|
40
41
|
`room delete ID ID`: it deletes standalone room-owned artifacts, but always
|
|
41
42
|
retains a linked Task workspace. Its repeated-ID confirmation is unchanged. To remove a Task's
|
|
42
|
-
artifacts, explicitly delete the Task
|
|
43
|
+
artifacts, explicitly delete the Task, or, for a Done Task, remove only its working files
|
|
44
|
+
(`task remove-files ID`, below). Cancellation is not deletion. Automatic
|
|
43
45
|
compatibility cleanup of legacy closed Rooms skips records with owned workspaces.
|
|
44
46
|
These choices reconcile close/remove wording with the requirement that completed,
|
|
45
47
|
recorded Tasks retain all artifacts.
|
|
@@ -223,3 +225,51 @@ requires a supported Home Screen installation and granted device/browser permiss
|
|
|
223
225
|
reopen the workspace to reconcile an expired subscription and explicitly re-enable
|
|
224
226
|
permission if it was revoked. Every received push must display a notification to
|
|
225
227
|
honor Safari's user-visible push requirement.
|
|
228
|
+
|
|
229
|
+
## Removing a Done Task's working files
|
|
230
|
+
|
|
231
|
+
`ours-fleet task remove-files ID` (API `POST /api/v1/tasks/ID/working-files/remove`)
|
|
232
|
+
frees disk space without deleting the Task. It removes only the recorded owned
|
|
233
|
+
workspace through the same guarded deletion as Task deletion (marker, Git
|
|
234
|
+
registration, symlink and mount checks, token tombstone). It never collects or
|
|
235
|
+
erases recovery archives, member artifacts or the To review store, and never
|
|
236
|
+
closes rooms or stops agents. It runs under the task operation lock and refuses
|
|
237
|
+
with the reason unless all of these hold:
|
|
238
|
+
|
|
239
|
+
- the Task is Done with its completion settled, and is not being deleted;
|
|
240
|
+
- no room record names the Task or its workspace, and every room record is readable;
|
|
241
|
+
- a layout run exists, is closed, is not uncertain, and has retired every owned participant;
|
|
242
|
+
- no supervisor registration belongs to the Task;
|
|
243
|
+
- no unarchived temporary agent state belongs to the Task or works in the
|
|
244
|
+
folder (cwd or startup workspace, literally or through symlinks), and all
|
|
245
|
+
such state is readable;
|
|
246
|
+
- no permanent agent's recorded `.cwd` or configured cwd is in the folder.
|
|
247
|
+
|
|
248
|
+
The intent is recorded before a final in-use scan. Agent state that names a
|
|
249
|
+
task folder is created under that folder's use lock and refuses a folder
|
|
250
|
+
whose removal began, so a concurrent launch is either seen by the scan or
|
|
251
|
+
refused. After the folder is renamed to its tombstone and before anything
|
|
252
|
+
is removed, every process's cwd, root and open files are checked (Linux
|
|
253
|
+
`/proc`). A process that entered the folder earlier restores the folder and
|
|
254
|
+
refuses the removal. Platforms without this check refuse the removal.
|
|
255
|
+
A same-user process whose cwd and descriptors are unreadable (for example
|
|
256
|
+
non-dumpable, or in a container) refuses the removal unless it is a zombie.
|
|
257
|
+
Nothing readable proves such a process holds nothing in the folder: a
|
|
258
|
+
retained cwd or descriptor survives namespace and chroot changes, and a user
|
|
259
|
+
service manager may keep descriptors in its store. The refusal names each
|
|
260
|
+
such process by pid and kernel name (never its command line), with
|
|
261
|
+
read-only context such as "own mount namespace without the folder".
|
|
262
|
+
Another user's unreadable process is skipped when a private ancestor closes
|
|
263
|
+
the folder to it. Superuser processes are outside the check. On hosts that
|
|
264
|
+
run rootless containers or a user service manager, this strict check can
|
|
265
|
+
make removal unavailable while those processes run. Only a folder
|
|
266
|
+
that this run renamed intact is restored. A partly removed tombstone from an
|
|
267
|
+
earlier run stays in place with the refusal recorded, so a later retry can
|
|
268
|
+
finish it.
|
|
269
|
+
|
|
270
|
+
The Task records `workspace_removal` (started, completed, error), shown as
|
|
271
|
+
`working_files` in API payloads. A retry resumes an unfinished tombstone, and
|
|
272
|
+
repeating a finished removal changes nothing. A folder already missing on the
|
|
273
|
+
first run is recorded as such. A create replay never recreates the folder, and
|
|
274
|
+
To review files can no longer be attached from it. Explicit Task deletion
|
|
275
|
+
still works and first finishes an interrupted removal.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ours.network/fleet",
|
|
3
|
-
"version": "2.4.0
|
|
3
|
+
"version": "2.4.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",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@agentclientprotocol/sdk": "^1.3.0",
|
|
51
51
|
"@fastify/websocket": "^11.2.0",
|
|
52
|
-
"@ours.network/cli": "4.2.
|
|
53
|
-
"@ours.network/mcp": "2.
|
|
54
|
-
"@ours.network/sdk": "5.2.
|
|
52
|
+
"@ours.network/cli": "4.2.0",
|
|
53
|
+
"@ours.network/mcp": "2.0.4",
|
|
54
|
+
"@ours.network/sdk": "5.2.0",
|
|
55
55
|
"commander": "^12.1.0",
|
|
56
56
|
"fastify": "^5.4.0",
|
|
57
57
|
"qrcode": "1.5.4",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"zod": "^4.4.3"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@agentclientprotocol/claude-agent-acp": "
|
|
65
|
-
"@agentclientprotocol/codex-acp": "
|
|
64
|
+
"@agentclientprotocol/claude-agent-acp": "0.103.0",
|
|
65
|
+
"@agentclientprotocol/codex-acp": "2.7.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@ours.network/daemon": "5.2.
|
|
68
|
+
"@ours.network/daemon": "5.2.0",
|
|
69
69
|
"@types/node": "^22.20.4",
|
|
70
70
|
"@types/qrcode": "^1.5.6",
|
|
71
71
|
"@types/ws": "^8.18.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 2,
|
|
3
|
-
"catalog_revision":
|
|
3
|
+
"catalog_revision": 6,
|
|
4
4
|
"models": [
|
|
5
5
|
{ "harness": "codex", "session": "acp", "model": "gpt-6-astra", "label": "GPT-6 Astra", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
|
|
6
6
|
{ "harness": "codex", "session": "acp", "model": "gpt-5.6-sol", "label": "GPT-5.6 Sol", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
{ "harness": "codex", "session": "acp", "model": "gpt-6-luna", "label": "GPT-6 Luna", "efforts": ["low", "medium", "high", "xhigh", "max"] },
|
|
19
19
|
{ "harness": "claude-code", "session": "acp", "model": "claude-fable-5-1", "label": "Claude Fable 5.1", "efforts": ["low", "medium", "high", "xhigh", "max"] },
|
|
20
20
|
{ "harness": "claude-code", "session": "acp", "model": "claude-opus-5-5", "label": "Claude Opus 5.5", "efforts": ["low", "medium", "high", "xhigh", "max"] },
|
|
21
|
-
{ "harness": "claude-code", "session": "acp", "model": "claude-haiku-4-5-20251001", "label": "Claude Haiku 4.5", "efforts": [] }
|
|
21
|
+
{ "harness": "claude-code", "session": "acp", "model": "claude-haiku-4-5-20251001", "label": "Claude Haiku 4.5", "efforts": [] },
|
|
22
|
+
{ "harness": "codex", "session": "acp", "model": "gpt-6.2-astra", "label": "GPT-6.2 Astra", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
|
|
23
|
+
{ "harness": "codex", "session": "acp", "model": "gpt-6.2-sol", "label": "GPT-6.2 Sol", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
|
|
24
|
+
{ "harness": "claude-code", "session": "acp", "model": "claude-fable-5-2", "label": "Claude Fable 5.2", "efforts": ["low", "medium", "high", "xhigh", "max"] }
|
|
22
25
|
]
|
|
23
26
|
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal HTTP adapter for the daemon's lease-free identity reads
|
|
3
|
-
* (`GET /identities/<name>/contacts-activity|history`, ours-sdk
|
|
4
|
-
* docs/identity-reads.md). Kept local so Fleet does not need a newer SDK client;
|
|
5
|
-
* the shapes are the daemon contract verbatim. The ordinary workspace client
|
|
6
|
-
* credential is reread on every request. No identity is ever bound.
|
|
7
|
-
*/
|
|
8
|
-
export interface IdentityRef {
|
|
9
|
-
identity: string;
|
|
10
|
-
expectedCid: string;
|
|
11
|
-
expectedProducerGeneration?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface SourcePosition {
|
|
14
|
-
protocolVersion: 1;
|
|
15
|
-
producerGeneration: string;
|
|
16
|
-
position: number;
|
|
17
|
-
}
|
|
18
|
-
export interface ContactRootClaim {
|
|
19
|
-
root_cid: string;
|
|
20
|
-
root_name: string;
|
|
21
|
-
role_id: string;
|
|
22
|
-
}
|
|
23
|
-
export interface ContactsActivity {
|
|
24
|
-
identity: {
|
|
25
|
-
name: string;
|
|
26
|
-
cid: string;
|
|
27
|
-
};
|
|
28
|
-
source: SourcePosition;
|
|
29
|
-
contacts: Array<{
|
|
30
|
-
name: string;
|
|
31
|
-
container_id: string;
|
|
32
|
-
}>;
|
|
33
|
-
roots: Record<string, ContactRootClaim>;
|
|
34
|
-
activity: Record<string, {
|
|
35
|
-
at: string;
|
|
36
|
-
} | {
|
|
37
|
-
unavailable: true;
|
|
38
|
-
}>;
|
|
39
|
-
}
|
|
40
|
-
export interface IdentityHistoryPage {
|
|
41
|
-
identity: {
|
|
42
|
-
name: string;
|
|
43
|
-
cid: string;
|
|
44
|
-
};
|
|
45
|
-
source: SourcePosition;
|
|
46
|
-
items: Array<Record<string, unknown> & {
|
|
47
|
-
seq: number;
|
|
48
|
-
wire_id: string;
|
|
49
|
-
}>;
|
|
50
|
-
next_cursor: number | null;
|
|
51
|
-
}
|
|
52
|
-
export declare class IdentityReadError extends Error {
|
|
53
|
-
readonly status: number;
|
|
54
|
-
readonly code: string | undefined;
|
|
55
|
-
constructor(status: number, code: string | undefined, message: string);
|
|
56
|
-
}
|
|
57
|
-
export interface IdentityReader {
|
|
58
|
-
contactsActivity(ref: IdentityRef, signal?: AbortSignal): Promise<ContactsActivity>;
|
|
59
|
-
history(ref: IdentityRef & {
|
|
60
|
-
peer_cid: string;
|
|
61
|
-
before_seq?: number;
|
|
62
|
-
limit?: number;
|
|
63
|
-
}, signal?: AbortSignal): Promise<IdentityHistoryPage>;
|
|
64
|
-
}
|
|
65
|
-
export declare function createIdentityReader(options: {
|
|
66
|
-
endpoint: string;
|
|
67
|
-
credentialPath: string;
|
|
68
|
-
fetchImpl?: typeof fetch;
|
|
69
|
-
}): IdentityReader;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { readPrivateFile } from '@ours.network/sdk/connector';
|
|
2
|
-
export class IdentityReadError extends Error {
|
|
3
|
-
status;
|
|
4
|
-
code;
|
|
5
|
-
constructor(status, code, message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.status = status;
|
|
8
|
-
this.code = code;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export function createIdentityReader(options) {
|
|
12
|
-
const fetchImpl = options.fetchImpl ?? fetch;
|
|
13
|
-
const base = options.endpoint.replace(/\/+$/, '');
|
|
14
|
-
async function get(name, kind, query, signal) {
|
|
15
|
-
const params = new URLSearchParams();
|
|
16
|
-
for (const [key, value] of Object.entries(query))
|
|
17
|
-
if (value !== undefined)
|
|
18
|
-
params.set(key, String(value));
|
|
19
|
-
const response = await fetchImpl(`${base}/identities/${encodeURIComponent(name)}/${kind}?${params}`, {
|
|
20
|
-
redirect: 'error',
|
|
21
|
-
signal: signal ?? AbortSignal.timeout(15_000),
|
|
22
|
-
headers: { 'x-ours-api-token': readPrivateFile(options.credentialPath, 4096).toString('utf8').trim() },
|
|
23
|
-
});
|
|
24
|
-
let json;
|
|
25
|
-
try {
|
|
26
|
-
json = await response.json();
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
throw new IdentityReadError(response.status, undefined, `${kind}: non-JSON response (HTTP ${response.status})`);
|
|
30
|
-
}
|
|
31
|
-
if (response.ok)
|
|
32
|
-
return json;
|
|
33
|
-
const error = json?.error;
|
|
34
|
-
if (error && typeof error === 'object') {
|
|
35
|
-
const { code, message } = error;
|
|
36
|
-
throw new IdentityReadError(response.status, typeof code === 'string' ? code : undefined, `${kind}: ${String(message ?? code)}`);
|
|
37
|
-
}
|
|
38
|
-
throw new IdentityReadError(response.status, undefined, `${kind}: ${String(error ?? `HTTP ${response.status}`)}`);
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
contactsActivity: (ref, signal) => get(ref.identity, 'contacts-activity', { expectedCid: ref.expectedCid, expectedProducerGeneration: ref.expectedProducerGeneration }, signal),
|
|
42
|
-
history: (ref, signal) => get(ref.identity, 'history', {
|
|
43
|
-
peer_cid: ref.peer_cid, before_seq: ref.before_seq, limit: ref.limit,
|
|
44
|
-
expectedCid: ref.expectedCid, expectedProducerGeneration: ref.expectedProducerGeneration,
|
|
45
|
-
}, signal),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { type ContactsActivity, type IdentityReader } from './identity-reads.js';
|
|
2
|
-
import { type ChannelSources } from './sources.js';
|
|
3
|
-
import type { ChannelEdge, ChannelsStore } from './store.js';
|
|
4
|
-
export interface ResourceFrame {
|
|
5
|
-
kind: string;
|
|
6
|
-
producerGeneration: string;
|
|
7
|
-
position: number;
|
|
8
|
-
}
|
|
9
|
-
export interface ResourceEventSource {
|
|
10
|
-
resourceEvents(identity: string, options: {
|
|
11
|
-
signal: AbortSignal;
|
|
12
|
-
expectedGeneration?: string;
|
|
13
|
-
after?: number;
|
|
14
|
-
}): AsyncIterable<ResourceFrame>;
|
|
15
|
-
}
|
|
16
|
-
export interface ChannelsIndexerDeps {
|
|
17
|
-
store: ChannelsStore;
|
|
18
|
-
reader: IdentityReader;
|
|
19
|
-
events: ResourceEventSource;
|
|
20
|
-
discover(): Promise<ChannelSources>;
|
|
21
|
-
onChange(): void;
|
|
22
|
-
log(message: string): void;
|
|
23
|
-
debounceMs?: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Event-driven Channels projection. One passive resource-event stream per live
|
|
27
|
-
* perspective source; idle coverage frames are ignored and a committed frame
|
|
28
|
-
* only schedules work when the source position advanced. Work is debounced,
|
|
29
|
-
* at most one observation runs per source, and each observation reads only
|
|
30
|
-
* that source's contacts and activity (one lease-free daemon read), never other sources.
|
|
31
|
-
*/
|
|
32
|
-
export declare class ChannelsIndexer {
|
|
33
|
-
private readonly deps;
|
|
34
|
-
private readonly watches;
|
|
35
|
-
private internal;
|
|
36
|
-
private syncing?;
|
|
37
|
-
private resync;
|
|
38
|
-
private stopped;
|
|
39
|
-
private readonly debounceMs;
|
|
40
|
-
constructor(deps: ChannelsIndexerDeps);
|
|
41
|
-
/** Re-derive sources and the exclusion set; start/stop streams accordingly. */
|
|
42
|
-
sync(): Promise<void>;
|
|
43
|
-
stop(): void;
|
|
44
|
-
private syncOnce;
|
|
45
|
-
/** The daemon source of `sourceCid` changed under a caller: drop its pin and observe again. */
|
|
46
|
-
invalidate(sourceCid: string): void;
|
|
47
|
-
private retire;
|
|
48
|
-
private follow;
|
|
49
|
-
private retired;
|
|
50
|
-
private schedule;
|
|
51
|
-
private run;
|
|
52
|
-
private observe;
|
|
53
|
-
}
|
|
54
|
-
/** Contacts of one observation, minus internal identities, as metadata-only edges. */
|
|
55
|
-
export declare function edgesFrom(observation: ContactsActivity, internal: Set<string>): ChannelEdge[];
|