@kubb/studio 5.3.18 → 5.3.19

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/index.d.ts CHANGED
@@ -36,6 +36,15 @@ type StudioSnapshotChanges = {
36
36
  changed: Array<string>;
37
37
  removed: Array<string>;
38
38
  };
39
+ /**
40
+ * `StudioSnapshotChanges` against a pull request's base branch. `baseFound` tells apart the two
41
+ * reasons `base` can be `null`: `false` when no CI agent is registered for the branch yet (the
42
+ * workflow has never run there), `true` when that agent exists but has no snapshot of this package
43
+ * to compare with.
44
+ */
45
+ type StudioBranchSnapshotChanges = StudioSnapshotChanges & {
46
+ baseFound: boolean;
47
+ };
39
48
  /**
40
49
  * Package view returned on a successful snapshot job from Studio.
41
50
  */
@@ -71,7 +80,7 @@ type StudioSnapshot = {
71
80
  /** What changed since the previous snapshot on the same agent. Absent when Studio or the agent predates it. */
72
81
  changes?: StudioSnapshotChanges;
73
82
  /** What differs from the latest snapshot of the CI agent `baseId` names. Absent without a base. */
74
- branchChanges?: StudioSnapshotChanges;
83
+ branchChanges?: StudioBranchSnapshotChanges;
75
84
  };
76
85
  /**
77
86
  * Job record from `POST /api/jobs` and `GET /api/jobs/{id}`.
@@ -627,5 +636,5 @@ export declare function pairAgent({ onCode, onRetry, maxAttempts, ...options }:
627
636
  */
628
637
  export declare const connectWebSocketRpc: RpcConnector;
629
638
  //#endregion
630
- export { AGENT_INSTANCE_HEADER, type AgentApi, type AgentCapacity, AgentCloseCode, type AgentLoad, type AgentRegisterInput, type AgentRegisterResponse, type Client, type ClientOptions, type ConfigEdit, type ConnectMessagePayload, type ConnectionOptions, type GenerateInput, type GenerateResult, type GenerationEvent, type GenerationEventPayloads, type GenerationEventType, type GenerationRun, type PairingAgentType, type PairingResult, type PairingSession, type PublishSnapshotInput, type PublishSnapshotResult, type RpcClose, type RpcConnection, type RpcConnector, type StudioAgent, type StudioApi, type StudioConnectedContext, type StudioJob, type StudioJobStatus, type StudioSnapshot, type StudioSnapshotChanges, generationEventTypes };
639
+ export { AGENT_INSTANCE_HEADER, type AgentApi, type AgentCapacity, AgentCloseCode, type AgentLoad, type AgentRegisterInput, type AgentRegisterResponse, type Client, type ClientOptions, type ConfigEdit, type ConnectMessagePayload, type ConnectionOptions, type GenerateInput, type GenerateResult, type GenerationEvent, type GenerationEventPayloads, type GenerationEventType, type GenerationRun, type PairingAgentType, type PairingResult, type PairingSession, type PublishSnapshotInput, type PublishSnapshotResult, type RpcClose, type RpcConnection, type RpcConnector, type StudioAgent, type StudioApi, type StudioBranchSnapshotChanges, type StudioConnectedContext, type StudioJob, type StudioJobStatus, type StudioSnapshot, type StudioSnapshotChanges, generationEventTypes };
631
640
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -345,7 +345,7 @@ function getElapsedMs(hrStart) {
345
345
  }
346
346
  //#endregion
347
347
  //#region package.json
348
- var version = "5.3.18";
348
+ var version = "5.3.19";
349
349
  //#endregion
350
350
  //#region src/operations/machine.ts
351
351
  /**
@@ -2332,7 +2332,6 @@ function applyStudioDefaults(options) {
2332
2332
  permissions: {
2333
2333
  allowWrite: false,
2334
2334
  allowConfigEdit: false,
2335
- allowInput: false,
2336
2335
  allowExec: false,
2337
2336
  allowRead: false,
2338
2337
  ...options.permissions
@@ -2468,13 +2467,6 @@ var StudioSession = class {
2468
2467
  return !this.#isSandbox && this.#options.permissions.allowConfigEdit;
2469
2468
  }
2470
2469
  /**
2471
- * A sandbox agent always generates from the spec Studio supplies. A local agent only when the
2472
- * host opted in.
2473
- */
2474
- get #canUseInput() {
2475
- return this.#isSandbox || this.#options.permissions.allowInput;
2476
- }
2477
- /**
2478
2470
  * A sandbox agent always allows reading its output back; a local agent only when opted in.
2479
2471
  */
2480
2472
  get #canRead() {
@@ -2623,7 +2615,6 @@ var StudioSession = class {
2623
2615
  permissions: {
2624
2616
  ...permissions,
2625
2617
  allowWrite: this.#canWrite,
2626
- allowInput: this.#canUseInput,
2627
2618
  allowConfigEdit: this.#canEditConfig,
2628
2619
  allowRead: this.#canRead
2629
2620
  }
@@ -2709,9 +2700,9 @@ var StudioSession = class {
2709
2700
  const patch = data.config;
2710
2701
  const plugins = await mergePlugins(config.plugins, patch?.plugins);
2711
2702
  const adapter = await mergeAdapter(config.adapter, patch?.adapter);
2712
- const inputOverride = this.#isSandbox ? patch?.input ?? "" : permissions.allowInput && patch?.input || void 0;
2703
+ const inputOverride = this.#isSandbox ? patch?.input ?? "" : void 0;
2713
2704
  if (permissions.allowWrite && this.#isSandbox) await this.#warn("Running in a sandbox, so writing files is disabled");
2714
- if (patch?.input && !this.#canUseInput) await this.#warn("Ignored the spec from Studio: generating from a Studio spec was not granted", "allowInput");
2705
+ if (patch?.input && !this.#isSandbox) await this.#warn("Ignored the spec from Studio: generating from a Studio spec is only available to a sandbox agent");
2715
2706
  const resolvedPlugins = plugins ?? config.plugins;
2716
2707
  this.#lastGeneration = void 0;
2717
2708
  const disk = await runGenerationOperation({