humanish 0.48.0 → 0.50.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 (74) hide show
  1. package/README.md +65 -6
  2. package/dist/actor-contract.d.ts +14 -0
  3. package/dist/actor-contract.js.map +1 -1
  4. package/dist/computer-use-actor.d.ts +3 -7
  5. package/dist/computer-use.d.ts +4 -7
  6. package/dist/computer-use.js +39 -3
  7. package/dist/computer-use.js.map +1 -1
  8. package/dist/concurrent-shared-world-lab.d.ts +5 -0
  9. package/dist/concurrent-shared-world-lab.js +30 -1
  10. package/dist/concurrent-shared-world-lab.js.map +1 -1
  11. package/dist/cua-actor-lab.d.ts +7 -0
  12. package/dist/cua-actor-lab.js +50 -9
  13. package/dist/cua-actor-lab.js.map +1 -1
  14. package/dist/e2b-terminal-lab.d.ts +7 -0
  15. package/dist/e2b-terminal-lab.js +54 -0
  16. package/dist/e2b-terminal-lab.js.map +1 -1
  17. package/dist/init-templates.js +7 -2
  18. package/dist/init-templates.js.map +1 -1
  19. package/dist/key-resolution.d.ts +67 -0
  20. package/dist/key-resolution.js +373 -0
  21. package/dist/key-resolution.js.map +1 -0
  22. package/dist/lab-engine.d.ts +11 -0
  23. package/dist/lab-engine.js +18 -0
  24. package/dist/lab-engine.js.map +1 -1
  25. package/dist/openai-responses-cu.d.ts +1 -1
  26. package/dist/openai-responses-cu.js +8 -2
  27. package/dist/openai-responses-cu.js.map +1 -1
  28. package/dist/oss-lab.d.ts +3 -0
  29. package/dist/oss-lab.js.map +1 -1
  30. package/dist/oss-meta-lab.d.ts +3 -0
  31. package/dist/oss-meta-lab.js +13 -0
  32. package/dist/oss-meta-lab.js.map +1 -1
  33. package/dist/pricing.d.ts +20 -0
  34. package/dist/pricing.js +109 -17
  35. package/dist/pricing.js.map +1 -1
  36. package/dist/program.d.ts +18 -1
  37. package/dist/program.js +291 -17
  38. package/dist/program.js.map +1 -1
  39. package/dist/run-detail.d.ts +59 -0
  40. package/dist/run-detail.js +108 -0
  41. package/dist/run-detail.js.map +1 -0
  42. package/dist/run-index.d.ts +71 -0
  43. package/dist/run-index.js +206 -0
  44. package/dist/run-index.js.map +1 -0
  45. package/dist/run-paths.js +16 -1
  46. package/dist/run-paths.js.map +1 -1
  47. package/dist/run-projection.d.ts +182 -0
  48. package/dist/run-projection.js +349 -0
  49. package/dist/run-projection.js.map +1 -0
  50. package/dist/run-status.d.ts +139 -0
  51. package/dist/run-status.js +218 -0
  52. package/dist/run-status.js.map +1 -0
  53. package/dist/run.d.ts +15 -0
  54. package/dist/run.js +115 -6
  55. package/dist/run.js.map +1 -1
  56. package/dist/scripted-browser-lab.d.ts +5 -0
  57. package/dist/scripted-browser-lab.js +29 -1
  58. package/dist/scripted-browser-lab.js.map +1 -1
  59. package/dist/shared-world-lab.d.ts +5 -0
  60. package/dist/shared-world-lab.js +29 -1
  61. package/dist/shared-world-lab.js.map +1 -1
  62. package/dist/tui-app.js +402 -0
  63. package/dist/tui-contract.d.ts +73 -0
  64. package/dist/tui-contract.js +32 -0
  65. package/dist/tui-contract.js.map +1 -0
  66. package/dist/tui-launch.d.ts +48 -0
  67. package/dist/tui-launch.js +159 -0
  68. package/dist/tui-launch.js.map +1 -0
  69. package/docs/contracts/run-bundle.md +8 -0
  70. package/docs/contracts/schemas.md +85 -7
  71. package/docs/goals/current.md +16 -7
  72. package/docs/ramp/README.md +1 -1
  73. package/package.json +8 -5
  74. package/skills/humanish/SKILL.md +19 -0
package/dist/pricing.d.ts CHANGED
@@ -11,6 +11,21 @@ export interface ModelRate {
11
11
  * billed at `inputUsdPerToken` — the previous behavior, kept as the fallback so a rate sheet
12
12
  * without this field prices exactly as it did before (#391). */
13
13
  cachedInputUsdPerToken?: number;
14
+ /** USD per input token newly WRITTEN to the provider's prompt cache, when the provider bills
15
+ * writes (OpenAI: GPT-5.6+ bills `cache_write_tokens` at 1.25x the uncached input rate, as the
16
+ * TOTAL rate for those tokens — not an extra charge on top). Absent = writes are free (every
17
+ * pre-5.6 model) and any reported write tokens price at the plain input rate. */
18
+ cacheWriteUsdPerToken?: number;
19
+ /** Long-context tier, when the provider re-prices the WHOLE request past an input-size
20
+ * threshold (OpenAI GPT-5.6: >272K input tokens => 2x input-side, 1.5x output, full request).
21
+ * Priced exactly only when the usage carries per-request `turns` records; totals alone cannot
22
+ * say which requests crossed, so without turns the estimate stays on the short-context rate
23
+ * (the historical behavior, and the under-estimate direction is called out in #334's fix). */
24
+ longContext?: {
25
+ thresholdInputTokens: number;
26
+ inputMultiplier: number;
27
+ outputMultiplier: number;
28
+ };
14
29
  /** "YYYY-MM-DD" the entry was last checked against `source`. */
15
30
  asOf: string;
16
31
  /** Public pricing page the number came from (a comment/URL, never a secret). */
@@ -53,6 +68,11 @@ export interface ActorEstimatedCost {
53
68
  /** Of `inputTokens`, how many were billed at the reduced cached rate. Present only when the
54
69
  * provider reported cache hits AND the rate sheet models a cached rate. */
55
70
  cachedInputTokens?: number;
71
+ /** Of `inputTokens`, how many were billed at the cache-WRITE rate (OpenAI 5.6+). */
72
+ cacheWriteInputTokens?: number;
73
+ /** How many requests crossed the long-context threshold and were re-tiered. Present only
74
+ * when per-request `turns` records made exact tiering possible. */
75
+ longContextTurns?: number;
56
76
  };
57
77
  }
58
78
  /** The desktop-minute cost ESTIMATE (host-side create->teardown span * a per-minute rate). Same
package/dist/pricing.js CHANGED
@@ -12,6 +12,28 @@
12
12
  // so a reader can never confuse an estimate for an authoritative charge (invariant 6).
13
13
  export const PRICING_SCHEMA = "humanish.pricing.v1";
14
14
  export const ACTOR_ESTIMATED_COST_SCHEMA = "humanish.actor-estimated-cost.v1";
15
+ // The gpt-5.6 long-context tier: >272K input tokens re-prices the FULL request at 2x
16
+ // input-side / 1.5x output (developers.openai.com/api/docs/models/gpt-5.6-sol, 2026-08-18).
17
+ const GPT56_LONG_CONTEXT = {
18
+ thresholdInputTokens: 272_000,
19
+ inputMultiplier: 2,
20
+ outputMultiplier: 1.5
21
+ };
22
+ const GPT56_SOURCE = "developers.openai.com/api/docs/pricing (gpt-5.6 family, standard tier)";
23
+ // One 5.6-family entry: rates in USD-per-1M for legibility, converted once. Cache writes bill at
24
+ // 1.25x the uncached input rate on this family (`cache_write_tokens`, prompt-caching guide); the
25
+ // built-in `computer` tool has no per-call fee on the live sheet.
26
+ function gpt56Rate(inPer1M, cachedPer1M, writePer1M, outPer1M) {
27
+ return {
28
+ inputUsdPerToken: inPer1M * 1e-6,
29
+ cachedInputUsdPerToken: cachedPer1M * 1e-6,
30
+ cacheWriteUsdPerToken: writePer1M * 1e-6,
31
+ outputUsdPerToken: outPer1M * 1e-6,
32
+ longContext: { ...GPT56_LONG_CONTEXT },
33
+ asOf: "2026-08-18",
34
+ source: GPT56_SOURCE
35
+ };
36
+ }
15
37
  // Per-model rates, keyed on the model id that lands in trace.ids.model (lookup is
16
38
  // case-insensitive on a trimmed id). An id NOT present here is DECLARED ABSENT, never guessed.
17
39
  export const MODEL_RATES = {
@@ -23,17 +45,32 @@ export const MODEL_RATES = {
23
45
  asOf: "2026-08-01",
24
46
  source: "openai.com/api/pricing (computer-use-preview)"
25
47
  },
26
- // gpt-5.5 = the shipped CUA default (DEFAULT_OPENAI_CU_MODEL). $5 / 1M input, $30 / 1M output,
27
- // $0.50 / 1M cached input. NOTE: OpenAI's live pricing page no longer lists gpt-5.5 (superseded
28
- // by the gpt-5.6 family) — rate confirmed against public third-party sheets instead; refreshing
29
- // the default model is tracked in issue #334.
48
+ // gpt-5.5: the PREVIOUS-generation CUA default, kept so pinned labs and old bundles still
49
+ // price. Pre-5.6 models bill no cache-write fee (prompt-caching guide) and no long-context
50
+ // tier was published for it.
30
51
  "gpt-5.5": {
31
52
  inputUsdPerToken: 5e-6,
32
53
  outputUsdPerToken: 30e-6,
33
54
  cachedInputUsdPerToken: 0.5e-6,
34
55
  asOf: "2026-08-05",
35
56
  source: "openrouter.ai/openai/gpt-5.5 (gpt-5.5 no longer on openai.com/api/pricing; see #334)"
36
- }
57
+ },
58
+ // The gpt-5.6 family (live sheet 2026-08-18, standard tier, short-context base rates;
59
+ // the longContext block prices the >272K re-tier when per-request turns are recorded).
60
+ // sol = flagship (the shipped CUA default), terra = cost-balanced, luna = high-volume,
61
+ // cyber = the Daybreak frontier tier.
62
+ "gpt-5.6-sol": gpt56Rate(5, 0.5, 6.25, 30),
63
+ // "gpt-5.6" is OpenAI's own alias for gpt-5.6-sol (models index); priced identically so a
64
+ // lab configured with the alias never reads as unpriced.
65
+ "gpt-5.6": gpt56Rate(5, 0.5, 6.25, 30),
66
+ "gpt-5.6-terra": gpt56Rate(2, 0.2, 2.5, 12),
67
+ "gpt-5.6-luna": gpt56Rate(0.2, 0.02, 0.25, 1.2),
68
+ "gpt-5.6-cyber": gpt56Rate(12.5, 1.25, 15.625, 75),
69
+ // Daybreak program aliases (blue -> sol, red -> cyber today). OpenAI repoints these as new
70
+ // frontier models ship, so prefer the explicit tier id in labs; the entries exist so a
71
+ // configured alias still prices at what the alias bills TODAY.
72
+ "daybreak-blue-latest": gpt56Rate(5, 0.5, 6.25, 30),
73
+ "daybreak-red-latest": gpt56Rate(12.5, 1.25, 15.625, 75)
37
74
  };
38
75
  // E2B desktop sandbox compute, billed per-second by vCPU+RAM. Live sheet: 2 vCPU (default)
39
76
  // $0.000028/s + RAM $0.0000045/GiB/s => at an ASSUMED 4 GiB desktop, $0.000046/s ~= $0.00276/min
@@ -74,17 +111,70 @@ export function estimateActorCost(tokenUsage, modelId, rates = MODEL_RATES) {
74
111
  }
75
112
  const inTok = tokenUsage.input ?? 0;
76
113
  const outTok = tokenUsage.output ?? 0;
77
- // Cached input is billed at a fraction of the full rate, and on a session that threads state
78
- // through the provider it is the MAJORITY of input a warm prefix is re-sent every turn. Pricing
79
- // it at the full rate overstated real spend by up to ~10x on long sessions, which is enough to
80
- // abort a run against its own cap for money it never spent (#391).
81
- //
82
- // Both halves are honestly absent: no reported cachedInput, or a rate sheet without a cached
83
- // rate, prices exactly as before. We never assume a discount we cannot evidence.
84
- const cachedTok = rate.cachedInputUsdPerToken === undefined ? 0 : Math.min(inTok, Math.max(0, tokenUsage.cachedInput ?? 0));
85
- const fullTok = inTok - cachedTok;
86
- const inputUsd = round6(fullTok * rate.inputUsdPerToken + cachedTok * (rate.cachedInputUsdPerToken ?? 0));
87
- const outputUsd = round6(outTok * rate.outputUsdPerToken);
114
+ // Long-context tiering needs to know each REQUEST's input size (the provider re-prices whole
115
+ // requests past the threshold), so it engages only when per-turn usage records exist AND their
116
+ // input sums to the reported total a partial turn ledger must not silently price the missing
117
+ // remainder at the wrong tier. Otherwise totals price on the base (short-context) rate exactly
118
+ // as before, which is the under-estimate direction and never trips a cap early.
119
+ const turns = tokenUsage.turns ?? [];
120
+ const sumOf = (field) => turns.reduce((sum, turn) => sum + (turn[field] ?? 0), 0);
121
+ // The ledger is trusted only when it decomposes the totals EXACTLY — all four sums, not just
122
+ // input/output. A ledger that carries request sizes but not the cache splits would otherwise
123
+ // price every token at the full rate while the session totals sit ignored (red-team finding:
124
+ // 3.5-5x overstatement, the #391 false-cap-trip direction). Inconsistent evidence falls back
125
+ // to the totals path, which honors the declared splits on the base tier.
126
+ const tiered = rate.longContext !== undefined &&
127
+ turns.length > 0 &&
128
+ sumOf("input") === inTok &&
129
+ sumOf("output") === outTok &&
130
+ sumOf("cachedInput") === (tokenUsage.cachedInput ?? 0) &&
131
+ sumOf("cacheWriteInput") === (tokenUsage.cacheWriteInput ?? 0);
132
+ let inputUsd = 0;
133
+ let outputUsd = 0;
134
+ let cachedTotal = 0;
135
+ let writeTotal = 0;
136
+ let longContextTurns = 0;
137
+ // Price one request's usage at one tier. Cached input is billed at a fraction of the full rate,
138
+ // and on a session that threads provider state it is the MAJORITY of input — pricing it at the
139
+ // full rate overstated real spend by up to ~10x (#391). Cache WRITES bill at their own rate
140
+ // (1.25x on OpenAI 5.6+) as the total rate for those tokens; a sheet without a write rate
141
+ // prices writes as plain input (pre-5.6: writes are free-of-extra-fee, i.e. plain input).
142
+ // Every piece is honestly absent: no reported split means no discount and no surcharge assumed.
143
+ const priceRequest = (usage, tierable) => {
144
+ const reqIn = usage.input ?? 0;
145
+ const reqOut = usage.output ?? 0;
146
+ // Tiering applies only to a real per-REQUEST record: session totals crossing the threshold
147
+ // say nothing about any single request, so totals always price on the base tier.
148
+ const long = tierable && rate.longContext !== undefined && reqIn > rate.longContext.thresholdInputTokens;
149
+ const inMul = long ? rate.longContext.inputMultiplier : 1;
150
+ const outMul = long ? rate.longContext.outputMultiplier : 1;
151
+ if (long)
152
+ longContextTurns += 1;
153
+ const cached = rate.cachedInputUsdPerToken === undefined ? 0 : Math.min(reqIn, Math.max(0, usage.cachedInput ?? 0));
154
+ const writes = Math.min(reqIn - cached, Math.max(0, usage.cacheWriteInput ?? 0));
155
+ const full = reqIn - cached - writes;
156
+ cachedTotal += cached;
157
+ writeTotal += writes;
158
+ inputUsd +=
159
+ full * rate.inputUsdPerToken * inMul +
160
+ cached * (rate.cachedInputUsdPerToken ?? 0) * inMul +
161
+ writes * (rate.cacheWriteUsdPerToken ?? rate.inputUsdPerToken) * inMul;
162
+ outputUsd += reqOut * rate.outputUsdPerToken * outMul;
163
+ };
164
+ if (tiered) {
165
+ for (const turn of turns)
166
+ priceRequest(turn, true);
167
+ }
168
+ else {
169
+ priceRequest({
170
+ input: inTok,
171
+ output: outTok,
172
+ ...(tokenUsage.cachedInput === undefined ? {} : { cachedInput: tokenUsage.cachedInput }),
173
+ ...(tokenUsage.cacheWriteInput === undefined ? {} : { cacheWriteInput: tokenUsage.cacheWriteInput })
174
+ }, false);
175
+ }
176
+ inputUsd = round6(inputUsd);
177
+ outputUsd = round6(outputUsd);
88
178
  return {
89
179
  schema: ACTOR_ESTIMATED_COST_SCHEMA,
90
180
  estimatedCostUsd: round6(inputUsd + outputUsd),
@@ -97,7 +187,9 @@ export function estimateActorCost(tokenUsage, modelId, rates = MODEL_RATES) {
97
187
  outputUsd,
98
188
  inputTokens: inTok,
99
189
  outputTokens: outTok,
100
- ...(cachedTok > 0 ? { cachedInputTokens: cachedTok } : {})
190
+ ...(cachedTotal > 0 ? { cachedInputTokens: cachedTotal } : {}),
191
+ ...(writeTotal > 0 ? { cacheWriteInputTokens: writeTotal } : {}),
192
+ ...(longContextTurns > 0 ? { longContextTurns } : {})
101
193
  }
102
194
  };
103
195
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,0FAA0F;AAC1F,6FAA6F;AAC7F,uFAAuF;AACvF,EAAE;AACF,yFAAyF;AACzF,4FAA4F;AAC5F,2FAA2F;AAC3F,+FAA+F;AAC/F,2FAA2F;AAC3F,4FAA4F;AAC5F,uFAAuF;AAMvF,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AACpD,MAAM,CAAC,MAAM,2BAA2B,GAAG,kCAAkC,CAAC;AAuE9E,kFAAkF;AAClF,+FAA+F;AAC/F,MAAM,CAAC,MAAM,WAAW,GAA8B;IACpD,yFAAyF;IACzF,6EAA6E;IAC7E,sBAAsB,EAAE;QACtB,gBAAgB,EAAE,IAAI;QACtB,iBAAiB,EAAE,KAAK;QACxB,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,+CAA+C;KACxD;IACD,+FAA+F;IAC/F,gGAAgG;IAChG,gGAAgG;IAChG,8CAA8C;IAC9C,SAAS,EAAE;QACT,gBAAgB,EAAE,IAAI;QACtB,iBAAiB,EAAE,KAAK;QACxB,sBAAsB,EAAE,MAAM;QAC9B,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,sFAAsF;KAC/F;CACF,CAAC;AAEF,2FAA2F;AAC3F,iGAAiG;AACjG,0FAA0F;AAC1F,8FAA8F;AAC9F,gGAAgG;AAChG,mBAAmB;AACnB,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,YAAY,EAAE,OAAO;IACrB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,oFAAoF;IAC5F,WAAW,EAAE,IA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,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,GAAG,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtD;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA2B,EAC3B,OAAoB,YAAY;IAEhC,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC;QAC7C,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3F,CAAC;IACD,OAAO;QACL,gBAAgB,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;QACrD,SAAS,EAAE,IAAI,CAAC,IAAI;QACpB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;QACxB,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnD,CAAC;AACJ,CAAC"}
package/dist/program.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { Command } from "commander";
2
+ import { discoverProviderKeys } from "./key-resolution.js";
2
3
  import type { ObserverResult, ObserverServer } from "./observer.js";
3
4
  import type { OssMetaLabResult } from "./oss-meta-lab.js";
5
+ import { type TuiModule } from "./tui-contract.js";
4
6
  export declare const CLI_RESPONSE_SCHEMA = "humanish.cli-response.v1";
5
7
  export interface CliIo {
6
8
  writeOut(text: string): void;
@@ -15,7 +17,22 @@ export interface UnexpectedErrorEnvelope {
15
17
  message: string;
16
18
  };
17
19
  }
18
- export declare function createProgram(io?: Partial<CliIo>): Command;
20
+ export declare function createProgram(io?: Partial<CliIo> & {
21
+ keyDiscovery?: typeof discoverProviderKeys;
22
+ tuiRuntime?: Partial<TuiRuntime>;
23
+ }): Command;
24
+ /**
25
+ * The pieces of the outside world the `tui` command touches. Injectable for the same reason
26
+ * `keyDiscovery` is: the refusals ARE the behavior worth testing, and a test cannot make a real
27
+ * TTY, an old Node, or a missing bundle appear.
28
+ */
29
+ export interface TuiRuntime {
30
+ stdin: NodeJS.ReadStream;
31
+ stdout: NodeJS.WriteStream;
32
+ nodeVersion: string;
33
+ /** Resolves the bundle, or null when it is not present. */
34
+ loadTui(bundle: URL): Promise<TuiModule | null>;
35
+ }
19
36
  /**
20
37
  * Default browser-open policy for a lab backend run. Mirrors the observe/watch gate:
21
38
  * an explicit --open/--no-open wins; --json (machine mode) never auto-opens; otherwise a