@ours.network/fleet 1.1.0-nightly.1 → 1.1.0-nightly.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.
Files changed (50) hide show
  1. package/README.md +64 -73
  2. package/dist/application/role-creation-service.js +9 -2
  3. package/dist/application/role-removal-service.js +6 -3
  4. package/dist/application/types.d.ts +1 -1
  5. package/dist/briefing.js +2 -2
  6. package/dist/build-info.json +4 -4
  7. package/dist/cli.js +8 -5
  8. package/dist/config.d.ts +28 -2
  9. package/dist/config.js +307 -23
  10. package/dist/creation.d.ts +1 -1
  11. package/dist/creation.js +2 -2
  12. package/dist/docs.d.ts +1 -1
  13. package/dist/docs.js +31 -69
  14. package/dist/doctor.js +1 -1
  15. package/dist/generated-agent-source.d.ts +9 -0
  16. package/dist/generated-agent-source.js +53 -0
  17. package/dist/harness/agent-session.d.ts +13 -0
  18. package/dist/harness/claude-code-session.d.ts +4 -0
  19. package/dist/harness/claude-code-session.js +4 -0
  20. package/dist/harness/claude-code.js +10 -0
  21. package/dist/harness/codex-session.d.ts +4 -0
  22. package/dist/harness/codex-session.js +4 -0
  23. package/dist/harness/codex.js +14 -0
  24. package/dist/harness/registry.js +4 -0
  25. package/dist/init-guidance.d.ts +1 -0
  26. package/dist/init-guidance.js +5 -0
  27. package/dist/model-env.d.ts +0 -1
  28. package/dist/model-env.js +2 -4
  29. package/dist/ops.js +4 -2
  30. package/dist/resolved-plan.d.ts +3 -2
  31. package/dist/resolved-plan.js +21 -5
  32. package/dist/sensitive-config.d.ts +2 -0
  33. package/dist/sensitive-config.js +4 -0
  34. package/dist/spawn.d.ts +4 -4
  35. package/dist/spawn.js +52 -23
  36. package/dist/web/fleet-config-service.d.ts +11 -8
  37. package/dist/web/fleet-config-service.js +383 -183
  38. package/dist/web/topology-promote.js +17 -14
  39. package/dist/web/topology.js +2 -2
  40. package/dist/web/yaml-document-edit.js +2 -0
  41. package/dist/web-app/assets/index-BbE9EX6n.js +10 -0
  42. package/dist/web-app/index.html +1 -1
  43. package/examples/fleet/agents/Alice.yaml +11 -0
  44. package/examples/fleet/agents/FleetCoordinator.yaml +7 -0
  45. package/examples/fleet/brains/claude-default.yaml +5 -0
  46. package/examples/fleet/roles/coordinator.yaml +5 -0
  47. package/examples/fleet/roles/developer.yaml +3 -0
  48. package/examples/fleet.yaml +74 -0
  49. package/package.json +2 -1
  50. package/dist/web-app/assets/index-DhMDVRU1.js +0 -10
@@ -15,8 +15,9 @@ import { FleetError } from '../application/errors.js';
15
15
  */
16
16
  /** Loop interval when the sketch did not choose one (`resolveLoops` requires it). */
17
17
  const DEFAULT_LOOP_INTERVAL = '10m';
18
- /** Scalar draft fields that are valid keys of a role mapping. */
19
- const ROLE_FIELDS = ['mission', 'bio', 'persona', 'coordinator', 'harness', 'session', 'model', 'identity', 'cwd'];
18
+ const ROLE_FIELDS = ['mission', 'bio', 'persona'];
19
+ const BRAIN_FIELDS = ['harness', 'session', 'model'];
20
+ const AGENT_OP_FIELDS = ['coordinator', 'identity', 'cwd'];
20
21
  /** Scalar draft fields that are valid keys of a watchdog mapping. */
21
22
  const WATCHDOG_FIELDS = ['coordinator', 'interval', 'enabled'];
22
23
  /** Scalar draft fields that are valid keys of a loop mapping. */
@@ -100,15 +101,22 @@ function resolve(merged, id) {
100
101
  return node;
101
102
  }
102
103
  function addNode(model, node, merged) {
103
- const block = section(model, node.kind === 'agent' ? 'roles' : node.kind === 'watchdog' ? 'watchdogs' : 'loops');
104
+ const block = node.kind === 'agent' ? model.agents
105
+ : manifestSection(model, node.kind === 'watchdog' ? 'watchdogs' : 'loops');
104
106
  if (block[node.label] !== undefined)
105
107
  throw new FleetError('conflict', `${node.label} already exists in the configuration`);
106
108
  block[node.label] = node.kind === 'agent' ? agentEntry(node)
107
109
  : node.kind === 'watchdog' ? watchdogEntry(node, merged)
108
- : loopEntry(node, merged, model);
110
+ : loopEntry(node, merged);
109
111
  }
110
112
  function agentEntry(node) {
111
- return pick(node, ROLE_FIELDS);
113
+ const brain = pick(node, BRAIN_FIELDS);
114
+ brain.harness ??= 'claude-code';
115
+ return {
116
+ role: { inline: pick(node, ROLE_FIELDS) },
117
+ brain: { inline: brain },
118
+ ...pick(node, AGENT_OP_FIELDS),
119
+ };
112
120
  }
113
121
  /**
114
122
  * A watchdog drawn on its own carries
@@ -120,7 +128,7 @@ function watchdogEntry(node, merged) {
120
128
  const scoped = linked(merged, node.id, 'watches');
121
129
  return { ...pick(node, WATCHDOG_FIELDS), ...(scoped.length ? { watch: scoped } : {}) };
122
130
  }
123
- function loopEntry(node, merged, model) {
131
+ function loopEntry(node, merged) {
124
132
  const roles = linked(merged, node.id, 'targets');
125
133
  const entry = {
126
134
  roles, ...pick(node, LOOP_FIELDS),
@@ -136,17 +144,12 @@ function linked(merged, id, kind) {
136
144
  .filter(edge => edge.kind === kind && edge.from === id && !edge.implicit && !edge.dangling)
137
145
  .map(edge => edge.to.slice('agent:'.length)))].sort();
138
146
  }
139
- function sessionOf(model, role) {
140
- const roles = model.roles;
141
- const defaults = model.defaults;
142
- return String(roles?.[role]?.session ?? defaults?.session ?? 'acp');
143
- }
144
- function section(model, key) {
145
- const existing = model[key];
147
+ function manifestSection(model, key) {
148
+ const existing = model.manifest[key];
146
149
  if (existing && typeof existing === 'object' && !Array.isArray(existing))
147
150
  return existing;
148
151
  const created = {};
149
- model[key] = created;
152
+ model.manifest[key] = created;
150
153
  return created;
151
154
  }
152
155
  /** Copy only the sketched fields that are real keys of the target mapping. */
@@ -11,8 +11,8 @@ export function deriveTopology(config, roles) {
11
11
  const add = (kind, from, to, label) => edges.push({ id: `${kind}:${from}:${to}`, kind, from, to, label });
12
12
  for (const role of config.roles)
13
13
  for (const entry of role.oversee ?? [])
14
- if (agentIds.has(role.name) && agentIds.has(entry.role))
15
- add('oversees', `agent:${role.name}`, `agent:${entry.role}`, `oversees · ${entry.interval}`);
14
+ if (agentIds.has(role.name) && agentIds.has(entry.agent))
15
+ add('oversees', `agent:${role.name}`, `agent:${entry.agent}`, `oversees · ${entry.interval}`);
16
16
  for (const watchdog of config.watchdogs) {
17
17
  const id = `watchdog:${watchdog.name}`;
18
18
  nodes.push({
@@ -85,6 +85,8 @@ export function redactSourceSecrets(source, marker) {
85
85
  redactEnvMap(['defaults', 'env']);
86
86
  for (const name of mapKeys(document, ['roles']))
87
87
  redactEnvMap(['roles', name, 'env']);
88
+ // A v2 Agent document is itself the role/ops mapping, so env is top-level.
89
+ redactEnvMap(['env']);
88
90
  const vars = document.getIn(['vars'], true);
89
91
  if (isMap(vars))
90
92
  for (const item of vars.items) {