@sealant/sdk-next 0.40.0-next.889 → 0.40.0-next.891

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.
@@ -3174,6 +3174,7 @@ declare const buildControlPlaneClient: (config: SealantInternalConfig) => Effect
3174
3174
  readonly summary: import("effect/Schema").String;
3175
3175
  readonly ref: import("effect/Schema").optional<import("effect/Schema").Unknown>;
3176
3176
  readonly processId: import("effect/Schema").optional<import("effect/Schema").String>;
3177
+ readonly executionId: import("effect/Schema").optional<import("effect/Schema").String>;
3177
3178
  readonly captureMethod: import("effect/Schema").Number;
3178
3179
  readonly confidence: import("effect/Schema").Number;
3179
3180
  }>>;
@@ -7943,6 +7944,7 @@ declare const SealantApiClient_base: Context.ServiceClass<SealantApiClient, "@se
7943
7944
  readonly summary: import("effect/Schema").String;
7944
7945
  readonly ref: import("effect/Schema").optional<import("effect/Schema").Unknown>;
7945
7946
  readonly processId: import("effect/Schema").optional<import("effect/Schema").String>;
7947
+ readonly executionId: import("effect/Schema").optional<import("effect/Schema").String>;
7946
7948
  readonly captureMethod: import("effect/Schema").Number;
7947
7949
  readonly confidence: import("effect/Schema").Number;
7948
7950
  }>>;
@@ -28,12 +28,19 @@ export const nextExecPollMs = (lastWaitMs, elapsedMs) => {
28
28
  };
29
29
  const isRecord = (value) => typeof value === "object" && value !== null;
30
30
  /**
31
- * The exec'd command's process: the `processStarted` entry whose recorded executable matches, or the
32
- * first one when attribution is imprecise (the record contains only processes this run exec'd).
31
+ * The exec'd command's process, from the run's `processStarted` entries: of the processes this run
32
+ * started (the daemon stamps the run as their `executionId`), the first whose recorded executable
33
+ * matches, else the first. A process stamped with another execution is never it: before sealant
34
+ * kept them out, another exec's changes reading (`sh`, untagged) could sit in this run's record
35
+ * ahead of the command, and its output was returned as the command's (SLNT-956). Untagged entries
36
+ * are considered only when no entry carries this run's id: a daemon that ignores execution ids, or
37
+ * a control plane that does not report them.
33
38
  */
34
- const findCommandProcessId = (entries, executable) => {
35
- const match = entries.find((entry) => isRecord(entry.ref) && entry.ref["executable"] === executable);
36
- return (match ?? entries[0])?.processId;
39
+ const findCommandProcessId = (entries, runId, executable) => {
40
+ const own = entries.filter((entry) => entry.executionId === runId);
41
+ const candidates = own.length > 0 ? own : entries.filter((entry) => entry.executionId === undefined);
42
+ const match = candidates.find((entry) => isRecord(entry.ref) && entry.ref["executable"] === executable);
43
+ return (match ?? candidates[0])?.processId;
37
44
  };
38
45
  const readScrollback = (runId, ownerUserId, processId, stream, deadline) => Effect.map(retryRead(getRunScrollbackOp(runId, { ownerUserId, processId, stream }), {
39
46
  runId,
@@ -85,7 +92,7 @@ const execWorkspaceEffect = (ctx, init, argv, options) => Effect.gen(function* (
85
92
  // Every record read names the owner: the control plane finds nothing for a read that does not.
86
93
  const ownerUserId = ctx.config.hostLocal.ownerUserId;
87
94
  const started = yield* retryRead(getRunTimelineOp(runId, { ownerUserId, kinds: "processStarted" }), { runId, what: "the timeline", deadline });
88
- const processId = findCommandProcessId(started, executable);
95
+ const processId = findCommandProcessId(started, runId, executable);
89
96
  // The three reads are independent: one round trip of waiting, not three.
90
97
  const [stdout, stderr, wireChanges] = yield* Effect.all([
91
98
  processId === undefined
@@ -979,6 +979,7 @@ export declare const getRunTimelineOp: (runId: string, query: GetRunTimelineQuer
979
979
  readonly summary: string;
980
980
  readonly ref?: unknown;
981
981
  readonly processId?: string | undefined;
982
+ readonly executionId?: string | undefined;
982
983
  readonly captureMethod: number;
983
984
  readonly confidence: number;
984
985
  }[], import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").RunBadRequestError | import("@sealant/api-contracts").RunInternalServerError | import("@sealant/api-contracts").RunNotFoundError | Schema.SchemaError, SealantApiClient>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealant/sdk-next",
3
- "version": "0.40.0-next.889",
3
+ "version": "0.40.0-next.891",
4
4
  "description": "The fluent public SDK for Sealant — create a workspace, run a harness, replay the record.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -26,12 +26,12 @@
26
26
  "node": ">=20"
27
27
  },
28
28
  "dependencies": {
29
- "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.889"
29
+ "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.891"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "effect": "^4.0.5"
33
33
  },
34
- "gitHead": "ece6eb222fb85620b4c22362b834684ad586a55a",
34
+ "gitHead": "89ae8a97d319ae4675d42e35d160d3fd481ff0ec",
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  }