polygram 0.46.1 → 0.46.2
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
|
|
3
3
|
"name": "polygram",
|
|
4
|
-
"version": "0.46.
|
|
4
|
+
"version": "0.46.2",
|
|
5
5
|
"description": "Telegram integration for Claude Code that preserves the OpenClaw per-chat session model. Migration target for OpenClaw users. Multi-bot, multi-chat, per-topic isolation; SQLite transcripts; inline-keyboard approvals. Bundles /polygram:status|logs|pair-code|approvals admin commands plus history (transcript queries) and polygram-send (out-of-turn IPC sends with file-upload validation) skills.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"telegram",
|
|
@@ -8,9 +8,9 @@ const MAX_EFFORTS = 32;
|
|
|
8
8
|
const SHA256_RE = /^[a-f0-9]{64}$/;
|
|
9
9
|
const PREFLIGHT_ACTIONS = Object.freeze({
|
|
10
10
|
CODEX_AUTH_UNAVAILABLE:
|
|
11
|
-
'
|
|
11
|
+
'Check the selected provider authentication: native ChatGPT login for OpenAI, or the private bearer configuration for CLIProxy, then rerun preflight.',
|
|
12
12
|
CODEX_MODEL_UNAVAILABLE:
|
|
13
|
-
'Choose a model returned by
|
|
13
|
+
'Choose a model returned by Codex runtime model preflight.',
|
|
14
14
|
CODEX_EFFORT_UNAVAILABLE:
|
|
15
15
|
'Choose a reasoning effort supported by the selected Codex model.',
|
|
16
16
|
CODEX_BINARY_MISMATCH:
|
|
@@ -93,7 +93,7 @@ function cloneModel(entry) {
|
|
|
93
93
|
throw new CodexCatalogError(
|
|
94
94
|
'Codex preflight returned a malformed model catalog.',
|
|
95
95
|
'CODEX_PREFLIGHT_INVALID',
|
|
96
|
-
'Rerun
|
|
96
|
+
'Rerun Codex runtime model preflight.',
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
const supportedReasoningEfforts = entry.supportedReasoningEfforts;
|
|
@@ -105,7 +105,7 @@ function cloneModel(entry) {
|
|
|
105
105
|
throw new CodexCatalogError(
|
|
106
106
|
'Codex preflight returned malformed reasoning efforts.',
|
|
107
107
|
'CODEX_PREFLIGHT_INVALID',
|
|
108
|
-
'Rerun
|
|
108
|
+
'Rerun Codex runtime model preflight.',
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
const efforts = supportedReasoningEfforts.map((effort) => (
|
|
@@ -115,7 +115,7 @@ function cloneModel(entry) {
|
|
|
115
115
|
throw new CodexCatalogError(
|
|
116
116
|
'Codex preflight returned duplicate reasoning efforts.',
|
|
117
117
|
'CODEX_PREFLIGHT_INVALID',
|
|
118
|
-
'Rerun
|
|
118
|
+
'Rerun Codex runtime model preflight.',
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
if (
|
|
@@ -125,7 +125,7 @@ function cloneModel(entry) {
|
|
|
125
125
|
throw new CodexCatalogError(
|
|
126
126
|
'Codex preflight returned an inconsistent default effort.',
|
|
127
127
|
'CODEX_PREFLIGHT_INVALID',
|
|
128
|
-
'Rerun
|
|
128
|
+
'Rerun Codex runtime model preflight.',
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
return {
|
|
@@ -138,25 +138,28 @@ function cloneModel(entry) {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function projectPreflight(result) {
|
|
141
|
+
function projectPreflight(result, expectedStaticProfile) {
|
|
142
|
+
const provider = expectedStaticProfile?.expectedConfig?.modelProvider;
|
|
143
|
+
const native = provider === 'openai';
|
|
142
144
|
if (
|
|
143
|
-
!
|
|
145
|
+
!['openai', 'cliproxyapi'].includes(provider)
|
|
146
|
+
|| !result
|
|
144
147
|
|| typeof result !== 'object'
|
|
145
148
|
|| Array.isArray(result)
|
|
146
149
|
|| result.runtime !== 'codex'
|
|
147
150
|
|| !SHA256_RE.test(result.spawnProfileId)
|
|
148
|
-
|| result.auth?.authenticated !==
|
|
149
|
-
|| result.auth?.accountType !== 'chatgpt'
|
|
150
|
-
||
|
|
151
|
+
|| result.auth?.authenticated !== native
|
|
152
|
+
|| result.auth?.accountType !== (native ? 'chatgpt' : null)
|
|
153
|
+
|| result.auth?.requiresOpenaiAuth !== native
|
|
151
154
|
|| !Array.isArray(result.models)
|
|
152
155
|
|| result.models.length === 0
|
|
153
156
|
|| result.models.length > MAX_MODELS
|
|
154
157
|
|| !Array.isArray(result.efforts)
|
|
155
158
|
) {
|
|
156
159
|
throw new CodexCatalogError(
|
|
157
|
-
'Codex preflight returned an invalid
|
|
160
|
+
'Codex preflight returned an invalid provider-specific catalog.',
|
|
158
161
|
'CODEX_PREFLIGHT_INVALID',
|
|
159
|
-
'Rerun
|
|
162
|
+
'Rerun Codex runtime preflight with the reviewed Orchestra runtime.',
|
|
160
163
|
);
|
|
161
164
|
}
|
|
162
165
|
|
|
@@ -168,7 +171,7 @@ function projectPreflight(result) {
|
|
|
168
171
|
throw new CodexCatalogError(
|
|
169
172
|
'Codex preflight returned duplicate model identities.',
|
|
170
173
|
'CODEX_PREFLIGHT_INVALID',
|
|
171
|
-
'Rerun
|
|
174
|
+
'Rerun Codex runtime model preflight.',
|
|
172
175
|
);
|
|
173
176
|
}
|
|
174
177
|
const selectedModel = boundedString(result.selected?.model, 'selected model');
|
|
@@ -186,7 +189,7 @@ function projectPreflight(result) {
|
|
|
186
189
|
throw new CodexCatalogError(
|
|
187
190
|
'Codex preflight selected model or effort is inconsistent.',
|
|
188
191
|
'CODEX_PREFLIGHT_INVALID',
|
|
189
|
-
'Select a model and effort returned by
|
|
192
|
+
'Select a model and effort returned by runtime model preflight.',
|
|
190
193
|
);
|
|
191
194
|
}
|
|
192
195
|
|
|
@@ -195,8 +198,8 @@ function projectPreflight(result) {
|
|
|
195
198
|
schemaVersion: boundedString(result.schemaVersion, 'schema version'),
|
|
196
199
|
spawnProfileId: result.spawnProfileId,
|
|
197
200
|
auth: {
|
|
198
|
-
authenticated:
|
|
199
|
-
accountType:
|
|
201
|
+
authenticated: result.auth.authenticated,
|
|
202
|
+
accountType: result.auth.accountType,
|
|
200
203
|
requiresOpenaiAuth: result.auth.requiresOpenaiAuth,
|
|
201
204
|
},
|
|
202
205
|
models,
|
|
@@ -262,7 +265,7 @@ class CodexModelCatalog {
|
|
|
262
265
|
throw new CodexCatalogError(
|
|
263
266
|
'Codex spawn profile ID must be a lowercase SHA-256.',
|
|
264
267
|
'CODEX_PREFLIGHT_INVALID',
|
|
265
|
-
'Use the exact spawn profile returned by
|
|
268
|
+
'Use the exact spawn profile returned by runtime preflight.',
|
|
266
269
|
);
|
|
267
270
|
}
|
|
268
271
|
const cacheKey = digest({ deploymentKey: key, spawnProfileId });
|
|
@@ -272,7 +275,7 @@ class CodexModelCatalog {
|
|
|
272
275
|
/**
|
|
273
276
|
* `deploymentIdentity` is an opaque fingerprint of the provisioned
|
|
274
277
|
* credential deployment, not credential contents. It must change when that
|
|
275
|
-
* deployment is replaced so
|
|
278
|
+
* deployment is replaced so a provider-bound catalog cannot cross stores.
|
|
276
279
|
*/
|
|
277
280
|
async preflight(expectedStaticProfile, { deploymentIdentity } = {}) {
|
|
278
281
|
const key = deploymentKey(deploymentIdentity);
|
|
@@ -308,7 +311,7 @@ class CodexModelCatalog {
|
|
|
308
311
|
}
|
|
309
312
|
|
|
310
313
|
try {
|
|
311
|
-
const projection = projectPreflight(result);
|
|
314
|
+
const projection = projectPreflight(result, expectedStaticProfile);
|
|
312
315
|
const spawnProfile = orchestra.createCodexSpawnProfile(
|
|
313
316
|
expectedStaticProfile,
|
|
314
317
|
result,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polygram",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.2",
|
|
4
4
|
"description": "Telegram daemon for Claude Code that preserves the OpenClaw per-chat session model. Migration path for OpenClaw users moving to Claude Code.",
|
|
5
5
|
"main": "lib/ipc/client.js",
|
|
6
6
|
"bin": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@anthropic-ai/claude-agent-sdk": "0.3.322",
|
|
73
73
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
74
|
-
"@shumkov/orchestra": "0.12.
|
|
74
|
+
"@shumkov/orchestra": "0.12.2",
|
|
75
75
|
"acorn": "8.18.0",
|
|
76
76
|
"better-sqlite3": "^12.9.0",
|
|
77
77
|
"grammy": "^1.42.0",
|