create-windy 0.4.1 → 0.5.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.
Files changed (174) hide show
  1. package/dist/cli.js +258 -121
  2. package/package.json +1 -1
  3. package/template/.windy-template.json +2 -2
  4. package/template/apps/agent-server/adk_web_agents/canonical_debug/agent.py +29 -9
  5. package/template/apps/agent-server/adk_web_agents/services.py +25 -0
  6. package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +40 -11
  7. package/template/apps/agent-server/src/southwind_agent_server/adk_debug_sessions.py +325 -0
  8. package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +70 -6
  9. package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +1 -1
  10. package/template/apps/agent-server/src/southwind_agent_server/app.py +16 -4
  11. package/template/apps/agent-server/src/southwind_agent_server/approval_resolution.py +30 -0
  12. package/template/apps/agent-server/src/southwind_agent_server/contracts.py +9 -0
  13. package/template/apps/agent-server/src/southwind_agent_server/deterministic.py +2 -1
  14. package/template/apps/agent-server/src/southwind_agent_server/engine.py +3 -1
  15. package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +95 -130
  16. package/template/apps/agent-server/src/southwind_agent_server/openai_engine_validation.py +133 -0
  17. package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +89 -20
  18. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_insert.py +34 -0
  19. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_queries.py +234 -0
  20. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_replay.py +44 -0
  21. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_status.py +83 -0
  22. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_store.py +331 -0
  23. package/template/apps/agent-server/src/southwind_agent_server/postgres_report_summary.py +304 -0
  24. package/template/apps/agent-server/src/southwind_agent_server/report_lifecycle.py +217 -0
  25. package/template/apps/agent-server/src/southwind_agent_server/report_metrics.py +149 -0
  26. package/template/apps/agent-server/src/southwind_agent_server/report_presenter.py +280 -0
  27. package/template/apps/agent-server/src/southwind_agent_server/report_routes.py +126 -0
  28. package/template/apps/agent-server/src/southwind_agent_server/report_store.py +344 -0
  29. package/template/apps/agent-server/src/southwind_agent_server/report_types.py +111 -0
  30. package/template/apps/agent-server/src/southwind_agent_server/runtime_factory.py +31 -2
  31. package/template/apps/agent-server/src/southwind_agent_server/service.py +56 -51
  32. package/template/apps/agent-server/src/southwind_agent_server/signal_events.py +18 -1
  33. package/template/apps/agent-server/tests/test_adk_adapter.py +7 -9
  34. package/template/apps/agent-server/tests/test_adk_debug_sessions.py +215 -0
  35. package/template/apps/agent-server/tests/test_adk_web_canonical_debug.py +48 -1
  36. package/template/apps/agent-server/tests/test_openai_provider.py +58 -6
  37. package/template/apps/agent-server/tests/test_postgres_report_status.py +59 -0
  38. package/template/apps/agent-server/tests/test_postgres_report_summary.py +298 -0
  39. package/template/apps/agent-server/tests/test_provider_attempt_reporting.py +152 -0
  40. package/template/apps/agent-server/tests/test_report_attempt_lifecycle.py +126 -0
  41. package/template/apps/agent-server/tests/test_report_resilience.py +181 -0
  42. package/template/apps/agent-server/tests/test_report_store.py +286 -0
  43. package/template/apps/agent-server/tests/test_report_summary_parity.py +115 -0
  44. package/template/apps/agent-server/tests/test_report_terminal_sync.py +177 -0
  45. package/template/apps/server/src/agent/debug-session-facade-provider-failure.test.ts +269 -0
  46. package/template/apps/server/src/agent/debug-session-facade.test.ts +335 -0
  47. package/template/apps/server/src/agent/debug-session-facade.ts +302 -0
  48. package/template/apps/server/src/agent/debug-session-id.test.ts +37 -0
  49. package/template/apps/server/src/agent/debug-session-id.ts +37 -0
  50. package/template/apps/server/src/agent/debug-session-provider-reader.ts +54 -0
  51. package/template/apps/server/src/agent/debug-session-routes.test.ts +64 -0
  52. package/template/apps/server/src/agent/debug-session-routes.ts +73 -0
  53. package/template/apps/server/src/agent/debug-session-validation.ts +106 -0
  54. package/template/apps/server/src/agent/drizzle-run-binding-repository.ts +2 -0
  55. package/template/apps/server/src/agent/provider-input-governance.test.ts +18 -0
  56. package/template/apps/server/src/agent/provider-input-governance.ts +37 -1
  57. package/template/apps/server/src/agent/remote-runtime.test.ts +7 -0
  58. package/template/apps/server/src/agent/remote-runtime.ts +1 -0
  59. package/template/apps/server/src/agent/run-authorization.test.ts +98 -0
  60. package/template/apps/server/src/agent/run-authorization.ts +32 -1
  61. package/template/apps/server/src/agent/run-binding-repository.ts +1 -0
  62. package/template/apps/server/src/agent/run-contracts.ts +5 -0
  63. package/template/apps/server/src/agent/run-facade-adk-debug.test.ts +39 -0
  64. package/template/apps/server/src/agent/run-facade.test.ts +78 -0
  65. package/template/apps/server/src/agent/run-facade.ts +33 -3
  66. package/template/apps/server/src/agent/run-input-commitment.ts +50 -0
  67. package/template/apps/server/src/agent/run-input-verification.ts +41 -0
  68. package/template/apps/server/src/agent/runtime-bootstrap-report.test.ts +136 -0
  69. package/template/apps/server/src/agent/runtime-bootstrap.ts +66 -1
  70. package/template/apps/server/src/agent/tool-host.test.ts +1 -0
  71. package/template/apps/server/src/agent/unavailable-routes.ts +4 -0
  72. package/template/apps/server/src/ai-runtime-report/actor-directory.ts +94 -0
  73. package/template/apps/server/src/ai-runtime-report/actor-handle.test.ts +27 -0
  74. package/template/apps/server/src/ai-runtime-report/actor-handle.ts +81 -0
  75. package/template/apps/server/src/ai-runtime-report/contracts.ts +91 -0
  76. package/template/apps/server/src/ai-runtime-report/remote-parser.ts +212 -0
  77. package/template/apps/server/src/ai-runtime-report/remote-port.ts +138 -0
  78. package/template/apps/server/src/ai-runtime-report/routes.ts +172 -0
  79. package/template/apps/server/src/ai-runtime-report/scope.ts +63 -0
  80. package/template/apps/server/src/ai-runtime-report/service.test.ts +271 -0
  81. package/template/apps/server/src/ai-runtime-report/service.ts +206 -0
  82. package/template/apps/server/src/license/runtime-audit-reliability.test.ts +2 -0
  83. package/template/apps/server/src/license/runtime-service.test.ts +6 -0
  84. package/template/apps/server/src/module-host/ai-operation-port.test.ts +63 -0
  85. package/template/apps/server/src/module-host/ai-operation-port.ts +30 -5
  86. package/template/apps/server/src/module-host/debug-session-provider-registration.test.ts +162 -0
  87. package/template/apps/server/src/module-host/debug-session-provider-registration.ts +84 -0
  88. package/template/apps/server/src/module-host/initialize-contracts.ts +7 -0
  89. package/template/apps/server/src/module-host/initialize.ts +6 -197
  90. package/template/apps/server/src/module-host/request-context.ts +1 -0
  91. package/template/apps/server/src/module-host/scoped-host.ts +214 -0
  92. package/template/apps/server/src/module-host.ts +1 -0
  93. package/template/apps/server/src/runtime-adk-debug.test.ts +25 -1
  94. package/template/apps/server/src/runtime-adk-debug.ts +8 -2
  95. package/template/apps/server/src/system/operations.test.ts +54 -0
  96. package/template/apps/server/src/system/operations.ts +23 -1
  97. package/template/apps/server/src/system/seed.test.ts +4 -0
  98. package/template/apps/server/src/system/system-resource-monitoring.test.ts +82 -0
  99. package/template/apps/server/src/system/system-resource-monitoring.ts +300 -0
  100. package/template/apps/web/src/layout/AppSidebar.vue +6 -1
  101. package/template/apps/web/src/layout/AppSidebar.webtest.ts +2 -0
  102. package/template/apps/web/src/pages/auth/LoginPage.vue +6 -1
  103. package/template/apps/web/src/pages/settings/BrandingSettingsSection.vue +20 -3
  104. package/template/apps/web/src/pages/settings/BrandingSettingsSection.webtest.ts +80 -0
  105. package/template/apps/web/src/pages/system/AiRuntimePage.vue +129 -0
  106. package/template/apps/web/src/pages/system/SystemOperationsPage.vue +2 -1
  107. package/template/apps/web/src/pages/system/ai-runtime-presenter.ts +60 -0
  108. package/template/apps/web/src/pages/system/ai-runtime-presenter.webtest.ts +48 -0
  109. package/template/apps/web/src/pages/system/audit-time-range.ts +34 -2
  110. package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +4 -3
  111. package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +26 -1
  112. package/template/apps/web/src/pages/system/components/OperationGpuMonitor.vue +98 -0
  113. package/template/apps/web/src/pages/system/components/OperationGpuMonitor.webtest.ts +61 -0
  114. package/template/apps/web/src/pages/system/components/OperationServiceMonitor.vue +53 -0
  115. package/template/apps/web/src/pages/system/components/OperationServiceMonitor.webtest.ts +20 -1
  116. package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +14 -1
  117. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeActivityChart.vue +85 -0
  118. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeCharts.webtest.ts +82 -0
  119. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeFilters.vue +98 -0
  120. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeFilters.webtest.ts +27 -0
  121. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.vue +168 -0
  122. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunTable.vue +130 -0
  123. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeSummaryCards.vue +82 -0
  124. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeSummaryCards.webtest.ts +102 -0
  125. package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeTokenByModelChart.vue +101 -0
  126. package/template/apps/web/src/pages/system/composables/useAiRuntimeReport.ts +185 -0
  127. package/template/apps/web/src/pages/system/composables/useAiRuntimeReport.webtest.ts +158 -0
  128. package/template/apps/web/src/pages/system/composables/useSystemResource.ts +21 -7
  129. package/template/apps/web/src/router/error-navigation.ts +22 -0
  130. package/template/apps/web/src/router/index.ts +12 -23
  131. package/template/apps/web/src/router/platform-admin-route-bindings.ts +4 -0
  132. package/template/apps/web/src/services/ai-runtime-api.ts +164 -0
  133. package/template/apps/web/src/services/ai-runtime-api.webtest.ts +111 -0
  134. package/template/apps/web/src/services/operations-api.ts +28 -0
  135. package/template/docker-compose.agent-debug.yml +1 -1
  136. package/template/docs/architecture/ai-runtime.md +2 -1
  137. package/template/docs/architecture/module-host.md +3 -0
  138. package/template/docs/platform/agent-run-attestation.md +65 -0
  139. package/template/docs/platform/agent-runtime-observability.md +135 -0
  140. package/template/docs/platform/agent-runtime.md +47 -3
  141. package/template/docs/platform/operations-overview.md +13 -0
  142. package/template/docs/platform/platform-authentication.md +4 -3
  143. package/template/packages/config/package.json +1 -1
  144. package/template/packages/database/drizzle/0045_tiny_cassandra_nova.sql +65 -0
  145. package/template/packages/database/drizzle/0046_tranquil_living_mummy.sql +6 -0
  146. package/template/packages/database/drizzle/0047_oval_luke_cage.sql +18 -0
  147. package/template/packages/database/drizzle/meta/0045_snapshot.json +8814 -0
  148. package/template/packages/database/drizzle/meta/0046_snapshot.json +8820 -0
  149. package/template/packages/database/drizzle/meta/0047_snapshot.json +8835 -0
  150. package/template/packages/database/drizzle/meta/_journal.json +21 -0
  151. package/template/packages/database/package.json +1 -1
  152. package/template/packages/database/src/agent-runtime-schema.test.ts +54 -0
  153. package/template/packages/database/src/schema/agent-runtime.ts +114 -0
  154. package/template/packages/jobs/package.json +1 -1
  155. package/template/packages/modules/package.json +1 -1
  156. package/template/packages/modules/src/system-admin-routes.ts +10 -0
  157. package/template/packages/modules/src/system-admin-ui-catalog.ts +1 -1
  158. package/template/packages/modules/src/system-api-control-plane.ts +17 -1
  159. package/template/packages/modules/src/system-audit-actions.ts +10 -0
  160. package/template/packages/modules/src/system-features.ts +8 -0
  161. package/template/packages/modules/src/system-module-catalog.test.ts +35 -0
  162. package/template/packages/modules/src/system-module-catalog.ts +15 -4
  163. package/template/packages/modules/src/system-modules-access.test.ts +69 -0
  164. package/template/packages/modules/src/system-modules.ts +13 -0
  165. package/template/packages/modules/src/system-permissions.ts +2 -0
  166. package/template/packages/server-sdk/index.ts +11 -0
  167. package/template/packages/server-sdk/package.json +2 -1
  168. package/template/packages/server-sdk/src/ai-operation-port.ts +5 -0
  169. package/template/packages/server-sdk/src/debug-session-provider.ts +63 -0
  170. package/template/packages/server-sdk/src/module-host.ts +5 -0
  171. package/template/packages/shared/index.ts +3 -0
  172. package/template/packages/shared/package.json +1 -1
  173. package/template/packages/shared/src/ai-runtime-report.ts +134 -0
  174. package/template/scripts/lib/postgres-regression.ts +201 -0
@@ -0,0 +1,65 @@
1
+ CREATE TABLE "agent_runtime_report_attempts" (
2
+ "attempt_id" varchar(80) PRIMARY KEY NOT NULL,
3
+ "run_id" varchar(80) NOT NULL,
4
+ "sequence" integer NOT NULL,
5
+ "tool_round" integer NOT NULL,
6
+ "deployment_key" varchar(200) NOT NULL,
7
+ "requested_model" varchar(200) NOT NULL,
8
+ "reported_model" varchar(200),
9
+ "outcome" varchar(32) NOT NULL,
10
+ "cache_status" varchar(16) NOT NULL,
11
+ "usage_source" varchar(32) NOT NULL,
12
+ "input_tokens" integer,
13
+ "output_tokens" integer,
14
+ "cached_input_tokens" integer,
15
+ "reasoning_tokens" integer,
16
+ "total_tokens" integer,
17
+ "first_token_latency_ms" integer,
18
+ "duration_ms" integer,
19
+ "safe_error_code" varchar(80),
20
+ "started_at" double precision NOT NULL,
21
+ "finished_at" double precision,
22
+ CONSTRAINT "ck_agent_report_attempts_sequence" CHECK ("agent_runtime_report_attempts"."sequence" > 0),
23
+ CONSTRAINT "ck_agent_report_attempts_tool_round" CHECK ("agent_runtime_report_attempts"."tool_round" > 0),
24
+ CONSTRAINT "ck_agent_report_attempts_outcome" CHECK ("agent_runtime_report_attempts"."outcome" in ('completed', 'failed', 'cancelled', 'blocked', 'abandoned')),
25
+ CONSTRAINT "ck_agent_report_attempts_cache" CHECK ("agent_runtime_report_attempts"."cache_status" in ('hit', 'miss', 'unknown')),
26
+ CONSTRAINT "ck_agent_report_attempts_usage_source" CHECK ("agent_runtime_report_attempts"."usage_source" in ('provider-reported', 'estimated', 'unknown')),
27
+ CONSTRAINT "ck_agent_report_attempts_non_negative" CHECK (coalesce("agent_runtime_report_attempts"."input_tokens", 0) >= 0
28
+ and coalesce("agent_runtime_report_attempts"."output_tokens", 0) >= 0
29
+ and coalesce("agent_runtime_report_attempts"."cached_input_tokens", 0) >= 0
30
+ and coalesce("agent_runtime_report_attempts"."reasoning_tokens", 0) >= 0
31
+ and coalesce("agent_runtime_report_attempts"."total_tokens", 0) >= 0
32
+ and coalesce("agent_runtime_report_attempts"."first_token_latency_ms", 0) >= 0
33
+ and coalesce("agent_runtime_report_attempts"."duration_ms", 0) >= 0)
34
+ );
35
+ --> statement-breakpoint
36
+ CREATE TABLE "agent_runtime_report_runs" (
37
+ "run_id" varchar(80) PRIMARY KEY NOT NULL,
38
+ "operation_key" varchar(200) NOT NULL,
39
+ "release_id" varchar(80) NOT NULL,
40
+ "trace_id" varchar(160) NOT NULL,
41
+ "actor_id" varchar(64),
42
+ "actor_type" varchar(32),
43
+ "department_id" varchar(64),
44
+ "status" varchar(32) NOT NULL,
45
+ "safe_error_code" varchar(80),
46
+ "started_at" double precision,
47
+ "finished_at" double precision,
48
+ "duration_ms" integer,
49
+ "created_at" double precision NOT NULL,
50
+ "updated_at" double precision NOT NULL,
51
+ "expires_at" double precision NOT NULL,
52
+ CONSTRAINT "ck_agent_report_runs_status" CHECK ("agent_runtime_report_runs"."status" in ('accepted', 'running', 'awaiting-approval', 'completed', 'failed', 'cancelled')),
53
+ CONSTRAINT "ck_agent_report_runs_duration" CHECK ("agent_runtime_report_runs"."duration_ms" is null or "agent_runtime_report_runs"."duration_ms" >= 0)
54
+ );
55
+ --> statement-breakpoint
56
+ ALTER TABLE "agent_runtime_report_attempts" ADD CONSTRAINT "agent_runtime_report_attempts_run_id_agent_runtime_report_runs_run_id_fk" FOREIGN KEY ("run_id") REFERENCES "public"."agent_runtime_report_runs"("run_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
57
+ CREATE UNIQUE INDEX "uk_agent_report_attempts_sequence" ON "agent_runtime_report_attempts" USING btree ("run_id","sequence");--> statement-breakpoint
58
+ CREATE INDEX "idx_agent_report_attempts_model" ON "agent_runtime_report_attempts" USING btree ("deployment_key","requested_model","started_at");--> statement-breakpoint
59
+ CREATE INDEX "idx_agent_report_attempts_outcome" ON "agent_runtime_report_attempts" USING btree ("outcome","started_at");--> statement-breakpoint
60
+ CREATE INDEX "idx_agent_report_runs_created" ON "agent_runtime_report_runs" USING btree ("created_at");--> statement-breakpoint
61
+ CREATE INDEX "idx_agent_report_runs_status" ON "agent_runtime_report_runs" USING btree ("status","created_at");--> statement-breakpoint
62
+ CREATE INDEX "idx_agent_report_runs_operation" ON "agent_runtime_report_runs" USING btree ("operation_key","created_at");--> statement-breakpoint
63
+ CREATE INDEX "idx_agent_report_runs_actor" ON "agent_runtime_report_runs" USING btree ("actor_id","created_at");--> statement-breakpoint
64
+ CREATE INDEX "idx_agent_report_runs_department" ON "agent_runtime_report_runs" USING btree ("department_id","created_at");--> statement-breakpoint
65
+ CREATE INDEX "idx_agent_report_runs_expiry" ON "agent_runtime_report_runs" USING btree ("expires_at");
@@ -0,0 +1,6 @@
1
+ ALTER TABLE "agent_run_bindings"
2
+ ADD COLUMN "input_digest_commitment" varchar(64)
3
+ DEFAULT repeat('0', 64) NOT NULL;
4
+ --> statement-breakpoint
5
+ ALTER TABLE "agent_run_bindings"
6
+ ALTER COLUMN "input_digest_commitment" DROP DEFAULT;
@@ -0,0 +1,18 @@
1
+ ALTER TABLE "agent_runtime_report_attempts" DROP CONSTRAINT "ck_agent_report_attempts_outcome";--> statement-breakpoint
2
+ UPDATE "agent_runtime_report_attempts"
3
+ SET "finished_at" = greatest(
4
+ "started_at",
5
+ extract(epoch from clock_timestamp())
6
+ ),
7
+ "duration_ms" = greatest(
8
+ 0,
9
+ round(
10
+ (
11
+ greatest("started_at", extract(epoch from clock_timestamp()))
12
+ - "started_at"
13
+ ) * 1000
14
+ )
15
+ )::integer
16
+ WHERE "outcome" = 'abandoned' AND "finished_at" IS NULL;--> statement-breakpoint
17
+ CREATE INDEX "idx_agent_report_attempts_started" ON "agent_runtime_report_attempts" USING btree ("started_at");--> statement-breakpoint
18
+ ALTER TABLE "agent_runtime_report_attempts" ADD CONSTRAINT "ck_agent_report_attempts_outcome" CHECK ("agent_runtime_report_attempts"."outcome" in ('running', 'completed', 'failed', 'cancelled', 'blocked', 'abandoned'));