nodal-agents 0.5.0 → 0.5.3

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.
Files changed (192) hide show
  1. package/README.md +9 -1
  2. package/cli.js +60 -7
  3. package/migrations/0037_agent_jobs_total_cost_usd.sql +11 -11
  4. package/migrations/0038_agent_jobs_served_provider.sql +7 -7
  5. package/migrations/0039_agent_skills_learning_loop.sql +20 -20
  6. package/migrations/0040_entities_last_curator_run.sql +7 -7
  7. package/migrations/0041_reflection_enabled.sql +1 -1
  8. package/migrations/0042_drop_agent_runs.sql +1 -1
  9. package/migrations/0043_skill_assignment.sql +2 -2
  10. package/migrations/0044_entities_lan_command_yolo.sql +1 -0
  11. package/migrations/0045_app_settings.sql +5 -0
  12. package/migrations/0046_skill_assignment_scripts_authorized.sql +1 -0
  13. package/migrations/0047_agent_schedules_timezone.sql +1 -0
  14. package/migrations/0048_entities_timezone.sql +1 -0
  15. package/migrations/meta/_journal.json +342 -307
  16. package/package.json +1 -1
  17. package/runner.js +3681 -1592
  18. package/web/.next/BUILD_ID +1 -1
  19. package/web/.next/app-path-routes-manifest.json +2 -1
  20. package/web/.next/build-manifest.json +2 -2
  21. package/web/.next/routes-manifest.json +6 -0
  22. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js +5 -3
  23. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js.nft.json +1 -1
  24. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  25. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js +2 -2
  26. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/agents/page.js +2 -2
  29. package/web/.next/server/app/(dashboard)/agents/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/approvals/page.js +2 -2
  32. package/web/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/automations/page.js +2 -2
  35. package/web/.next/server/app/(dashboard)/automations/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/automations/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/billing/page.js +2 -2
  38. package/web/.next/server/app/(dashboard)/billing/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/billing/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/chat/page.js +2 -2
  41. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/connectors/page.js +2 -2
  44. package/web/.next/server/app/(dashboard)/connectors/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/connectors/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/credentials/page.js +2 -2
  47. package/web/.next/server/app/(dashboard)/credentials/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js +2 -2
  50. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/jobs/page.js +2 -2
  53. package/web/.next/server/app/(dashboard)/jobs/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(dashboard)/learned-skills/page.js +2 -2
  56. package/web/.next/server/app/(dashboard)/learned-skills/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/learned-skills/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/llm-providers/page.js +2 -2
  59. package/web/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(dashboard)/logs/page.js +2 -2
  62. package/web/.next/server/app/(dashboard)/logs/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/logs/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(dashboard)/mcp/page.js +2 -2
  65. package/web/.next/server/app/(dashboard)/mcp/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(dashboard)/mcp/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/(dashboard)/memories/page.js +2 -2
  68. package/web/.next/server/app/(dashboard)/memories/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/memories/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/page.js +4 -4
  71. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  72. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/(dashboard)/settings/page.js +2 -2
  74. package/web/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/(dashboard)/settings/root-context/page.js +2 -0
  77. package/web/.next/server/app/(dashboard)/settings/root-context/page.js.nft.json +1 -0
  78. package/web/.next/server/app/(dashboard)/settings/root-context/page_client-reference-manifest.js +1 -0
  79. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js +2 -2
  80. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js.nft.json +1 -1
  81. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page_client-reference-manifest.js +1 -1
  82. package/web/.next/server/app/(dashboard)/skills/new/page.js +2 -2
  83. package/web/.next/server/app/(dashboard)/skills/new/page.js.nft.json +1 -1
  84. package/web/.next/server/app/(dashboard)/skills/new/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/app/(dashboard)/skills/page.js +2 -2
  86. package/web/.next/server/app/(dashboard)/skills/page.js.nft.json +1 -1
  87. package/web/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  88. package/web/.next/server/app/_global-error/page.js +3 -3
  89. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  90. package/web/.next/server/app/_global-error.html +1 -1
  91. package/web/.next/server/app/_global-error.rsc +2 -2
  92. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  93. package/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  94. package/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  95. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  96. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  97. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  98. package/web/.next/server/app/_not-found/page.js +2 -2
  99. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  100. package/web/.next/server/app/_not-found.html +1 -1
  101. package/web/.next/server/app/_not-found.rsc +3 -3
  102. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  103. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  104. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  105. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  106. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  107. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  108. package/web/.next/server/app/api/auth/[...all]/route.js +1 -1
  109. package/web/.next/server/app/api/health/route.js +1 -1
  110. package/web/.next/server/app/api/oauth/[provider]/callback/route.js +1 -1
  111. package/web/.next/server/app/api/oauth/[provider]/start/route.js +1 -1
  112. package/web/.next/server/app/auth/callback/route.js +1 -1
  113. package/web/.next/server/app/login/page.js +2 -2
  114. package/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  115. package/web/.next/server/app/onboarding/page.js +2 -2
  116. package/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  117. package/web/.next/server/app/onboarding.html +1 -1
  118. package/web/.next/server/app/onboarding.rsc +3 -3
  119. package/web/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
  120. package/web/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  121. package/web/.next/server/app/onboarding.segments/_index.segment.rsc +3 -3
  122. package/web/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  123. package/web/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +1 -1
  124. package/web/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  125. package/web/.next/server/app-paths-manifest.json +2 -1
  126. package/web/.next/server/chunks/1544.js +1 -0
  127. package/web/.next/server/chunks/1827.js +1 -0
  128. package/web/.next/server/chunks/3188.js +1 -0
  129. package/web/.next/server/chunks/3636.js +1 -1
  130. package/web/.next/server/chunks/4370.js +1425 -0
  131. package/web/.next/server/chunks/4574.js +1 -1
  132. package/web/.next/server/chunks/473.js +1 -0
  133. package/web/.next/server/chunks/6200.js +1 -0
  134. package/web/.next/server/chunks/652.js +709 -0
  135. package/web/.next/server/chunks/6778.js +1 -0
  136. package/web/.next/server/chunks/7415.js +1 -0
  137. package/web/.next/server/middleware-build-manifest.js +1 -1
  138. package/web/.next/server/pages/404.html +1 -1
  139. package/web/.next/server/pages/500.html +1 -1
  140. package/web/.next/server/server-reference-manifest.js +1 -1
  141. package/web/.next/server/server-reference-manifest.json +1 -1
  142. package/web/.next/static/chunks/6097-12165ea99c077896.js +1 -0
  143. package/web/.next/static/chunks/{7164-a5cae6a1833041a7.js → 7164-080c206b663d64b2.js} +1 -1
  144. package/web/.next/static/chunks/{6908-e8114db85dca4371.js → 8666-90a1f5d99b79411e.js} +1 -1
  145. package/web/.next/static/chunks/9711-628acc64d23620d2.js +1 -0
  146. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-72e5a7541de7e969.js +4 -0
  147. package/web/.next/static/chunks/app/(dashboard)/approvals/page-8556dfa45a425603.js +1 -0
  148. package/web/.next/static/chunks/app/(dashboard)/connectors/page-6c4c1c753858c7b8.js +1 -0
  149. package/web/.next/static/chunks/app/(dashboard)/credentials/page-ef2666c5ac3ede9b.js +1 -0
  150. package/web/.next/static/chunks/app/(dashboard)/layout-a34502d1a8386a62.js +1 -0
  151. package/web/.next/static/chunks/app/(dashboard)/mcp/page-d53d13942bd635a4.js +1 -0
  152. package/web/.next/static/chunks/app/(dashboard)/memories/page-ebcc28ea081ae566.js +1 -0
  153. package/web/.next/static/chunks/app/(dashboard)/settings/page-b3cc57c577895cac.js +1 -0
  154. package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-6830a271484d97d5.js +1 -0
  155. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-ddd8ebba5889c9a4.js +1 -0
  156. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-6246f9236b209e76.js +1 -0
  157. package/web/.next/static/chunks/app/error-f106e9e65e16edb3.js +1 -0
  158. package/web/.next/static/css/f93e519b745ac2de.css +3 -0
  159. package/web/.next/static/myxe5H5Kmyn7MUh1XMxek/_buildManifest.js +1 -0
  160. package/web/public/connector-icons/airtable.svg +13 -0
  161. package/web/public/connector-icons/git.svg +3 -0
  162. package/web/public/connector-icons/github.svg +10 -0
  163. package/web/public/connector-icons/gmail.svg +14 -0
  164. package/web/public/connector-icons/google-docs.svg +12 -0
  165. package/web/public/connector-icons/google-drive.svg +8 -0
  166. package/web/public/connector-icons/google-sheets.svg +25 -0
  167. package/web/public/connector-icons/notion.svg +3 -0
  168. package/web/public/connector-icons/postgresql.svg +14 -0
  169. package/web/public/connector-icons/sentry.svg +10 -0
  170. package/web/public/connector-icons/stripe.svg +4 -0
  171. package/web/.next/server/chunks/1567.js +0 -16
  172. package/web/.next/server/chunks/4108.js +0 -1
  173. package/web/.next/server/chunks/511.js +0 -1
  174. package/web/.next/server/chunks/7741.js +0 -1223
  175. package/web/.next/server/chunks/8978.js +0 -1
  176. package/web/.next/server/chunks/9798.js +0 -1
  177. package/web/.next/static/PbmIekL33DORo2X47l_Ar/_buildManifest.js +0 -1
  178. package/web/.next/static/chunks/3178-bde220b789f10130.js +0 -1
  179. package/web/.next/static/chunks/6347-6d9d5ab25cbd59b9.js +0 -1
  180. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-651673d70c193f79.js +0 -2
  181. package/web/.next/static/chunks/app/(dashboard)/approvals/page-6d8c74fd86d2d3c3.js +0 -1
  182. package/web/.next/static/chunks/app/(dashboard)/connectors/page-6591a8753b6a19c1.js +0 -1
  183. package/web/.next/static/chunks/app/(dashboard)/credentials/page-19061f4a8bf1978f.js +0 -1
  184. package/web/.next/static/chunks/app/(dashboard)/layout-509579b7d75ffd9d.js +0 -1
  185. package/web/.next/static/chunks/app/(dashboard)/mcp/page-f9337250ed07249e.js +0 -1
  186. package/web/.next/static/chunks/app/(dashboard)/memories/page-b935752c6cb36a04.js +0 -1
  187. package/web/.next/static/chunks/app/(dashboard)/settings/page-5862a4767233ec26.js +0 -1
  188. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-85c75cc88ee1d6a8.js +0 -1
  189. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-9b0777fccb89a00b.js +0 -1
  190. package/web/.next/static/chunks/app/error-61e58aa304e1b34e.js +0 -1
  191. package/web/.next/static/css/46db738e95b440c0.css +0 -3
  192. /package/web/.next/static/{PbmIekL33DORo2X47l_Ar → myxe5H5Kmyn7MUh1XMxek}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -215,7 +215,7 @@ pnpm deps:check # runs locally and in CI before every release
215
215
 
216
216
  ## Status
217
217
 
218
- **Current release:** `0.5.0` on npm `latest`. Used daily by the
218
+ **Current release:** `0.5.2` on npm `latest`. Used daily by the
219
219
  maintainer, stable enough for personal production. Pre-1.0 — breaking
220
220
  changes are still possible between minors.
221
221
 
@@ -270,6 +270,14 @@ changes are still possible between minors.
270
270
  - ROOT agent — your first orchestrator automatically becomes the workspace ROOT (the single top-level agent; later orchestrators slot under it). It can create *and update* skills, create agents and assign them, and create MCP servers + API connectors — each gated by per-grant toggles + an autonomy/approval level (powers start off, opt in per grant). Provisioning verifies before it writes (an MCP server is connected and its tools listed first); skill authoring is grounded in the workspace's real tools (a linter rejects skills referencing tools the agent doesn't have)
271
271
  - Office file editing — Excel in-place edit, Word/PowerPoint create, in the agent workspace (office-editing skill)
272
272
  - Multiple filesystem folders per agent (sandboxed `file_*` tools)
273
+ - **Shell execution** — agents can run shell commands in their workspace
274
+ (`run_command`: install deps, run scripts, build steps) via an opt-in
275
+ `command-execution` skill. Safe-by-default: every command pauses for your
276
+ approval, with an optional per-agent auto-run ("Yolo"). On a shared / LAN
277
+ install auto-run is gated behind an explicit workspace-owner opt-in and
278
+ **enforced at execution time** — flip the workspace switch off and even an
279
+ already-trusted agent drops back to requiring approval. A live bell surfaces
280
+ pending approvals from anywhere in the dashboard
273
281
  - Telegram delivery (long-poll, group filters, multi-agent routing,
274
282
  delegation gracefulness) — exactly-once delivery contract: anti-spam guard
275
283
  against runaway message loops + a guard that re-prompts (then fails loud)
package/cli.js CHANGED
@@ -12127,12 +12127,16 @@ var init_root_agent = __esm({
12127
12127
  AutonomyLevelSchema = z18.enum(["propose_confirm", "destructive_gate", "fully_autonomous"]);
12128
12128
  RootGrantsSchema = z18.object({
12129
12129
  createAgent: z18.boolean(),
12130
+ updateAgent: z18.boolean(),
12130
12131
  attachAgent: z18.boolean(),
12131
12132
  createSkill: z18.boolean(),
12132
12133
  updateSkill: z18.boolean(),
12133
12134
  assignSkill: z18.boolean(),
12134
12135
  createMcp: z18.boolean(),
12136
+ attachMcp: z18.boolean(),
12135
12137
  createConnector: z18.boolean(),
12138
+ attachConnector: z18.boolean(),
12139
+ manageSchedules: z18.boolean(),
12136
12140
  autonomy: AutonomyLevelSchema
12137
12141
  });
12138
12142
  }
@@ -12152,6 +12156,13 @@ var init_model_catalog = __esm({
12152
12156
  }
12153
12157
  });
12154
12158
 
12159
+ // ../../packages/shared/src/timezone.ts
12160
+ var init_timezone = __esm({
12161
+ "../../packages/shared/src/timezone.ts"() {
12162
+ "use strict";
12163
+ }
12164
+ });
12165
+
12155
12166
  // ../../packages/shared/src/index.ts
12156
12167
  var init_src2 = __esm({
12157
12168
  "../../packages/shared/src/index.ts"() {
@@ -12177,6 +12188,7 @@ var init_src2 = __esm({
12177
12188
  init_root_agent();
12178
12189
  init_connector_catalog();
12179
12190
  init_model_catalog();
12191
+ init_timezone();
12180
12192
  }
12181
12193
  });
12182
12194
 
@@ -12265,6 +12277,11 @@ var init_entities = __esm({
12265
12277
  icon: text("icon").default("\u{1F3E2}"),
12266
12278
  industry: text("industry"),
12267
12279
  goal: text("goal"),
12280
+ // IANA timezone for this workspace (e.g. 'Europe/Paris'). Captured from the
12281
+ // user's browser at onboarding, editable in Settings. Authoritative for the
12282
+ // agent: it reads the current local time and schedules crons in THIS zone.
12283
+ // null = fall back to the server's resolved timezone (legacy / pre-capture).
12284
+ timezone: text("timezone"),
12268
12285
  mcpToken: uuid("mcp_token").defaultRandom(),
12269
12286
  // ROOT agent designation (Wave 1 — V4 ROOT agent, 2026-05-29).
12270
12287
  // Points at the agent that receives meta-tools. Set null when no root
@@ -12284,7 +12301,12 @@ var init_entities = __esm({
12284
12301
  reflectionEnabled: boolean("reflection_enabled").notNull().default(false),
12285
12302
  // Controls whether agent-authored skills are auto-assigned to the authoring
12286
12303
  // agent ('auto') or queued for the entity owner to approve ('approval').
12287
- skillAssignmentMode: text("skill_assignment_mode").notNull().default("approval").$type()
12304
+ skillAssignmentMode: text("skill_assignment_mode").notNull().default("approval").$type(),
12305
+ // Allows the workspace OWNER to opt into Yolo (auto-approve run_command)
12306
+ // even in non-local-trust (LAN/local-auth) mode. Off by default: in
12307
+ // local-auth mode, commands always require approval unless the owner
12308
+ // explicitly opts in here.
12309
+ lanCommandYolo: boolean("lan_command_yolo").notNull().default(false)
12288
12310
  },
12289
12311
  (table) => [
12290
12312
  uniqueIndex("entities_mcp_token_idx").on(table.mcpToken),
@@ -12991,6 +13013,12 @@ var init_skills = __esm({
12991
13013
  approvalOverrides: jsonb("approval_overrides").default(sql`'{}'::jsonb`),
12992
13014
  useCustomInstructions: boolean("use_custom_instructions").notNull().default(false),
12993
13015
  enabledOperations: text("enabled_operations").array(),
13016
+ // Per-skill × per-agent authorization to EXECUTE the skill's bundled scripts
13017
+ // (installed_scripts) via run_skill_script. Owner opt-in, default FALSE. A
13018
+ // community skill may ship .py/.sh scripts, but the runtime refuses to run
13019
+ // them unless the owner flips this for a specific agent × skill — the
13020
+ // case-by-case execution gate. Loaded by the runner into the ToolContext.
13021
+ scriptsAuthorized: boolean("scripts_authorized").notNull().default(false),
12994
13022
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
12995
13023
  },
12996
13024
  () => []
@@ -13016,6 +13044,10 @@ var init_schedules = __esm({
13016
13044
  type: text("type").notNull().default("cron"),
13017
13045
  name: text("name").notNull(),
13018
13046
  cronExpr: text("cron_expr").notNull(),
13047
+ // IANA timezone the cron is evaluated in (e.g. 'Asia/Singapore'). null = the
13048
+ // server's local timezone (legacy rows). New schedules capture an explicit tz
13049
+ // so "9am" stays 9am in the user's zone regardless of where the runner hosts.
13050
+ timezone: text("timezone"),
13019
13051
  task: text("task"),
13020
13052
  objectives: text("objectives"),
13021
13053
  active: boolean("active").default(true),
@@ -13347,6 +13379,20 @@ var init_chat_messages = __esm({
13347
13379
  }
13348
13380
  });
13349
13381
 
13382
+ // ../../packages/db/src/schema/app-settings.ts
13383
+ var appSettings;
13384
+ var init_app_settings = __esm({
13385
+ "../../packages/db/src/schema/app-settings.ts"() {
13386
+ "use strict";
13387
+ init_pg_core();
13388
+ appSettings = pgTable("app_settings", {
13389
+ key: text("key").primaryKey(),
13390
+ value: text("value").default("").notNull(),
13391
+ updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull()
13392
+ });
13393
+ }
13394
+ });
13395
+
13350
13396
  // ../../packages/db/src/schema/index.ts
13351
13397
  var schema_exports = {};
13352
13398
  __export(schema_exports, {
@@ -13384,6 +13430,7 @@ __export(schema_exports, {
13384
13430
  agentTasks: () => agentTasks,
13385
13431
  agentWorkspaces: () => agentWorkspaces,
13386
13432
  agents: () => agents,
13433
+ appSettings: () => appSettings,
13387
13434
  approvalRequests: () => approvalRequests,
13388
13435
  approvalRules: () => approvalRules,
13389
13436
  chatMessages: () => chatMessages,
@@ -13430,6 +13477,7 @@ var init_schema2 = __esm({
13430
13477
  init_agent_connector_assignments();
13431
13478
  init_agent_workspaces();
13432
13479
  init_chat_messages();
13480
+ init_app_settings();
13433
13481
  }
13434
13482
  });
13435
13483
 
@@ -13513,6 +13561,14 @@ var init_retention = __esm({
13513
13561
  }
13514
13562
  });
13515
13563
 
13564
+ // ../../packages/db/src/repos/app-settings.ts
13565
+ var init_app_settings2 = __esm({
13566
+ "../../packages/db/src/repos/app-settings.ts"() {
13567
+ "use strict";
13568
+ init_schema2();
13569
+ }
13570
+ });
13571
+
13516
13572
  // ../../packages/db/src/index.ts
13517
13573
  var init_src4 = __esm({
13518
13574
  "../../packages/db/src/index.ts"() {
@@ -13524,6 +13580,7 @@ var init_src4 = __esm({
13524
13580
  init_agents2();
13525
13581
  init_skills2();
13526
13582
  init_retention();
13583
+ init_app_settings2();
13527
13584
  init_drizzle_orm();
13528
13585
  }
13529
13586
  });
@@ -13997,17 +14054,13 @@ async function runUp(opts = {}) {
13997
14054
  await stopOrphanPostgres();
13998
14055
  if (isPidAlive(pgOrphan.pid)) {
13999
14056
  try {
14000
- if (process.platform === "win32") {
14001
- await execa4("taskkill", ["/T", "/F", "/PID", String(pgOrphan.pid)], { reject: false });
14002
- } else {
14003
- process.kill(pgOrphan.pid, "SIGKILL");
14004
- }
14057
+ process.kill(pgOrphan.pid, "SIGKILL");
14005
14058
  } catch {
14006
14059
  }
14007
14060
  await waitForPidDead(pgOrphan.pid, 5e3);
14008
14061
  }
14009
14062
  if (isPidAlive(pgOrphan.pid)) {
14010
- const killCmd = process.platform === "win32" ? `taskkill /T /F /PID ${pgOrphan.pid}` : `kill -9 ${pgOrphan.pid}`;
14063
+ const killCmd = process.platform === "win32" ? `powershell Stop-Process -Id ${pgOrphan.pid} -Force` : `kill -9 ${pgOrphan.pid}`;
14011
14064
  throw new Error(
14012
14065
  `An orphaned Postgres (pid ${pgOrphan.pid}) is still running and holds the shared-memory block for the data dir. Rotating ports won't help \u2014 the SHM segment is keyed to the data dir, not the port.
14013
14066
  Fix: run \`nodal-agents down\`, then \`${killCmd}\`. If it persists, reboot to clear the orphan kernel object. No data is lost \u2014 pg-data is preserved.`
@@ -1,11 +1,11 @@
1
- -- Real dollar cost budget (Guard 1e). Track what was ACTUALLY BILLED per job
2
- -- (not token proxies) so the runner can enforce a hard dollar cap and the
3
- -- dashboard can surface real $/job cost. Populated by OpenRouter when
4
- -- `usage:{include:true}` is sent — `usage.cost` in the response lands in
5
- -- providerMetadata.openrouter.usage.cost on the AI SDK result. NULL / 0 for
6
- -- providers that don't report per-call cost (Anthropic, Ollama, etc.).
7
- --
8
- -- Stored as real (float4) — sub-cent values are common (e.g. $0.00056).
9
- -- Default 0 so existing rows are valid without a backfill.
10
- ALTER TABLE "agent_jobs"
11
- ADD COLUMN IF NOT EXISTS "total_cost_usd" real DEFAULT 0;
1
+ -- Real dollar cost budget (Guard 1e). Track what was ACTUALLY BILLED per job
2
+ -- (not token proxies) so the runner can enforce a hard dollar cap and the
3
+ -- dashboard can surface real $/job cost. Populated by OpenRouter when
4
+ -- `usage:{include:true}` is sent — `usage.cost` in the response lands in
5
+ -- providerMetadata.openrouter.usage.cost on the AI SDK result. NULL / 0 for
6
+ -- providers that don't report per-call cost (Anthropic, Ollama, etc.).
7
+ --
8
+ -- Stored as real (float4) — sub-cent values are common (e.g. $0.00056).
9
+ -- Default 0 so existing rows are valid without a backfill.
10
+ ALTER TABLE "agent_jobs"
11
+ ADD COLUMN IF NOT EXISTS "total_cost_usd" real DEFAULT 0;
@@ -1,7 +1,7 @@
1
- -- Served-upstream observability (P0-B). Tracks which upstream provider actually
2
- -- handled a given job execution (e.g. 'DeepSeek' when routed via OpenRouter's
3
- -- provider-order preference). Populated from providerMetadata.openrouter.provider
4
- -- on each LLM call; only the LAST non-empty value is stored per job. NULL for
5
- -- providers that don't report upstream identity (Anthropic, Ollama, etc.).
6
- ALTER TABLE "agent_jobs"
7
- ADD COLUMN IF NOT EXISTS "served_provider" text;
1
+ -- Served-upstream observability (P0-B). Tracks which upstream provider actually
2
+ -- handled a given job execution (e.g. 'DeepSeek' when routed via OpenRouter's
3
+ -- provider-order preference). Populated from providerMetadata.openrouter.provider
4
+ -- on each LLM call; only the LAST non-empty value is stored per job. NULL for
5
+ -- providers that don't report upstream identity (Anthropic, Ollama, etc.).
6
+ ALTER TABLE "agent_jobs"
7
+ ADD COLUMN IF NOT EXISTS "served_provider" text;
@@ -1,20 +1,20 @@
1
- -- Learning-loop columns for agent_skills (Phase A).
2
- -- created_by: provenance — who created this skill ('user' | 'system' | 'agent').
3
- -- Default 'user' for forward-compatibility; backfilled to 'system' for
4
- -- community/bundled skills below.
5
- -- state: lifecycle state — 'active' (default) | 'stale' | 'archived'.
6
- -- No hard-delete path — skills are archived, never deleted.
7
- -- last_used_at: fire-and-forget timestamp, bumped each time the skill is injected
8
- -- into a job's system prompt. NULL = never used. Used to surface stale skills.
9
- -- patch_count: how many agent-authored patches have been applied. Starts at 0.
10
- -- archived_at: when the skill was moved to state='archived'. NULL while active.
11
-
12
- ALTER TABLE "agent_skills"
13
- ADD COLUMN IF NOT EXISTS "created_by" text NOT NULL DEFAULT 'user',
14
- ADD COLUMN IF NOT EXISTS "state" text NOT NULL DEFAULT 'active',
15
- ADD COLUMN IF NOT EXISTS "last_used_at" timestamptz,
16
- ADD COLUMN IF NOT EXISTS "patch_count" integer NOT NULL DEFAULT 0,
17
- ADD COLUMN IF NOT EXISTS "archived_at" timestamptz;
18
-
19
- -- Backfill: community/bundled skills are 'system' provenance
20
- UPDATE "agent_skills" SET "created_by" = 'system' WHERE "is_community" = true;
1
+ -- Learning-loop columns for agent_skills (Phase A).
2
+ -- created_by: provenance — who created this skill ('user' | 'system' | 'agent').
3
+ -- Default 'user' for forward-compatibility; backfilled to 'system' for
4
+ -- community/bundled skills below.
5
+ -- state: lifecycle state — 'active' (default) | 'stale' | 'archived'.
6
+ -- No hard-delete path — skills are archived, never deleted.
7
+ -- last_used_at: fire-and-forget timestamp, bumped each time the skill is injected
8
+ -- into a job's system prompt. NULL = never used. Used to surface stale skills.
9
+ -- patch_count: how many agent-authored patches have been applied. Starts at 0.
10
+ -- archived_at: when the skill was moved to state='archived'. NULL while active.
11
+
12
+ ALTER TABLE "agent_skills"
13
+ ADD COLUMN IF NOT EXISTS "created_by" text NOT NULL DEFAULT 'user',
14
+ ADD COLUMN IF NOT EXISTS "state" text NOT NULL DEFAULT 'active',
15
+ ADD COLUMN IF NOT EXISTS "last_used_at" timestamptz,
16
+ ADD COLUMN IF NOT EXISTS "patch_count" integer NOT NULL DEFAULT 0,
17
+ ADD COLUMN IF NOT EXISTS "archived_at" timestamptz;
18
+
19
+ -- Backfill: community/bundled skills are 'system' provenance
20
+ UPDATE "agent_skills" SET "created_by" = 'system' WHERE "is_community" = true;
@@ -1,7 +1,7 @@
1
- -- Tier-2 CURATOR cadence tracker.
2
- -- Per-entity timestamp of the last LLM consolidation pass. NULL = never run.
3
- -- Used by run-curator.ts to gate the first-run-deferred pattern (skip first
4
- -- run, set to now(), run on subsequent ticks beyond CURATOR_INTERVAL_DAYS).
5
-
6
- ALTER TABLE "entities"
7
- ADD COLUMN IF NOT EXISTS "last_curator_run_at" timestamptz;
1
+ -- Tier-2 CURATOR cadence tracker.
2
+ -- Per-entity timestamp of the last LLM consolidation pass. NULL = never run.
3
+ -- Used by run-curator.ts to gate the first-run-deferred pattern (skip first
4
+ -- run, set to now(), run on subsequent ticks beyond CURATOR_INTERVAL_DAYS).
5
+
6
+ ALTER TABLE "entities"
7
+ ADD COLUMN IF NOT EXISTS "last_curator_run_at" timestamptz;
@@ -1 +1 @@
1
- ALTER TABLE entities ADD COLUMN reflection_enabled boolean NOT NULL DEFAULT false;
1
+ ALTER TABLE entities ADD COLUMN reflection_enabled boolean NOT NULL DEFAULT false;
@@ -1 +1 @@
1
- DROP TABLE IF EXISTS "agent_runs" CASCADE;
1
+ DROP TABLE IF EXISTS "agent_runs" CASCADE;
@@ -1,2 +1,2 @@
1
- ALTER TABLE entities ADD COLUMN skill_assignment_mode text NOT NULL DEFAULT 'approval';
2
- ALTER TABLE agent_skills ADD COLUMN created_by_agent_id uuid REFERENCES agents(id) ON DELETE SET NULL;
1
+ ALTER TABLE entities ADD COLUMN skill_assignment_mode text NOT NULL DEFAULT 'approval';
2
+ ALTER TABLE agent_skills ADD COLUMN created_by_agent_id uuid REFERENCES agents(id) ON DELETE SET NULL;
@@ -0,0 +1 @@
1
+ ALTER TABLE "entities" ADD COLUMN "lan_command_yolo" boolean DEFAULT false NOT NULL;
@@ -0,0 +1,5 @@
1
+ CREATE TABLE "app_settings" (
2
+ "key" text PRIMARY KEY NOT NULL,
3
+ "value" text DEFAULT '' NOT NULL,
4
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
5
+ );
@@ -0,0 +1 @@
1
+ ALTER TABLE "agent_skill_assignments" ADD COLUMN "scripts_authorized" boolean DEFAULT false NOT NULL;
@@ -0,0 +1 @@
1
+ ALTER TABLE "agent_schedules" ADD COLUMN "timezone" text;
@@ -0,0 +1 @@
1
+ ALTER TABLE "entities" ADD COLUMN "timezone" text;