@agent-native/core 0.71.0 → 0.72.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.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +38 -0
- package/corpus/core/docs/content/actions.md +23 -0
- package/corpus/core/docs/content/audit-log.md +111 -0
- package/corpus/core/package.json +2 -1
- package/corpus/core/src/action.ts +80 -1
- package/corpus/core/src/agent/production-agent.ts +27 -0
- package/corpus/core/src/agent/run-store.ts +14 -0
- package/corpus/core/src/application-state/store.ts +5 -0
- package/corpus/core/src/audit/actions/get-audit-event.ts +23 -0
- package/corpus/core/src/audit/actions/list-audit-events.ts +65 -0
- package/corpus/core/src/audit/cleanup-job.ts +100 -0
- package/corpus/core/src/audit/config.ts +91 -0
- package/corpus/core/src/audit/index.ts +43 -0
- package/corpus/core/src/audit/record.ts +143 -0
- package/corpus/core/src/audit/redact.ts +109 -0
- package/corpus/core/src/audit/store.ts +244 -0
- package/corpus/core/src/audit/types.ts +125 -0
- package/corpus/core/src/chat-threads/store.ts +10 -0
- package/corpus/core/src/client/AssistantChat.tsx +6 -0
- package/corpus/core/src/client/chat/repo-helpers.ts +38 -0
- package/corpus/core/src/db/client.ts +4 -0
- package/corpus/core/src/db/widen-columns.ts +75 -0
- package/corpus/core/src/mcp/build-server.ts +1 -0
- package/corpus/core/src/oauth-tokens/store.ts +6 -0
- package/corpus/core/src/provider-api/custom-registry.ts +8 -0
- package/corpus/core/src/resources/store.ts +10 -0
- package/corpus/core/src/scripts/runner.ts +6 -3
- package/corpus/core/src/server/action-discovery.ts +6 -0
- package/corpus/core/src/server/action-routes.ts +1 -0
- package/corpus/core/src/server/auth.ts +5 -0
- package/corpus/core/src/server/core-routes-plugin.ts +14 -0
- package/corpus/core/src/server/security-headers.ts +9 -6
- package/corpus/core/src/settings/store.ts +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +93 -0
- package/corpus/core/src/usage/store.ts +6 -0
- package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +60 -6
- package/corpus/templates/calendar/changelog/2026-06-23-added-a-heads-up-explaining-google-s-app-not-verified-screen.md +6 -0
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +20 -43
- package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +5 -1
- package/corpus/templates/clips/app/lib/countdown-audio-cue.ts +3 -51
- package/corpus/templates/clips/changelog/2026-06-23-public-clips-now-play-inline-in-slack-connect-a-workspac.md +6 -0
- package/corpus/templates/clips/chrome-extension/PERMISSIONS.md +72 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -10
- package/corpus/templates/clips/chrome-extension/src/background.ts +34 -1
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +138 -11
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +50 -33
- package/corpus/templates/clips/chrome-extension/src/overlay.css +11 -27
- package/corpus/templates/clips/chrome-extension/src/overlay.html +7 -1
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +33 -38
- package/corpus/templates/clips/chrome-extension/src/popup.ts +6 -24
- package/corpus/templates/clips/chrome-extension/vite.config.ts +5 -0
- package/corpus/templates/clips/server/lib/media-permissions.ts +5 -1
- package/corpus/templates/clips/shared/recording-audio.ts +62 -0
- package/corpus/templates/clips/shared/recording-core.ts +94 -0
- package/dist/action.d.ts +31 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +45 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/context-xray/schema.d.ts +1 -1
- package/dist/agent/observational-memory/schema.d.ts +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +28 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +14 -0
- package/dist/agent/run-store.js.map +1 -1
- package/dist/application-state/store.d.ts.map +1 -1
- package/dist/application-state/store.js +5 -0
- package/dist/application-state/store.js.map +1 -1
- package/dist/audit/actions/get-audit-event.d.ts +11 -0
- package/dist/audit/actions/get-audit-event.d.ts.map +1 -0
- package/dist/audit/actions/get-audit-event.js +22 -0
- package/dist/audit/actions/get-audit-event.js.map +1 -0
- package/dist/audit/actions/list-audit-events.d.ts +22 -0
- package/dist/audit/actions/list-audit-events.d.ts.map +1 -0
- package/dist/audit/actions/list-audit-events.js +61 -0
- package/dist/audit/actions/list-audit-events.js.map +1 -0
- package/dist/audit/cleanup-job.d.ts +12 -0
- package/dist/audit/cleanup-job.d.ts.map +1 -0
- package/dist/audit/cleanup-job.js +93 -0
- package/dist/audit/cleanup-job.js.map +1 -0
- package/dist/audit/config.d.ts +30 -0
- package/dist/audit/config.d.ts.map +1 -0
- package/dist/audit/config.js +65 -0
- package/dist/audit/config.js.map +1 -0
- package/dist/audit/index.d.ts +13 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +6 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/record.d.ts +24 -0
- package/dist/audit/record.d.ts.map +1 -0
- package/dist/audit/record.js +106 -0
- package/dist/audit/record.js.map +1 -0
- package/dist/audit/redact.d.ts +28 -0
- package/dist/audit/redact.d.ts.map +1 -0
- package/dist/audit/redact.js +109 -0
- package/dist/audit/redact.js.map +1 -0
- package/dist/audit/store.d.ts +14 -0
- package/dist/audit/store.d.ts.map +1 -0
- package/dist/audit/store.js +219 -0
- package/dist/audit/store.js.map +1 -0
- package/dist/audit/types.d.ts +114 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +15 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +10 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +6 -1
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/chat/repo-helpers.d.ts +16 -0
- package/dist/client/chat/repo-helpers.d.ts.map +1 -1
- package/dist/client/chat/repo-helpers.js +40 -0
- package/dist/client/chat/repo-helpers.js.map +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +3 -0
- package/dist/db/client.js.map +1 -1
- package/dist/db/widen-columns.d.ts +39 -0
- package/dist/db/widen-columns.d.ts.map +1 -0
- package/dist/db/widen-columns.js +73 -0
- package/dist/db/widen-columns.js.map +1 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +1 -0
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/oauth-tokens/store.d.ts.map +1 -1
- package/dist/oauth-tokens/store.js +6 -0
- package/dist/oauth-tokens/store.js.map +1 -1
- package/dist/provider-api/custom-registry.d.ts.map +1 -1
- package/dist/provider-api/custom-registry.js +8 -0
- package/dist/provider-api/custom-registry.js.map +1 -1
- package/dist/resources/store.d.ts.map +1 -1
- package/dist/resources/store.js +9 -0
- package/dist/resources/store.js.map +1 -1
- package/dist/scripts/runner.js +4 -3
- package/dist/scripts/runner.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +6 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +1 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +5 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +13 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/security-headers.d.ts +8 -5
- package/dist/server/security-headers.d.ts.map +1 -1
- package/dist/server/security-headers.js +9 -6
- package/dist/server/security-headers.js.map +1 -1
- package/dist/settings/store.d.ts.map +1 -1
- package/dist/settings/store.js +6 -0
- package/dist/settings/store.js.map +1 -1
- package/dist/templates/workspace-core/.agents/skills/audit-log/SKILL.md +93 -0
- package/dist/usage/store.d.ts.map +1 -1
- package/dist/usage/store.js +5 -0
- package/dist/usage/store.js.map +1 -1
- package/docs/content/actions.md +23 -0
- package/docs/content/audit-log.md +111 -0
- package/package.json +2 -1
- package/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +93 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.72.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"./org": "./dist/org/index.js",
|
|
98
98
|
"./client/org": "./dist/client/org/index.js",
|
|
99
99
|
"./client/db-admin": "./dist/client/db-admin/index.js",
|
|
100
|
+
"./audit": "./dist/audit/index.js",
|
|
100
101
|
"./sharing": "./dist/sharing/index.js",
|
|
101
102
|
"./sharing/actions/share-resource": "./dist/sharing/actions/share-resource.js",
|
|
102
103
|
"./sharing/actions/unshare-resource": "./dist/sharing/actions/unshare-resource.js",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-log
|
|
3
|
+
description: >-
|
|
4
|
+
Durable, access-scoped, append-only record of who changed what app data,
|
|
5
|
+
when, and whether it was the agent or a human. Use when adding an activity
|
|
6
|
+
feed or change history, declaring what a mutating action targets, auditing
|
|
7
|
+
sensitive reads, or answering "what did the agent change / who edited this".
|
|
8
|
+
scope: dev
|
|
9
|
+
metadata:
|
|
10
|
+
internal: true
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Audit Log
|
|
14
|
+
|
|
15
|
+
## Rule
|
|
16
|
+
|
|
17
|
+
Every mutating action automatically records an audit event — **no wiring
|
|
18
|
+
needed**. The framework captures who/what/when/from-where at the `defineAction`
|
|
19
|
+
seam, redacts credentials, and attributes the change to a human or the agent
|
|
20
|
+
(with the agent thread/turn that caused it). You only touch `audit` config to
|
|
21
|
+
make events *more useful* (declare the target) or to opt a read in / a noisy
|
|
22
|
+
write out.
|
|
23
|
+
|
|
24
|
+
This is distinct from:
|
|
25
|
+
|
|
26
|
+
- **observability** — sampled agent-run telemetry (traces, evals), developer-facing.
|
|
27
|
+
- **tracking** — fire-and-forget product analytics to external SaaS.
|
|
28
|
+
|
|
29
|
+
Audit is complete, durable, locally queryable, and scoped to the data it
|
|
30
|
+
describes.
|
|
31
|
+
|
|
32
|
+
## Declare the target so it lands in the owner's trail
|
|
33
|
+
|
|
34
|
+
By default an event is scoped to the **actor** (you see your own changes and the
|
|
35
|
+
agent's changes on your behalf). To make a change to a *shared* resource show up
|
|
36
|
+
in the **owner's** audit trail, declare the target:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
defineAction({
|
|
40
|
+
description: "Delete a recording",
|
|
41
|
+
schema: z.object({ id: z.string() }),
|
|
42
|
+
audit: {
|
|
43
|
+
// type + id label the event; ownerEmail/orgId/visibility scope who can read it.
|
|
44
|
+
target: (args, result, meta) => ({
|
|
45
|
+
type: "recording",
|
|
46
|
+
id: args.id,
|
|
47
|
+
// Optional — defaults to the actor. Set when editing someone else's resource.
|
|
48
|
+
ownerEmail: result?.ownerEmail,
|
|
49
|
+
visibility: "org",
|
|
50
|
+
}),
|
|
51
|
+
summary: (args) => `Deleted recording ${args.id}`,
|
|
52
|
+
},
|
|
53
|
+
run: async (args, ctx) => { /* ... */ },
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`target`, `ownerEmail`, `visibility`, and `summary` are all optional. The
|
|
58
|
+
minimum useful addition is `target: () => ({ type, id })`.
|
|
59
|
+
|
|
60
|
+
## Defaults and how to override them
|
|
61
|
+
|
|
62
|
+
- **Mutations** (anything not GET / `readOnly`) are audited automatically.
|
|
63
|
+
- **Read-only** actions are skipped. Audit a sensitive read (secret access, bulk
|
|
64
|
+
export) with `audit: { onRead: true }`.
|
|
65
|
+
- **High-frequency framework actions** (app-state sync, context-xray, navigate,
|
|
66
|
+
appearance) are skipped by default. Force one on with `audit: { enabled: true }`.
|
|
67
|
+
- **Opt a noisy write out** with `audit: { enabled: false }`.
|
|
68
|
+
- **Skip capturing arguments** (large/sensitive payloads) with
|
|
69
|
+
`audit: { recordInputs: false }`. Inputs are credential-redacted regardless.
|
|
70
|
+
|
|
71
|
+
## Reading the log
|
|
72
|
+
|
|
73
|
+
Two actions are available to the agent and the frontend in every app, scoped in
|
|
74
|
+
SQL to the caller — they never leak another tenant's rows:
|
|
75
|
+
|
|
76
|
+
- `list-audit-events` — filter by `targetType`/`targetId`, `actorKind`
|
|
77
|
+
(`agent` | `human` | `system`), `status`, `threadId`/`turnId`, `action`,
|
|
78
|
+
`sinceMs`, `limit`.
|
|
79
|
+
- `get-audit-event` — one event by id, with its redacted input payload.
|
|
80
|
+
|
|
81
|
+
Call them from the UI with `useActionQuery` to build an activity feed or a
|
|
82
|
+
"who changed this" line — never hand-write a fetch to the audit table.
|
|
83
|
+
|
|
84
|
+
## Never
|
|
85
|
+
|
|
86
|
+
- Don't write a parallel "history" table for a resource — declare an `audit.target`
|
|
87
|
+
and read it back instead.
|
|
88
|
+
- Don't put secrets in `summary` or rely on inputs being safe — redaction covers
|
|
89
|
+
credential-shaped values, but keep summaries free of sensitive data.
|
|
90
|
+
- Don't expose an update/delete path for audit rows. The log is append-only; the
|
|
91
|
+
only deletion is the retention purge (`AGENT_NATIVE_AUDIT_RETENTION_DAYS`,
|
|
92
|
+
default 365 days; `0` = keep forever). Global kill switch:
|
|
93
|
+
`AGENT_NATIVE_AUDIT_ENABLED=false`.
|