@poncho-ai/sdk 1.6.3 → 1.7.1

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/sdk@1.6.3 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
2
+ > @poncho-ai/sdk@1.7.1 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 11.50 KB
11
- ESM ⚡️ Build success in 18ms
10
+ ESM dist/index.js 12.46 KB
11
+ ESM ⚡️ Build success in 19ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 1202ms
14
- DTS dist/index.d.ts 22.58 KB
13
+ DTS ⚡️ Build success in 1298ms
14
+ DTS dist/index.d.ts 23.88 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @poncho-ai/sdk
2
2
 
3
+ ## 1.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#54](https://github.com/cesr/poncho-ai/pull/54) [`2341915`](https://github.com/cesr/poncho-ai/commit/23419152d52c39f3bcaf8cdcd424625d5f897315) Thanks [@cesr](https://github.com/cesr)! - Reduce high-cost outliers with aggressive runtime controls and better cost visibility.
8
+
9
+ This adds older-turn tool result archiving/truncation, tighter retry/step/subagent limits, compaction tuning, selective prompt cache behavior, and richer cache-write token attribution in logs/events.
10
+
11
+ ## 1.7.0
12
+
13
+ ### Minor Changes
14
+
15
+ - Add OpenAI Codex OAuth provider support with one-time auth bootstrap and runtime token refresh.
16
+
17
+ This adds `openai-codex` model provider support, `poncho auth` login/status/logout/export commands, onboarding updates, and Codex request compatibility handling for OAuth-backed Responses API calls.
18
+
3
19
  ## 1.6.3
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -47,6 +47,10 @@ declare const ONBOARDING_FIELDS: readonly [{
47
47
  readonly value: "openai";
48
48
  readonly label: "OpenAI";
49
49
  readonly envVars: ["OPENAI_API_KEY"];
50
+ }, {
51
+ readonly value: "openai-codex";
52
+ readonly label: "OpenAI Codex (OAuth subscription)";
53
+ readonly envVars: ["OPENAI_CODEX_REFRESH_TOKEN", "OPENAI_CODEX_ACCOUNT_ID"];
50
54
  }];
51
55
  }, {
52
56
  readonly id: "env.ANTHROPIC_API_KEY";
@@ -80,6 +84,37 @@ declare const ONBOARDING_FIELDS: readonly [{
80
84
  readonly fieldId: "model.provider";
81
85
  readonly equals: "openai";
82
86
  };
87
+ }, {
88
+ readonly id: "env.OPENAI_CODEX_REFRESH_TOKEN";
89
+ readonly domain: "model";
90
+ readonly target: "env";
91
+ readonly path: "OPENAI_CODEX_REFRESH_TOKEN";
92
+ readonly kind: "string";
93
+ readonly scopes: ["light", "full"];
94
+ readonly label: "OpenAI Codex refresh token";
95
+ readonly prompt: "OpenAI Codex refresh token";
96
+ readonly defaultValue: "";
97
+ readonly placeholder: "rt_...";
98
+ readonly secret: true;
99
+ readonly dependsOn: {
100
+ readonly fieldId: "model.provider";
101
+ readonly equals: "openai-codex";
102
+ };
103
+ }, {
104
+ readonly id: "env.OPENAI_CODEX_ACCOUNT_ID";
105
+ readonly domain: "model";
106
+ readonly target: "env";
107
+ readonly path: "OPENAI_CODEX_ACCOUNT_ID";
108
+ readonly kind: "string";
109
+ readonly scopes: ["light", "full"];
110
+ readonly label: "OpenAI Codex account ID (optional)";
111
+ readonly prompt: "OpenAI Codex account ID (optional)";
112
+ readonly defaultValue: "";
113
+ readonly placeholder: "org_... or acct_...";
114
+ readonly dependsOn: {
115
+ readonly fieldId: "model.provider";
116
+ readonly equals: "openai-codex";
117
+ };
83
118
  }, {
84
119
  readonly id: "deploy.target";
85
120
  readonly domain: "deploy";
@@ -524,6 +559,7 @@ interface Message {
524
559
  timestamp?: number;
525
560
  tokenCount?: number;
526
561
  step?: number;
562
+ runId?: string;
527
563
  toolActivity?: string[];
528
564
  sections?: Array<{
529
565
  type: "text" | "tools";
@@ -577,6 +613,7 @@ interface TokenUsage {
577
613
  input: number;
578
614
  output: number;
579
615
  cached: number;
616
+ cacheWrite?: number;
580
617
  }
581
618
  interface RunResult {
582
619
  status: "completed" | "error" | "cancelled";
package/dist/index.js CHANGED
@@ -12,7 +12,12 @@ var ONBOARDING_FIELDS = [
12
12
  defaultValue: "anthropic",
13
13
  options: [
14
14
  { value: "anthropic", label: "Anthropic", envVars: ["ANTHROPIC_API_KEY"] },
15
- { value: "openai", label: "OpenAI", envVars: ["OPENAI_API_KEY"] }
15
+ { value: "openai", label: "OpenAI", envVars: ["OPENAI_API_KEY"] },
16
+ {
17
+ value: "openai-codex",
18
+ label: "OpenAI Codex (OAuth subscription)",
19
+ envVars: ["OPENAI_CODEX_REFRESH_TOKEN", "OPENAI_CODEX_ACCOUNT_ID"]
20
+ }
16
21
  ]
17
22
  },
18
23
  {
@@ -43,6 +48,33 @@ var ONBOARDING_FIELDS = [
43
48
  secret: true,
44
49
  dependsOn: { fieldId: "model.provider", equals: "openai" }
45
50
  },
51
+ {
52
+ id: "env.OPENAI_CODEX_REFRESH_TOKEN",
53
+ domain: "model",
54
+ target: "env",
55
+ path: "OPENAI_CODEX_REFRESH_TOKEN",
56
+ kind: "string",
57
+ scopes: ["light", "full"],
58
+ label: "OpenAI Codex refresh token",
59
+ prompt: "OpenAI Codex refresh token",
60
+ defaultValue: "",
61
+ placeholder: "rt_...",
62
+ secret: true,
63
+ dependsOn: { fieldId: "model.provider", equals: "openai-codex" }
64
+ },
65
+ {
66
+ id: "env.OPENAI_CODEX_ACCOUNT_ID",
67
+ domain: "model",
68
+ target: "env",
69
+ path: "OPENAI_CODEX_ACCOUNT_ID",
70
+ kind: "string",
71
+ scopes: ["light", "full"],
72
+ label: "OpenAI Codex account ID (optional)",
73
+ prompt: "OpenAI Codex account ID (optional)",
74
+ defaultValue: "",
75
+ placeholder: "org_... or acct_...",
76
+ dependsOn: { fieldId: "model.provider", equals: "openai-codex" }
77
+ },
46
78
  {
47
79
  id: "deploy.target",
48
80
  domain: "deploy",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/sdk",
3
- "version": "1.6.3",
3
+ "version": "1.7.1",
4
4
  "description": "Core types and utilities for building Poncho skills",
5
5
  "repository": {
6
6
  "type": "git",
@@ -58,6 +58,11 @@ export const ONBOARDING_FIELDS = [
58
58
  options: [
59
59
  { value: "anthropic", label: "Anthropic", envVars: ["ANTHROPIC_API_KEY"] },
60
60
  { value: "openai", label: "OpenAI", envVars: ["OPENAI_API_KEY"] },
61
+ {
62
+ value: "openai-codex",
63
+ label: "OpenAI Codex (OAuth subscription)",
64
+ envVars: ["OPENAI_CODEX_REFRESH_TOKEN", "OPENAI_CODEX_ACCOUNT_ID"],
65
+ },
61
66
  ],
62
67
  },
63
68
  {
@@ -88,6 +93,33 @@ export const ONBOARDING_FIELDS = [
88
93
  secret: true,
89
94
  dependsOn: { fieldId: "model.provider", equals: "openai" },
90
95
  },
96
+ {
97
+ id: "env.OPENAI_CODEX_REFRESH_TOKEN",
98
+ domain: "model",
99
+ target: "env",
100
+ path: "OPENAI_CODEX_REFRESH_TOKEN",
101
+ kind: "string",
102
+ scopes: ["light", "full"],
103
+ label: "OpenAI Codex refresh token",
104
+ prompt: "OpenAI Codex refresh token",
105
+ defaultValue: "",
106
+ placeholder: "rt_...",
107
+ secret: true,
108
+ dependsOn: { fieldId: "model.provider", equals: "openai-codex" },
109
+ },
110
+ {
111
+ id: "env.OPENAI_CODEX_ACCOUNT_ID",
112
+ domain: "model",
113
+ target: "env",
114
+ path: "OPENAI_CODEX_ACCOUNT_ID",
115
+ kind: "string",
116
+ scopes: ["light", "full"],
117
+ label: "OpenAI Codex account ID (optional)",
118
+ prompt: "OpenAI Codex account ID (optional)",
119
+ defaultValue: "",
120
+ placeholder: "org_... or acct_...",
121
+ dependsOn: { fieldId: "model.provider", equals: "openai-codex" },
122
+ },
91
123
  {
92
124
  id: "deploy.target",
93
125
  domain: "deploy",
package/src/index.ts CHANGED
@@ -34,6 +34,7 @@ export interface Message {
34
34
  timestamp?: number;
35
35
  tokenCount?: number;
36
36
  step?: number;
37
+ runId?: string;
37
38
  toolActivity?: string[];
38
39
  sections?: Array<{ type: "text" | "tools"; content: string | string[] }>;
39
40
  isCompactionSummary?: boolean;
@@ -110,6 +111,7 @@ export interface TokenUsage {
110
111
  input: number;
111
112
  output: number;
112
113
  cached: number;
114
+ cacheWrite?: number;
113
115
  }
114
116
 
115
117
  export interface RunResult {