@ftai/dsh-plugin-acn 0.0.0-stage → 0.1.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/CHANGELOG.md +79 -0
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +19 -0
- package/README.md +55 -2
- package/README_EN.md +56 -0
- package/cordis.patch.yml +29 -0
- package/docs/acn-compat.md +33 -0
- package/docs/architecture.md +129 -0
- package/docs/assets/activity-view.png +0 -0
- package/docs/assets/install-package.png +0 -0
- package/docs/assets/knowledge-model.png +0 -0
- package/docs/assets/knowledge-view.png +0 -0
- package/docs/assets/personal-configuration.png +0 -0
- package/docs/assets/session-upstream.png +0 -0
- package/docs/assets/upstream-settings.png +0 -0
- package/docs/assets/upstream-team.png +0 -0
- package/docs/command-reference.md +201 -0
- package/docs/config.md +243 -0
- package/docs/development.md +197 -0
- package/docs/dsh-compat.md +59 -0
- package/docs/index.md +16 -0
- package/docs/outstanding-issues.md +61 -0
- package/docs/user_guide.md +183 -0
- package/icon.svg +8 -0
- package/lib/activities-LRoCwpzw.js +327 -0
- package/lib/alignment-CwH0nBf-.js +80 -0
- package/lib/auth-DFI9yowX.js +71 -0
- package/lib/checkpoint-Bmt8q2vB.js +188 -0
- package/lib/checkpoint-RgcdqifN.js +318 -0
- package/lib/claim-DOAGe8ZK.js +168 -0
- package/lib/client.js +18420 -0
- package/lib/deliver-BuYQaPRW.js +168 -0
- package/lib/delivery-status-D5m3178s.js +87 -0
- package/lib/dispute-CtrInHzf.js +20 -0
- package/lib/disputes-ByEmi43j.js +51 -0
- package/lib/dream-agent-DBszTHXY.js +249 -0
- package/lib/dream.js +4 -0
- package/lib/effects-DJ4Xa7Tx.js +268 -0
- package/lib/errors-Bp_2WXBr.js +19 -0
- package/lib/errors-pPumDOGD.js +18 -0
- package/lib/evidence-store-DLFvSuNa.js +1030 -0
- package/lib/formation-D4LO31WW.js +187 -0
- package/lib/formation-replay-CEOy5FkI.js +87 -0
- package/lib/formation.js +9 -0
- package/lib/inbox-2CugZZQm.js +188 -0
- package/lib/inbox-DFtE2fOp.js +71 -0
- package/lib/inbox.js +3 -0
- package/lib/index.js +1377 -0
- package/lib/lock-DbmlKOoX.js +332 -0
- package/lib/pages-BEWC3kmZ.js +51 -0
- package/lib/paths-CDYV5UH9.js +154 -0
- package/lib/plugins/commands.js +590 -0
- package/lib/plugins/dream.js +66 -0
- package/lib/plugins/formation.js +66 -0
- package/lib/plugins/inbox.js +53 -0
- package/lib/plugins/knowledge.js +1111 -0
- package/lib/plugins/prompt.js +102 -0
- package/lib/plugins/tools.js +280 -0
- package/lib/policy-DnyHh7Bl.js +16 -0
- package/lib/prepare-DwHZudbA.js +134 -0
- package/lib/presentation-BlLjgDjP.js +47 -0
- package/lib/protocol.js +8 -0
- package/lib/queue-M917xHPS.js +153 -0
- package/lib/regular-file-BFpqMoub.js +136 -0
- package/lib/render-CJaVcKKC.js +48 -0
- package/lib/reported-sets-DdEKdeVb.js +122 -0
- package/lib/revision-DeoL_IUN.js +11 -0
- package/lib/scheduler-MaUEbXr3.js +64 -0
- package/lib/service-B7AI5jds.js +344 -0
- package/lib/service-BcHV5mc7.js +305 -0
- package/lib/service-CNjqHCBR.js +505 -0
- package/lib/service-C_i3BzdP.js +1106 -0
- package/lib/session-binding-BQrOGhZI.js +151 -0
- package/lib/session-state-CYqUhC95.js +38 -0
- package/lib/sessions-C2xuPFQv.js +218 -0
- package/lib/store.js +16 -0
- package/lib/structured-lyQCK-Zk.js +452 -0
- package/lib/subagent-yJsFxHmH.js +9 -0
- package/lib/team-credentials-C9xHrPIi.js +579 -0
- package/lib/team.js +3 -0
- package/lib/tool-schema-3b4gH1zf.js +28 -0
- package/lib/trace-Da0RnL5R.js +14 -0
- package/lib/traces-CHBo8y1z.js +11 -0
- package/lib/types/activities.d.ts +71 -0
- package/lib/types/advanced-configuration.d.ts +11 -0
- package/lib/types/client/ActivityDetails.d.ts +18 -0
- package/lib/types/client/AdvancedPreferences.d.ts +8 -0
- package/lib/types/client/BlankCommandFeedback.d.ts +10 -0
- package/lib/types/client/ComposerMenu.d.ts +24 -0
- package/lib/types/client/ConfigurationPage.d.ts +11 -0
- package/lib/types/client/ConnectionCheckDialog.d.ts +12 -0
- package/lib/types/client/KnowledgeDetail.d.ts +6 -0
- package/lib/types/client/KnowledgeDirectoryField.d.ts +11 -0
- package/lib/types/client/KnowledgePanel.d.ts +12 -0
- package/lib/types/client/KnowledgeReference.d.ts +13 -0
- package/lib/types/client/SessionToolbar.d.ts +16 -0
- package/lib/types/client/SettingsToast.d.ts +3 -0
- package/lib/types/client/SourceSessionLink.d.ts +15 -0
- package/lib/types/client/TeamCredentialField.d.ts +16 -0
- package/lib/types/client/TeamSettingsPage.d.ts +30 -0
- package/lib/types/client/configuration-errors.d.ts +2 -0
- package/lib/types/client/interaction-styles.d.ts +1 -0
- package/lib/types/client/interaction-ui.d.ts +30 -0
- package/lib/types/client/knowledge-labels.d.ts +5 -0
- package/lib/types/client/locales.d.ts +51 -0
- package/lib/types/commands/claim.d.ts +4 -0
- package/lib/types/commands/import.d.ts +10 -0
- package/lib/types/commands/status.d.ts +5 -0
- package/lib/types/config.d.ts +122 -0
- package/lib/types/configuration.d.ts +259 -0
- package/lib/types/credentials.d.ts +65 -0
- package/lib/types/dream/audit.d.ts +4 -0
- package/lib/types/dream/autonomous.d.ts +185 -0
- package/lib/types/dream/candidates.d.ts +34 -0
- package/lib/types/dream/checkpoint.d.ts +35 -0
- package/lib/types/dream/evidence-files.d.ts +10 -0
- package/lib/types/dream/evidence-store.d.ts +103 -0
- package/lib/types/dream/evidence.d.ts +30 -0
- package/lib/types/dream/index.d.ts +10 -0
- package/lib/types/dream/plan.d.ts +18 -0
- package/lib/types/dream/preservation.d.ts +6 -0
- package/lib/types/dream/review.d.ts +10 -0
- package/lib/types/dream/schema.d.ts +1475 -0
- package/lib/types/dream/service.d.ts +56 -0
- package/lib/types/dream/sync.d.ts +147 -0
- package/lib/types/dsh-adapter/configuration-remote.d.ts +1 -0
- package/lib/types/dsh-adapter/configuration-service.d.ts +28 -0
- package/lib/types/dsh-adapter/dream-agent.d.ts +4 -0
- package/lib/types/dsh-adapter/dream-evidence.d.ts +3 -0
- package/lib/types/dsh-adapter/formation-archive.d.ts +3 -0
- package/lib/types/dsh-adapter/formation-replay.d.ts +5 -0
- package/lib/types/dsh-adapter/formation.d.ts +4 -0
- package/lib/types/dsh-adapter/interaction-service.d.ts +13 -0
- package/lib/types/dsh-adapter/knowledge-paths.d.ts +3 -0
- package/lib/types/dsh-adapter/llm.d.ts +10 -0
- package/lib/types/dsh-adapter/project-upstream.d.ts +4 -0
- package/lib/types/dsh-adapter/runtime-pool.d.ts +110 -0
- package/lib/types/dsh-adapter/session-binding.d.ts +43 -0
- package/lib/types/dsh-adapter/source-sessions.d.ts +3 -0
- package/lib/types/dsh-adapter/team-credentials.d.ts +5 -0
- package/lib/types/dsh-adapter/tool-schema.d.ts +4 -0
- package/lib/types/dsh-adapter/tools.d.ts +5 -0
- package/lib/types/formation/capture.d.ts +19 -0
- package/lib/types/formation/checkpoint.d.ts +136 -0
- package/lib/types/formation/index.d.ts +10 -0
- package/lib/types/formation/prepare.d.ts +16 -0
- package/lib/types/formation/schema.d.ts +45 -0
- package/lib/types/formation/service.d.ts +58 -0
- package/lib/types/formation/transcript.d.ts +75 -0
- package/lib/types/formation/triggers.d.ts +3 -0
- package/lib/types/inbox/cascade.d.ts +3 -0
- package/lib/types/inbox/effects.d.ts +275 -0
- package/lib/types/inbox/index.d.ts +5 -0
- package/lib/types/inbox/prepare.d.ts +380 -0
- package/lib/types/inbox/service.d.ts +26 -0
- package/lib/types/inbox/sync.d.ts +9 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/interaction-messages.d.ts +69 -0
- package/lib/types/interaction.d.ts +550 -0
- package/lib/types/knowledge/alignment.d.ts +49 -0
- package/lib/types/knowledge/catalog.d.ts +5 -0
- package/lib/types/knowledge/changes.d.ts +32 -0
- package/lib/types/knowledge/disputes.d.ts +3 -0
- package/lib/types/knowledge/errors.d.ts +9 -0
- package/lib/types/knowledge/ordering.d.ts +7 -0
- package/lib/types/knowledge/pages.d.ts +7 -0
- package/lib/types/knowledge/safety.d.ts +2 -0
- package/lib/types/knowledge/service.d.ts +52 -0
- package/lib/types/knowledge/sessions.d.ts +59 -0
- package/lib/types/knowledge/sources.d.ts +2 -0
- package/lib/types/knowledge/timestamps.d.ts +1 -0
- package/lib/types/knowledge/types.d.ts +84 -0
- package/lib/types/llm/response.d.ts +1 -0
- package/lib/types/llm/structured.d.ts +27 -0
- package/lib/types/local-name.d.ts +1 -0
- package/lib/types/plugins/client.d.ts +9 -0
- package/lib/types/plugins/commands.d.ts +11 -0
- package/lib/types/plugins/configuration.d.ts +8 -0
- package/lib/types/plugins/dream.d.ts +16 -0
- package/lib/types/plugins/formation.d.ts +16 -0
- package/lib/types/plugins/inbox.d.ts +16 -0
- package/lib/types/plugins/knowledge.d.ts +19 -0
- package/lib/types/plugins/prompt.d.ts +17 -0
- package/lib/types/plugins/tools.d.ts +10 -0
- package/lib/types/prompt/render.d.ts +2 -0
- package/lib/types/protocol/arbitration.d.ts +154 -0
- package/lib/types/protocol/auth.d.ts +31 -0
- package/lib/types/protocol/claim.d.ts +36 -0
- package/lib/types/protocol/dispute.d.ts +17 -0
- package/lib/types/protocol/ids.d.ts +20 -0
- package/lib/types/protocol/inbox.d.ts +141 -0
- package/lib/types/protocol/index.d.ts +11 -0
- package/lib/types/protocol/policy.d.ts +21 -0
- package/lib/types/protocol/revision.d.ts +2 -0
- package/lib/types/protocol/router.d.ts +114 -0
- package/lib/types/protocol/schema.d.ts +4 -0
- package/lib/types/protocol/time.d.ts +5 -0
- package/lib/types/protocol/trace.d.ts +11 -0
- package/lib/types/store/atomic.d.ts +8 -0
- package/lib/types/store/claim-edits.d.ts +33 -0
- package/lib/types/store/claims.d.ts +7 -0
- package/lib/types/store/context.d.ts +13 -0
- package/lib/types/store/delivery-status.d.ts +47 -0
- package/lib/types/store/disputes.d.ts +6 -0
- package/lib/types/store/entities.d.ts +16 -0
- package/lib/types/store/errors.d.ts +8 -0
- package/lib/types/store/inbox.d.ts +27 -0
- package/lib/types/store/index.d.ts +16 -0
- package/lib/types/store/jobs.d.ts +5 -0
- package/lib/types/store/lock.d.ts +11 -0
- package/lib/types/store/path-names.d.ts +2 -0
- package/lib/types/store/paths.d.ts +45 -0
- package/lib/types/store/presentation.d.ts +13 -0
- package/lib/types/store/regular-file.d.ts +2 -0
- package/lib/types/store/rejected-disputes.d.ts +18 -0
- package/lib/types/store/rename.d.ts +1 -0
- package/lib/types/store/reported-sets.d.ts +24 -0
- package/lib/types/store/session-state.d.ts +17 -0
- package/lib/types/store/traces.d.ts +6 -0
- package/lib/types/store/uploads.d.ts +312 -0
- package/lib/types/store/yaml.d.ts +8 -0
- package/lib/types/team/errors.d.ts +10 -0
- package/lib/types/team/http.d.ts +20 -0
- package/lib/types/team/index.d.ts +5 -0
- package/lib/types/team/maintainer-client.d.ts +18 -0
- package/lib/types/team/router-client.d.ts +14 -0
- package/lib/types/team/service.d.ts +28 -0
- package/lib/types/team/system-proxy.d.ts +9 -0
- package/lib/types/tools/claim.d.ts +63 -0
- package/lib/types/tools/consult-router.d.ts +11 -0
- package/lib/types/tools/subagent.d.ts +8 -0
- package/lib/types/tools/validation.d.ts +2 -0
- package/lib/types/upload/consolidation.d.ts +63 -0
- package/lib/types/upload/deliver.d.ts +15 -0
- package/lib/types/upload/index.d.ts +2 -0
- package/lib/types/upload/scheduler.d.ts +19 -0
- package/lib/types/upstreams.d.ts +5 -0
- package/lib/types/worker/queue.d.ts +17 -0
- package/lib/types/worker/types.d.ts +51 -0
- package/lib/types/worker/worker.d.ts +39 -0
- package/lib/types-C2ST2Zdg.js +17 -0
- package/lib/upload.js +3 -0
- package/lib/uploads-BCA2p92b.js +210 -0
- package/lib/worker-BBTYP2RE.js +185 -0
- package/locale/commands/en.json +1 -0
- package/locale/commands/zh.json +1 -0
- package/locale/dream/en.json +1 -0
- package/locale/dream/zh.json +1 -0
- package/locale/en.json +7 -0
- package/locale/formation/en.json +1 -0
- package/locale/formation/zh.json +1 -0
- package/locale/inbox/en.json +1 -0
- package/locale/inbox/zh.json +1 -0
- package/locale/knowledge/en.json +1 -0
- package/locale/knowledge/zh.json +1 -0
- package/locale/prompt/en.json +1 -0
- package/locale/prompt/zh.json +1 -0
- package/locale/tools/en.json +1 -0
- package/locale/tools/zh.json +1 -0
- package/locale/zh.json +7 -0
- package/package.json +262 -3
- package/prompts/claim_dream.j2 +77 -0
- package/prompts/claim_dream_legacy.j2 +63 -0
- package/prompts/dream_compaction.j2 +11 -0
- package/prompts/dream_evidence.j2 +5 -0
- package/prompts/inbox_claim_attribute_update_internalize.j2 +112 -0
- package/prompts/inbox_policy_update_internalize.j2 +87 -0
- package/prompts/knowledge.j2 +38 -0
- package/prompts/session_recap.j2 +113 -0
- package/prompts/what_is_claim.j2 +51 -0
- package/prompts/what_is_dispute.j2 +21 -0
- package/prompts/what_is_policy.j2 +22 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { d as sessionAllowed } from "../session-binding-BQrOGhZI.js";
|
|
2
|
+
import { n as projectEvent, r as structuredBackend, t as compactionEnd } from "../formation-D4LO31WW.js";
|
|
3
|
+
import { t as loadPromptRenderer } from "../render-CJaVcKKC.js";
|
|
4
|
+
import { n as isSubagent } from "../subagent-yJsFxHmH.js";
|
|
5
|
+
import { t as AcnFormation } from "../service-CNjqHCBR.js";
|
|
6
|
+
import { n as formationReplay, r as connectArchives, t as formationOwnership } from "../formation-replay-CEOy5FkI.js";
|
|
7
|
+
//#region src/plugins/formation.ts
|
|
8
|
+
const name = "acn-formation";
|
|
9
|
+
const inject = [
|
|
10
|
+
"acnKnowledge",
|
|
11
|
+
"acnRuntime",
|
|
12
|
+
"agents",
|
|
13
|
+
"sessions",
|
|
14
|
+
"llm"
|
|
15
|
+
];
|
|
16
|
+
async function apply(ctx) {
|
|
17
|
+
ctx.effect(() => ctx.acnRuntime.component("formation"));
|
|
18
|
+
if (!ctx.acnKnowledge.configured || ctx.acnKnowledge.config.upstreams !== void 0) return;
|
|
19
|
+
const knowledge = ctx.acnKnowledge;
|
|
20
|
+
const worker = knowledge.jobs;
|
|
21
|
+
if (worker === null) return;
|
|
22
|
+
const service = new AcnFormation(ctx.acnKnowledge, structuredBackend(ctx), await loadPromptRenderer(), {}, worker, async (route) => {
|
|
23
|
+
try {
|
|
24
|
+
await ctx.llm.prepareCall(route, AbortSignal.timeout(15e3));
|
|
25
|
+
return true;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}, formationReplay(ctx, knowledge.config));
|
|
30
|
+
ctx.provide("acnFormation", service);
|
|
31
|
+
if (!knowledge.active) {
|
|
32
|
+
ctx.effect(() => () => service.close());
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
ctx.on("session/event", (session, event) => {
|
|
36
|
+
if (sessionAllowed(ctx, knowledge.config, session.header) && !isSubagent(session.header)) {
|
|
37
|
+
const projection = projectEvent(event);
|
|
38
|
+
const until = compactionEnd(event);
|
|
39
|
+
if (Object.keys(projection).length > 0 || until !== void 0) service.capture(session.id, projection, until);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
ctx.on("agent/created", ({ agent }) => {
|
|
43
|
+
if (sessionAllowed(ctx, knowledge.config, agent.session.header) && !isSubagent(agent.session.header)) service.attach(agent.session.id);
|
|
44
|
+
});
|
|
45
|
+
ctx.on("agent/status", ({ agent, status }) => {
|
|
46
|
+
if (sessionAllowed(ctx, knowledge.config, agent.session.header) && !isSubagent(agent.session.header)) if (status === "running") service.running(agent.session.id);
|
|
47
|
+
else service.idle(agent.session.id);
|
|
48
|
+
});
|
|
49
|
+
ctx.on("agent/disposed", ({ agent }) => {
|
|
50
|
+
if (sessionAllowed(ctx, knowledge.config, agent.session.header) && !isSubagent(agent.session.header)) service.disposed(agent.session.id);
|
|
51
|
+
});
|
|
52
|
+
ctx.effect(() => () => service.close());
|
|
53
|
+
for (const agent of ctx.agents.list()) if (sessionAllowed(ctx, knowledge.config, agent.session.header) && !isSubagent(agent.session.header)) {
|
|
54
|
+
service.attach(agent.session.id);
|
|
55
|
+
if (agent.status === "running") service.running(agent.session.id);
|
|
56
|
+
}
|
|
57
|
+
await ctx.inject(["workspaceRegistry"], (child) => connectArchives(child, service, formationOwnership(child, knowledge.config)));
|
|
58
|
+
await service.start();
|
|
59
|
+
}
|
|
60
|
+
var formation_default = {
|
|
61
|
+
name,
|
|
62
|
+
inject,
|
|
63
|
+
apply
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { apply, formation_default as default, inject, name };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { o as RouteSchema } from "../structured-lyQCK-Zk.js";
|
|
2
|
+
import { l as writeYamlAtomic, n as withFileLock } from "../lock-DbmlKOoX.js";
|
|
3
|
+
import { d as sessionAllowed } from "../session-binding-BQrOGhZI.js";
|
|
4
|
+
import { n as projectEvent, r as structuredBackend } from "../formation-D4LO31WW.js";
|
|
5
|
+
import { t as loadPromptRenderer } from "../render-CJaVcKKC.js";
|
|
6
|
+
import { n as isSubagent } from "../subagent-yJsFxHmH.js";
|
|
7
|
+
import { t as AcnInbox } from "../service-BcHV5mc7.js";
|
|
8
|
+
//#region src/plugins/inbox.ts
|
|
9
|
+
const name = "acn-inbox";
|
|
10
|
+
const inject = [
|
|
11
|
+
"acnKnowledge",
|
|
12
|
+
"acnRuntime",
|
|
13
|
+
"agents",
|
|
14
|
+
"sessions",
|
|
15
|
+
"llm"
|
|
16
|
+
];
|
|
17
|
+
async function apply(ctx) {
|
|
18
|
+
const knowledge = ctx.acnKnowledge;
|
|
19
|
+
ctx.effect(() => ctx.acnRuntime.component("inbox"));
|
|
20
|
+
if (!knowledge.configured || knowledge.config.upstreams !== void 0) return;
|
|
21
|
+
const service = new AcnInbox(knowledge, structuredBackend(ctx), await loadPromptRenderer());
|
|
22
|
+
ctx.provide("acnInbox", service);
|
|
23
|
+
if (!knowledge.active) {
|
|
24
|
+
ctx.effect(() => () => service.close());
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let pending = Promise.resolve();
|
|
28
|
+
const schedule = (action) => {
|
|
29
|
+
pending = pending.then(action).then(() => void 0).catch(() => {
|
|
30
|
+
ctx.logger.warn("Could not persist an Inbox trigger or background model route.");
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
ctx.on("session/event", (session, event) => {
|
|
34
|
+
if (!sessionAllowed(ctx, knowledge.config, session.header) || isSubagent(session.header)) return;
|
|
35
|
+
const route = projectEvent(event).route;
|
|
36
|
+
if (route !== void 0) schedule(() => withFileLock(`${knowledge.context().paths.lastRoute}.lock`, () => writeYamlAtomic(knowledge.context().paths.lastRoute, route, RouteSchema, knowledge.logger)));
|
|
37
|
+
});
|
|
38
|
+
ctx.on("agent/created", ({ agent, source }) => {
|
|
39
|
+
if (sessionAllowed(ctx, knowledge.config, agent.session.header) && !isSubagent(agent.session.header) && knowledge.config.inbox.pullOnSessionStart && (source === "startup" || source === "resume")) schedule(() => service.enqueue(true, agent.session.id));
|
|
40
|
+
});
|
|
41
|
+
ctx.effect(() => async () => {
|
|
42
|
+
await service.close();
|
|
43
|
+
await pending;
|
|
44
|
+
});
|
|
45
|
+
await service.start();
|
|
46
|
+
}
|
|
47
|
+
var inbox_default = {
|
|
48
|
+
name,
|
|
49
|
+
inject,
|
|
50
|
+
apply
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { apply, inbox_default as default, inject, name };
|