pullfrog 0.1.27 → 0.1.28

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/cli.mjs CHANGED
@@ -101867,7 +101867,7 @@ var import_semver = __toESM(require_semver2(), 1);
101867
101867
  // package.json
101868
101868
  var package_default = {
101869
101869
  name: "pullfrog",
101870
- version: "0.1.27",
101870
+ version: "0.1.28",
101871
101871
  type: "module",
101872
101872
  bin: {
101873
101873
  pullfrog: "dist/cli.mjs",
@@ -108449,6 +108449,7 @@ var opencode = agent({
108449
108449
  run: async (ctx) => {
108450
108450
  const cliPath = await installCli();
108451
108451
  const rawModel = ctx.payload.proxyModel ?? ctx.resolvedModel ?? autoSelectModel();
108452
+ if (rawModel) ctx.toolState.model = rawModel;
108452
108453
  const bedrockModelId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
108453
108454
  const isBedrockRoute = rawModel !== void 0 && bedrockModelId !== void 0 && bedrockModelId === rawModel;
108454
108455
  const vertexModel = resolveVertexOpenCodeModel(rawModel);
@@ -117274,7 +117275,8 @@ var STRING_KEYS = [
117274
117275
  "issueNodeId",
117275
117276
  "reviewNodeId",
117276
117277
  "planCommentNodeId",
117277
- "summarySnapshot"
117278
+ "summarySnapshot",
117279
+ "model"
117278
117280
  ];
117279
117281
  var NUMBER_KEYS = [
117280
117282
  "inputTokens",
@@ -161865,11 +161867,12 @@ async function main() {
161865
161867
  }
161866
161868
  vertexCredentials = materializeVertexCredentials({ model: resolvedModel });
161867
161869
  const agent2 = resolveAgent({ model: resolvedModel });
161868
- toolState.model = payload.proxyModel ?? resolvedModel ?? effectiveSlug;
161870
+ const effectiveModel = payload.proxyModel ?? resolvedModel ?? effectiveSlug;
161871
+ toolState.model = effectiveModel;
161869
161872
  if (!fallback.fallback && !payload.proxyModel) {
161870
161873
  validateAgentApiKey({
161871
161874
  agent: agent2,
161872
- model: payload.proxyModel ?? resolvedModel ?? effectiveSlug,
161875
+ model: effectiveModel,
161873
161876
  authorized: authorized2,
161874
161877
  owner: runContext.repo.owner,
161875
161878
  name: runContext.repo.name
@@ -162149,6 +162152,7 @@ ${instructions.user}` : null,
162149
162152
  }
162150
162153
  if (toolContext) {
162151
162154
  const patch = aggregateUsage(toolState.usageEntries);
162155
+ if (toolState.model) patch.model = toolState.model;
162152
162156
  if (Object.keys(patch).length > 0) {
162153
162157
  await patchWorkflowRunFields(toolContext, patch);
162154
162158
  }
@@ -163042,7 +163046,7 @@ async function run2() {
163042
163046
  }
163043
163047
 
163044
163048
  // cli.ts
163045
- var VERSION10 = "0.1.27";
163049
+ var VERSION10 = "0.1.28";
163046
163050
  var bin = basename2(process.argv[1] || "");
163047
163051
  var PROG = bin === "pf" || bin === "pullfrog" ? bin : "pullfrog";
163048
163052
  var rawArgs = process.argv.slice(2);
package/dist/index.js CHANGED
@@ -100067,7 +100067,7 @@ var import_semver = __toESM(require_semver2(), 1);
100067
100067
  // package.json
100068
100068
  var package_default = {
100069
100069
  name: "pullfrog",
100070
- version: "0.1.27",
100070
+ version: "0.1.28",
100071
100071
  type: "module",
100072
100072
  bin: {
100073
100073
  pullfrog: "dist/cli.mjs",
@@ -106691,6 +106691,7 @@ var opencode = agent({
106691
106691
  run: async (ctx) => {
106692
106692
  const cliPath = await installCli();
106693
106693
  const rawModel = ctx.payload.proxyModel ?? ctx.resolvedModel ?? autoSelectModel();
106694
+ if (rawModel) ctx.toolState.model = rawModel;
106694
106695
  const bedrockModelId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
106695
106696
  const isBedrockRoute = rawModel !== void 0 && bedrockModelId !== void 0 && bedrockModelId === rawModel;
106696
106697
  const vertexModel = resolveVertexOpenCodeModel(rawModel);
@@ -115516,7 +115517,8 @@ var STRING_KEYS = [
115516
115517
  "issueNodeId",
115517
115518
  "reviewNodeId",
115518
115519
  "planCommentNodeId",
115519
- "summarySnapshot"
115520
+ "summarySnapshot",
115521
+ "model"
115520
115522
  ];
115521
115523
  var NUMBER_KEYS = [
115522
115524
  "inputTokens",
@@ -160107,11 +160109,12 @@ async function main() {
160107
160109
  }
160108
160110
  vertexCredentials = materializeVertexCredentials({ model: resolvedModel });
160109
160111
  const agent2 = resolveAgent({ model: resolvedModel });
160110
- toolState.model = payload.proxyModel ?? resolvedModel ?? effectiveSlug;
160112
+ const effectiveModel = payload.proxyModel ?? resolvedModel ?? effectiveSlug;
160113
+ toolState.model = effectiveModel;
160111
160114
  if (!fallback.fallback && !payload.proxyModel) {
160112
160115
  validateAgentApiKey({
160113
160116
  agent: agent2,
160114
- model: payload.proxyModel ?? resolvedModel ?? effectiveSlug,
160117
+ model: effectiveModel,
160115
160118
  authorized: authorized2,
160116
160119
  owner: runContext.repo.owner,
160117
160120
  name: runContext.repo.name
@@ -160391,6 +160394,7 @@ ${instructions.user}` : null,
160391
160394
  }
160392
160395
  if (toolContext) {
160393
160396
  const patch = aggregateUsage(toolState.usageEntries);
160397
+ if (toolState.model) patch.model = toolState.model;
160394
160398
  if (Object.keys(patch).length > 0) {
160395
160399
  await patchWorkflowRunFields(toolContext, patch);
160396
160400
  }
@@ -1,19 +1,24 @@
1
1
  import type { AgentUsage } from "../agents/shared.ts";
2
2
  import type { ToolContext } from "../mcp/server.ts";
3
3
  /**
4
- * Artifact tracking fields one-off PATCHes from MCP tools as GitHub entities
5
- * are created during the run. Strings only (GraphQL node IDs).
4
+ * String-valued PATCH fields (all serialized identically on the wire):
5
+ * - artifact node IDs (`*NodeId`, `summarySnapshot`) PATCHed incrementally
6
+ * by MCP tools as GitHub entities are created during the run.
7
+ * - `model` — the resolved/effective model the run actually ran on (proxy spec
8
+ * for router/oss, post-fallback slug otherwise; NOT the configured
9
+ * `Repo.model` slug), PATCHed once at end-of-run so per-model cost analytics
10
+ * don't parse the audit-only `payload`.
6
11
  * Keep in sync with `STRING_FIELDS` in `app/api/workflow-run/[runId]/route.ts`.
7
12
  */
8
- export type WorkflowRunArtifactPatchKey = "prNodeId" | "issueNodeId" | "reviewNodeId" | "planCommentNodeId" | "summarySnapshot";
13
+ declare const STRING_KEYS: readonly ["prNodeId", "issueNodeId", "reviewNodeId", "planCommentNodeId", "summarySnapshot", "model"];
9
14
  /**
10
- * Usage fields — aggregated across all agent calls and PATCHed once at
11
- * end-of-run. Token counts are Int4 on the DB side (ample for any realistic
12
- * run); `costUsd` is a Decimal populated by provider-reported dollar amounts.
13
- * Keep in sync with `INT_FIELDS` + `DECIMAL_FIELDS` in the server route.
15
+ * Number-valued usage fields — aggregated across all agent calls and PATCHed
16
+ * once at end-of-run. Token counts are Int4 on the DB side (ample for any
17
+ * realistic run); `costUsd` is a Decimal populated by provider-reported dollar
18
+ * amounts. Keep in sync with `INT_FIELDS` + `DECIMAL_FIELDS` in the server route.
14
19
  */
15
- export type WorkflowRunUsagePatchKey = "inputTokens" | "outputTokens" | "cacheReadTokens" | "cacheWriteTokens" | "costUsd";
16
- export type WorkflowRunPatch = Partial<Record<WorkflowRunArtifactPatchKey, string>> & Partial<Record<WorkflowRunUsagePatchKey, number>>;
20
+ declare const NUMBER_KEYS: readonly ["inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens", "costUsd"];
21
+ export type WorkflowRunPatch = Partial<Record<(typeof STRING_KEYS)[number], string>> & Partial<Record<(typeof NUMBER_KEYS)[number], number>>;
17
22
  /** PATCH workflow-run fields (Pullfrog JWT, not GitHub). */
18
23
  export declare function patchWorkflowRunFields(ctx: ToolContext, fields: WorkflowRunPatch): Promise<void>;
19
24
  /**
@@ -27,3 +32,4 @@ export declare function patchWorkflowRunFields(ctx: ToolContext, fields: Workflo
27
32
  * sees is always self-consistent across all numeric columns.
28
33
  */
29
34
  export declare function aggregateUsage(entries: AgentUsage[]): WorkflowRunPatch;
35
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pullfrog": "dist/cli.mjs",