@keystrokehq/cli 0.1.159 → 0.1.161

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.
@@ -1833,7 +1833,66 @@ function buildWorkflowCanvasGraph(source, options = {}) {
1833
1833
  return buildGraph(sourceFile, located, { resolveSlug: options.resolveSlug });
1834
1834
  }
1835
1835
  //#endregion
1836
- //#region ../../packages/sandbox/dist/resolve-sandbox-definition-DI1boqdr.mjs
1836
+ //#region ../../packages/sandbox/dist/sizes-bFiP6d6Y.mjs
1837
+ /** Author-facing VM size presets (t-shirt sizes; Daytona-aligned). */
1838
+ const SandboxSizeSchema = _enum([
1839
+ "small",
1840
+ "medium",
1841
+ "large"
1842
+ ]);
1843
+ const SIZE_RESOURCES = {
1844
+ small: {
1845
+ cpu: 1,
1846
+ memoryGiB: 1,
1847
+ diskGiB: 3,
1848
+ memoryMiB: 1024
1849
+ },
1850
+ medium: {
1851
+ cpu: 2,
1852
+ memoryGiB: 4,
1853
+ diskGiB: 8,
1854
+ memoryMiB: 4096
1855
+ },
1856
+ large: {
1857
+ cpu: 4,
1858
+ memoryGiB: 8,
1859
+ diskGiB: 10,
1860
+ memoryMiB: 8192
1861
+ }
1862
+ };
1863
+ /**
1864
+ * Daytona pay-as-you-go rates (USD per second of reserved resource).
1865
+ * @see https://www.daytona.io/docs/en/billing/
1866
+ */
1867
+ const DAYTONA_CPU_USD_PER_SECOND = 14e-6;
1868
+ const DAYTONA_MEMORY_USD_PER_GIB_SECOND = 45e-7;
1869
+ const DAYTONA_DISK_USD_PER_GIB_SECOND = 3e-8;
1870
+ function daytonaSandboxUsdPerSecond(resources) {
1871
+ return resources.cpu * DAYTONA_CPU_USD_PER_SECOND + resources.memoryGiB * DAYTONA_MEMORY_USD_PER_GIB_SECOND + resources.diskGiB * DAYTONA_DISK_USD_PER_GIB_SECOND;
1872
+ }
1873
+ /**
1874
+ * Pass-through µc/s for a size (ceil to match historical small rate: 18.59 → 19).
1875
+ * small 1/1/3 → 19, medium 2/4/8 → 47, large 4/8/10 → 93.
1876
+ */
1877
+ function vmSecondRateMicroCredits(size) {
1878
+ return Math.ceil(daytonaSandboxUsdPerSecond(resolveSandboxResources(size)) * 1e6);
1879
+ }
1880
+ /**
1881
+ * Scale factor for `vm_second` quantity so `quantity * 19µc` ≈ Daytona cost.
1882
+ * Fractional on purpose — charge math rounds after multiplying the small rate.
1883
+ */
1884
+ function vmSecondSizeMultiplier(size) {
1885
+ return vmSecondRateMicroCredits(normalizeSandboxSize(size)) / vmSecondRateMicroCredits("small");
1886
+ }
1887
+ vmSecondSizeMultiplier("small"), vmSecondSizeMultiplier("medium"), vmSecondSizeMultiplier("large");
1888
+ function normalizeSandboxSize(size) {
1889
+ return size ?? "small";
1890
+ }
1891
+ function resolveSandboxResources(size) {
1892
+ return SIZE_RESOURCES[normalizeSandboxSize(size)];
1893
+ }
1894
+ //#endregion
1895
+ //#region ../../packages/sandbox/dist/resolve-sandbox-definition-Bgbd2rfm.mjs
1837
1896
  const SKIP_DIRS$1$1 = new Set([".git", "node_modules"]);
1838
1897
  /** Recursively read a host file or directory into sandbox-relative `{ path, file }` entries. */
1839
1898
  function packDirFromDisk(rootPath) {
@@ -1869,7 +1928,7 @@ function runWithAppRoot(appRoot, fn) {
1869
1928
  return appRootStorage.run(appRoot, fn);
1870
1929
  }
1871
1930
  //#endregion
1872
- //#region ../../packages/sandbox/dist/files-D7-c4SBi.mjs
1931
+ //#region ../../packages/sandbox/dist/files-Bo1xCPZl.mjs
1873
1932
  const SandboxModeSchema = _enum(["in-process", "vm"]);
1874
1933
  const SandboxFileContentSchema = object({
1875
1934
  path: string(),
@@ -1911,14 +1970,20 @@ object({
1911
1970
  /** Sandbox execution mode. Defaults to in-process when omitted. */
1912
1971
  mode: SandboxModeSchema.optional(),
1913
1972
  files: SandboxFilesInputSchema.optional(),
1973
+ /** VM size preset. Requires `mode: "vm"`. Defaults to `small` when omitted. */
1974
+ size: SandboxSizeSchema.optional(),
1914
1975
  credentials: array(credentialInputSchema).optional(),
1915
1976
  env: SandboxEnvFnSchema.optional(),
1916
1977
  git: SandboxGitSchema.optional(),
1978
+ /**
1979
+ * One-shot install commands when the session sandbox is first created
1980
+ * (like Cursor `install` — not for starting long-lived servers).
1981
+ */
1917
1982
  setup: SandboxSetupSchema.optional()
1918
1983
  }).superRefine((value, ctx) => {
1919
- if ((value.credentials !== void 0 || value.env !== void 0 || value.git !== void 0 || value.setup !== void 0) && value.mode !== "vm") ctx.addIssue({
1984
+ if ((value.size !== void 0 || value.credentials !== void 0 || value.env !== void 0 || value.git !== void 0 || value.setup !== void 0) && value.mode !== "vm") ctx.addIssue({
1920
1985
  code: "custom",
1921
- message: "sandbox credentials, env, git, and setup require mode: \"vm\"",
1986
+ message: "sandbox size, credentials, env, git, and setup require mode: \"vm\"",
1922
1987
  path: ["mode"]
1923
1988
  });
1924
1989
  if ((value.env !== void 0 || value.git !== void 0) && !value.credentials?.length) ctx.addIssue({
@@ -1951,6 +2016,7 @@ object({
1951
2016
  object({
1952
2017
  key: string().optional(),
1953
2018
  mode: SandboxModeSchema.optional(),
2019
+ size: SandboxSizeSchema.optional(),
1954
2020
  files: array(SandboxFileSchema).optional(),
1955
2021
  credentials: array(credentialInputSchema).optional(),
1956
2022
  env: SandboxEnvFnSchema.optional(),
@@ -25454,6 +25520,8 @@ const organizationBilling = pgTable("organization_billing", {
25454
25520
  autoTopupThresholdMicroCredits: bigint("auto_topup_threshold_micro_credits", { mode: "number" }),
25455
25521
  autoTopupAmountMicroCredits: bigint("auto_topup_amount_micro_credits", { mode: "number" }),
25456
25522
  autoTopupPendingIntentId: text$1("auto_topup_pending_intent_id"),
25523
+ creditWarningSentAt: timestamp("credit_warning_sent_at", { withTimezone: true }),
25524
+ creditExhaustedSentAt: timestamp("credit_exhausted_sent_at", { withTimezone: true }),
25457
25525
  createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
25458
25526
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
25459
25527
  }, (table) => [index$1("organization_billing_stripe_customer_id_idx").on(table.stripeCustomerId)]);
@@ -25472,6 +25540,8 @@ const organizationBillingSqlite = sqliteTable("organization_billing", {
25472
25540
  autoTopupThresholdMicroCredits: integer("auto_topup_threshold_micro_credits"),
25473
25541
  autoTopupAmountMicroCredits: integer("auto_topup_amount_micro_credits"),
25474
25542
  autoTopupPendingIntentId: text("auto_topup_pending_intent_id"),
25543
+ creditWarningSentAt: integer("credit_warning_sent_at", { mode: "timestamp_ms" }),
25544
+ creditExhaustedSentAt: integer("credit_exhausted_sent_at", { mode: "timestamp_ms" }),
25475
25545
  createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
25476
25546
  updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
25477
25547
  }, (table) => [index("organization_billing_stripe_customer_id_idx").on(table.stripeCustomerId)]);
@@ -46623,4 +46693,4 @@ async function emitStoredRouteManifestForProject(projectRoot) {
46623
46693
  //#endregion
46624
46694
  export { artifactIndexFromModules as $, serializeRouteManifest as A, validateProjectModules as B, isModularManifestEmitCacheHit as C, pollRouteFromSourceSlug as D, pollGroupRouteFromId as E, tryReadProjectManifest as F, webhookMatchSchemaForBindings as G, validateUniqueAttachmentSlugs as H, validateAttachmentTargets as I, workflowRouteFromKey as J, webhookRouteFromEndpoint as K, validateImportedTriggerAttachment as L, sha256File as M, splitStoredRouteManifest as N, projectActionsFingerprint as O, toStoredRouteManifest as P, withMcpReadClient as Q, validateImportedWorkflowDefinition as R, integrationPackagesFingerprint as S, pollGroupId as T, validateUniqueTriggerSourceSlugs as U, validateTriggerAttachments as V, webhookManifestAttachmentSchemasFromBindings as W, PublicHttpUrlError as X, attachmentSlugFromRecord as Y, assertPublicHttpUrl as Z, emitStoredRouteManifestForProject as _, configureTelemetry as _t, buildPollGroups as a, computeCallSiteIds as at, importTriggerAttachments as b, shutdownTelemetry as bt, collectAgentAppSlugs as c, discoverEntries as ct, countAgentCredentials as d, readKeystrokeIgnoreDirective as dt, collectArtifactModules as et, discoverAgentEntries as f, shouldSkipKeystrokeModuleFile as ft, discoverWorkflows as g, captureException as gt, discoverWorkflowEntries as h, alias as ht, agentRouteFromKey as i, classifyCall as it, sha256Bytes as j, schemaToJson as k, collectAgentToolSlugs as l, discoverModuleFileEntries as lt, discoverTriggerAttachments as m, walkTypeScriptFiles as mt, agentKeyForAttachment as n, moduleBlobRefsFromModules as nt, buildStoredRouteManifestForProject as o, diagnoseWorkflowSource as ot, discoverSkillManifestEntries as p, validateUniqueModuleKeys as pt, workflowKeyForAttachment as q, agentManifestEntry as r, packDirFromDisk as rt, buildStoredRouteManifestFromContext as s, locateWorkflow as st, actionsCatalogFingerprint as t, mapInParallelBatches as tt, contentHashForModule as u, entryIdFromFile as ut, hashDirectoryContents as v, event as vt, persistModularRouteManifest as w, importWorkflowDefinition as x, importAgentDefinition as y, flushTelemetry as yt, validatePollGroups as z };
46625
46695
 
46626
- //# sourceMappingURL=dist-D-qnmHDz.mjs.map
46696
+ //# sourceMappingURL=dist-Dg-PHK0j.mjs.map