@desplega.ai/agent-swarm 1.102.0 → 1.103.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 (107) hide show
  1. package/dist/{actions-j9399ktm.js → actions-7txktrdj.js} +6 -6
  2. package/dist/{app-tnq1pz27.js → app-xm3xsdye.js} +3 -3
  3. package/dist/{assistant-c7y92gkw.js → assistant-qpv63wk6.js} +9 -9
  4. package/dist/{boot-reembed-k7e6fc1p.js → boot-reembed-9cxqka3e.js} +3 -3
  5. package/dist/{boot-reembed-b97r699t.js → boot-reembed-chxhrwv8.js} +4 -4
  6. package/dist/{boot-scrub-logs-14kbc61y.js → boot-scrub-logs-8qtfkcz8.js} +2 -2
  7. package/dist/{claude-managed-adapter-g07dbz3b.js → claude-managed-adapter-z29hjgzz.js} +3 -3
  8. package/dist/{cli-tsz1q7gk.js → cli-2307phk1.js} +375 -23
  9. package/dist/{cli-g5px3d7x.js → cli-2957pqpj.js} +24 -1
  10. package/dist/{cli-9qascwj7.js → cli-2qynerth.js} +1 -1
  11. package/dist/{cli-k1ghyj8b.js → cli-4fnp2tc3.js} +1 -1
  12. package/dist/{cli-hc4rd6sv.js → cli-85pf4z38.js} +1 -1
  13. package/dist/{cli-zk4gn40w.js → cli-8hyv6c2v.js} +6 -14
  14. package/dist/{cli-k81y1cjb.js → cli-8w95v19d.js} +1 -1
  15. package/dist/{cli-7xdq3jg3.js → cli-92fqyjcv.js} +1 -1
  16. package/dist/{cli-zctkpdmd.js → cli-dz3d6zjg.js} +1 -1
  17. package/dist/{cli-d0t4854c.js → cli-fedn86nz.js} +213 -476
  18. package/dist/{cli-g861fwjp.js → cli-fwxdt7kt.js} +3 -3
  19. package/dist/{cli-2aaa9mqr.js → cli-fygaw191.js} +2 -2
  20. package/dist/{cli-qbc6mncp.js → cli-gzepjz54.js} +2 -2
  21. package/dist/{cli-r68m8arr.js → cli-jt9d9fjw.js} +1 -1
  22. package/dist/{cli-axtg1zaa.js → cli-khe4x17a.js} +1 -1
  23. package/dist/{cli-sygq3fhn.js → cli-kk51f3tf.js} +5 -5
  24. package/dist/{cli-dgab5x2h.js → cli-krvxq8bc.js} +1 -1
  25. package/dist/{cli-xde8vhhp.js → cli-ksq38x4n.js} +2 -2
  26. package/dist/{cli-stqqf5kh.js → cli-m8f6qzck.js} +1 -1
  27. package/dist/{cli-ap4md0gc.js → cli-ns0r7mkr.js} +30 -5
  28. package/dist/{cli-t2jk33ta.js → cli-rttgde5f.js} +18 -6
  29. package/dist/{cli-mhj07xbq.js → cli-rvae030h.js} +3 -3
  30. package/dist/{cli-q6jzg6wj.js → cli-s14sb64w.js} +4 -4
  31. package/dist/{cli-zmf7refz.js → cli-v9283nma.js} +1 -1
  32. package/dist/{cli-fjx4x7nn.js → cli-xmtsan9k.js} +1 -1
  33. package/dist/{cli-vgck9mqq.js → cli-yeemwevj.js} +155 -37
  34. package/dist/{cli-5bqa41fd.js → cli-yfwwjeft.js} +1 -1
  35. package/dist/{cli-s8jw5bmg.js → cli-yp2krx5r.js} +2 -2
  36. package/dist/cli.js +9 -9
  37. package/dist/{codex-adapter-wf119mnw.js → codex-adapter-w0xharsg.js} +3 -3
  38. package/dist/{codex-session-runner-1gknw7mh.js → codex-session-runner-kzbjcm2k.js} +3 -3
  39. package/dist/{commands-2wyn3swb.js → commands-aqn63mcw.js} +2 -2
  40. package/dist/{db-567ntpxv.js → db-azrvwsnj.js} +2 -2
  41. package/dist/{handlers-wvwpk2kj.js → handlers-hf61har3.js} +9 -9
  42. package/dist/{hook-fatkywc0.js → hook-306p3yz4.js} +2 -2
  43. package/dist/{http-eq6wxve6.js → http-zts4haq7.js} +81 -62
  44. package/dist/{index-400x6p3j.js → index-29vg51x6.js} +6 -6
  45. package/dist/{index-9wqh5352.js → index-3c651yfk.js} +10 -10
  46. package/dist/{index-6aj8966p.js → index-bfh9hgek.js} +5 -5
  47. package/dist/{index-d1rm4ea3.js → index-h2yqjyk0.js} +8 -8
  48. package/dist/{keepalive-6x9nx92g.js → keepalive-a0dg5pds.js} +4 -4
  49. package/dist/{lead-5fgqwe13.js → lead-7mcxedkc.js} +21 -21
  50. package/dist/{maintenance-eajx5k1k.js → maintenance-mrzqd53t.js} +4 -4
  51. package/dist/{onboard-jc1w1edg.js → onboard-4dkpv9wa.js} +2 -2
  52. package/dist/{otel-impl-8k375amf.js → otel-impl-jt7gpyp9.js} +1 -1
  53. package/dist/{pi-mono-adapter-hf8sw7hs.js → pi-mono-adapter-zf7dt1wg.js} +1 -1
  54. package/dist/{pricing-refresh-zed6916t.js → pricing-refresh-xqnzh8dt.js} +4 -4
  55. package/dist/{seed-pricing-5805qzkz.js → seed-pricing-56tjm1fj.js} +3 -3
  56. package/dist/{setup-wz05vxh0.js → setup-tbwk8j10.js} +2 -2
  57. package/dist/{worker-j359graf.js → worker-e03za92t.js} +21 -21
  58. package/openapi.json +70 -1
  59. package/package.json +1 -1
  60. package/src/be/db.ts +83 -13
  61. package/src/be/migrations/098_repo_hooks_config.sql +3 -0
  62. package/src/be/task-lifecycle-events.ts +42 -0
  63. package/src/commands/runner.ts +174 -25
  64. package/src/github/task-reactions.ts +21 -0
  65. package/src/hooks/tool-loop-detection.test.ts +40 -0
  66. package/src/hooks/tool-loop-detection.ts +37 -1
  67. package/src/http/agents.ts +7 -0
  68. package/src/http/index.ts +16 -2
  69. package/src/http/prompt-templates.ts +1 -1
  70. package/src/http/repos.ts +5 -1
  71. package/src/http/schedules.ts +1 -1
  72. package/src/http/session-data.ts +2 -0
  73. package/src/http/tasks.ts +2 -1
  74. package/src/http/workflows.ts +1 -0
  75. package/src/prompts/resolver.ts +1 -1
  76. package/src/scheduler/scheduler.ts +25 -2
  77. package/src/server-runtime-counters.ts +12 -0
  78. package/src/server-user.ts +1 -2
  79. package/src/server.ts +5 -0
  80. package/src/telemetry.ts +18 -1
  81. package/src/tests/http-api-integration.test.ts +4 -0
  82. package/src/tests/model-control.test.ts +6 -6
  83. package/src/tests/swarm-repos.test.ts +25 -2
  84. package/src/tests/task-lifecycle-events.test.ts +53 -0
  85. package/src/tests/task-lifecycle-telemetry.test.ts +37 -1
  86. package/src/tests/telemetry-init.test.ts +32 -0
  87. package/src/tools/prompt-templates/preview.ts +1 -1
  88. package/src/tools/repos/update-repo.ts +6 -1
  89. package/src/tools/schedules/create-schedule.ts +1 -1
  90. package/src/tools/schedules/update-schedule.ts +1 -1
  91. package/src/tools/send-task.ts +7 -2
  92. package/src/tools/task-action.ts +6 -2
  93. package/src/types.ts +155 -1
  94. package/src/utils/template.ts +127 -0
  95. package/src/workflows/engine.ts +7 -0
  96. package/src/workflows/executors/agent-task.ts +1 -2
  97. package/src/workflows/template.ts +12 -121
  98. package/src/workflows/triggers.ts +6 -2
  99. package/templates/community/code-health-reports/PLAYBOOK.md +355 -0
  100. package/templates/community/code-health-reports/README.md +38 -0
  101. package/templates/community/code-health-reports/lead-prompt.md +52 -0
  102. package/templates/community/code-health-reports/report.mjs +378 -0
  103. package/templates/community/code-health-reports/run.sh +143 -0
  104. package/templates/schedules/weekly-code-health-reports/config.json +13 -0
  105. package/templates/schedules/weekly-code-health-reports/content.md +60 -0
  106. package/src/model-tiers.ts +0 -140
  107. package/templates/community/.gitkeep +0 -0
@@ -1,140 +0,0 @@
1
- import { z } from "zod";
2
- import type { ProviderName } from "./types";
3
-
4
- export const ModelTierSchema = z.enum(["smol", "regular", "smart", "ultra"]);
5
- export type ModelTier = z.infer<typeof ModelTierSchema>;
6
-
7
- export const MODEL_TIERS = ModelTierSchema.options;
8
-
9
- export const LEGACY_MODEL_TO_TIER: Record<string, ModelTier> = {
10
- haiku: "smol",
11
- sonnet: "regular",
12
- opus: "smart",
13
- fable: "ultra",
14
- };
15
-
16
- export const MODEL_TIER_LABELS: Record<ModelTier, string> = {
17
- smol: "Smol",
18
- regular: "Regular",
19
- smart: "Smart",
20
- ultra: "Ultra",
21
- };
22
-
23
- export const DEFAULT_MODEL_TIER_MAP: Record<ProviderName, Record<ModelTier, string>> = {
24
- claude: {
25
- smol: "haiku",
26
- regular: "sonnet",
27
- smart: "opus",
28
- ultra: "fable",
29
- },
30
- "claude-managed": {
31
- smol: "claude-haiku-4-5",
32
- regular: "claude-sonnet-4-6",
33
- smart: "claude-opus-4-8",
34
- ultra: "claude-fable-5",
35
- },
36
- codex: {
37
- smol: "gpt-5.4-mini",
38
- regular: "gpt-5.4",
39
- smart: "gpt-5.5",
40
- ultra: "gpt-5.5",
41
- },
42
- pi: {
43
- smol: "openrouter/deepseek/deepseek-v4-flash",
44
- regular: "openrouter/deepseek/deepseek-v4-flash",
45
- smart: "openrouter/deepseek/deepseek-v4-pro",
46
- ultra: "openrouter/anthropic/claude-opus-4.8",
47
- },
48
- opencode: {
49
- smol: "openrouter/deepseek/deepseek-v4-flash",
50
- regular: "openrouter/deepseek/deepseek-v4-flash",
51
- smart: "openrouter/deepseek/deepseek-v4-pro",
52
- ultra: "openrouter/anthropic/claude-opus-4.8",
53
- },
54
- devin: {
55
- smol: "devin",
56
- regular: "devin",
57
- smart: "devin",
58
- ultra: "devin",
59
- },
60
- };
61
-
62
- export function parseModelTier(value: string | null | undefined): ModelTier | undefined {
63
- if (!value) return undefined;
64
- const normalized = value.trim().toLowerCase();
65
- return ModelTierSchema.safeParse(normalized).success
66
- ? (normalized as ModelTier)
67
- : LEGACY_MODEL_TO_TIER[normalized];
68
- }
69
-
70
- export function splitLegacyModelAlias(input: {
71
- model?: string | null;
72
- modelTier?: string | null;
73
- }): { model?: string; modelTier?: ModelTier } {
74
- const explicitTier = parseModelTier(input.modelTier);
75
- const model = input.model?.trim();
76
- if (!model) return { modelTier: explicitTier };
77
-
78
- const legacyTier = parseModelTier(model);
79
- if (legacyTier && !explicitTier) {
80
- return { modelTier: legacyTier };
81
- }
82
-
83
- return {
84
- model,
85
- modelTier: explicitTier,
86
- };
87
- }
88
-
89
- function parseTierMapJson(value: string | undefined): Partial<Record<ModelTier, string>> {
90
- if (!value) return {};
91
- try {
92
- const parsed = JSON.parse(value) as unknown;
93
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
94
- const result: Partial<Record<ModelTier, string>> = {};
95
- for (const tier of MODEL_TIERS) {
96
- const model = (parsed as Record<string, unknown>)[tier];
97
- if (typeof model === "string" && model.trim()) result[tier] = model.trim();
98
- }
99
- return result;
100
- } catch {
101
- return {};
102
- }
103
- }
104
-
105
- export function resolveModelTier(opts: {
106
- tier?: string | null;
107
- harnessProvider: ProviderName;
108
- env?: Record<string, string | undefined>;
109
- }): string | undefined {
110
- const tier = parseModelTier(opts.tier);
111
- if (!tier) return undefined;
112
-
113
- const env = opts.env ?? {};
114
- const jsonOverrides = parseTierMapJson(env.MODEL_TIER_MAP);
115
- const envKey = `MODEL_TIER_${tier.toUpperCase()}`;
116
- const directOverride = env[envKey]?.trim();
117
- if (directOverride) return directOverride;
118
- if (jsonOverrides[tier]) return jsonOverrides[tier];
119
-
120
- return DEFAULT_MODEL_TIER_MAP[opts.harnessProvider]?.[tier];
121
- }
122
-
123
- export function resolveTaskModelSelection(opts: {
124
- model?: string | null;
125
- modelTier?: string | null;
126
- harnessProvider: ProviderName;
127
- env?: Record<string, string | undefined>;
128
- }): { model?: string; source: "model" | "modelTier" | "none" } {
129
- const model = opts.model?.trim();
130
- if (model) return { model, source: "model" };
131
-
132
- const tierModel = resolveModelTier({
133
- tier: opts.modelTier,
134
- harnessProvider: opts.harnessProvider,
135
- env: opts.env,
136
- });
137
- if (tierModel) return { model: tierModel, source: "modelTier" };
138
-
139
- return { source: "none" };
140
- }
File without changes