pi-radar 0.3.0 → 0.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.
Files changed (36) hide show
  1. package/README.md +4 -2
  2. package/dist/extension/baseline.js +227 -402
  3. package/dist/extension/radar-client.js +53 -13
  4. package/dist/extension/radar-communication.js +5 -5
  5. package/dist/extension/radar-execution.js +168 -383
  6. package/dist/extension/radar-launch.js +13 -13
  7. package/dist/extension/radar-publication.js +160 -299
  8. package/dist/index.js +239 -414
  9. package/extension/generated-contracts.ts +1249 -13
  10. package/extension/radar-client.ts +92 -29
  11. package/extension/radar-communication.ts +5 -5
  12. package/extension/radar-execution.ts +11 -58
  13. package/extension/radar-launch.ts +21 -21
  14. package/extension/radar-publication.ts +209 -412
  15. package/package.json +3 -4
  16. package/schema/public/v1/handoff-publish-params.deserialize.schema.json +2 -2
  17. package/schema/public/v1/handoff-publish-params.serialize.schema.json +2 -2
  18. package/schema/public/v1/handoff-receipt.deserialize.schema.json +4 -4
  19. package/schema/public/v1/handoff-receipt.serialize.schema.json +4 -4
  20. package/schema/public/v1/handoff.deserialize.schema.json +4 -4
  21. package/schema/public/v1/handoff.serialize.schema.json +4 -4
  22. package/schema/public/v1/observation-get-params.deserialize.schema.json +46 -0
  23. package/schema/public/v1/observation-get-params.serialize.schema.json +52 -0
  24. package/schema/public/v1/observation-get-response.deserialize.schema.json +2731 -0
  25. package/schema/public/v1/observation-get-response.serialize.schema.json +2862 -0
  26. package/schema/public/v1/observation-snapshot.deserialize.schema.json +2616 -0
  27. package/schema/public/v1/observation-snapshot.serialize.schema.json +2741 -0
  28. package/schema/public/v1/presence-answer.deserialize.schema.json +40 -0
  29. package/schema/public/v1/presence-answer.serialize.schema.json +40 -0
  30. package/schema/public/v1/presence-release.deserialize.schema.json +51 -0
  31. package/schema/public/v1/presence-release.serialize.schema.json +52 -0
  32. package/schema/public/v1/presence-report.deserialize.schema.json +149 -0
  33. package/schema/public/v1/presence-report.serialize.schema.json +157 -0
  34. package/extension/radar-session-marker.ts +0 -146
  35. package/schema/public/v1/launch-identity-marker.deserialize.schema.json +0 -32
  36. package/schema/public/v1/launch-identity-marker.serialize.schema.json +0 -32
@@ -21,7 +21,7 @@ function trajectory(reason) {
21
21
  return `the daemon's current record of this launch's child is ${reason}`;
22
22
  }
23
23
  async function observeRadarChild(client, provenance) {
24
- if (provenance.agent_id === void 0)
24
+ if (provenance.registration_id === void 0)
25
25
  return unknownChild("not bound to a child by this launch");
26
26
  if (provenance.pane_id === void 0)
27
27
  return unknownChild("without a pane this launch recorded for it");
@@ -32,11 +32,11 @@ async function observeRadarChild(client, provenance) {
32
32
  );
33
33
  const topology = read.value;
34
34
  const edge = topology.edge;
35
- if (edge.bound === void 0 || edge.bound.agent_id === void 0)
35
+ if (edge.bound === void 0 || edge.bound.registration_id === void 0)
36
36
  return unknownChild("not bound to a child by the daemon");
37
- if (edge.bound.agent_id !== provenance.agent_id)
37
+ if (edge.bound.registration_id !== provenance.registration_id)
38
38
  return unknownChild(
39
- `bound to another subject (${edge.bound.agent_id}), not to ${provenance.agent_id}`
39
+ `bound to another subject (${edge.bound.registration_id}), not to ${provenance.registration_id}`
40
40
  );
41
41
  if (edge.location?.pane === void 0)
42
42
  return unknownChild("recorded without a pane");
@@ -54,7 +54,7 @@ async function observeRadarChild(client, provenance) {
54
54
  return unknownChild(
55
55
  `not currently placed (state ${topology.state ?? "unreported"})`
56
56
  );
57
- const reply = await client.agentGet(edge.bound.agent_id);
57
+ const reply = await client.agentGet(edge.bound.registration_id);
58
58
  if (reply.ok === false)
59
59
  return unknownChild(
60
60
  `process verdict not readable (${reply.code}: ${reply.message})`
@@ -82,7 +82,7 @@ async function observeRadarChild(client, provenance) {
82
82
  kind: "live",
83
83
  evidence: {
84
84
  request_id: provenance.request_id,
85
- agent_id: edge.bound.agent_id,
85
+ registration_id: edge.bound.registration_id,
86
86
  source: edge.bound.source,
87
87
  incarnation: edge.bound.incarnation,
88
88
  pane_id: edge.location.pane
@@ -142,7 +142,7 @@ async function launchRadarWorker(options) {
142
142
  const deadline = Date.now() + options.timeoutMs;
143
143
  const remaining = () => Math.max(0, deadline - Date.now());
144
144
  const pane = launch.parent.location?.pane;
145
- if (!isUuid(launch.parent.agent_id))
145
+ if (!isUuid(launch.parent.registration_id))
146
146
  return refusedLaunch(
147
147
  "the launch has no exact parent registration to spawn under"
148
148
  );
@@ -156,7 +156,7 @@ async function launchRadarWorker(options) {
156
156
  );
157
157
  const spawned = await client.spawn({
158
158
  request_id: launch.request_id,
159
- parent: launch.parent.agent_id,
159
+ parent: launch.parent.registration_id,
160
160
  parent_session_id: launch.parent_session_id,
161
161
  executable: launch.executable,
162
162
  managed: { parent_subject_id: launch.parent.subject_id },
@@ -181,10 +181,10 @@ async function launchRadarWorker(options) {
181
181
  ...signal !== void 0 ? { signal } : {}
182
182
  });
183
183
  if (bound.kind !== "bound") return bound;
184
- const agentId = bound.agent_id;
184
+ const agentId = bound.registration_id;
185
185
  if (launch.onBound !== void 0) {
186
186
  try {
187
- launch.onBound({ agent_id: agentId, pane_id: bound.pane_id });
187
+ launch.onBound({ registration_id: agentId, pane_id: bound.pane_id });
188
188
  } catch (error) {
189
189
  return unresolvedLaunch(
190
190
  launch.request_id,
@@ -212,7 +212,7 @@ async function launchRadarWorker(options) {
212
212
  kind: "ready",
213
213
  value: {
214
214
  request_id: launch.request_id,
215
- agent_id: agentId,
215
+ registration_id: agentId,
216
216
  pane_id: bound.pane_id,
217
217
  bound_process: {
218
218
  source: bound.source,
@@ -258,7 +258,7 @@ async function waitForChild(client, requestId, options) {
258
258
  requestId,
259
259
  "the daemon observed the launched child's process exit"
260
260
  );
261
- const agentId = edge.bound?.agent_id;
261
+ const agentId = edge.bound?.registration_id;
262
262
  if (agentId !== void 0 && isUuid(agentId)) {
263
263
  const source = edge.bound?.source;
264
264
  const incarnation = edge.bound?.incarnation;
@@ -269,7 +269,7 @@ async function waitForChild(client, requestId, options) {
269
269
  );
270
270
  return {
271
271
  kind: "bound",
272
- agent_id: agentId,
272
+ registration_id: agentId,
273
273
  pane_id: pane,
274
274
  source,
275
275
  incarnation