@keystrokehq/cli 0.1.89 → 0.1.91
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/{dist--rEosQWM.mjs → dist-BAOpw31u.mjs} +130 -10
- package/dist/dist-BAOpw31u.mjs.map +1 -0
- package/dist/dist-C2CYNwJz.mjs +3 -0
- package/dist/{dist-CKYkjDwF.mjs → dist-CNjsuUwx.mjs} +2 -2
- package/dist/{dist-CKYkjDwF.mjs.map → dist-CNjsuUwx.mjs.map} +1 -1
- package/dist/{dist-B-bOSK-t.mjs → dist-CppcpBQ9.mjs} +235 -175
- package/dist/dist-CppcpBQ9.mjs.map +1 -0
- package/dist/{dist-CtzRBy-4.mjs → dist-ZnMK-kgH.mjs} +3 -3
- package/dist/{dist-CtzRBy-4.mjs.map → dist-ZnMK-kgH.mjs.map} +1 -1
- package/dist/index.mjs +10 -10
- package/dist/{maybe-auto-update-C0AJd45Y.mjs → maybe-auto-update-CWdTMKQy.mjs} +2 -2
- package/dist/{maybe-auto-update-C0AJd45Y.mjs.map → maybe-auto-update-CWdTMKQy.mjs.map} +1 -1
- package/dist/{run-package-manager-update-C2PHSwh5.mjs → run-package-manager-update-DMMruzWa.mjs} +2 -2
- package/dist/{run-package-manager-update-C2PHSwh5.mjs.map → run-package-manager-update-DMMruzWa.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist--rEosQWM.mjs.map +0 -1
- package/dist/dist-27bn8V75.mjs +0 -3
- package/dist/dist-B-bOSK-t.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as __require, t as __commonJSMin } from "./chunk-DiodbrVj.mjs";
|
|
3
|
-
import { $r as toJSONSchema, Ar as ZodType, Br as lazy, Cr as parseStoredRouteManifest, Fr as array, Ir as boolean$1, Jr as string, Kr as preprocess, Lr as custom, Mr as _function, Nr as _null, Rr as discriminatedUnion, Ur as number, Vr as literal, Wr as object, Yr as union, cn as PromptResponseSchema, et as DEFAULT_CLOUD_PLATFORM_ORIGIN, fn as ROUTE_MANIFEST_REL_PATH, jr as _enum, ln as PublicModelsResponseSchema, mr as credentialInputSchema, qr as record, wr as requiredDisplayTextSchema, yr as normalizeCredentialList } from "./dist-
|
|
4
|
-
import "./dist-
|
|
3
|
+
import { $r as toJSONSchema, Ar as ZodType, Br as lazy, Cr as parseStoredRouteManifest, Fr as array, Ir as boolean$1, Jr as string, Kr as preprocess, Lr as custom, Mr as _function, Nr as _null, Rr as discriminatedUnion, Ur as number, Vr as literal, Wr as object, Yr as union, cn as PromptResponseSchema, et as DEFAULT_CLOUD_PLATFORM_ORIGIN, fn as ROUTE_MANIFEST_REL_PATH, jr as _enum, ln as PublicModelsResponseSchema, mr as credentialInputSchema, qr as record, wr as requiredDisplayTextSchema, yr as normalizeCredentialList } from "./dist-CppcpBQ9.mjs";
|
|
4
|
+
import "./dist-CNjsuUwx.mjs";
|
|
5
5
|
import "./chunk-BZUGFHVS-CPWRFwK8.mjs";
|
|
6
6
|
import "./chunk-DLL7UR66-BUYgzxnR.mjs";
|
|
7
7
|
import "./chunk-TN7HHBQW-CSB_R-XD.mjs";
|
|
@@ -3350,12 +3350,17 @@ const resourceActivitySqlite = sqliteTable("resource_activity", {
|
|
|
3350
3350
|
lastOpenedAt: integer$1("last_opened_at", { mode: "timestamp_ms" }).notNull()
|
|
3351
3351
|
}, (table) => [uniqueIndex$1("resource_activity_project_user_kind_resource").on(table.projectId, table.userId, table.resourceKind, table.resourceId), index$1("resource_activity_user_last_opened_at").on(table.userId, table.lastOpenedAt)]);
|
|
3352
3352
|
/**
|
|
3353
|
+
* Legacy org-runtime billing cache. Platform cloud financial authority now
|
|
3354
|
+
* lives in `@keystrokehq/platform-database`; keep this table for existing org
|
|
3355
|
+
* databases and pushed-down runtime plan hints, but do not add new billing
|
|
3356
|
+
* writers here.
|
|
3357
|
+
*
|
|
3353
3358
|
* Single-row prepaid credit wallet + pushed-down plan config for the org
|
|
3354
3359
|
* (the org runtime DB is per-org). Cache of `SUM(usage_records.microCredits)`,
|
|
3355
3360
|
* updated in the same transaction as each ledger insert. Cloud-only: standalone
|
|
3356
3361
|
* never writes it. All billing logic lives in `packages/cloud/*`.
|
|
3357
3362
|
*/
|
|
3358
|
-
const billingWallet = pgTable("billing_wallet", {
|
|
3363
|
+
const billingWallet$1 = pgTable("billing_wallet", {
|
|
3359
3364
|
organizationId: text("organization_id").primaryKey(),
|
|
3360
3365
|
planCreditMicroCredits: bigint("plan_credit_micro_credits", { mode: "number" }).notNull().default(0),
|
|
3361
3366
|
prepaidCreditMicroCredits: bigint("prepaid_credit_micro_credits", { mode: "number" }).notNull().default(0),
|
|
@@ -3373,7 +3378,7 @@ const billingWallet = pgTable("billing_wallet", {
|
|
|
3373
3378
|
autoTopupThresholdMicroCredits: bigint("auto_topup_threshold_micro_credits", { mode: "number" }),
|
|
3374
3379
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
3375
3380
|
});
|
|
3376
|
-
const billingWalletSqlite = sqliteTable("billing_wallet", {
|
|
3381
|
+
const billingWalletSqlite$1 = sqliteTable("billing_wallet", {
|
|
3377
3382
|
organizationId: text$1("organization_id").primaryKey(),
|
|
3378
3383
|
planCreditMicroCredits: integer$1("plan_credit_micro_credits").notNull().default(0),
|
|
3379
3384
|
prepaidCreditMicroCredits: integer$1("prepaid_credit_micro_credits").notNull().default(0),
|
|
@@ -3480,14 +3485,13 @@ const tableRegistry$1 = {
|
|
|
3480
3485
|
sqlite: resourceActivitySqlite
|
|
3481
3486
|
},
|
|
3482
3487
|
billingWallet: {
|
|
3483
|
-
pg: billingWallet,
|
|
3484
|
-
sqlite: billingWalletSqlite
|
|
3488
|
+
pg: billingWallet$1,
|
|
3489
|
+
sqlite: billingWalletSqlite$1
|
|
3485
3490
|
}
|
|
3486
3491
|
};
|
|
3487
3492
|
buildPgSchema$1(tableRegistry$1);
|
|
3488
3493
|
buildSqliteSchema$1(tableRegistry$1);
|
|
3489
|
-
|
|
3490
|
-
//#region ../../packages/agent/dist/schemas-4m3ayl5o.mjs
|
|
3494
|
+
new AsyncLocalStorage();
|
|
3491
3495
|
const AGENT_MODEL_ID_PATTERN = /^[a-z0-9-]+\/.+/;
|
|
3492
3496
|
const AgentModelIdSchema = custom((value) => typeof value === "string" && AGENT_MODEL_ID_PATTERN.test(value), "model must be vendor/model-id");
|
|
3493
3497
|
const GatewayModelPricingSchema = object({
|
|
@@ -3517,8 +3521,20 @@ const ThinkingLevelSchema = _enum([
|
|
|
3517
3521
|
object({
|
|
3518
3522
|
systemPrompt: string(),
|
|
3519
3523
|
model: AgentModelIdSchema,
|
|
3524
|
+
/**
|
|
3525
|
+
* Optional model used only for context compaction. Same `vendor/model-id` form as
|
|
3526
|
+
* `model`. When omitted, Keystroke uses {@link DEFAULT_COMPACTION_MODEL_ID}.
|
|
3527
|
+
*/
|
|
3528
|
+
compactionModel: AgentModelIdSchema.optional(),
|
|
3520
3529
|
thinkingLevel: ThinkingLevelSchema.optional()
|
|
3521
3530
|
});
|
|
3531
|
+
[
|
|
3532
|
+
"You compress long agent conversation history into a compact context summary.",
|
|
3533
|
+
"Preserve durable facts, decisions, IDs, file paths, unresolved tasks, and recent tool outcomes.",
|
|
3534
|
+
"Omit chit-chat, repeated tool dumps, and superseded drafts.",
|
|
3535
|
+
"Write plain prose the primary agent can continue from. Do not call tools.",
|
|
3536
|
+
"Respond with ONLY the summary text."
|
|
3537
|
+
].join("\n");
|
|
3522
3538
|
//#endregion
|
|
3523
3539
|
//#region ../../packages/action/dist/index.mjs
|
|
3524
3540
|
const zodSchema$3 = custom((v) => v instanceof ZodType, "must be a Zod schema");
|
|
@@ -13949,6 +13965,96 @@ const billingEventsSqlite = sqliteTable("billing_events", {
|
|
|
13949
13965
|
metadata: text$1("metadata", { mode: "json" }),
|
|
13950
13966
|
createdAt: integer$1("created_at", { mode: "timestamp_ms" }).notNull()
|
|
13951
13967
|
}, (table) => [uniqueIndex$1("billing_events_stripe_event_id_unique").on(table.stripeEventId), index$1("billing_events_organization_id_idx").on(table.organizationId)]);
|
|
13968
|
+
/**
|
|
13969
|
+
* Platform billing authority: one narrow wallet projection per organization.
|
|
13970
|
+
* Plan limits stay in `organization_billing` / pushed-down runtime config.
|
|
13971
|
+
*/
|
|
13972
|
+
const billingWallet = pgTable("billing_wallet", {
|
|
13973
|
+
organizationId: text("organization_id").primaryKey().references(() => organizations.id, { onDelete: "cascade" }),
|
|
13974
|
+
planCreditMicroCredits: bigint("plan_credit_micro_credits", { mode: "number" }).notNull().default(0),
|
|
13975
|
+
prepaidCreditMicroCredits: bigint("prepaid_credit_micro_credits", { mode: "number" }).notNull().default(0),
|
|
13976
|
+
periodStart: timestamp("period_start", { withTimezone: true }),
|
|
13977
|
+
periodEnd: timestamp("period_end", { withTimezone: true }),
|
|
13978
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
13979
|
+
});
|
|
13980
|
+
const billingWalletSqlite = sqliteTable("billing_wallet", {
|
|
13981
|
+
organizationId: text$1("organization_id").primaryKey().references(() => organizationsSqlite.id, { onDelete: "cascade" }),
|
|
13982
|
+
planCreditMicroCredits: integer$1("plan_credit_micro_credits").notNull().default(0),
|
|
13983
|
+
prepaidCreditMicroCredits: integer$1("prepaid_credit_micro_credits").notNull().default(0),
|
|
13984
|
+
periodStart: integer$1("period_start", { mode: "timestamp_ms" }),
|
|
13985
|
+
periodEnd: integer$1("period_end", { mode: "timestamp_ms" }),
|
|
13986
|
+
updatedAt: integer$1("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
13987
|
+
});
|
|
13988
|
+
/** Immutable platform financial history. */
|
|
13989
|
+
const billingLedger = pgTable("billing_ledger", {
|
|
13990
|
+
id: text("id").primaryKey(),
|
|
13991
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
13992
|
+
entryType: text("entry_type").$type().notNull(),
|
|
13993
|
+
planDeltaMicroCredits: bigint("plan_delta_micro_credits", { mode: "number" }).notNull().default(0),
|
|
13994
|
+
prepaidDeltaMicroCredits: bigint("prepaid_delta_micro_credits", { mode: "number" }).notNull().default(0),
|
|
13995
|
+
source: text("source").notNull(),
|
|
13996
|
+
idempotencyKey: text("idempotency_key").notNull(),
|
|
13997
|
+
runId: text("run_id"),
|
|
13998
|
+
projectId: text("project_id"),
|
|
13999
|
+
providerReference: text("provider_reference"),
|
|
14000
|
+
metadata: jsonb("metadata"),
|
|
14001
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull()
|
|
14002
|
+
}, (table) => [uniqueIndex("billing_ledger_org_idempotency_unique").on(table.organizationId, table.idempotencyKey), index("billing_ledger_org_created_at_idx").on(table.organizationId, table.createdAt)]);
|
|
14003
|
+
const billingLedgerSqlite = sqliteTable("billing_ledger", {
|
|
14004
|
+
id: text$1("id").primaryKey(),
|
|
14005
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id, { onDelete: "cascade" }),
|
|
14006
|
+
entryType: text$1("entry_type").$type().notNull(),
|
|
14007
|
+
planDeltaMicroCredits: integer$1("plan_delta_micro_credits").notNull().default(0),
|
|
14008
|
+
prepaidDeltaMicroCredits: integer$1("prepaid_delta_micro_credits").notNull().default(0),
|
|
14009
|
+
source: text$1("source").notNull(),
|
|
14010
|
+
idempotencyKey: text$1("idempotency_key").notNull(),
|
|
14011
|
+
runId: text$1("run_id"),
|
|
14012
|
+
projectId: text$1("project_id"),
|
|
14013
|
+
providerReference: text$1("provider_reference"),
|
|
14014
|
+
metadata: text$1("metadata", { mode: "json" }),
|
|
14015
|
+
createdAt: integer$1("created_at", { mode: "timestamp_ms" }).notNull()
|
|
14016
|
+
}, (table) => [uniqueIndex$1("billing_ledger_org_idempotency_unique").on(table.organizationId, table.idempotencyKey), index$1("billing_ledger_org_created_at_idx").on(table.organizationId, table.createdAt)]);
|
|
14017
|
+
/** Append-only platform meter facts, priced before insertion by the server. */
|
|
14018
|
+
const usageEvents = pgTable("usage_events", {
|
|
14019
|
+
id: text("id").primaryKey(),
|
|
14020
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
14021
|
+
projectId: text("project_id"),
|
|
14022
|
+
runId: text("run_id"),
|
|
14023
|
+
runKind: text("run_kind").$type(),
|
|
14024
|
+
source: text("source").notNull(),
|
|
14025
|
+
sourceEventId: text("source_event_id").notNull(),
|
|
14026
|
+
meterKey: text("meter_key").notNull(),
|
|
14027
|
+
quantity: doublePrecision("quantity").notNull(),
|
|
14028
|
+
unit: text("unit").notNull(),
|
|
14029
|
+
providerCostUsd: doublePrecision("provider_cost_usd"),
|
|
14030
|
+
keySource: text("key_source").$type(),
|
|
14031
|
+
priceVersion: text("price_version").notNull(),
|
|
14032
|
+
chargeMicroCredits: bigint("charge_micro_credits", { mode: "number" }).notNull(),
|
|
14033
|
+
settledLedgerId: text("settled_ledger_id"),
|
|
14034
|
+
occurredAt: timestamp("occurred_at", { withTimezone: true }).notNull(),
|
|
14035
|
+
acceptedAt: timestamp("accepted_at", { withTimezone: true }).notNull(),
|
|
14036
|
+
metadata: jsonb("metadata")
|
|
14037
|
+
}, (table) => [uniqueIndex("usage_events_org_source_event_unique").on(table.organizationId, table.source, table.sourceEventId), index("usage_events_org_run_occurred_idx").on(table.organizationId, table.runId, table.occurredAt)]);
|
|
14038
|
+
const usageEventsSqlite = sqliteTable("usage_events", {
|
|
14039
|
+
id: text$1("id").primaryKey(),
|
|
14040
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id, { onDelete: "cascade" }),
|
|
14041
|
+
projectId: text$1("project_id"),
|
|
14042
|
+
runId: text$1("run_id"),
|
|
14043
|
+
runKind: text$1("run_kind").$type(),
|
|
14044
|
+
source: text$1("source").notNull(),
|
|
14045
|
+
sourceEventId: text$1("source_event_id").notNull(),
|
|
14046
|
+
meterKey: text$1("meter_key").notNull(),
|
|
14047
|
+
quantity: real("quantity").notNull(),
|
|
14048
|
+
unit: text$1("unit").notNull(),
|
|
14049
|
+
providerCostUsd: real("provider_cost_usd"),
|
|
14050
|
+
keySource: text$1("key_source").$type(),
|
|
14051
|
+
priceVersion: text$1("price_version").notNull(),
|
|
14052
|
+
chargeMicroCredits: integer$1("charge_micro_credits").notNull(),
|
|
14053
|
+
settledLedgerId: text$1("settled_ledger_id"),
|
|
14054
|
+
occurredAt: integer$1("occurred_at", { mode: "timestamp_ms" }).notNull(),
|
|
14055
|
+
acceptedAt: integer$1("accepted_at", { mode: "timestamp_ms" }).notNull(),
|
|
14056
|
+
metadata: text$1("metadata", { mode: "json" })
|
|
14057
|
+
}, (table) => [uniqueIndex$1("usage_events_org_source_event_unique").on(table.organizationId, table.source, table.sourceEventId), index$1("usage_events_org_run_occurred_idx").on(table.organizationId, table.runId, table.occurredAt)]);
|
|
13952
14058
|
const managedServiceCredentials = pgTable("managed_service_credentials", {
|
|
13953
14059
|
id: text("id").primaryKey(),
|
|
13954
14060
|
organizationId: text("organization_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
@@ -14063,6 +14169,18 @@ const tableRegistry = {
|
|
|
14063
14169
|
pg: billingEvents,
|
|
14064
14170
|
sqlite: billingEventsSqlite
|
|
14065
14171
|
},
|
|
14172
|
+
billingWallet: {
|
|
14173
|
+
pg: billingWallet,
|
|
14174
|
+
sqlite: billingWalletSqlite
|
|
14175
|
+
},
|
|
14176
|
+
billingLedger: {
|
|
14177
|
+
pg: billingLedger,
|
|
14178
|
+
sqlite: billingLedgerSqlite
|
|
14179
|
+
},
|
|
14180
|
+
usageEvents: {
|
|
14181
|
+
pg: usageEvents,
|
|
14182
|
+
sqlite: usageEventsSqlite
|
|
14183
|
+
},
|
|
14066
14184
|
managedServiceCredentials: {
|
|
14067
14185
|
pg: managedServiceCredentials,
|
|
14068
14186
|
sqlite: managedServiceCredentialsSqlite
|
|
@@ -29904,6 +30022,7 @@ function agentManifestEntry(agent, options) {
|
|
|
29904
30022
|
name: agent.name,
|
|
29905
30023
|
description: agent.description,
|
|
29906
30024
|
model: agent.model,
|
|
30025
|
+
...agent.compactionModel !== void 0 ? { compactionModel: agent.compactionModel } : {},
|
|
29907
30026
|
systemPrompt: agent.systemPrompt,
|
|
29908
30027
|
toolCount: agent.tools?.length ?? 0,
|
|
29909
30028
|
credentialCount: countAgentCredentials(agent),
|
|
@@ -30247,6 +30366,7 @@ function serializeRouteManifest(manifest) {
|
|
|
30247
30366
|
name: entry.name,
|
|
30248
30367
|
description: entry.description,
|
|
30249
30368
|
model: entry.model,
|
|
30369
|
+
...entry.compactionModel !== void 0 ? { compactionModel: entry.compactionModel } : {},
|
|
30250
30370
|
systemPrompt: entry.systemPrompt,
|
|
30251
30371
|
toolCount: entry.toolCount,
|
|
30252
30372
|
credentialCount: entry.credentialCount,
|
|
@@ -30843,7 +30963,7 @@ async function buildStoredRouteManifestForProject(projectRoot, options) {
|
|
|
30843
30963
|
entry,
|
|
30844
30964
|
agent: await importAgentDefinition(entry.filePath, reload)
|
|
30845
30965
|
})));
|
|
30846
|
-
await validateAgentModelIds(loadedAgents.
|
|
30966
|
+
await validateAgentModelIds(loadedAgents.flatMap(({ agent }) => agent.compactionModel ? [agent.model, agent.compactionModel] : [agent.model]));
|
|
30847
30967
|
const resolvedAgents = [];
|
|
30848
30968
|
for (const { entry, agent } of loadedAgents) {
|
|
30849
30969
|
const moduleFile = await sourcePaths.resolve("agents", "agent", dirs.agentsDir, entry.filePath);
|
|
@@ -31009,4 +31129,4 @@ async function emitStoredRouteManifestForProject(projectRoot) {
|
|
|
31009
31129
|
//#endregion
|
|
31010
31130
|
export { validatePollGroups as A, attachmentSlugFromRecord as B, pollRouteFromSourceSlug as C, validateAttachmentTargets as D, toStoredRouteManifest as E, webhookManifestAttachmentSchemasFromBindings as F, packAssetDirs as G, computeCallSiteIds as H, webhookMatchSchemaForBindings as I, entryIdFromFile as J, discoverEntries as K, webhookRouteFromEndpoint as L, validateTriggerAttachments as M, validateUniqueAttachmentSlugs as N, validateImportedTriggerAttachment as O, validateUniqueTriggerSourceSlugs as P, walkTypeScriptFiles as Q, workflowKeyForAttachment as R, pollGroupRouteFromId as S, serializeRouteManifest as T, diagnoseWorkflowSource as U, classifyCall as V, locateWorkflow as W, shouldSkipKeystrokeModuleFile as X, readKeystrokeIgnoreDirective as Y, validateUniqueModuleKeys as Z, importAgentDefinition as _, buildStoredRouteManifestForProject as a, persistStoredRouteManifest as b, collectAgentAppSlugs as c, discoverAgentEntries as d, discoverSkillManifestEntries as f, emitStoredRouteManifestForProject as g, discoverWorkflows as h, buildPollGroups as i, validateProjectModules as j, validateImportedWorkflowDefinition as k, collectAgentToolSlugs as l, discoverWorkflowEntries as m, agentManifestEntry as n, buildStoredRouteManifestFromContext as o, discoverTriggerAttachments as p, discoverModuleFileEntries as q, agentRouteFromKey as r, buildWebhookBindingsByRoute as s, agentKeyForAttachment as t, countAgentCredentials as u, importTriggerAttachments as v, schemaToJson as w, pollGroupId as x, importWorkflowDefinition as y, workflowRouteFromKey as z };
|
|
31011
31131
|
|
|
31012
|
-
//# sourceMappingURL=dist
|
|
31132
|
+
//# sourceMappingURL=dist-BAOpw31u.mjs.map
|