@pome-sh/cli 0.23.50 → 0.24.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.
- package/dist/build-info.json +3 -3
- package/dist/{checks-YRMP2JX7.js → checks-QFWWMBDU.js} +3 -3
- package/dist/{chunk-SIJP5OCX.js → chunk-FH3W7IRL.js} +1 -1
- package/dist/{chunk-UZDZM67T.js → chunk-GXQVX6IQ.js} +8 -3
- package/dist/{chunk-ECMAQH5H.js → chunk-KBE4RT5T.js} +3 -3
- package/dist/{chunk-ABM3CMQB.js → chunk-LA6BHJ5H.js} +1 -1
- package/dist/{chunk-R6YWMPGO.js → chunk-PMM3VKN6.js} +2 -2
- package/dist/{chunk-P6PGKXS5.js → chunk-QFQTZ6L4.js} +2 -2
- package/dist/{chunk-X66JOOO7.js → chunk-QYCUNR2V.js} +13 -0
- package/dist/{runDemo-EK4AMZVR.js → runDemo-TXFZWHHJ.js} +5 -5
- package/dist/{runTrialGroup-RLR2JD3T.js → runTrialGroup-KTTAYFWE.js} +5 -5
- package/dist/src/cli/main.js +13 -13
- package/dist/{src-BAPCY3ID.js → src-FZPIGBIO.js} +60 -36
- package/dist/twinHarness-ASAPUQJT.js +5 -0
- package/dist/{twinStart-BF375EBE.js → twinStart-PZNMEDBK.js} +2 -2
- package/package.json +1 -1
- package/dist/twinHarness-5UJQR4QM.js +0 -5
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-08-
|
|
3
|
+
"version": "0.24.0",
|
|
4
|
+
"git_sha": "9158b590adb2d241a803fe2c6206e6674e392dd3",
|
|
5
|
+
"build_time": "2026-08-18T10:26:51.900Z"
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { findManifestPath, readManifest } from './chunk-
|
|
1
|
+
import { findManifestPath, readManifest } from './chunk-LA6BHJ5H.js';
|
|
2
2
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
3
3
|
import { buildEgressAllowlist } from './chunk-CBFKZZBR.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-QYCUNR2V.js';
|
|
5
5
|
import './chunk-VBATFCWR.js';
|
|
6
6
|
import './chunk-SG6ZTIMT.js';
|
|
7
7
|
import { serve } from '@hono/node-server';
|
|
@@ -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-ASAPUQJT.js');
|
|
187
187
|
harness = await bootTwin({
|
|
188
188
|
twin: "github",
|
|
189
189
|
seedState: void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-
|
|
1
|
+
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-PMM3VKN6.js';
|
|
2
2
|
import { createFileBackedRecorderStore, createRecorderStore } from './chunk-5EGHN6H4.js';
|
|
3
3
|
|
|
4
4
|
// src/recorder/recorder.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { criterionSchema, finalizeResponseSchema, HostedDiscardRefusedError, HostedOrchError, HostedAuthError, HostedQuotaError, submitResultResponseSchema, createEvalSessionResponseSchema, createSessionResponseSchema, sessionPublicSchema } from './chunk-
|
|
1
|
+
import { criterionSchema, finalizeResponseSchema, HostedDiscardRefusedError, HostedOrchError, HostedAuthError, HostedQuotaError, submitResultResponseSchema, createEvalSessionResponseSchema, createSessionResponseSchema, sessionPublicSchema } from './chunk-QYCUNR2V.js';
|
|
2
2
|
import { seedSchema, parseSeed, defaultSeedState as defaultSeedState$2 } from './chunk-B22TYIEM.js';
|
|
3
3
|
import { gmailSeedSchema, defaultSeedState } from './chunk-NJ246QPJ.js';
|
|
4
4
|
import { linearSeedSchema, defaultSeedState as defaultSeedState$1 } from './chunk-IZIZC7ZW.js';
|
|
5
|
-
import { isTwinName, TWIN_REGISTRY } from './chunk-
|
|
5
|
+
import { isTwinName, TWIN_REGISTRY } from './chunk-PMM3VKN6.js';
|
|
6
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';
|
|
@@ -190,7 +190,12 @@ var stripeSeedStateSchema = z.object({
|
|
|
190
190
|
var slackSeedStateSchema = z.object({
|
|
191
191
|
team: z.record(z.string(), z.unknown()).optional(),
|
|
192
192
|
users: z.array(z.record(z.string(), z.unknown())).default([]),
|
|
193
|
-
channels: z.array(z.record(z.string(), z.unknown())).default([])
|
|
193
|
+
channels: z.array(z.record(z.string(), z.unknown())).default([]),
|
|
194
|
+
// F-1509. Permissive like its siblings — the vendored `parseSeed` does the
|
|
195
|
+
// regex-level validation. It has to be listed at all because `.strict()`
|
|
196
|
+
// REJECTS an unlisted key: without this line a slack seed declaring `files`
|
|
197
|
+
// fails to parse rather than being stripped.
|
|
198
|
+
files: z.array(z.record(z.string(), z.unknown())).default([])
|
|
194
199
|
}).strict();
|
|
195
200
|
var seedStateSchema = z.union([
|
|
196
201
|
gmailSeedSchema,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readManifest, normalizeManifestTwins } from './chunk-
|
|
2
|
-
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-
|
|
3
|
-
import { MOUNTED_TWINS, HostedAuthError, HostedDiscardRefusedError, HostedQuotaError, HostedOrchError, HostedTrialError, agentResponseSchema } from './chunk-
|
|
1
|
+
import { readManifest, normalizeManifestTwins } from './chunk-LA6BHJ5H.js';
|
|
2
|
+
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-GXQVX6IQ.js';
|
|
3
|
+
import { MOUNTED_TWINS, HostedAuthError, HostedDiscardRefusedError, HostedQuotaError, HostedOrchError, HostedTrialError, agentResponseSchema } from './chunk-QYCUNR2V.js';
|
|
4
4
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
5
5
|
import { randomUUID, createHash } from 'node:crypto';
|
|
6
6
|
import { rm, readFile, stat, mkdir, writeFile, chmod, mkdtemp, readdir, rename } from 'node:fs/promises';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HostedOrchError, manifestSchema, deriveAgentSlug, SLUG_RE } from './chunk-
|
|
1
|
+
import { HostedOrchError, manifestSchema, deriveAgentSlug, SLUG_RE } from './chunk-QYCUNR2V.js';
|
|
2
2
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve, join, dirname } from 'node:path';
|
|
4
4
|
import { stringify, parse } from 'yaml';
|
|
@@ -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-FZPIGBIO.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-FZPIGBIO.js');
|
|
65
65
|
const db = openSlackTwinDatabase(":memory:");
|
|
66
66
|
const domain = new SlackDomain(db);
|
|
67
67
|
domain.applySeed(seedState);
|
|
@@ -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-GXQVX6IQ.js';
|
|
4
|
+
import { createRecorder, bootTwin } from './chunk-FH3W7IRL.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';
|
|
@@ -415,6 +415,19 @@ var slackSeedStateSchema = z.object({
|
|
|
415
415
|
).default([])
|
|
416
416
|
})
|
|
417
417
|
).default([]),
|
|
418
|
+
// F-1509. Mirrors `seedSchema.files` in `@pome-sh/twin-slack`. `user` and
|
|
419
|
+
// `channels` are seed HANDLES (a user/channel `name`) or ids.
|
|
420
|
+
files: z.array(
|
|
421
|
+
z.object({
|
|
422
|
+
id: z.string().regex(/^F[A-Z0-9_]+$/).optional(),
|
|
423
|
+
name: z.string().min(1),
|
|
424
|
+
title: z.string().optional(),
|
|
425
|
+
filetype: z.string().min(1).default("text"),
|
|
426
|
+
user: z.string().optional(),
|
|
427
|
+
channels: z.array(z.string()).default([]),
|
|
428
|
+
content: z.string().optional()
|
|
429
|
+
})
|
|
430
|
+
).default([]),
|
|
418
431
|
emoji: z.array(
|
|
419
432
|
z.object({
|
|
420
433
|
name: z.string().regex(/^[a-z0-9_+-]{1,100}$/),
|
|
@@ -1,16 +1,16 @@
|
|
|
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-QFQTZ6L4.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-GXQVX6IQ.js';
|
|
7
7
|
import './chunk-NW7HGA2K.js';
|
|
8
|
-
import { HostedQuotaError, HostedOrchError } from './chunk-
|
|
8
|
+
import { HostedQuotaError, HostedOrchError } from './chunk-QYCUNR2V.js';
|
|
9
9
|
import './chunk-B22TYIEM.js';
|
|
10
10
|
import './chunk-NJ246QPJ.js';
|
|
11
11
|
import './chunk-IZIZC7ZW.js';
|
|
12
|
-
import { bootTwin } from './chunk-
|
|
13
|
-
import './chunk-
|
|
12
|
+
import { bootTwin } from './chunk-FH3W7IRL.js';
|
|
13
|
+
import './chunk-PMM3VKN6.js';
|
|
14
14
|
import './chunk-5EGHN6H4.js';
|
|
15
15
|
import './chunk-VBATFCWR.js';
|
|
16
16
|
import './chunk-SG6ZTIMT.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { newGroupId, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
|
-
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-
|
|
2
|
+
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-KBE4RT5T.js';
|
|
3
|
+
import './chunk-LA6BHJ5H.js';
|
|
4
|
+
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-GXQVX6IQ.js';
|
|
5
5
|
import './chunk-NW7HGA2K.js';
|
|
6
|
-
import { HostedQuotaError, HostedTrialError } from './chunk-
|
|
6
|
+
import { HostedQuotaError, HostedTrialError } from './chunk-QYCUNR2V.js';
|
|
7
7
|
import './chunk-B22TYIEM.js';
|
|
8
8
|
import './chunk-NJ246QPJ.js';
|
|
9
9
|
import './chunk-IZIZC7ZW.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-PMM3VKN6.js';
|
|
11
11
|
import './chunk-5EGHN6H4.js';
|
|
12
12
|
import './chunk-VBATFCWR.js';
|
|
13
13
|
import './chunk-SG6ZTIMT.js';
|
package/dist/src/cli/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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-
|
|
3
|
-
import { readManifest, writeManifest, MANIFEST_JSON, readRequiredManifest, normalizeManifestTwins } from '../../chunk-
|
|
4
|
-
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } 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-KBE4RT5T.js';
|
|
3
|
+
import { readManifest, writeManifest, MANIFEST_JSON, readRequiredManifest, normalizeManifestTwins } from '../../chunk-LA6BHJ5H.js';
|
|
4
|
+
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-QFQTZ6L4.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-GXQVX6IQ.js';
|
|
8
8
|
import '../../chunk-NW7HGA2K.js';
|
|
9
|
-
import { MOUNTED_TWINS, deriveAgentSlug, exitCodeFor, HostedUsageError, HostedOrchError, HostedAuthError, HostedQuotaError } from '../../chunk-
|
|
9
|
+
import { MOUNTED_TWINS, deriveAgentSlug, exitCodeFor, HostedUsageError, HostedOrchError, HostedAuthError, HostedQuotaError } from '../../chunk-QYCUNR2V.js';
|
|
10
10
|
import { TAPE_ASSERTABLE_TOOLS } from '../../chunk-C4BVTUA3.js';
|
|
11
11
|
import { seedSchema } from '../../chunk-B22TYIEM.js';
|
|
12
12
|
import { SLACK_CHECKS } from '../../chunk-IDNSKKEC.js';
|
|
@@ -15,8 +15,8 @@ import '../../chunk-NJ246QPJ.js';
|
|
|
15
15
|
import { LINEAR_CHECKS } from '../../chunk-XBT6ZLBG.js';
|
|
16
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-
|
|
18
|
+
import '../../chunk-FH3W7IRL.js';
|
|
19
|
+
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-PMM3VKN6.js';
|
|
20
20
|
import '../../chunk-5EGHN6H4.js';
|
|
21
21
|
import { isLegacyEventRow, eventSchema } from '../../chunk-VBATFCWR.js';
|
|
22
22
|
import { redactEvent, redactSecrets } from '../../chunk-SG6ZTIMT.js';
|
|
@@ -4651,7 +4651,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
|
4651
4651
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
4652
4652
|
var MAX_UNREADABLE_PATHS_SHOWN = 5;
|
|
4653
4653
|
function readPackageVersion() {
|
|
4654
|
-
if ("0.
|
|
4654
|
+
if ("0.24.0".length > 0) return "0.24.0";
|
|
4655
4655
|
try {
|
|
4656
4656
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
4657
4657
|
const candidates = [
|
|
@@ -5106,7 +5106,7 @@ function createProgram() {
|
|
|
5106
5106
|
return;
|
|
5107
5107
|
}
|
|
5108
5108
|
{
|
|
5109
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5109
|
+
const { runDoctorChecks } = await import('../../checks-QFWWMBDU.js');
|
|
5110
5110
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5111
5111
|
const doctorReport = await runDoctorChecks({ mode: useLocal ? "full" : "hosted" });
|
|
5112
5112
|
if (!doctorReport.ok) {
|
|
@@ -5144,7 +5144,7 @@ function createProgram() {
|
|
|
5144
5144
|
taskForRuns.config.runs
|
|
5145
5145
|
);
|
|
5146
5146
|
if (k > 1) {
|
|
5147
|
-
const { runTrialGroup } = await import('../../runTrialGroup-
|
|
5147
|
+
const { runTrialGroup } = await import('../../runTrialGroup-KTTAYFWE.js');
|
|
5148
5148
|
const fileForRerun = relative(process.cwd(), file);
|
|
5149
5149
|
const rerunCommand = defaultTask ? options.trials !== void 0 ? `pome run -n ${k}` : "pome run" : `pome run ${fileForRerun && !fileForRerun.startsWith("..") ? fileForRerun : file} -n ${k}`;
|
|
5150
5150
|
const groupResult = await runTrialGroup({
|
|
@@ -5238,7 +5238,7 @@ function createProgram() {
|
|
|
5238
5238
|
process.exitCode = 5;
|
|
5239
5239
|
return;
|
|
5240
5240
|
}
|
|
5241
|
-
const { runDemo } = await import('../../runDemo-
|
|
5241
|
+
const { runDemo } = await import('../../runDemo-TXFZWHHJ.js');
|
|
5242
5242
|
const result = await runDemo({
|
|
5243
5243
|
apiBase: opts.apiUrl.replace(/\/$/, ""),
|
|
5244
5244
|
dashboardBase: process.env.POME_DASHBOARD_URL ?? DEFAULT_DASHBOARD_URL,
|
|
@@ -5256,7 +5256,7 @@ function createProgram() {
|
|
|
5256
5256
|
program.command("doctor").description(
|
|
5257
5257
|
"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."
|
|
5258
5258
|
).action(async () => {
|
|
5259
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5259
|
+
const { runDoctorChecks } = await import('../../checks-QFWWMBDU.js');
|
|
5260
5260
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5261
5261
|
const report = await runDoctorChecks();
|
|
5262
5262
|
for (const line of renderDoctorReport(report, { passNote: true })) console.error(line);
|
|
@@ -5432,7 +5432,7 @@ function createProgram() {
|
|
|
5432
5432
|
).description(
|
|
5433
5433
|
"Start a standalone twin as a long-lived foreground server (Ctrl-C to stop)"
|
|
5434
5434
|
).action(async (name, options) => {
|
|
5435
|
-
const { runTwinStartCommand } = await import('../../twinStart-
|
|
5435
|
+
const { runTwinStartCommand } = await import('../../twinStart-PZNMEDBK.js');
|
|
5436
5436
|
await runTwinStartCommand(name, options);
|
|
5437
5437
|
});
|
|
5438
5438
|
twin.command("reset").argument("[name]", "Twin name (default: github)", "github").description("Reset standalone twin state").action(async (name) => {
|
|
@@ -923,6 +923,18 @@ var seedSchema = z.object({
|
|
|
923
923
|
reactions: z.array(z.object({ name: z.string(), user: z.string() })).default([])
|
|
924
924
|
})).default([])
|
|
925
925
|
})).default([]),
|
|
926
|
+
// F-1509. Files present in the world before the agent runs. `user` and
|
|
927
|
+
// `channels` are seed HANDLES (a user/channel `name`) or ids — the same
|
|
928
|
+
// currency `channels[].members` and `channels[].messages[].user` already use.
|
|
929
|
+
files: z.array(z.object({
|
|
930
|
+
id: z.string().regex(/^F[A-Z0-9_]+$/).optional(),
|
|
931
|
+
name: z.string().min(1),
|
|
932
|
+
title: z.string().optional(),
|
|
933
|
+
filetype: z.string().min(1).default("text"),
|
|
934
|
+
user: z.string().optional(),
|
|
935
|
+
channels: z.array(z.string()).default([]),
|
|
936
|
+
content: z.string().optional()
|
|
937
|
+
})).default([]),
|
|
926
938
|
emoji: z.array(z.object({
|
|
927
939
|
name: z.string().regex(/^[a-z0-9_+-]{1,100}$/),
|
|
928
940
|
url: z.string().url().optional(),
|
|
@@ -1016,42 +1028,6 @@ function defaultSeedState() {
|
|
|
1016
1028
|
};
|
|
1017
1029
|
}
|
|
1018
1030
|
|
|
1019
|
-
// ../packages/twin-slack/dist/src/domain/bookmarks.js
|
|
1020
|
-
function bookmarksAdd(domain, args, actor, onDelta = NOOP3) {
|
|
1021
|
-
const channel = domain.requireChannel(args.channel_id);
|
|
1022
|
-
if (!args.title)
|
|
1023
|
-
slackError("invalid_arguments", 400);
|
|
1024
|
-
if (!args.link && (!args.type || args.type === "link"))
|
|
1025
|
-
slackError("invalid_arguments", 400);
|
|
1026
|
-
const acting = domain.resolveActorUser(actor);
|
|
1027
|
-
const id = domain.allocId(domain.requireWorkspace().id, "Bk");
|
|
1028
|
-
const out = domain.db.transaction(() => {
|
|
1029
|
-
domain.db.prepare(`INSERT INTO bookmarks (id, channel_id, title, link, emoji, type, created_by, created_at)
|
|
1030
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`).run(id, channel.id, args.title, args.link ?? "", args.emoji ?? null, args.type ?? "link", acting.id, nowIso());
|
|
1031
|
-
const after = domain.db.prepare(`SELECT * FROM bookmarks WHERE id = ?`).get(id);
|
|
1032
|
-
onDelta({ before: null, after });
|
|
1033
|
-
return { bookmark: serializeBookmark(after) };
|
|
1034
|
-
})();
|
|
1035
|
-
return out;
|
|
1036
|
-
}
|
|
1037
|
-
function bookmarksRemove(domain, args, actor, onDelta = NOOP3) {
|
|
1038
|
-
const channel = domain.requireChannel(args.channel_id);
|
|
1039
|
-
const before = domain.db.prepare(`SELECT * FROM bookmarks WHERE id = ? AND channel_id = ?`).get(args.bookmark_id, channel.id);
|
|
1040
|
-
if (!before)
|
|
1041
|
-
slackError("no_bookmark_found", 404);
|
|
1042
|
-
const out = domain.db.transaction(() => {
|
|
1043
|
-
domain.db.prepare(`DELETE FROM bookmarks WHERE id = ?`).run(before.id);
|
|
1044
|
-
onDelta({ before, after: null });
|
|
1045
|
-
return {};
|
|
1046
|
-
})();
|
|
1047
|
-
return out;
|
|
1048
|
-
}
|
|
1049
|
-
function bookmarksList(domain, args) {
|
|
1050
|
-
const channel = domain.requireChannel(args.channel_id);
|
|
1051
|
-
const rows = domain.db.prepare(`SELECT * FROM bookmarks WHERE channel_id = ? ORDER BY created_at`).all(channel.id);
|
|
1052
|
-
return { bookmarks: rows.map((row) => serializeBookmark(row)) };
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
1031
|
// ../packages/twin-slack/dist/src/domain/helpers.js
|
|
1056
1032
|
function clampLimit(value, max, fallback) {
|
|
1057
1033
|
if (!Number.isFinite(value) || value === void 0)
|
|
@@ -1095,6 +1071,42 @@ function filetypeMimetype(filetype) {
|
|
|
1095
1071
|
return mapping[filetype] ?? "application/octet-stream";
|
|
1096
1072
|
}
|
|
1097
1073
|
|
|
1074
|
+
// ../packages/twin-slack/dist/src/domain/bookmarks.js
|
|
1075
|
+
function bookmarksAdd(domain, args, actor, onDelta = NOOP3) {
|
|
1076
|
+
const channel = domain.requireChannel(args.channel_id);
|
|
1077
|
+
if (!args.title)
|
|
1078
|
+
slackError("invalid_arguments", 400);
|
|
1079
|
+
if (!args.link && (!args.type || args.type === "link"))
|
|
1080
|
+
slackError("invalid_arguments", 400);
|
|
1081
|
+
const acting = domain.resolveActorUser(actor);
|
|
1082
|
+
const id = domain.allocId(domain.requireWorkspace().id, "Bk");
|
|
1083
|
+
const out = domain.db.transaction(() => {
|
|
1084
|
+
domain.db.prepare(`INSERT INTO bookmarks (id, channel_id, title, link, emoji, type, created_by, created_at)
|
|
1085
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`).run(id, channel.id, args.title, args.link ?? "", args.emoji ?? null, args.type ?? "link", acting.id, nowIso());
|
|
1086
|
+
const after = domain.db.prepare(`SELECT * FROM bookmarks WHERE id = ?`).get(id);
|
|
1087
|
+
onDelta({ before: null, after });
|
|
1088
|
+
return { bookmark: serializeBookmark(after) };
|
|
1089
|
+
})();
|
|
1090
|
+
return out;
|
|
1091
|
+
}
|
|
1092
|
+
function bookmarksRemove(domain, args, actor, onDelta = NOOP3) {
|
|
1093
|
+
const channel = domain.requireChannel(args.channel_id);
|
|
1094
|
+
const before = domain.db.prepare(`SELECT * FROM bookmarks WHERE id = ? AND channel_id = ?`).get(args.bookmark_id, channel.id);
|
|
1095
|
+
if (!before)
|
|
1096
|
+
slackError("no_bookmark_found", 404);
|
|
1097
|
+
const out = domain.db.transaction(() => {
|
|
1098
|
+
domain.db.prepare(`DELETE FROM bookmarks WHERE id = ?`).run(before.id);
|
|
1099
|
+
onDelta({ before, after: null });
|
|
1100
|
+
return {};
|
|
1101
|
+
})();
|
|
1102
|
+
return out;
|
|
1103
|
+
}
|
|
1104
|
+
function bookmarksList(domain, args) {
|
|
1105
|
+
const channel = domain.requireChannel(args.channel_id);
|
|
1106
|
+
const rows = domain.db.prepare(`SELECT * FROM bookmarks WHERE channel_id = ? ORDER BY created_at`).all(channel.id);
|
|
1107
|
+
return { bookmarks: rows.map((row) => serializeBookmark(row)) };
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1098
1110
|
// ../packages/twin-slack/dist/src/domain/chat.js
|
|
1099
1111
|
function chatPostMessage(domain, args, actor, onDelta = NOOP3) {
|
|
1100
1112
|
const channel = domain.requireChannel(args.channel);
|
|
@@ -1882,9 +1894,12 @@ var SlackDomain = class {
|
|
|
1882
1894
|
this.db.prepare(`INSERT INTO users (id, team_id, name, real_name, display_name, email, is_bot, is_admin, deleted, tz, profile_json, created_at, updated_at)
|
|
1883
1895
|
VALUES (?, ?, 'pome-agent', 'Pome Agent', '', 'pome-agent@pome-twin.slack.com', 0, 1, 0, 'America/Los_Angeles', '{}', ?, ?)`).run(id, teamId, now, now);
|
|
1884
1896
|
}
|
|
1897
|
+
const channelIdByHandle = /* @__PURE__ */ new Map();
|
|
1885
1898
|
const seedChannels = state.channels ?? [];
|
|
1886
1899
|
for (const ch of seedChannels) {
|
|
1887
1900
|
const channelId = ch.id ?? this.allocId(teamId, ch.is_private ? "G" : "C");
|
|
1901
|
+
channelIdByHandle.set(ch.name, channelId);
|
|
1902
|
+
channelIdByHandle.set(channelId, channelId);
|
|
1888
1903
|
const creator = this.resolveSeedUserId(ch.creator, userIdByHandle) ?? DEFAULT_BOT_USER;
|
|
1889
1904
|
this.db.prepare(`INSERT INTO channels (id, team_id, name, is_channel, is_group, is_im, is_mpim, is_private, is_archived, topic, purpose, creator, created_at, ts_counter)
|
|
1890
1905
|
VALUES (?, ?, ?, ?, ?, 0, 0, ?, 0, ?, ?, ?, ?, 0)`).run(channelId, teamId, ch.name, ch.is_private ? 0 : 1, ch.is_private ? 1 : 0, ch.is_private ? 1 : 0, ch.topic ?? "", ch.purpose ?? "", creator, now);
|
|
@@ -1918,6 +1933,15 @@ var SlackDomain = class {
|
|
|
1918
1933
|
}
|
|
1919
1934
|
}
|
|
1920
1935
|
}
|
|
1936
|
+
for (const f of state.files ?? []) {
|
|
1937
|
+
const fileId = f.id ?? this.allocId(teamId, "F");
|
|
1938
|
+
const uploader = this.resolveSeedUserId(f.user, userIdByHandle) ?? DEFAULT_BOT_USER;
|
|
1939
|
+
const channelIds = (f.channels ?? []).map((ref) => channelIdByHandle.get(ref)).filter((id) => id !== void 0);
|
|
1940
|
+
const filetype = f.filetype ?? "text";
|
|
1941
|
+
const content = f.content ?? null;
|
|
1942
|
+
this.db.prepare(`INSERT INTO files (id, team_id, user_id, name, title, mimetype, filetype, size, url_private, channels_json, deleted, content, created_at)
|
|
1943
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, '', ?, 0, ?, ?)`).run(fileId, teamId, uploader, f.name, f.title ?? f.name, filetypeMimetype(filetype), filetype, content === null ? 0 : Buffer.byteLength(content, "utf8"), JSON.stringify(channelIds), content, now);
|
|
1944
|
+
}
|
|
1921
1945
|
const seedEmoji = state.emoji ?? [];
|
|
1922
1946
|
if (seedEmoji.length > 0) {
|
|
1923
1947
|
seedEmojiRows(this.db, teamId, seedEmoji);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bootTwin } from './chunk-
|
|
2
|
-
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-
|
|
1
|
+
import { bootTwin } from './chunk-FH3W7IRL.js';
|
|
2
|
+
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-PMM3VKN6.js';
|
|
3
3
|
import './chunk-5EGHN6H4.js';
|
|
4
4
|
import './chunk-VBATFCWR.js';
|
|
5
5
|
import './chunk-SG6ZTIMT.js';
|
package/package.json
CHANGED