@pome-sh/cli 0.23.45 → 0.23.47
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/README.md +8 -5
- package/dist/build-info.json +3 -3
- package/dist/{checks-5T2MVAUX.js → checks-T3EWJXDT.js} +1 -1
- package/dist/{chunk-OW7VVW6X.js → chunk-5EGHN6H4.js} +3 -3
- package/dist/{chunk-F3KQCVWU.js → chunk-AS477MNU.js} +11 -11
- package/dist/{chunk-ZKID2HS3.js → chunk-IZIZC7ZW.js} +14 -3
- package/dist/{chunk-6GS7QNCQ.js → chunk-J2U6LMFM.js} +3 -3
- package/dist/{chunk-VIB6XLX2.js → chunk-SFB63DN6.js} +1 -1
- package/dist/{chunk-5Q6D6ORU.js → chunk-TY5365F4.js} +2 -2
- package/dist/{chunk-XIKQEAWV.js → chunk-VVMGE677.js} +2 -2
- package/dist/{runDemo-L5HORQFT.js → runDemo-JW6EGT66.js} +6 -6
- package/dist/{runTrialGroup-BC47IPE2.js → runTrialGroup-JDTUSWGS.js} +5 -5
- package/dist/{server-KOR7UHEP.js → server-AJUCP5KS.js} +1 -1
- package/dist/src/cli/main.js +14 -14
- package/dist/{src-OYBYLMMI.js → src-7Z35KM4S.js} +38 -13
- package/dist/{src-6RAKZPHK.js → src-BAPCY3ID.js} +1 -1
- package/dist/{src-UVXZQZGN.js → src-LE3GXOQL.js} +15 -6
- package/dist/{src-HJRL3WKN.js → src-NKGQXT7H.js} +25 -7
- package/dist/{src-HRW7OZBS.js → src-NMHFBKVW.js} +3 -2
- package/dist/twinHarness-IMJBFVAL.js +5 -0
- package/dist/{twinStart-63756OWJ.js → twinStart-T7SKWGEL.js} +3 -3
- package/package.json +1 -1
- package/dist/twinHarness-MRRHZ6WW.js +0 -5
package/README.md
CHANGED
|
@@ -121,14 +121,17 @@ npm test
|
|
|
121
121
|
|
|
122
122
|
The package publishes the `pome` binary from `dist/src/cli/main.js`.
|
|
123
123
|
|
|
124
|
-
### Versioning — every behavior change ships with a
|
|
124
|
+
### Versioning — every behavior change ships with a release, and you do not write the number
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
`
|
|
126
|
+
Add the user-facing entry to `CHANGELOG.md` under an `## Unreleased (patch)` (or
|
|
127
|
+
`(minor)`) heading, above the newest released one, and leave `version` in
|
|
128
|
+
`cli/package.json` alone — a PR that moves it fails CI. Merging to `main` is the
|
|
129
|
+
release trigger: `.github/workflows/allocate-version.yml` allocates the number
|
|
130
|
+
there, rewriting that heading and the manifest in one commit, and
|
|
128
131
|
`.github/workflows/release.yml` compares the local version against npm and
|
|
129
|
-
publishes when they differ. `pome --version` reports the
|
|
132
|
+
publishes when they differ. `pome --version` reports the allocated value from a
|
|
130
133
|
build-time constant, so a user can always tell whether their install carries a
|
|
131
|
-
given fix.
|
|
134
|
+
given fix. See [`RELEASING.md`](../RELEASING.md).
|
|
132
135
|
|
|
133
136
|
## License
|
|
134
137
|
|
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.23.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-08-
|
|
3
|
+
"version": "0.23.47",
|
|
4
|
+
"git_sha": "95240f908f2348af9ad981943e2aab76b5df844b",
|
|
5
|
+
"build_time": "2026-08-13T17:53:11.645Z"
|
|
6
6
|
}
|
|
@@ -183,7 +183,7 @@ async function checkTwinReachable(_configDir) {
|
|
|
183
183
|
});
|
|
184
184
|
let harness;
|
|
185
185
|
try {
|
|
186
|
-
const { bootTwin } = await import('./twinHarness-
|
|
186
|
+
const { bootTwin } = await import('./twinHarness-IMJBFVAL.js');
|
|
187
187
|
harness = await bootTwin({
|
|
188
188
|
twin: "github",
|
|
189
189
|
seedState: void 0,
|
|
@@ -447,7 +447,7 @@ function isLoopbackAddress(remote) {
|
|
|
447
447
|
return remote === "127.0.0.1" || remote === "::1" || remote === "::ffff:127.0.0.1" || remote === "localhost";
|
|
448
448
|
}
|
|
449
449
|
function defaultForbidden() {
|
|
450
|
-
return Response.json({ message: "Forbidden"
|
|
450
|
+
return Response.json({ message: "Forbidden" }, { status: 403 });
|
|
451
451
|
}
|
|
452
452
|
function createAdminGate(options = {}) {
|
|
453
453
|
const forbidden = options.forbidden ?? defaultForbidden;
|
|
@@ -576,11 +576,11 @@ function formTokenResolver(param = "token") {
|
|
|
576
576
|
}
|
|
577
577
|
var defaultUnauthorized = () => ({
|
|
578
578
|
status: 401,
|
|
579
|
-
body: { message: "Bad credentials"
|
|
579
|
+
body: { message: "Bad credentials" }
|
|
580
580
|
});
|
|
581
581
|
var defaultSidMismatch = () => ({
|
|
582
582
|
status: 401,
|
|
583
|
-
body: { message: "Forbidden"
|
|
583
|
+
body: { message: "Forbidden" }
|
|
584
584
|
});
|
|
585
585
|
function respond(envelope) {
|
|
586
586
|
return Response.json(envelope.body, { status: envelope.status });
|
|
@@ -39,7 +39,7 @@ var TWIN_REGISTRY = {
|
|
|
39
39
|
defaultSeedState,
|
|
40
40
|
GitHubDomain,
|
|
41
41
|
openGitHubCloneDatabase
|
|
42
|
-
} = await import('./src-
|
|
42
|
+
} = await import('./src-7Z35KM4S.js');
|
|
43
43
|
const db = openGitHubCloneDatabase();
|
|
44
44
|
const domain = new GitHubDomain(db);
|
|
45
45
|
domain.seed(seedState === void 0 ? defaultSeedState() : seedState);
|
|
@@ -59,9 +59,9 @@ var TWIN_REGISTRY = {
|
|
|
59
59
|
envName: "SLACK",
|
|
60
60
|
defaultPort: 3333,
|
|
61
61
|
version: package_default2.version,
|
|
62
|
-
defaultSeed: async () => (await import('./src-
|
|
62
|
+
defaultSeed: async () => (await import('./src-BAPCY3ID.js')).defaultSeedState(),
|
|
63
63
|
async boot({ seedState, runId, recorder }) {
|
|
64
|
-
const { createSlackTwinApp, openSlackTwinDatabase, SlackDomain } = await import('./src-
|
|
64
|
+
const { createSlackTwinApp, openSlackTwinDatabase, SlackDomain } = await import('./src-BAPCY3ID.js');
|
|
65
65
|
const db = openSlackTwinDatabase(":memory:");
|
|
66
66
|
const domain = new SlackDomain(db);
|
|
67
67
|
domain.applySeed(seedState);
|
|
@@ -84,10 +84,10 @@ var TWIN_REGISTRY = {
|
|
|
84
84
|
envName: "STRIPE",
|
|
85
85
|
defaultPort: 3333,
|
|
86
86
|
version: package_default3.version,
|
|
87
|
-
defaultSeed: async () => (await import('./src-
|
|
87
|
+
defaultSeed: async () => (await import('./src-NMHFBKVW.js')).defaultSeed(),
|
|
88
88
|
async boot({ seedState, runId, recorder, twinBaseUrl }) {
|
|
89
|
-
const stripeTwin = await import('./src-
|
|
90
|
-
const { createApp } = await import('./server-
|
|
89
|
+
const stripeTwin = await import('./src-NMHFBKVW.js');
|
|
90
|
+
const { createApp } = await import('./server-AJUCP5KS.js');
|
|
91
91
|
const {
|
|
92
92
|
applySeed: applyStripeSeed,
|
|
93
93
|
createTwinStripeApp,
|
|
@@ -128,9 +128,9 @@ var TWIN_REGISTRY = {
|
|
|
128
128
|
portEnvName: "GMAIL_TWIN_PORT",
|
|
129
129
|
tokenEnvName: "POME_GMAIL_TOKEN",
|
|
130
130
|
version: package_default4.version,
|
|
131
|
-
defaultSeed: async () => (await import('./src-
|
|
131
|
+
defaultSeed: async () => (await import('./src-NKGQXT7H.js')).defaultSeedState(),
|
|
132
132
|
async boot({ seedState, runId, recorder }) {
|
|
133
|
-
const { createGmailTwinApp, GmailDomain, openGmailTwinDatabase, parseSeed } = await import('./src-
|
|
133
|
+
const { createGmailTwinApp, GmailDomain, openGmailTwinDatabase, parseSeed } = await import('./src-NKGQXT7H.js');
|
|
134
134
|
const db = openGmailTwinDatabase(":memory:");
|
|
135
135
|
const seed = parseSeed(seedState);
|
|
136
136
|
const domain = new GmailDomain(db);
|
|
@@ -149,7 +149,7 @@ var TWIN_REGISTRY = {
|
|
|
149
149
|
portEnvName: "LINEAR_TWIN_PORT",
|
|
150
150
|
tokenEnvName: "POME_LINEAR_TOKEN",
|
|
151
151
|
version: package_default5.version,
|
|
152
|
-
defaultSeed: async () => (await import('./src-
|
|
152
|
+
defaultSeed: async () => (await import('./src-LE3GXOQL.js')).defaultSeedState(),
|
|
153
153
|
async boot({ seedState, runId, recorder }) {
|
|
154
154
|
const {
|
|
155
155
|
createLinearTwinApp,
|
|
@@ -157,7 +157,7 @@ var TWIN_REGISTRY = {
|
|
|
157
157
|
LinearDomain,
|
|
158
158
|
openLinearTwinDatabase,
|
|
159
159
|
parseSeed
|
|
160
|
-
} = await import('./src-
|
|
160
|
+
} = await import('./src-LE3GXOQL.js');
|
|
161
161
|
const db = openLinearTwinDatabase(":memory:");
|
|
162
162
|
const seed = parseSeed(seedState);
|
|
163
163
|
const domain = new LinearDomain(db);
|
|
@@ -173,7 +173,7 @@ var TWIN_REGISTRY = {
|
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
async function createGitHubSmokeApp() {
|
|
176
|
-
const { createGitHubCloneApp } = await import('./src-
|
|
176
|
+
const { createGitHubCloneApp } = await import('./src-7Z35KM4S.js');
|
|
177
177
|
return createGitHubCloneApp();
|
|
178
178
|
}
|
|
179
179
|
function defaultPortFor(twin, env = process.env) {
|
|
@@ -23,19 +23,30 @@ var LinearTwinError = class extends Error {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function unauthorizedEnvelope(message = "Authentication required") {
|
|
26
|
+
function unauthorizedEnvelope(message = "Authentication required, not authenticated") {
|
|
27
27
|
return {
|
|
28
28
|
status: 401,
|
|
29
29
|
body: {
|
|
30
30
|
errors: [
|
|
31
31
|
{
|
|
32
32
|
message,
|
|
33
|
-
extensions: {
|
|
33
|
+
extensions: {
|
|
34
|
+
type: "authentication error",
|
|
35
|
+
code: "AUTHENTICATION_ERROR",
|
|
36
|
+
statusCode: 401,
|
|
37
|
+
userError: true,
|
|
38
|
+
userPresentableMessage: "You need to authenticate to access this operation.",
|
|
39
|
+
meta: {},
|
|
40
|
+
http: { status: 401 }
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
]
|
|
36
44
|
}
|
|
37
45
|
};
|
|
38
46
|
}
|
|
47
|
+
function forbiddenEnvelope(message = "Forbidden") {
|
|
48
|
+
return linearErrorEnvelope(new LinearTwinError(403, "FORBIDDEN", message));
|
|
49
|
+
}
|
|
39
50
|
function unsupportedEnvelope(method, path) {
|
|
40
51
|
return {
|
|
41
52
|
status: 501,
|
|
@@ -625,4 +636,4 @@ function defaultSeedState() {
|
|
|
625
636
|
};
|
|
626
637
|
}
|
|
627
638
|
|
|
628
|
-
export { ACCESS_TOKEN_TTL_SECONDS, BODY_MAX_BYTES, DEFAULT_LINEAR_CLOCK, DEFAULT_LINEAR_EMAIL, DEFAULT_LINEAR_PORT, DEFAULT_LINEAR_SID, DEFAULT_LINEAR_TOKEN, DEFAULT_SCOPES, GRAPHQL_QUERY_MAX_BYTES, GRAPHQL_SELECTION_DEPTH_MAX, LINEAR_PROVIDER_TOKEN_PREFIX, LinearTwinError, MCP_PAGE_DEFAULT, MCP_PAGE_MAX, OAUTH_CODE_TTL_SECONDS, RELAY_PAGE_DEFAULT, RELAY_PAGE_MAX, STATE_EXPORT_CAP, TITLE_MAX_BYTES, assertWebhookUrl, badUserInput, defaultSeedState, linearErrorEnvelope, linearSeedSchema, loadSeedFromEnv, notFound, parseSeed, unauthorizedEnvelope, unsupportedEnvelope, webhookUrlError };
|
|
639
|
+
export { ACCESS_TOKEN_TTL_SECONDS, BODY_MAX_BYTES, DEFAULT_LINEAR_CLOCK, DEFAULT_LINEAR_EMAIL, DEFAULT_LINEAR_PORT, DEFAULT_LINEAR_SID, DEFAULT_LINEAR_TOKEN, DEFAULT_SCOPES, GRAPHQL_QUERY_MAX_BYTES, GRAPHQL_SELECTION_DEPTH_MAX, LINEAR_PROVIDER_TOKEN_PREFIX, LinearTwinError, MCP_PAGE_DEFAULT, MCP_PAGE_MAX, OAUTH_CODE_TTL_SECONDS, RELAY_PAGE_DEFAULT, RELAY_PAGE_MAX, STATE_EXPORT_CAP, TITLE_MAX_BYTES, assertWebhookUrl, badUserInput, defaultSeedState, forbiddenEnvelope, linearErrorEnvelope, linearSeedSchema, loadSeedFromEnv, notFound, parseSeed, unauthorizedEnvelope, unsupportedEnvelope, webhookUrlError };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { criterionSchema, finalizeResponseSchema, HostedDiscardRefusedError, HostedOrchError, HostedAuthError, HostedQuotaError, submitResultResponseSchema, createEvalSessionResponseSchema, createSessionResponseSchema, sessionPublicSchema } from './chunk-X66JOOO7.js';
|
|
2
2
|
import { seedSchema, parseSeed, defaultSeedState as defaultSeedState$2 } from './chunk-B22TYIEM.js';
|
|
3
3
|
import { gmailSeedSchema, defaultSeedState } from './chunk-NJ246QPJ.js';
|
|
4
|
-
import { linearSeedSchema, defaultSeedState as defaultSeedState$1 } from './chunk-
|
|
5
|
-
import { isTwinName, TWIN_REGISTRY } from './chunk-
|
|
6
|
-
import { toTwinHttpEventRow } from './chunk-
|
|
4
|
+
import { linearSeedSchema, defaultSeedState as defaultSeedState$1 } from './chunk-IZIZC7ZW.js';
|
|
5
|
+
import { isTwinName, TWIN_REGISTRY } from './chunk-AS477MNU.js';
|
|
6
|
+
import { toTwinHttpEventRow } from './chunk-5EGHN6H4.js';
|
|
7
7
|
import { redactEvent, redactSecrets } from './chunk-SG6ZTIMT.js';
|
|
8
8
|
import { mkdir, appendFile, writeFile, readFile } from 'node:fs/promises';
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readManifest, normalizeManifestTwins } from './chunk-ABM3CMQB.js';
|
|
2
|
-
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-
|
|
2
|
+
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-J2U6LMFM.js';
|
|
3
3
|
import { MOUNTED_TWINS, HostedAuthError, HostedDiscardRefusedError, HostedQuotaError, HostedOrchError, HostedTrialError, agentResponseSchema } from './chunk-X66JOOO7.js';
|
|
4
4
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
5
5
|
import { randomUUID, createHash } from 'node:crypto';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
2
2
|
import { buildEgressAllowlist, readBlockedEgress } from './chunk-CBFKZZBR.js';
|
|
3
|
-
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-
|
|
4
|
-
import { createRecorder, bootTwin } from './chunk-
|
|
3
|
+
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-J2U6LMFM.js';
|
|
4
|
+
import { createRecorder, bootTwin } from './chunk-VVMGE677.js';
|
|
5
5
|
import { eventSchema } from './chunk-VBATFCWR.js';
|
|
6
6
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
7
7
|
import { serve } from '@hono/node-server';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-
|
|
2
|
-
import { createFileBackedRecorderStore, createRecorderStore } from './chunk-
|
|
1
|
+
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-AS477MNU.js';
|
|
2
|
+
import { createFileBackedRecorderStore, createRecorderStore } from './chunk-5EGHN6H4.js';
|
|
3
3
|
|
|
4
4
|
// src/recorder/recorder.ts
|
|
5
5
|
function createRecorder(options = {}) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { newGroupId, reassuranceBox, twinReadyLine, trialsHeaderLine, trialLine, summaryLines, evaluatingLine, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
2
|
import { DemoCapacityError, capacityLabel, parseCapacityMarker, capacityKindFrom } from './chunk-ZX4WNSZ5.js';
|
|
3
|
-
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-
|
|
3
|
+
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-TY5365F4.js';
|
|
4
4
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
5
5
|
import './chunk-CBFKZZBR.js';
|
|
6
|
-
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, outcomeOf } from './chunk-
|
|
6
|
+
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, outcomeOf } from './chunk-J2U6LMFM.js';
|
|
7
7
|
import './chunk-NW7HGA2K.js';
|
|
8
8
|
import { HostedQuotaError, HostedOrchError } from './chunk-X66JOOO7.js';
|
|
9
9
|
import './chunk-B22TYIEM.js';
|
|
10
10
|
import './chunk-NJ246QPJ.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import { bootTwin } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
11
|
+
import './chunk-IZIZC7ZW.js';
|
|
12
|
+
import { bootTwin } from './chunk-VVMGE677.js';
|
|
13
|
+
import './chunk-AS477MNU.js';
|
|
14
|
+
import './chunk-5EGHN6H4.js';
|
|
15
15
|
import './chunk-VBATFCWR.js';
|
|
16
16
|
import './chunk-SG6ZTIMT.js';
|
|
17
17
|
import { readFile } from 'node:fs/promises';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { newGroupId, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
|
-
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-
|
|
2
|
+
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-SFB63DN6.js';
|
|
3
3
|
import './chunk-ABM3CMQB.js';
|
|
4
|
-
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-
|
|
4
|
+
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-J2U6LMFM.js';
|
|
5
5
|
import './chunk-NW7HGA2K.js';
|
|
6
6
|
import { HostedQuotaError, HostedTrialError } from './chunk-X66JOOO7.js';
|
|
7
7
|
import './chunk-B22TYIEM.js';
|
|
8
8
|
import './chunk-NJ246QPJ.js';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
9
|
+
import './chunk-IZIZC7ZW.js';
|
|
10
|
+
import './chunk-AS477MNU.js';
|
|
11
|
+
import './chunk-5EGHN6H4.js';
|
|
12
12
|
import './chunk-VBATFCWR.js';
|
|
13
13
|
import './chunk-SG6ZTIMT.js';
|
|
14
14
|
import { randomUUID } from 'node:crypto';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FAILURE_INJECTION_OVERRIDE_KEY, POME_RECORDER_EVENTS_PATH, PROVIDER_SHAPED_TEAM_ID, TwinBootError, TwinError, UnknownToolError, bearerAuth, createAdminGate, createApp, createFailureInjectionStore, createFileBackedRecorderStore, createRecorderHandle, createRecorderStore, created, ensureTwinAuthSecret, failureInjectionMiddleware, failureInjectionRuleSchema, formTokenResolver, isLoopbackHost, mintProviderToken, ok, queryTokenResolver, recordedRequestHeaders, requireAdminAuth, resolveAuthSecret, resolveRecorderStore, serve, setClientIp, setRecordedTool, toTwinHttpEventRow, twinBuildInfo, verifyProviderToken } from './chunk-
|
|
1
|
+
export { FAILURE_INJECTION_OVERRIDE_KEY, POME_RECORDER_EVENTS_PATH, PROVIDER_SHAPED_TEAM_ID, TwinBootError, TwinError, UnknownToolError, bearerAuth, createAdminGate, createApp, createFailureInjectionStore, createFileBackedRecorderStore, createRecorderHandle, createRecorderStore, created, ensureTwinAuthSecret, failureInjectionMiddleware, failureInjectionRuleSchema, formTokenResolver, isLoopbackHost, mintProviderToken, ok, queryTokenResolver, recordedRequestHeaders, requireAdminAuth, resolveAuthSecret, resolveRecorderStore, serve, setClientIp, setRecordedTool, toTwinHttpEventRow, twinBuildInfo, verifyProviderToken } from './chunk-5EGHN6H4.js';
|
|
2
2
|
import './chunk-VBATFCWR.js';
|
|
3
3
|
export { redactEvent, redactSecrets } from './chunk-SG6ZTIMT.js';
|
package/dist/src/cli/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, VERDICT_ARTIFACT_VERSION, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-
|
|
2
|
+
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, VERDICT_ARTIFACT_VERSION, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-SFB63DN6.js';
|
|
3
3
|
import { readManifest, writeManifest, MANIFEST_JSON, readRequiredManifest, normalizeManifestTwins } from '../../chunk-ABM3CMQB.js';
|
|
4
|
-
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-
|
|
4
|
+
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-TY5365F4.js';
|
|
5
5
|
import '../../chunk-XDU6TD4O.js';
|
|
6
6
|
import '../../chunk-CBFKZZBR.js';
|
|
7
|
-
import { parseTaskFile, scoreStatus, runScoreLine, readLatestRun, readMetaSummary, outcomeOf, readConfigTwins, scoreCountsSummary, markerFor, criterionMarkerLabel, twinSkipSuffix, readCodeCriteria, createHostedClient, toTwinHttpEvent, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-
|
|
7
|
+
import { parseTaskFile, scoreStatus, runScoreLine, readLatestRun, readMetaSummary, outcomeOf, readConfigTwins, scoreCountsSummary, markerFor, criterionMarkerLabel, twinSkipSuffix, readCodeCriteria, createHostedClient, toTwinHttpEvent, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-J2U6LMFM.js';
|
|
8
8
|
import '../../chunk-NW7HGA2K.js';
|
|
9
9
|
import { MOUNTED_TWINS, deriveAgentSlug, exitCodeFor, HostedUsageError, HostedOrchError, HostedAuthError, HostedQuotaError } from '../../chunk-X66JOOO7.js';
|
|
10
10
|
import { TAPE_ASSERTABLE_TOOLS } from '../../chunk-FKZZWWYC.js';
|
|
@@ -13,11 +13,11 @@ import { SLACK_CHECKS } from '../../chunk-IDNSKKEC.js';
|
|
|
13
13
|
import { GMAIL_CHECKS } from '../../chunk-JM6VS62R.js';
|
|
14
14
|
import '../../chunk-NJ246QPJ.js';
|
|
15
15
|
import { LINEAR_CHECKS } from '../../chunk-XBT6ZLBG.js';
|
|
16
|
-
import '../../chunk-
|
|
16
|
+
import '../../chunk-IZIZC7ZW.js';
|
|
17
17
|
import { oneOf, defineCheck, repoRef, VACUITY_SENTINEL_NUMBER, childStatePath, VACUITY_SENTINEL, statePath, templateSlots, renderCheck, checksDigest, checkPattern, checkNearMissPattern } from '../../chunk-JWJYNAWI.js';
|
|
18
|
-
import '../../chunk-
|
|
19
|
-
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-
|
|
20
|
-
import '../../chunk-
|
|
18
|
+
import '../../chunk-VVMGE677.js';
|
|
19
|
+
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-AS477MNU.js';
|
|
20
|
+
import '../../chunk-5EGHN6H4.js';
|
|
21
21
|
import { isLegacyEventRow, eventSchema } from '../../chunk-VBATFCWR.js';
|
|
22
22
|
import { redactEvent, redactSecrets } from '../../chunk-SG6ZTIMT.js';
|
|
23
23
|
import { Command } from 'commander';
|
|
@@ -850,7 +850,7 @@ async function throwForStatus(res) {
|
|
|
850
850
|
|
|
851
851
|
// src/task/seed-verifier.ts
|
|
852
852
|
async function verifySeedWithTwin(seed) {
|
|
853
|
-
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-
|
|
853
|
+
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-7Z35KM4S.js');
|
|
854
854
|
const db = openGitHubCloneDatabase(":memory:");
|
|
855
855
|
try {
|
|
856
856
|
new GitHubDomain(db).seed(seed);
|
|
@@ -4580,7 +4580,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
|
4580
4580
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
4581
4581
|
var MAX_UNREADABLE_PATHS_SHOWN = 5;
|
|
4582
4582
|
function readPackageVersion() {
|
|
4583
|
-
if ("0.23.
|
|
4583
|
+
if ("0.23.47".length > 0) return "0.23.47";
|
|
4584
4584
|
try {
|
|
4585
4585
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
4586
4586
|
const candidates = [
|
|
@@ -5035,7 +5035,7 @@ function createProgram() {
|
|
|
5035
5035
|
return;
|
|
5036
5036
|
}
|
|
5037
5037
|
{
|
|
5038
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5038
|
+
const { runDoctorChecks } = await import('../../checks-T3EWJXDT.js');
|
|
5039
5039
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5040
5040
|
const doctorReport = await runDoctorChecks({ mode: useLocal ? "full" : "hosted" });
|
|
5041
5041
|
if (!doctorReport.ok) {
|
|
@@ -5073,7 +5073,7 @@ function createProgram() {
|
|
|
5073
5073
|
taskForRuns.config.runs
|
|
5074
5074
|
);
|
|
5075
5075
|
if (k > 1) {
|
|
5076
|
-
const { runTrialGroup } = await import('../../runTrialGroup-
|
|
5076
|
+
const { runTrialGroup } = await import('../../runTrialGroup-JDTUSWGS.js');
|
|
5077
5077
|
const fileForRerun = relative(process.cwd(), file);
|
|
5078
5078
|
const rerunCommand = defaultTask ? options.trials !== void 0 ? `pome run -n ${k}` : "pome run" : `pome run ${fileForRerun && !fileForRerun.startsWith("..") ? fileForRerun : file} -n ${k}`;
|
|
5079
5079
|
const groupResult = await runTrialGroup({
|
|
@@ -5167,7 +5167,7 @@ function createProgram() {
|
|
|
5167
5167
|
process.exitCode = 5;
|
|
5168
5168
|
return;
|
|
5169
5169
|
}
|
|
5170
|
-
const { runDemo } = await import('../../runDemo-
|
|
5170
|
+
const { runDemo } = await import('../../runDemo-JW6EGT66.js');
|
|
5171
5171
|
const result = await runDemo({
|
|
5172
5172
|
apiBase: opts.apiUrl.replace(/\/$/, ""),
|
|
5173
5173
|
dashboardBase: process.env.POME_DASHBOARD_URL ?? DEFAULT_DASHBOARD_URL,
|
|
@@ -5185,7 +5185,7 @@ function createProgram() {
|
|
|
5185
5185
|
program.command("doctor").description(
|
|
5186
5186
|
"Check the agent\u2194twin wiring: pome.json (or pome.yaml) present + valid, the local twin boots + serves, requests routed to the twin (not a hardcoded production host), egress floor active. On failure prints one named cause (file:line where knowable) + one concrete fix and exits non-zero."
|
|
5187
5187
|
).action(async () => {
|
|
5188
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5188
|
+
const { runDoctorChecks } = await import('../../checks-T3EWJXDT.js');
|
|
5189
5189
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5190
5190
|
const report = await runDoctorChecks();
|
|
5191
5191
|
for (const line of renderDoctorReport(report, { passNote: true })) console.error(line);
|
|
@@ -5361,7 +5361,7 @@ function createProgram() {
|
|
|
5361
5361
|
).description(
|
|
5362
5362
|
"Start a standalone twin as a long-lived foreground server (Ctrl-C to stop)"
|
|
5363
5363
|
).action(async (name, options) => {
|
|
5364
|
-
const { runTwinStartCommand } = await import('../../twinStart-
|
|
5364
|
+
const { runTwinStartCommand } = await import('../../twinStart-T7SKWGEL.js');
|
|
5365
5365
|
await runTwinStartCommand(name, options);
|
|
5366
5366
|
});
|
|
5367
5367
|
twin.command("reset").argument("[name]", "Twin name (default: github)", "github").description("Reset standalone twin state").action(async (name) => {
|
|
@@ -2,7 +2,7 @@ import './chunk-FKZZWWYC.js';
|
|
|
2
2
|
import { defaultSeedState, parseSeed } from './chunk-B22TYIEM.js';
|
|
3
3
|
export { defaultSeedState, parseSeed, seedSchema } from './chunk-B22TYIEM.js';
|
|
4
4
|
import { routeInputDeclarer, integerInput, mountDeclaredRoute, UndeclaredInputError, MalformedBodyError } from './chunk-2Q3P45LK.js';
|
|
5
|
-
import { loadMcpToolFixture, defineTwin, twinBuildInfo, deriveMcpToolTable, UnknownToolError, openTwinDatabase, createApp } from './chunk-
|
|
5
|
+
import { loadMcpToolFixture, defineTwin, twinBuildInfo, deriveMcpToolTable, UnknownToolError, openTwinDatabase, createApp } from './chunk-5EGHN6H4.js';
|
|
6
6
|
import './chunk-VBATFCWR.js';
|
|
7
7
|
import './chunk-SG6ZTIMT.js';
|
|
8
8
|
import { z, ZodError } from 'zod';
|
|
@@ -5652,9 +5652,17 @@ var githubTwinDefinition = defineTwin({
|
|
|
5652
5652
|
seed: ({ domain, seed, reportDelta }) => {
|
|
5653
5653
|
domain.seed(seed, reportDelta);
|
|
5654
5654
|
return { ok: true, repositories: seed.repositories.length };
|
|
5655
|
-
}
|
|
5656
|
-
//
|
|
5657
|
-
//
|
|
5655
|
+
},
|
|
5656
|
+
// F-1497: the admin-gate 403 body is BUILT HERE now, not defaulted in
|
|
5657
|
+
// `@pome-sh/sdk`. The gate is shared by all five twins, so its default
|
|
5658
|
+
// cannot carry GitHub's `documentation_url`/`status` leaves — and while
|
|
5659
|
+
// it defaulted, this twin's 403 said `documentation_url: ""`.
|
|
5660
|
+
//
|
|
5661
|
+
// The url is the GENERIC one on purpose. Real GitHub's measured 403s
|
|
5662
|
+
// name the operation (3 of 3, F-1490), but `/admin/*` is a twin-only
|
|
5663
|
+
// route with no GitHub operation behind it, which is the same reason
|
|
5664
|
+
// `/pulls/:n/diff` and `/pulls/:n/status` stay generic (divergence 32).
|
|
5665
|
+
forbidden: () => ({ status: 403, body: githubError("Forbidden", 403) })
|
|
5658
5666
|
},
|
|
5659
5667
|
tools: deriveMcpToolTable(githubToolFixture, githubToolImplementations),
|
|
5660
5668
|
// Frozen healthz shape: {ok, twin, implementation, fidelity, tools,
|
|
@@ -5685,21 +5693,38 @@ var githubTwinDefinition = defineTwin({
|
|
|
5685
5693
|
auth: {
|
|
5686
5694
|
// F-712 pins (wire-frozen): Bearer-header only (no extra token
|
|
5687
5695
|
// resolvers), raw bearer rejected (allowRawBearer=false), sid mismatch
|
|
5688
|
-
// → 401 {message:"Forbidden"}, and
|
|
5689
|
-
//
|
|
5690
|
-
//
|
|
5691
|
-
//
|
|
5692
|
-
//
|
|
5693
|
-
//
|
|
5696
|
+
// → 401 {message:"Forbidden"}, and an expired JWT rendering as
|
|
5697
|
+
// "Bad credentials". The pre-port explicit "Token expired" branch was
|
|
5698
|
+
// dead code: hono/jwt's verify throws JwtTokenExpired before the branch
|
|
5699
|
+
// was ever reached, so the wire always said "Bad credentials"
|
|
5700
|
+
// (pre-ruled: deleting it is zero wire diff).
|
|
5701
|
+
//
|
|
5702
|
+
// ── F-1497 changed two things about these bodies ────────────────────
|
|
5703
|
+
//
|
|
5704
|
+
// 1. They are built by `githubError` now instead of by hand, which is
|
|
5705
|
+
// what gives them the `documentation_url` and `status` leaves real
|
|
5706
|
+
// GitHub sends. Measured live 2026-08-13, 401 on `GET /user`:
|
|
5707
|
+
// `{"message":…,"documentation_url":"https://docs.github.com/rest","status":"401"}`.
|
|
5708
|
+
// The url is GitHub's GENERIC one and MUST STAY generic — GitHub
|
|
5709
|
+
// names no operation on a 401 because authentication fails before
|
|
5710
|
+
// dispatch (8 of 8 measured, F-1490), which is the half of
|
|
5711
|
+
// divergence 32 that is a requirement rather than a gap. `githubError`
|
|
5712
|
+
// defaults to exactly that url and this call passes no override.
|
|
5713
|
+
//
|
|
5714
|
+
// 2. A MISSING credential and a BAD one no longer say the same thing.
|
|
5715
|
+
// Real GitHub, same probe: no `Authorization` header at all answers
|
|
5716
|
+
// `Requires authentication`, a bad token answers `Bad credentials`.
|
|
5717
|
+
// The engine already classifies the two (`no_token` vs `invalid`);
|
|
5718
|
+
// this twin was collapsing them.
|
|
5694
5719
|
providerToken: { provider: "github", prefixes: ["ghp_pome_", "github_pat_pome_"] },
|
|
5695
5720
|
allowRawBearer: false,
|
|
5696
|
-
unauthorized: () => ({
|
|
5721
|
+
unauthorized: (kind) => ({
|
|
5697
5722
|
status: 401,
|
|
5698
|
-
body:
|
|
5723
|
+
body: githubError(kind === "no_token" ? "Requires authentication" : "Bad credentials", 401)
|
|
5699
5724
|
}),
|
|
5700
5725
|
sidMismatch: () => ({
|
|
5701
5726
|
status: 401,
|
|
5702
|
-
body:
|
|
5727
|
+
body: githubError("Forbidden", 401)
|
|
5703
5728
|
}),
|
|
5704
5729
|
sessionExtras: (claims) => typeof claims.login === "string" && claims.login.length > 0 ? { login: claims.login } : {}
|
|
5705
5730
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { SLACK_CHECKS } from './chunk-IDNSKKEC.js';
|
|
2
2
|
import './chunk-JWJYNAWI.js';
|
|
3
3
|
import { routeInputDeclarer, booleanInput, integerInput, mountDeclaredRoute, UndeclaredInputError } from './chunk-2Q3P45LK.js';
|
|
4
|
-
import { loadMcpToolFixture, defineTwin, queryTokenResolver, formTokenResolver, deriveMcpToolTable, UnknownToolError, openTwinDatabase, createApp } from './chunk-
|
|
4
|
+
import { loadMcpToolFixture, defineTwin, queryTokenResolver, formTokenResolver, deriveMcpToolTable, UnknownToolError, openTwinDatabase, createApp } from './chunk-5EGHN6H4.js';
|
|
5
5
|
import './chunk-VBATFCWR.js';
|
|
6
6
|
import './chunk-SG6ZTIMT.js';
|
|
7
7
|
import { z, ZodError } from 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { LINEAR_CHECKS } from './chunk-XBT6ZLBG.js';
|
|
2
|
-
import { MCP_PAGE_MAX, defaultSeedState, linearSeedSchema, notFound, badUserInput, MCP_PAGE_DEFAULT, DEFAULT_LINEAR_EMAIL, RELAY_PAGE_MAX, RELAY_PAGE_DEFAULT, STATE_EXPORT_CAP, parseSeed, DEFAULT_LINEAR_CLOCK, LINEAR_PROVIDER_TOKEN_PREFIX, DEFAULT_LINEAR_SID, DEFAULT_SCOPES, linearErrorEnvelope, unauthorizedEnvelope, unsupportedEnvelope, assertWebhookUrl, ACCESS_TOKEN_TTL_SECONDS, OAUTH_CODE_TTL_SECONDS, TITLE_MAX_BYTES, BODY_MAX_BYTES, LinearTwinError, GRAPHQL_QUERY_MAX_BYTES, GRAPHQL_SELECTION_DEPTH_MAX } from './chunk-
|
|
3
|
-
export { DEFAULT_LINEAR_CLOCK, DEFAULT_LINEAR_EMAIL, DEFAULT_LINEAR_PORT, DEFAULT_LINEAR_SID, DEFAULT_LINEAR_TOKEN, LINEAR_PROVIDER_TOKEN_PREFIX, LinearTwinError, STATE_EXPORT_CAP, assertWebhookUrl, defaultSeedState, linearErrorEnvelope, linearSeedSchema, loadSeedFromEnv, parseSeed, unauthorizedEnvelope, unsupportedEnvelope, webhookUrlError } from './chunk-
|
|
2
|
+
import { MCP_PAGE_MAX, defaultSeedState, linearSeedSchema, notFound, badUserInput, MCP_PAGE_DEFAULT, DEFAULT_LINEAR_EMAIL, RELAY_PAGE_MAX, RELAY_PAGE_DEFAULT, STATE_EXPORT_CAP, parseSeed, DEFAULT_LINEAR_CLOCK, LINEAR_PROVIDER_TOKEN_PREFIX, DEFAULT_LINEAR_SID, DEFAULT_SCOPES, linearErrorEnvelope, unauthorizedEnvelope, unsupportedEnvelope, forbiddenEnvelope, assertWebhookUrl, ACCESS_TOKEN_TTL_SECONDS, OAUTH_CODE_TTL_SECONDS, TITLE_MAX_BYTES, BODY_MAX_BYTES, LinearTwinError, GRAPHQL_QUERY_MAX_BYTES, GRAPHQL_SELECTION_DEPTH_MAX } from './chunk-IZIZC7ZW.js';
|
|
3
|
+
export { DEFAULT_LINEAR_CLOCK, DEFAULT_LINEAR_EMAIL, DEFAULT_LINEAR_PORT, DEFAULT_LINEAR_SID, DEFAULT_LINEAR_TOKEN, LINEAR_PROVIDER_TOKEN_PREFIX, LinearTwinError, STATE_EXPORT_CAP, assertWebhookUrl, defaultSeedState, linearErrorEnvelope, linearSeedSchema, loadSeedFromEnv, parseSeed, unauthorizedEnvelope, unsupportedEnvelope, webhookUrlError } from './chunk-IZIZC7ZW.js';
|
|
4
4
|
import './chunk-JWJYNAWI.js';
|
|
5
5
|
import { routeInputDeclarer, mountDeclaredRoute, UndeclaredInputError } from './chunk-2Q3P45LK.js';
|
|
6
|
-
import { loadMcpToolFixture, deriveMcpToolTable, openTwinDatabase, defineTwin, createApp } from './chunk-
|
|
6
|
+
import { loadMcpToolFixture, deriveMcpToolTable, openTwinDatabase, defineTwin, createApp } from './chunk-5EGHN6H4.js';
|
|
7
7
|
import './chunk-VBATFCWR.js';
|
|
8
8
|
import './chunk-SG6ZTIMT.js';
|
|
9
9
|
import { createHmac, timingSafeEqual, createHash, randomBytes } from 'node:crypto';
|
|
@@ -5461,7 +5461,10 @@ function createLinearTwinDefinition(db) {
|
|
|
5461
5461
|
domain.seed(seed);
|
|
5462
5462
|
reportDelta(linearStateDelta(before, domain.exportState()));
|
|
5463
5463
|
return { ok: true };
|
|
5464
|
-
}
|
|
5464
|
+
},
|
|
5465
|
+
// F-1497 — declared, so the shared gate in `@pome-sh/sdk` stops
|
|
5466
|
+
// answering a GraphQL twin with GitHub's `{message, documentation_url}`.
|
|
5467
|
+
forbidden: () => forbiddenEnvelope()
|
|
5465
5468
|
},
|
|
5466
5469
|
recordingProjection: projectLinearRecording,
|
|
5467
5470
|
errorEnvelope: linearErrorEnvelope,
|
|
@@ -5476,8 +5479,14 @@ function createLinearTwinDefinition(db) {
|
|
|
5476
5479
|
requirePathSid: false,
|
|
5477
5480
|
allowRawBearer: true,
|
|
5478
5481
|
resolveCredential: (token2) => resolveLinearCredential(db, token2),
|
|
5479
|
-
|
|
5480
|
-
|
|
5482
|
+
// Both take `unauthorizedEnvelope`'s default: Linear answers a bad
|
|
5483
|
+
// bearer and a missing one with the SAME body (measured 2026-08-13,
|
|
5484
|
+
// F-1497), and has no session-id concept to give the mismatch leg a
|
|
5485
|
+
// third one. The messages that used to be here — "Bad credentials" and
|
|
5486
|
+
// "Session id mismatch" — were the twin's own inventions, and the first
|
|
5487
|
+
// was GitHub's.
|
|
5488
|
+
unauthorized: () => unauthorizedEnvelope(),
|
|
5489
|
+
sidMismatch: () => unauthorizedEnvelope(),
|
|
5481
5490
|
sessionExtras: (claims) => ({
|
|
5482
5491
|
linear_email: typeof claims.linear_email === "string" && claims.linear_email.length > 0 ? claims.linear_email.toLowerCase() : DEFAULT_LINEAR_EMAIL,
|
|
5483
5492
|
scopes: [...DEFAULT_SCOPES]
|
|
@@ -3,7 +3,7 @@ import { gmailErrorEnvelope, gmailSeedSchema, parseSeed, defaultSeedState, notFo
|
|
|
3
3
|
export { DEFAULT_GMAIL_AGENT_EMAIL, GmailError, SEARCH_MAILBOX_MESSAGE_BUDGET, agentPathInboxMailbox, defaultSeedState, gmailErrorEnvelope, gmailSeedSchema, loadSeedFromEnv, parseSearchQuery, parseSeed, validateSearchQuery } from './chunk-NJ246QPJ.js';
|
|
4
4
|
import './chunk-JWJYNAWI.js';
|
|
5
5
|
import { routeInputDeclarer, integerInput, booleanInput, repeatedInput, mountDeclaredRoute, UndeclaredInputError, MalformedBodyError } from './chunk-2Q3P45LK.js';
|
|
6
|
-
import { loadMcpToolFixture, deriveMcpToolTable, defineTwin, openTwinDatabase, createApp } from './chunk-
|
|
6
|
+
import { loadMcpToolFixture, deriveMcpToolTable, defineTwin, openTwinDatabase, createApp } from './chunk-5EGHN6H4.js';
|
|
7
7
|
import './chunk-VBATFCWR.js';
|
|
8
8
|
import './chunk-SG6ZTIMT.js';
|
|
9
9
|
import { createHash, createHmac, timingSafeEqual, randomBytes } from 'node:crypto';
|
|
@@ -3861,18 +3861,20 @@ function registerGmailRoutes(app, context) {
|
|
|
3861
3861
|
}
|
|
3862
3862
|
|
|
3863
3863
|
// ../packages/twin-gmail/dist/src/twin.js
|
|
3864
|
-
|
|
3864
|
+
var OAUTH_TAIL = "Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.";
|
|
3865
|
+
function unauthorized(kind = "invalid") {
|
|
3866
|
+
const missing = kind === "no_token";
|
|
3865
3867
|
return {
|
|
3866
3868
|
status: 401,
|
|
3867
3869
|
body: {
|
|
3868
3870
|
error: {
|
|
3869
3871
|
code: 401,
|
|
3870
|
-
message:
|
|
3872
|
+
message: missing ? `Request is missing required authentication credential. ${OAUTH_TAIL}` : `Request had invalid authentication credentials. ${OAUTH_TAIL}`,
|
|
3871
3873
|
errors: [
|
|
3872
3874
|
{
|
|
3873
|
-
message: "Invalid Credentials",
|
|
3875
|
+
message: missing ? "Login Required." : "Invalid Credentials",
|
|
3874
3876
|
domain: "global",
|
|
3875
|
-
reason: "authError",
|
|
3877
|
+
reason: missing ? "required" : "authError",
|
|
3876
3878
|
location: "Authorization",
|
|
3877
3879
|
locationType: "header"
|
|
3878
3880
|
}
|
|
@@ -3882,6 +3884,19 @@ function unauthorized() {
|
|
|
3882
3884
|
}
|
|
3883
3885
|
};
|
|
3884
3886
|
}
|
|
3887
|
+
function adminForbidden() {
|
|
3888
|
+
return {
|
|
3889
|
+
status: 403,
|
|
3890
|
+
body: {
|
|
3891
|
+
error: {
|
|
3892
|
+
code: 403,
|
|
3893
|
+
message: "Forbidden",
|
|
3894
|
+
errors: [{ message: "Forbidden", domain: "global", reason: "forbidden" }],
|
|
3895
|
+
status: "PERMISSION_DENIED"
|
|
3896
|
+
}
|
|
3897
|
+
}
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
3885
3900
|
var gmailTwinDefinition = defineTwin({
|
|
3886
3901
|
id: "gmail",
|
|
3887
3902
|
version: process.env.POME_TWIN_VERSION ?? "0.1.0",
|
|
@@ -3910,7 +3925,8 @@ var gmailTwinDefinition = defineTwin({
|
|
|
3910
3925
|
domain.seed(seed);
|
|
3911
3926
|
reportDelta(gmailStateDelta(before, domain.exportState()));
|
|
3912
3927
|
return { ok: true };
|
|
3913
|
-
}
|
|
3928
|
+
},
|
|
3929
|
+
forbidden: adminForbidden
|
|
3914
3930
|
},
|
|
3915
3931
|
recordingProjection: projectGmailRecording,
|
|
3916
3932
|
errorEnvelope: gmailErrorEnvelope,
|
|
@@ -3927,7 +3943,9 @@ var gmailTwinDefinition = defineTwin({
|
|
|
3927
3943
|
}),
|
|
3928
3944
|
auth: {
|
|
3929
3945
|
unauthorized,
|
|
3930
|
-
|
|
3946
|
+
// A credential that belongs to another session is a credential this one
|
|
3947
|
+
// cannot use — the INVALID body, not the missing one.
|
|
3948
|
+
sidMismatch: () => unauthorized("invalid"),
|
|
3931
3949
|
sessionExtras: (claims) => ({
|
|
3932
3950
|
gmail_email: typeof claims.gmail_email === "string" && claims.gmail_email.length > 0 ? claims.gmail_email.toLowerCase() : DEFAULT_GMAIL_EMAIL
|
|
3933
3951
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { routeInputDeclarer, bracketedQuery, integerInput, booleanInput, mountDeclaredRoute, UndeclaredInputError } from './chunk-2Q3P45LK.js';
|
|
2
|
-
import { failureInjectionRuleSchema, loadMcpToolFixture, openTwinDatabase, createFailureInjectionStore, defineTwin, twinBuildInfo, deriveMcpToolTable, failureInjectionMiddleware, createApp, FAILURE_INJECTION_OVERRIDE_KEY, recordedRequestHeaders, UnknownToolError } from './chunk-
|
|
2
|
+
import { failureInjectionRuleSchema, loadMcpToolFixture, openTwinDatabase, createFailureInjectionStore, defineTwin, twinBuildInfo, deriveMcpToolTable, failureInjectionMiddleware, createApp, FAILURE_INJECTION_OVERRIDE_KEY, recordedRequestHeaders, UnknownToolError } from './chunk-5EGHN6H4.js';
|
|
3
3
|
import './chunk-VBATFCWR.js';
|
|
4
4
|
import './chunk-SG6ZTIMT.js';
|
|
5
5
|
import { z, ZodError } from 'zod';
|
|
@@ -4337,6 +4337,7 @@ function stripeToolInputSchema(schema) {
|
|
|
4337
4337
|
}
|
|
4338
4338
|
|
|
4339
4339
|
// ../packages/twin-stripe/dist/src/twin.js
|
|
4340
|
+
var NO_API_KEY_MESSAGE = "You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/.";
|
|
4340
4341
|
var stripeSeedSchema = z.preprocess((value) => value === null || value === void 0 ? defaultSeed() : value, seedSchema);
|
|
4341
4342
|
function tthwSeconds(startedAtMs, nowMs = Date.now) {
|
|
4342
4343
|
const ms = Math.max(0, nowMs() - startedAtMs);
|
|
@@ -4517,7 +4518,7 @@ function createStripeTwinDefinition(opts) {
|
|
|
4517
4518
|
return row ? { sid: row.sid, account_id: row.account_id, via: "api_key" } : void 0;
|
|
4518
4519
|
},
|
|
4519
4520
|
unauthorized: (kind, info) => {
|
|
4520
|
-
const message = kind === "expired" ? "Token expired" : info?.token && looksLikeApiKey(info.token) ? "Invalid API Key provided." : "Bad credentials";
|
|
4521
|
+
const message = kind === "no_token" ? NO_API_KEY_MESSAGE : kind === "expired" ? "Token expired" : info?.token && looksLikeApiKey(info.token) ? "Invalid API Key provided." : "Bad credentials";
|
|
4521
4522
|
const envelope = unauthorized(message);
|
|
4522
4523
|
return { status: envelope.status, body: envelope.body };
|
|
4523
4524
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { bootTwin } from './chunk-
|
|
2
|
-
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { bootTwin } from './chunk-VVMGE677.js';
|
|
2
|
+
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-AS477MNU.js';
|
|
3
|
+
import './chunk-5EGHN6H4.js';
|
|
4
4
|
import './chunk-VBATFCWR.js';
|
|
5
5
|
import './chunk-SG6ZTIMT.js';
|
|
6
6
|
import { randomBytes } from 'node:crypto';
|
package/package.json
CHANGED