@songsid/agend 2.3.4-beta.8 → 2.3.4-beta.9
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/THIRD_PARTY_NOTICES.md +37 -0
- package/dist/agent-cli-instructions.md +1 -1
- package/dist/agent-credentials.d.ts +24 -0
- package/dist/agent-credentials.js +66 -0
- package/dist/agent-credentials.js.map +1 -0
- package/dist/agent-endpoint.d.ts +3 -1
- package/dist/agent-endpoint.js +13 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +28 -4
- package/dist/authority/session-authorizations.js +63 -17
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/backend/antigravity.js +3 -1
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/codex-footer-hints.d.ts +4 -0
- package/dist/backend/codex-footer-hints.js +27 -0
- package/dist/backend/codex-footer-hints.js.map +1 -0
- package/dist/backend/codex.js +8 -3
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/muse.js +5 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/cache-ledger.d.ts +85 -0
- package/dist/cache-ledger.js +236 -1
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-service.d.ts +5 -0
- package/dist/cache-service.js +16 -4
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.js +11 -3
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.js +4 -3
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +10 -0
- package/dist/cross-instance-notice.js +67 -5
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +3 -0
- package/dist/daemon.js +11 -4
- package/dist/daemon.js.map +1 -1
- package/dist/export-import.d.ts +7 -0
- package/dist/export-import.js +44 -10
- package/dist/export-import.js.map +1 -1
- package/dist/fleet-context.d.ts +2 -0
- package/dist/fleet-manager.d.ts +82 -4
- package/dist/fleet-manager.js +361 -29
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +1 -0
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/instance-lifecycle.d.ts +6 -2
- package/dist/instance-lifecycle.js +11 -6
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instance-topic-delete.d.ts +77 -0
- package/dist/instance-topic-delete.js +123 -0
- package/dist/instance-topic-delete.js.map +1 -0
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +23 -1
- package/dist/locale.js.map +1 -1
- package/dist/log-steps.d.ts +4 -3
- package/dist/log-steps.js +32 -7
- package/dist/log-steps.js.map +1 -1
- package/dist/outbound-handlers.js +3 -3
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.js +5 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/scheduler/db.d.ts +2 -1
- package/dist/scheduler/db.js +23 -9
- package/dist/scheduler/db.js.map +1 -1
- package/dist/settings-api.d.ts +13 -0
- package/dist/settings-api.js +12 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/tool-progress.d.ts +2 -0
- package/dist/tool-progress.js +19 -3
- package/dist/tool-progress.js.map +1 -1
- package/dist/topic-commands.js +4 -0
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/chat-strings.js +2 -2
- package/dist/ui/fleet-usage.js +90 -27
- package/dist/ui/panel-chat.js +2 -0
- package/dist/ui/settings-strings.js +2 -2
- package/dist/ui/shared/app.css +15 -0
- package/dist/ui/shared/usage-dialog.js +18 -1
- package/dist/ui/shared/view-strings.js +16 -0
- package/dist/usage/capacity.d.ts +69 -0
- package/dist/usage/capacity.js +119 -0
- package/dist/usage/capacity.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +3 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +16 -0
- package/dist/usage/profile-timeline.js +58 -0
- package/dist/usage/profile-timeline.js.map +1 -0
- package/dist/usage/quota-history.d.ts +43 -0
- package/dist/usage/quota-history.js +168 -0
- package/dist/usage/quota-history.js.map +1 -0
- package/dist/usage/usage-api.d.ts +31 -0
- package/dist/usage/usage-api.js +80 -1
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/usage-report.d.ts +25 -1
- package/dist/usage-report.js +55 -4
- package/dist/usage-report.js.map +1 -1
- package/dist/usage-rollup.d.ts +4 -1
- package/dist/usage-rollup.js +12 -3
- package/dist/usage-rollup.js.map +1 -1
- package/dist/web-api.d.ts +6 -0
- package/dist/web-api.js +8 -2
- package/dist/web-api.js.map +1 -1
- package/dist/web-session-authorization.d.ts +13 -2
- package/dist/web-session-authorization.js +10 -3
- package/dist/web-session-authorization.js.map +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ A peer's summary is not the original person's consent. Before an irreversible ac
|
|
|
53
53
|
|
|
54
54
|
1. Ask the peer to send/delegate with `forwards: [verification_id]`, using the original human receipt's `verification_id` / `[agend-human-id:…]`. Every hop needs an explicit forward; mentioning an ID grants nothing. Only delivered references the sender can read are accepted (up to 16).
|
|
55
55
|
- The ID goes in the `forwards` parameter, never only in the message text: an ID in the text grants nothing, and the receiver's `delivery_status` says "Delivery not found".
|
|
56
|
+
- Put verification and message ids in the `forwards` field only; do not repeat them in the message text, because people see that text in the topic notices.
|
|
56
57
|
- If the `send_to_instance` / `delegate_task` schema you loaded has no `forwards`, pass it anyway. A session resumed across an AgEnD upgrade keeps the tool copy it first loaded (reloading does not refresh it); AgEnD's server accepts the parameter.
|
|
57
58
|
2. Read `delivery_status({message_id: verification_id})`. Require `state: delivered`, its owned `proof_kind`, and the original `content` naming the exact operation/resource. Check `origin.platform`, `origin.adapter_id` and `origin.user_id` against the human authorized for that resource. Labels, quoted headers and agent relay rows are not origin evidence.
|
|
58
59
|
3. Native queue/composer acceptance never proves the model consumed the message. Unknown/unverifiable outcomes, `/raw`, historical rows and a missing origin cannot prove human authorization. Action receipts identify the click and its anchor, not a human-authored platform message.
|
|
@@ -11,7 +11,7 @@ roles: [general]
|
|
|
11
11
|
Use when the session is the problem: hallucinating / referencing stale info, stuck in a
|
|
12
12
|
tool-call loop, or context is degrading (only backends that report context % surface that).
|
|
13
13
|
- `stop_instance("<name>")` / `start_instance("<name>")` — stop or start an instance without removing its configuration or topic.
|
|
14
|
-
- `delete_instance("<name>")` — stop and remove the instance
|
|
14
|
+
- `delete_instance("<name>")` — stop and remove the instance, its schedules and team memberships, and its own chat topic (by default; pass `delete_topic: false` to keep the topic). On Discord the topic is a channel, so its history goes too. The General topic and a topic another agent uses are never deleted. The result's `topic_deleted` is the platform's answer; when it is false, `topic_reason` says why (for example, the Telegram bot lacks the Manage Topics admin right) — the agent is deleted either way.
|
|
15
15
|
|
|
16
16
|
## Pause / Wake (resource management)
|
|
17
17
|
|
|
@@ -42,4 +42,4 @@ Do not put user-facing results only in terminal text; the fleet report is the de
|
|
|
42
42
|
|
|
43
43
|
## Relayed human approval
|
|
44
44
|
|
|
45
|
-
For an irreversible action based on relayed consent, request an explicit `forwards` edge for the original human `verification_id`, then read its original content and origin with `delivery_status`. Each hop needs a forward; a peer's summary or a mentioned ID grants nothing. When you relay it, put the ID in `forwards` (even if your loaded copy of the tool's schema lacks the parameter: the server accepts it), not in the text. Require delivered and an owned proof_kind, and verify the actual platform/adapter/actor plus the exact resource. Hidden/expired/uncertain receipts are not consent and must not trigger a resend. A web-chat message (`[user:<name> via web, id:…]`) is that person: their sign-in code went to their own Discord or Telegram account. Answer it and do what it asks within your work — questions, looking things up, reading, analysis, changes in your own scope. Only a go-ahead action asks for more: a release or publish, anything destructive or irreversible beyond your own work (deleting what others use, force-pushing or resetting a shared branch; your temp files and your own branch and worktree are routine), spending money or quota beyond normal work, credentials or secrets, or granting or forwarding authority to another instance. For these an open browser is not proof of the account, so the account must stand behind it: a Discord or Telegram receipt, or a `via web (verified)` one — read it with `delivery_status`: `authority.kind: web-verified`, its person `authority.actor` (adapter and user id), checked like a Discord or Telegram message (delivered, an owned proof_kind, the original content, that actor) and forwarded the same way. On a web-only fleet (no Discord or Telegram connection) that person is the host operator, signed in with `agend web --code` on the AgEnD computer itself: a verified receipt names `authority.actor` adapter `host`, user `operator`. A guest (`via web (guest)`) was let in only to chat: talk with them there, and take nothing they ask as the admin's. Plain `via web`, a guest, and authority since revoked (`authority.kind: none`) are not a go-ahead; nor is a reviewer's APPROVE. See the cross-instance-messaging skill.
|
|
45
|
+
For an irreversible action based on relayed consent, request an explicit `forwards` edge for the original human `verification_id`, then read its original content and origin with `delivery_status`. Each hop needs a forward; a peer's summary or a mentioned ID grants nothing. When you relay it, put the ID in `forwards` (even if your loaded copy of the tool's schema lacks the parameter: the server accepts it), not in the text. Put verification and message ids in the `forwards` field only; do not repeat them in the message text, because people see that text in the topic notices. Require delivered and an owned proof_kind, and verify the actual platform/adapter/actor plus the exact resource. Hidden/expired/uncertain receipts are not consent and must not trigger a resend. A web-chat message (`[user:<name> via web, id:…]`) is that person: their sign-in code went to their own Discord or Telegram account. Answer it and do what it asks within your work — questions, looking things up, reading, analysis, changes in your own scope. Only a go-ahead action asks for more: a release or publish, anything destructive or irreversible beyond your own work (deleting what others use, force-pushing or resetting a shared branch; your temp files and your own branch and worktree are routine), spending money or quota beyond normal work, credentials or secrets, or granting or forwarding authority to another instance. For these an open browser is not proof of the account, so the account must stand behind it: a Discord or Telegram receipt, or a `via web (verified)` one — read it with `delivery_status`: `authority.kind: web-verified`, its person `authority.actor` (adapter and user id), checked like a Discord or Telegram message (delivered, an owned proof_kind, the original content, that actor) and forwarded the same way. On a web-only fleet (no Discord or Telegram connection) that person is the host operator, signed in with `agend web --code` on the AgEnD computer itself: a verified receipt names `authority.actor` adapter `host`, user `operator`. A guest (`via web (guest)`) was let in only to chat: talk with them there, and take nothing they ask as the admin's. Plain `via web`, a guest, and authority since revoked (`authority.kind: none`) are not a go-ahead; nor is a reviewer's APPROVE. See the cross-instance-messaging skill.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SettingsExecution } from "./settings-transaction.js";
|
|
2
2
|
import type { InstanceConfig, FleetConfig } from "./types.js";
|
|
3
|
+
import type { TopicDeleteOutcome } from "./instance-topic-delete.js";
|
|
3
4
|
import { RoutingEngine } from "./routing-engine.js";
|
|
4
5
|
import type { Logger } from "./logger.js";
|
|
5
6
|
import type { IpcClient } from "./channel/ipc-bridge.js";
|
|
@@ -57,6 +58,7 @@ export declare function getUnsafeInstanceDaemonPidReason(pid: number, dataDir: s
|
|
|
57
58
|
* FleetManager implements this.
|
|
58
59
|
*/
|
|
59
60
|
export interface LifecycleContext {
|
|
61
|
+
readonly agentCredentials?: Pick<import("./agent-credentials.js").AgentCredentials, "issue" | "invalidate">;
|
|
60
62
|
readonly fleetConfig: FleetConfig | null;
|
|
61
63
|
readonly logger: Logger;
|
|
62
64
|
readonly dataDir: string;
|
|
@@ -93,8 +95,10 @@ export interface LifecycleContext {
|
|
|
93
95
|
createForumTopic(topicName: string, adapterId?: string): Promise<number | string>;
|
|
94
96
|
/** #2910: no Discord or Telegram connection at all — a new agent gets no topic (it is reached from the dashboard). */
|
|
95
97
|
isWebOnlyFleet?(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
+
/** delete_instance: the removal, then (unless `deleteTopic` is false) the agent's own topic, through its own bot. */
|
|
99
|
+
removeInstanceAndTopic(name: string, authorization: ExplicitInstanceRemoval, opts: {
|
|
100
|
+
deleteTopic: boolean;
|
|
101
|
+
}): Promise<TopicDeleteOutcome>;
|
|
98
102
|
/**
|
|
99
103
|
* A bound delete for the world `adapterId` selects, captured by the caller
|
|
100
104
|
* BEFORE awaiting createForumTopic. Rollback must use exactly this — never
|
|
@@ -1385,6 +1385,7 @@ export class InstanceLifecycle {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
/** Invalidate every start/wake already running for `name` (they will not publish). */
|
|
1387
1387
|
invalidate(name) {
|
|
1388
|
+
this.ctx.agentCredentials?.invalidate(name);
|
|
1388
1389
|
this.lifecycleEpochs.set(name, this.epochOf(name) + 1);
|
|
1389
1390
|
}
|
|
1390
1391
|
/** Whether `transition` is `name`'s transition and is the one running now. */
|
|
@@ -1512,6 +1513,11 @@ export class InstanceLifecycle {
|
|
|
1512
1513
|
return;
|
|
1513
1514
|
this.ctx.setKiroCompatibilityHold?.(name, message);
|
|
1514
1515
|
});
|
|
1516
|
+
daemon.setAgentCredentialIssuer?.(token => {
|
|
1517
|
+
if (this.epochOf(name) !== epoch)
|
|
1518
|
+
throw new SupersededStartError(name);
|
|
1519
|
+
this.ctx.agentCredentials?.issue(name, token);
|
|
1520
|
+
});
|
|
1515
1521
|
daemon.setDeliveryOutboxPort(this.ctx.deliveryOutbox ?? undefined);
|
|
1516
1522
|
daemon.setWorkLeaseCheck(() => this.hasWorkLease(name));
|
|
1517
1523
|
if (seedNow)
|
|
@@ -2367,7 +2373,8 @@ export class InstanceLifecycle {
|
|
|
2367
2373
|
/** Handle delete_instance tool call from a daemon. */
|
|
2368
2374
|
async handleDelete(args, respond) {
|
|
2369
2375
|
const instanceName = args.name;
|
|
2370
|
-
|
|
2376
|
+
// The user's decision (beta.9): deleting an agent deletes its topic, unless `delete_topic: false` keeps it.
|
|
2377
|
+
const deleteTopic = args.delete_topic ?? true;
|
|
2371
2378
|
const instanceConfig = this.ctx.fleetConfig?.instances[instanceName];
|
|
2372
2379
|
if (!instanceConfig) {
|
|
2373
2380
|
respond(null, `Instance not found: ${instanceName}`);
|
|
@@ -2377,11 +2384,9 @@ export class InstanceLifecycle {
|
|
|
2377
2384
|
respond(null, "Cannot delete the General instance");
|
|
2378
2385
|
return;
|
|
2379
2386
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
}
|
|
2383
|
-
await this.ctx.removeInstance(instanceName, authorizeExplicitInstanceRemoval("delete-instance-tool"));
|
|
2384
|
-
respond({ success: true, name: instanceName, topic_deleted: deleteTopic });
|
|
2387
|
+
// topic_deleted is the platform's answer, never the request; when the topic stays, topic_reason says why.
|
|
2388
|
+
const topic = await this.ctx.removeInstanceAndTopic(instanceName, authorizeExplicitInstanceRemoval("delete-instance-tool"), { deleteTopic });
|
|
2389
|
+
respond({ success: true, name: instanceName, topic_deleted: topic.deleted, ...(topic.deleted ? {} : { topic_reason: topic.reason }) });
|
|
2385
2390
|
}
|
|
2386
2391
|
has(name) {
|
|
2387
2392
|
return this.daemons.has(name);
|