@amalgm/automations 0.4.4-main.38984232586 → 0.4.4-main.41264868541

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/PURPOSE.md CHANGED
@@ -56,7 +56,9 @@ each host forwards only to the owning machine and schedules the next durable
56
56
  retry or lease deadline. Notifications carry no workflow data and never replace
57
57
  the run ledger. Reconnecting re-establishes notification coverage before checking
58
58
  the ledger. Connection health and active execution leases have bounded timers;
59
- idle machines have no periodic work-claim timer.
59
+ idle machines have no periodic work-claim timer. A claimed run executing here
60
+ is work running here: the worker tells its host how many are executing, from
61
+ creation on and on every change. Schedules waiting for their time are not.
60
62
 
61
63
  Complete create and update requests validate their supplied schedules, workflow
62
64
  plans, and field names before writing configuration. Unknown fields cannot
@@ -1 +1 @@
1
- {"$schema":"https://schemas.agentskills.io/discovery/0.2.0/schema.json","skills":[{"name":"amalgm-automations","description":"Set up and use Amalgm to schedule workflows, run native agents and scripts, receive webhooks, and inspect automation results through the amalgm CLI or an existing MCP connection.","type":"archive","url":"./amalgm-automations.892a1f85b39a0bde9452aeb3b59a3bf639f67a1e28bf09132ea4e2c1760d5742.tgz","digest":"sha256:892a1f85b39a0bde9452aeb3b59a3bf639f67a1e28bf09132ea4e2c1760d5742"}]}
1
+ {"$schema":"https://schemas.agentskills.io/discovery/0.2.0/schema.json","skills":[{"name":"amalgm-automations","description":"Set up and use Amalgm to schedule workflows, run native agents and scripts, receive webhooks, and inspect automation results through the amalgm CLI or an existing MCP connection.","type":"archive","url":"./amalgm-automations.9c32199aaa660f1372aa734e33f95379eae4d4a2d51e12d81ebcf97f55dfc38c.tgz","digest":"sha256:9c32199aaa660f1372aa734e33f95379eae4d4a2d51e12d81ebcf97f55dfc38c"}]}
@@ -8,6 +8,8 @@ export interface AutomationMachineRunnerOptions {
8
8
  readonly reconnectDelayMs?: number;
9
9
  readonly maxBackoffMs?: number;
10
10
  readonly log?: (event: string, details?: Readonly<Record<string, unknown>>) => void;
11
+ /** Called with how many claimed runs are executing here, at creation and on every change. */
12
+ readonly activity?: (count: number) => void;
11
13
  }
12
14
  /** Listen first, then drain. There is no timer that asks an idle machine for work. */
13
15
  export declare function createAutomationMachineRunner(options: AutomationMachineRunnerOptions): Readonly<{
@@ -9,6 +9,18 @@ export function createAutomationMachineRunner(options) {
9
9
  let listening = null;
10
10
  let draining = null;
11
11
  let pending = false;
12
+ // A claimed run executing here is work running here, so its count is runtime activity.
13
+ let running = 0;
14
+ const execute = async (run) => {
15
+ options.activity?.(++running);
16
+ try {
17
+ await options.execute(run);
18
+ }
19
+ finally {
20
+ options.activity?.(--running);
21
+ }
22
+ };
23
+ options.activity?.(running);
12
24
  const wake = (connection, signal) => {
13
25
  pending = true;
14
26
  if (draining)
@@ -19,7 +31,7 @@ export function createAutomationMachineRunner(options) {
19
31
  const runs = await options.runs.claim({ limit: batchSize, leaseSeconds });
20
32
  if (runs.length)
21
33
  options.log?.('automations.claimed', { count: runs.length });
22
- const settled = await Promise.allSettled(runs.map(options.execute));
34
+ const settled = await Promise.allSettled(runs.map(execute));
23
35
  for (const result of settled) {
24
36
  if (result.status === 'rejected')
25
37
  options.log?.('automations.run.failed', { error: safe(result.reason) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amalgm/automations",
3
- "version": "0.4.4-main.38984232586",
3
+ "version": "0.4.4-main.41264868541",
4
4
  "description": "Amalgm's automation SDK: durable trigger admission and target-machine execution.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -65,7 +65,7 @@
65
65
  "node": ">=24"
66
66
  },
67
67
  "dependencies": {
68
- "@amalgm/core": "0.5.1-main.38983350397",
68
+ "@amalgm/core": "0.5.1-main.41264319540",
69
69
  "@modelcontextprotocol/sdk": "^1.30.0",
70
70
  "@supabase/supabase-js": "2.57.4",
71
71
  "cron-parser": "^5.4.0",
@@ -108,11 +108,11 @@
108
108
  "@amalgm/core"
109
109
  ]
110
110
  },
111
- "gitHead": "f025ee464a7316eb349101516f515c2fcfd9378d",
111
+ "gitHead": "4669872401fc7722068b08ea491af6c526a36889",
112
112
  "amalgmSource": {
113
113
  "repository": "amalgm-inc/amalgm-automations",
114
114
  "branch": "main",
115
- "commit": "f025ee464a7316eb349101516f515c2fcfd9378d",
116
- "occurrence": "38984232586"
115
+ "commit": "4669872401fc7722068b08ea491af6c526a36889",
116
+ "occurrence": "41264868541"
117
117
  }
118
118
  }