@agent-native/core 0.136.3 → 0.136.5
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/corpus/README.md +1 -1
- package/corpus/templates/clips/.agents/skills/recording/SKILL.md +53 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +7 -0
- package/corpus/templates/clips/actions/lib/loom-import-job.ts +24 -4
- package/corpus/templates/clips/changelog/2026-08-03-restart-during-a-recording-now-immediately-starts-a-fresh-ta.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +81 -30
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +436 -158
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +14 -1
- package/corpus/templates/clips/server/plugins/auth.ts +9 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +13 -0
- package/dist/client/agent-page/AgentJobsTab.js +19 -4
- package/dist/client/agent-page/use-jobs.d.ts +10 -0
- package/dist/client/agent-page/use-jobs.js +21 -0
- package/dist/client/settings/SecretsSection.js +32 -8
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/actions/run-automation-now.d.ts +6 -0
- package/dist/jobs/actions/run-automation-now.js +22 -0
- package/dist/jobs/background-automation-runner.d.ts +2 -0
- package/dist/jobs/background-automation-runner.js +22 -16
- package/dist/jobs/run-history.d.ts +17 -3
- package/dist/jobs/run-history.js +73 -7
- package/dist/jobs/run-now.d.ts +20 -0
- package/dist/jobs/run-now.js +99 -0
- package/dist/jobs/scheduler.d.ts +15 -0
- package/dist/jobs/scheduler.js +76 -12
- package/dist/localization/default-messages.d.ts +8 -0
- package/dist/localization/default-messages.js +8 -0
- package/dist/notifications/routes.d.ts +4 -4
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +12 -12
- package/dist/provider-api/actions/provider-api.d.ts +4 -4
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/secrets/routes.d.ts +5 -5
- package/dist/secrets/routes.js +41 -17
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/agent-chat-plugin.js +135 -68
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/email-actions.d.ts +6 -3
- package/dist/server/email-actions.js +17 -83
- package/dist/server/email-markdown.d.ts +4 -0
- package/dist/server/email-markdown.js +174 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -0
- package/dist/triggers/actions.d.ts +1 -1
- package/dist/triggers/actions.js +27 -5
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -0
package/dist/triggers/actions.js
CHANGED
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* available in every template. The agent uses them to create, list, and
|
|
6
6
|
* manage automations from chat.
|
|
7
7
|
*
|
|
8
|
-
* All
|
|
8
|
+
* All seven operations are consolidated into a single `manage-automations` tool
|
|
9
9
|
* with an `action` discriminator to keep the tool registry compact.
|
|
10
10
|
*/
|
|
11
11
|
import { defineAutomation, deleteAutomation, listAutomationDefinitions, updateAutomation, } from "../automations/service.js";
|
|
12
12
|
import { listEvents } from "../event-bus/index.js";
|
|
13
13
|
import { describeCron, effectiveTimezone } from "../jobs/cron.js";
|
|
14
|
+
import { queueAutomationRunNow } from "../jobs/run-now.js";
|
|
14
15
|
import { getIntegrationRequestContext, getRequestOrgId, } from "../server/request-context.js";
|
|
15
16
|
import { refreshEventSubscriptions } from "./dispatcher.js";
|
|
16
17
|
/* ------------------------------------------------------------------ */
|
|
@@ -235,6 +236,23 @@ async function handleFireTest(args, getCurrentUser) {
|
|
|
235
236
|
emit("test.event.fired", { data }, { owner });
|
|
236
237
|
return `Test event fired with payload: ${JSON.stringify({ data })}. Any automations subscribed to "test.event.fired" will be evaluated.`;
|
|
237
238
|
}
|
|
239
|
+
async function handleRunNow(args, getCurrentUser, context) {
|
|
240
|
+
if (context?.caller === "automation") {
|
|
241
|
+
return "Error: an automation cannot run another automation.";
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
const result = await queueAutomationRunNow({
|
|
245
|
+
userEmail: getCurrentUser(),
|
|
246
|
+
orgId: getRequestOrgId(),
|
|
247
|
+
scope: automationScope(args.scope),
|
|
248
|
+
name: typeof args.name === "string" ? args.name : "",
|
|
249
|
+
});
|
|
250
|
+
return JSON.stringify(result);
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
return `Error: ${error.message}`;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
238
256
|
/* ------------------------------------------------------------------ */
|
|
239
257
|
/* Consolidated tool entry */
|
|
240
258
|
/* ------------------------------------------------------------------ */
|
|
@@ -245,6 +263,7 @@ const VALID_ACTIONS = [
|
|
|
245
263
|
"update",
|
|
246
264
|
"delete",
|
|
247
265
|
"fire-test",
|
|
266
|
+
"run-now",
|
|
248
267
|
];
|
|
249
268
|
export function createAutomationToolEntries(getCurrentUser) {
|
|
250
269
|
return {
|
|
@@ -257,18 +276,19 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
257
276
|
- **define**: Create a new automation. IMPORTANT: Always confirm with the user before calling — show them a summary of what will be created. Required params: name, trigger_type, body. Optional: scope, event, schedule, timezone, condition, mode, domain, delegated_policy_id, model, mcpTools.
|
|
258
277
|
- **update**: Update an existing automation's settings without changing its creator (enabled, schedule, timezone, condition, body, policy, model, MCP allowlist). Required param: name. Use the same scope it was created in.
|
|
259
278
|
- **delete**: Delete an automation. Always confirm with the user first. Required param: name.
|
|
260
|
-
- **fire-test**: Fire a test event to validate automations. Emits a test.event.fired event. Optional param: data (JSON string)
|
|
279
|
+
- **fire-test**: Fire a test event to validate automations. Emits a test.event.fired event. Optional param: data (JSON string).
|
|
280
|
+
- **run-now**: Run one automation immediately using its real actions and side effects. This is an explicit user-authorized run and returns a durable run id; it does not change the automation's next scheduled run. Required params: name; optional scope.`,
|
|
261
281
|
parameters: {
|
|
262
282
|
type: "object",
|
|
263
283
|
properties: {
|
|
264
284
|
action: {
|
|
265
285
|
type: "string",
|
|
266
|
-
description: "The operation to perform: list-events, list, define, update, delete, or
|
|
286
|
+
description: "The operation to perform: list-events, list, define, update, delete, fire-test, or run-now.",
|
|
267
287
|
enum: [...VALID_ACTIONS],
|
|
268
288
|
},
|
|
269
289
|
name: {
|
|
270
290
|
type: "string",
|
|
271
|
-
description: "Slug name for the automation (lowercase, hyphens). Used by define, update, and
|
|
291
|
+
description: "Slug name for the automation (lowercase, hyphens). Used by define, update, delete, and run-now.",
|
|
272
292
|
},
|
|
273
293
|
scope: {
|
|
274
294
|
type: "string",
|
|
@@ -345,7 +365,7 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
345
365
|
allowedValues: { action: ["list-events", "list"] },
|
|
346
366
|
description: "Plan mode allows listing automations and event types.",
|
|
347
367
|
},
|
|
348
|
-
run: async (args) => {
|
|
368
|
+
run: async (args, context) => {
|
|
349
369
|
const action = args.action;
|
|
350
370
|
switch (action) {
|
|
351
371
|
case "list-events":
|
|
@@ -360,6 +380,8 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
360
380
|
return handleDelete(args, getCurrentUser);
|
|
361
381
|
case "fire-test":
|
|
362
382
|
return handleFireTest(args, getCurrentUser);
|
|
383
|
+
case "run-now":
|
|
384
|
+
return handleRunNow(args, getCurrentUser, context);
|
|
363
385
|
default:
|
|
364
386
|
return `Error: unknown action "${action}". Valid actions: ${VALID_ACTIONS.join(", ")}.`;
|
|
365
387
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.136.
|
|
3
|
+
"version": "0.136.5",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -103,6 +103,7 @@ All automation operations are accessed through a single `manage-automations` too
|
|
|
103
103
|
| `update` | Update an existing automation (enabled, condition, body) |
|
|
104
104
|
| `delete` | Delete an automation (always confirm with user first) |
|
|
105
105
|
| `fire-test` | Emit a `test.event.fired` event to validate automations |
|
|
106
|
+
| `run-now` | Run one automation immediately with its real actions and side effects |
|
|
106
107
|
|
|
107
108
|
Additional tool: `web-request` — outbound HTTP with `${keys.NAME}` substitution.
|
|
108
109
|
|