showrunner-agent-staging 0.5.135-staging.2012 → 0.5.135-staging.2014

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.
@@ -29,6 +29,8 @@ export declare class ProviderAccounts implements AgentAdapter {
29
29
  get stopCleanupMilliseconds(): number | undefined;
30
30
  /** Inside `run`, the account generation that invocation started on; elsewhere the current one. */
31
31
  get generation(): string;
32
+ /** Inside `run`, the account that invocation started on; elsewhere the current one. */
33
+ get accountProfileId(): string | null;
32
34
  listModels(signal: AbortSignal): Promise<import("../adapter.js").AgentRuntimeOption[] | null>;
33
35
  listRuntimeOptions(signal: AbortSignal): Promise<AgentRuntimeOptions | null>;
34
36
  applyInstallationSettings(settings: InstallationSettings): Promise<void>;
@@ -69,6 +69,11 @@ export class ProviderAccounts {
69
69
  get stopCleanupMilliseconds() { return this.#adapter.stopCleanupMilliseconds; }
70
70
  /** Inside `run`, the account generation that invocation started on; elsewhere the current one. */
71
71
  get generation() { return this.#binding.getStore()?.generation ?? this.#registry.generation; }
72
+ /** Inside `run`, the account that invocation started on; elsewhere the current one. */
73
+ get accountProfileId() {
74
+ const bound = this.#binding.getStore();
75
+ return bound === undefined ? this.#registry.currentAccountProfileId : bound.accountProfileId;
76
+ }
72
77
  listModels(signal) { return this.#registry.blocked ? Promise.resolve(null) : this.#adapter.listModels?.(signal) ?? Promise.resolve(null); }
73
78
  async listRuntimeOptions(signal) {
74
79
  if (this.#registry.blocked)
@@ -30,6 +30,8 @@ export declare function createAdapterProcessor(input: {
30
30
  record(): Promise<void>;
31
31
  };
32
32
  accountGeneration?: () => string;
33
+ /** The provider account a run is on, reported with its completion so a plan limit names the account that hit it. */
34
+ accountProfileId?: () => string | null;
33
35
  macPrivacyPermissionHost?: MacPrivacyPermissionHost;
34
36
  /** The Mac helper running this connector, which opens provider sign-in when the owner asks from Showrunner. */
35
37
  signInHost?: {
@@ -28,6 +28,7 @@ export function createAdapterProcessor(input) {
28
28
  await client.installationSettingsApplied;
29
29
  const trust = { ...event.trust, initiatingProfileId: event.initiatingProfile.id, initiatingDisplayName: event.initiatingProfile.displayName };
30
30
  const generation = input.accountGeneration?.();
31
+ const accountProfileId = input.accountProfileId?.() ?? undefined;
31
32
  const storedGeneration = generation === undefined ? undefined
32
33
  : await input.state.get("provider-account-generation", event.session.id);
33
34
  if (generation !== undefined && storedGeneration === undefined) {
@@ -164,6 +165,7 @@ export function createAdapterProcessor(input) {
164
165
  usage: normalizeUsage(outcome.usage),
165
166
  ...(outcome.failureAsStatus === true && outcome.error !== undefined ? { stopReason: outcome.error.code } : {}),
166
167
  error: commands.hasPostedFailure ? undefined : outcome.error,
168
+ ...(accountProfileId === undefined ? {} : { accountProfileId }),
167
169
  };
168
170
  // A later abandon report replays this completion rather than calling a finished run stopped.
169
171
  await bookkeeping(() => input.state.set(runOutcomeNamespace, event.invocation.id, completionRequest));
package/dist/src/cli.js CHANGED
@@ -234,6 +234,7 @@ async function main() {
234
234
  projectDirectory: loaded.workingDirectory,
235
235
  processLedger,
236
236
  accountGeneration: accounts === undefined ? undefined : () => accounts.generation,
237
+ accountProfileId: accounts === undefined ? undefined : () => accounts.accountProfileId,
237
238
  ...(desktopLifecycle === undefined ? {} : { macPrivacyPermissionHost: desktopLifecycle, signInHost: desktopLifecycle }),
238
239
  });
239
240
  const handler = new AgentEventHandler({
@@ -276,6 +276,8 @@ export declare class ExternalAgentClient {
276
276
  branchName: string | null;
277
277
  filesChanged?: string[];
278
278
  } | null;
279
+ /** The provider account the run was on. */
280
+ accountProfileId?: string;
279
281
  }): Promise<CommandResponse>;
280
282
  createActivity(invocationId: string, input: {
281
283
  commandId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "showrunner-agent-staging",
3
- "version": "0.5.135-staging.2012",
3
+ "version": "0.5.135-staging.2014",
4
4
  "description": "Provider-neutral connector SDK for Showrunner agents",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",