@segmentstream/agent 0.63.0 → 0.64.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 +18 -0
- package/README.md +1 -0
- package/dist/_chunks/{build-metadata-B6igFj94.mjs → build-metadata-IxPkc2J2.mjs} +1 -1
- package/dist/_chunks/{principal-TJ6zB2rF.mjs → principal-CDPJQgPO.mjs} +25 -2
- package/dist/extension/channels/revisions.d.ts +8 -0
- package/dist/extension/channels/revisions.mjs +9 -0
- package/dist/extension/connections/ontology.mjs +1 -1
- package/dist/extension/hooks/authorization.mjs +1 -1
- package/dist/extension/instructions/persona.mjs +1 -1
- package/dist/extension/instructions/revision.d.ts +2 -0
- package/dist/extension/instructions/revision.mjs +29 -0
- package/dist/extension/instructions.md +5 -4
- package/dist/extension/lib/actor.d.ts +13 -7
- package/dist/extension/lib/actor.mjs +1 -1
- package/dist/extension/lib/attachment-tools.mjs +1 -1
- package/dist/extension/lib/attachments-send.mjs +1 -1
- package/dist/extension/lib/attachments.mjs +1 -1
- package/dist/extension/lib/build-metadata.mjs +1 -1
- package/dist/extension/lib/chat-address.mjs +1 -1
- package/dist/extension/lib/chat-context.d.ts +3 -2
- package/dist/extension/lib/chat-context.mjs +4 -3
- package/dist/extension/lib/chat-recorder.mjs +11 -1
- package/dist/extension/lib/confirmations.mjs +1 -1
- package/dist/extension/lib/email/attachments-send.mjs +1 -1
- package/dist/extension/lib/email/channel.mjs +1 -1
- package/dist/extension/lib/guest-usage.mjs +1 -1
- package/dist/extension/lib/inbound-media/files.mjs +1 -1
- package/dist/extension/lib/inbound-media/index.mjs +1 -1
- package/dist/extension/lib/ontology-connection.mjs +1 -1
- package/dist/extension/lib/ontology-file-call.mjs +1 -1
- package/dist/extension/lib/ontology-tools.mjs +1 -1
- package/dist/extension/lib/review/client.d.ts +1 -1
- package/dist/extension/lib/review/hold.mjs +1 -1
- package/dist/extension/lib/review/reply.mjs +1 -1
- package/dist/extension/lib/review/revision-channel.d.ts +42 -0
- package/dist/extension/lib/review/revision-channel.mjs +120 -0
- package/dist/extension/lib/review/revision.d.ts +102 -0
- package/dist/extension/lib/review/revision.mjs +213 -0
- package/dist/extension/lib/role-skill.mjs +1 -1
- package/dist/extension/lib/runtime-envelope.mjs +1 -1
- package/dist/extension/lib/sent-files.mjs +1 -1
- package/dist/extension/lib/slack/adapter.mjs +1 -1
- package/dist/extension/lib/slack/attachments-send.mjs +1 -1
- package/dist/extension/lib/stored-files.mjs +1 -1
- package/dist/extension/lib/telegram/adapter.mjs +2 -2
- package/dist/extension/lib/telegram/attachment-description.mjs +1 -1
- package/dist/extension/lib/telegram/attachments-send.mjs +1 -1
- package/dist/extension/lib/telegram/callbacks.mjs +1 -1
- package/dist/extension/lib/telegram/chat-archive.mjs +1 -1
- package/dist/extension/lib/telegram/confirmations.mjs +1 -1
- package/dist/extension/lib/telegram/customer-text.mjs +1 -1
- package/dist/extension/lib/telegram/files.mjs +1 -1
- package/dist/extension/lib/telegram/health.mjs +1 -1
- package/dist/extension/lib/telegram/held-approvals.mjs +1 -1
- package/dist/extension/lib/telegram/inbound-request.mjs +1 -1
- package/dist/extension/lib/telegram/inbound.mjs +1 -1
- package/dist/extension/lib/telegram/lifecycle.mjs +2 -2
- package/dist/extension/lib/telegram/principal.mjs +1 -1
- package/dist/extension/lib/telegram/session-recovery.mjs +1 -1
- package/dist/extension/lib/telegram/silent.mjs +1 -1
- package/dist/extension/lib/telegram/structured.mjs +1 -1
- package/dist/extension/lib/telegram/turn-errors.mjs +1 -1
- package/dist/extension/lib/telegram/workspace-action.mjs +1 -1
- package/dist/extension/lib/web/auth.mjs +1 -1
- package/dist/extension/lib/web/channel.mjs +1 -1
- package/dist/extension/lib/whatsapp/adapter.mjs +1 -1
- package/dist/extension/lib/whatsapp/attachments-send.mjs +1 -1
- package/dist/extension/lib/whatsapp/files.mjs +1 -1
- package/dist/extension/lib/workspace-channel/attachments-send.mjs +1 -1
- package/dist/extension/lib/workspace-channel/channel.mjs +1 -1
- package/dist/extension/lib/workspace-source.mjs +1 -1
- package/dist/extension/model.mjs +1 -1
- package/dist/extension/tools/attachments_discard.mjs +1 -1
- package/dist/extension/tools/attachments_list.mjs +1 -1
- package/dist/extension/tools/attachments_promote.mjs +1 -1
- package/dist/extension/tools/attachments_read.mjs +1 -1
- package/dist/extension/tools/attachments_send.mjs +1 -1
- package/dist/extension/tools/attachments_stage.mjs +1 -1
- package/dist/extension/tools/attachments_table.mjs +1 -1
- package/dist/extension/tools/handoff.mjs +1 -1
- package/dist/extension/tools/questions_ask.mjs +1 -1
- package/dist/extension/tools/unanswered.mjs +2 -1
- package/dist/extension/tools/workspace_source.mjs +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { chatArchive } from "../chat-archive.mjs";
|
|
8
|
+
import { appOrigin, channelsEnabled, runtimeIdentityEnvironment } from "../environment.mjs";
|
|
9
|
+
import { runtimeTokenVerifier } from "../runtime-identity.mjs";
|
|
10
|
+
import { runtimeToken } from "../runtime-token.mjs";
|
|
11
|
+
import { runtimeRequestFailure } from "../telegram/runtime-request.mjs";
|
|
12
|
+
import { REVISION_ROUTE, agentRevisions, eveSessionStream, revisionAddress, revisionContext, revisionOf, revisionPrincipal, revisionRequest } from "./revision.mjs";
|
|
13
|
+
import { reply } from "eve/events";
|
|
14
|
+
import { defineState } from "eve/context";
|
|
15
|
+
import { POST, defineChannel } from "eve/channels";
|
|
16
|
+
const revisionReports = defineState("segmentstream.revision", () => ({}));
|
|
17
|
+
function error(code, status) {
|
|
18
|
+
return Response.json({ error: code }, { status });
|
|
19
|
+
}
|
|
20
|
+
function replyText(view, turnId) {
|
|
21
|
+
return reply(view, turnId).filter((part) => part.kind === "text" && part.interrupted !== true).flatMap((part) => typeof part.value === "string" ? [part.value] : []).join("\n").trim();
|
|
22
|
+
}
|
|
23
|
+
function revisionEvents(input) {
|
|
24
|
+
const state = input.state ?? revisionReports;
|
|
25
|
+
const log = input.log ?? ((message, detail) => console.error(message, detail));
|
|
26
|
+
async function finish(principal, text) {
|
|
27
|
+
const revision = revisionOf(principal);
|
|
28
|
+
if (revision === void 0 || state.get().reported === revision.revision) return;
|
|
29
|
+
if (text !== void 0 && text !== "") state.update((current) => ({
|
|
30
|
+
...current,
|
|
31
|
+
text
|
|
32
|
+
}));
|
|
33
|
+
const kept = text === void 0 || text === "" ? state.get().text : text;
|
|
34
|
+
try {
|
|
35
|
+
await input.report()({
|
|
36
|
+
reviewId: revision.reviewId,
|
|
37
|
+
revision: revision.revision,
|
|
38
|
+
...kept === void 0 ? {} : { text: kept }
|
|
39
|
+
});
|
|
40
|
+
state.update(() => ({ reported: revision.revision }));
|
|
41
|
+
} catch (cause) {
|
|
42
|
+
log("[segmentstream] revision_report_failed", {
|
|
43
|
+
reviewId: revision.reviewId,
|
|
44
|
+
error: cause
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
async "turn.paused"(_event, ctx) {
|
|
50
|
+
await finish(ctx.session.auth.current, void 0);
|
|
51
|
+
},
|
|
52
|
+
async "turn.settled"(event, ctx) {
|
|
53
|
+
const { outcome, turnId } = event.data;
|
|
54
|
+
await finish(ctx.session.auth.current, outcome === "completed" ? replyText(ctx.view, turnId) : void 0);
|
|
55
|
+
},
|
|
56
|
+
async "session.ended"(_event, ctx) {
|
|
57
|
+
await finish(ctx.session.auth.current, void 0);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function revisionChannel(options = {}) {
|
|
62
|
+
const environment = options.environment ?? process.env;
|
|
63
|
+
const log = options.log ?? ((message, detail) => console.error(message, detail));
|
|
64
|
+
let verify = options.verify;
|
|
65
|
+
let report = options.report;
|
|
66
|
+
let archive = options.archive;
|
|
67
|
+
const reporter = () => report ??= agentRevisions({
|
|
68
|
+
origin: appOrigin(environment),
|
|
69
|
+
token: options.token ?? runtimeToken,
|
|
70
|
+
...options.fetch === void 0 ? {} : { fetch: options.fetch }
|
|
71
|
+
});
|
|
72
|
+
const authenticate = (request) => runtimeRequestFailure(request, {
|
|
73
|
+
enabled: () => true,
|
|
74
|
+
configured: () => channelsEnabled(environment),
|
|
75
|
+
verify: () => verify ??= runtimeTokenVerifier(runtimeIdentityEnvironment(environment))
|
|
76
|
+
});
|
|
77
|
+
async function start(request, args) {
|
|
78
|
+
const failure = await authenticate(request);
|
|
79
|
+
if (failure !== void 0) return failure;
|
|
80
|
+
let body;
|
|
81
|
+
try {
|
|
82
|
+
body = await request.json();
|
|
83
|
+
} catch {
|
|
84
|
+
return error("invalid_request", 400);
|
|
85
|
+
}
|
|
86
|
+
const revision = revisionRequest(body);
|
|
87
|
+
if (revision === void 0) return error("invalid_request", 400);
|
|
88
|
+
const source = args.from(revisionAddress(revision.reviewId, revision.revision));
|
|
89
|
+
try {
|
|
90
|
+
const context = await revisionContext({
|
|
91
|
+
request: revision,
|
|
92
|
+
archive: archive ??= chatArchive({ environment }),
|
|
93
|
+
stream: options.stream ?? eveSessionStream,
|
|
94
|
+
log
|
|
95
|
+
});
|
|
96
|
+
await source.send(revision.note, {
|
|
97
|
+
auth: revisionPrincipal(revision),
|
|
98
|
+
context
|
|
99
|
+
});
|
|
100
|
+
} catch (cause) {
|
|
101
|
+
log("[segmentstream] revision_start_failed", {
|
|
102
|
+
reviewId: revision.reviewId,
|
|
103
|
+
error: cause
|
|
104
|
+
});
|
|
105
|
+
return error("unavailable", 503);
|
|
106
|
+
}
|
|
107
|
+
return Response.json({ accepted: true }, { status: 202 });
|
|
108
|
+
}
|
|
109
|
+
return defineChannel({
|
|
110
|
+
state: {},
|
|
111
|
+
context: () => ({}),
|
|
112
|
+
routes: [POST(REVISION_ROUTE, start)],
|
|
113
|
+
events: revisionEvents({
|
|
114
|
+
report: reporter,
|
|
115
|
+
...options.state === void 0 ? {} : { state: options.state },
|
|
116
|
+
log
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export { revisionChannel, revisionEvents, revisionReports };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { SessionAuthContext } from "eve/context";
|
|
2
|
+
import type { ChatArchive } from "../chat-archive.js";
|
|
3
|
+
import type { RuntimeToken } from "../runtime-token.js";
|
|
4
|
+
/**
|
|
5
|
+
* Redrafts (`docs/agent.md`, "Reply review"): a member hands a reply the agent held for review back
|
|
6
|
+
* with a note, and the agent writes it again in a session of its own. That session acts as the
|
|
7
|
+
* person the reply is for, reading only; it reads the chat and what the session that wrote the
|
|
8
|
+
* reply looked up for it, and its answer becomes a new held reply that replaces the first. The
|
|
9
|
+
* person's own session never sees the note: it learns only what became of its reply.
|
|
10
|
+
*/
|
|
11
|
+
/** The route authenticator of a redraft session's principal. */
|
|
12
|
+
export declare const REVISION_AUTHENTICATOR = "segmentstream-review-revision";
|
|
13
|
+
/** Where the ontology hands a held reply back with a member's note. eve reserves `/eve/v1/*`. */
|
|
14
|
+
export declare const REVISION_ROUTE = "/eve/segmentstream/v1/reviews/revise";
|
|
15
|
+
/** The scope a redraft narrows its ontology requests to: the person's reads alone. */
|
|
16
|
+
export declare const REVISION_SCOPE = "ontology:read";
|
|
17
|
+
/** The header that narrows an ontology request to a scope. */
|
|
18
|
+
export declare const AGENT_SCOPE_HEADER = "X-SegmentStream-Agent-Scope";
|
|
19
|
+
/** The redraft channel's address of one redraft of a review. */
|
|
20
|
+
export declare function revisionAddress(reviewId: string, revision: string): string;
|
|
21
|
+
/** A held reply handed back for redrafting, as the ontology's request names it. */
|
|
22
|
+
export interface RevisionRequest {
|
|
23
|
+
readonly reviewId: string;
|
|
24
|
+
/** The redraft asked for: only its result replaces the review. */
|
|
25
|
+
readonly revision: string;
|
|
26
|
+
/** What the member asked the agent to change, in their words. */
|
|
27
|
+
readonly note: string;
|
|
28
|
+
/** The person the reply is for, and the roles they hold now. */
|
|
29
|
+
readonly memberId: string;
|
|
30
|
+
readonly roles: ReadonlyArray<string>;
|
|
31
|
+
/** The session that wrote the reply, and the key of the reply it first held, `<session>:<part>`. */
|
|
32
|
+
readonly sessionId: string;
|
|
33
|
+
readonly key: string;
|
|
34
|
+
readonly provider: string;
|
|
35
|
+
/** The channel the chat is on, by name, as the chat archive keys it. */
|
|
36
|
+
readonly channel: string;
|
|
37
|
+
readonly chatId: string;
|
|
38
|
+
readonly threadId: string | null;
|
|
39
|
+
readonly chatKind: "private" | "group";
|
|
40
|
+
readonly draft: string;
|
|
41
|
+
}
|
|
42
|
+
/** The ontology's request, or `undefined` when it is not one. */
|
|
43
|
+
export declare function revisionRequest(body: unknown): RevisionRequest | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The principal of a redraft session: the person the reply is for, with the roles they hold now, so
|
|
46
|
+
* the session writes as the agent writes to them, and none of the agent's own tools. It comes from
|
|
47
|
+
* the ontology's request, which only this deployment's functions may make.
|
|
48
|
+
*/
|
|
49
|
+
export declare function revisionPrincipal(request: RevisionRequest): SessionAuthContext;
|
|
50
|
+
/** The review and redraft a redraft session's principal names; `undefined` for any other session. */
|
|
51
|
+
export declare function revisionOf(principal: SessionAuthContext | null | undefined): {
|
|
52
|
+
readonly reviewId: string;
|
|
53
|
+
readonly revision: string;
|
|
54
|
+
readonly memberId: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
/** An event of a session's stream, as eve's server reads it. */
|
|
57
|
+
export interface StreamEvent {
|
|
58
|
+
readonly type: string;
|
|
59
|
+
readonly data: unknown;
|
|
60
|
+
readonly scope?: {
|
|
61
|
+
readonly turnId?: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
}
|
|
64
|
+
/** Reads a session's whole recorded stream. */
|
|
65
|
+
export type SessionStream = (sessionId: string) => AsyncIterable<StreamEvent>;
|
|
66
|
+
/** The deployment's own session store, which exists only inside the deployed agent. */
|
|
67
|
+
export declare const eveSessionStream: SessionStream;
|
|
68
|
+
/**
|
|
69
|
+
* What the session that wrote the reply looked up in the turn that wrote it: each tool call with its
|
|
70
|
+
* input and output, in order, as JSON lines. The reply's part names the turn: a channel that holds
|
|
71
|
+
* a turn's whole reply names the turn itself, and another names the reply's part of it. A value too
|
|
72
|
+
* large for the stream to carry inline is left out.
|
|
73
|
+
*/
|
|
74
|
+
export declare function turnLookups(stream: SessionStream, sessionId: string, partId: string): Promise<ReadonlyArray<string>>;
|
|
75
|
+
/**
|
|
76
|
+
* The context a redraft session starts with, ahead of the member's note: the chat with the person,
|
|
77
|
+
* what the session that wrote the reply looked up for it, and the reply as it was written. Each part
|
|
78
|
+
* that cannot be read is left out, and the session writes from what remains.
|
|
79
|
+
*/
|
|
80
|
+
export declare function revisionContext(input: {
|
|
81
|
+
readonly request: RevisionRequest;
|
|
82
|
+
readonly archive: ChatArchive;
|
|
83
|
+
readonly stream: SessionStream;
|
|
84
|
+
readonly log?: (message: string, detail: unknown) => void;
|
|
85
|
+
}): Promise<ReadonlyArray<string>>;
|
|
86
|
+
/** Reports what became of a redraft: its text, or, without one, that the agent wrote none. */
|
|
87
|
+
export type ReportRevision = (input: {
|
|
88
|
+
readonly reviewId: string;
|
|
89
|
+
readonly revision: string;
|
|
90
|
+
readonly text?: string;
|
|
91
|
+
}) => Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* The ontology's redraft route, with the deployment's runtime token. A report the ontology could not
|
|
94
|
+
* take for a while is sent again; the ontology holds a redraft once, however often it is reported.
|
|
95
|
+
*/
|
|
96
|
+
export declare function agentRevisions(input: {
|
|
97
|
+
readonly origin: string;
|
|
98
|
+
readonly token: RuntimeToken;
|
|
99
|
+
readonly fetch?: typeof fetch;
|
|
100
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
101
|
+
readonly now?: () => number;
|
|
102
|
+
}): ReportRevision;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { redactDiagnostic } from "../diagnostics.mjs";
|
|
8
|
+
import { AgentIdentityError, refusal } from "../identities.mjs";
|
|
9
|
+
import { readChat } from "./judge.mjs";
|
|
10
|
+
const REVISION_AUTHENTICATOR = "segmentstream-review-revision";
|
|
11
|
+
const REVISION_ROUTE = "/eve/segmentstream/v1/reviews/revise";
|
|
12
|
+
const REVISION_SCOPE = "ontology:read";
|
|
13
|
+
const AGENT_SCOPE_HEADER = "X-SegmentStream-Agent-Scope";
|
|
14
|
+
function revisionAddress(reviewId, revision) {
|
|
15
|
+
return `revision:${reviewId}:${revision}`;
|
|
16
|
+
}
|
|
17
|
+
const ID = /^[0-9A-Za-z][0-9A-Za-z:_.@+-]{0,511}$/u;
|
|
18
|
+
const NOTE_LIMIT = 2e3;
|
|
19
|
+
const TEXT_LIMIT = 2e4;
|
|
20
|
+
function text(value, limit = 512) {
|
|
21
|
+
return typeof value === "string" && value !== "" && value.length <= limit ? value : void 0;
|
|
22
|
+
}
|
|
23
|
+
function revisionRequest(body) {
|
|
24
|
+
if (typeof body !== "object" || body === null || Array.isArray(body)) return;
|
|
25
|
+
const record = body;
|
|
26
|
+
const reviewId = text(record.review_id, 64);
|
|
27
|
+
const revision = text(record.revision, 64);
|
|
28
|
+
const note = text(record.note, NOTE_LIMIT)?.trim();
|
|
29
|
+
const memberId = text(record.member_id);
|
|
30
|
+
const sessionId = text(record.session_id);
|
|
31
|
+
const provider = text(record.provider, 64);
|
|
32
|
+
const channel = text(record.channel, 64);
|
|
33
|
+
const chatId = text(record.chat_id);
|
|
34
|
+
const draft = text(record.draft, TEXT_LIMIT);
|
|
35
|
+
const roles = record.roles;
|
|
36
|
+
const key = text(record.key);
|
|
37
|
+
const threadId = record.thread_id === null ? null : text(record.thread_id);
|
|
38
|
+
if (reviewId === void 0 || revision === void 0 || note === void 0 || note === "" || memberId === void 0 || !ID.test(memberId) || sessionId === void 0 || provider === void 0 || channel === void 0 || chatId === void 0 || draft === void 0 || key === void 0 || threadId === void 0 || !Array.isArray(roles) || !roles.every((role) => typeof role === "string") || record.chat_kind !== "private" && record.chat_kind !== "group") return;
|
|
39
|
+
return {
|
|
40
|
+
reviewId,
|
|
41
|
+
revision,
|
|
42
|
+
note,
|
|
43
|
+
memberId,
|
|
44
|
+
roles,
|
|
45
|
+
sessionId,
|
|
46
|
+
key,
|
|
47
|
+
provider,
|
|
48
|
+
channel,
|
|
49
|
+
chatId,
|
|
50
|
+
threadId,
|
|
51
|
+
chatKind: record.chat_kind,
|
|
52
|
+
draft
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function revisionPrincipal(request) {
|
|
56
|
+
return {
|
|
57
|
+
authenticator: REVISION_AUTHENTICATOR,
|
|
58
|
+
principalType: "user",
|
|
59
|
+
principalId: request.memberId,
|
|
60
|
+
attributes: {
|
|
61
|
+
memberId: request.memberId,
|
|
62
|
+
roles: request.roles,
|
|
63
|
+
reviewId: request.reviewId,
|
|
64
|
+
revision: request.revision
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function revisionOf(principal) {
|
|
69
|
+
if (principal?.authenticator !== "segmentstream-review-revision") return;
|
|
70
|
+
const { reviewId, revision, memberId } = principal.attributes;
|
|
71
|
+
return typeof reviewId === "string" && reviewId !== "" && typeof revision === "string" && revision !== "" && typeof memberId === "string" && memberId !== "" ? {
|
|
72
|
+
reviewId,
|
|
73
|
+
revision,
|
|
74
|
+
memberId
|
|
75
|
+
} : void 0;
|
|
76
|
+
}
|
|
77
|
+
const eveSessionStream = async function* (sessionId) {
|
|
78
|
+
const { sessions } = await import("eve/server");
|
|
79
|
+
yield* sessions.attach(sessionId).stream({ follow: false });
|
|
80
|
+
};
|
|
81
|
+
const LOOKUP_CHARACTERS = 4e3;
|
|
82
|
+
const LOOKUPS_CHARACTERS = 24e3;
|
|
83
|
+
function shown(value) {
|
|
84
|
+
const text = typeof value === "string" ? value : JSON.stringify(value ?? null);
|
|
85
|
+
return text.length > LOOKUP_CHARACTERS ? `${text.slice(0, LOOKUP_CHARACTERS)}…` : text;
|
|
86
|
+
}
|
|
87
|
+
async function turnLookups(stream, sessionId, partId) {
|
|
88
|
+
const turns = new Map();
|
|
89
|
+
let turnId;
|
|
90
|
+
for await (const event of stream(sessionId)) {
|
|
91
|
+
const turn = event.scope?.turnId;
|
|
92
|
+
if (turn === void 0) continue;
|
|
93
|
+
const data = event.data;
|
|
94
|
+
if (turn === partId || event.type === "content.completed" && data.partId === partId && turnId === void 0) turnId = turn;
|
|
95
|
+
const calls = turns.get(turn) ?? new Map();
|
|
96
|
+
turns.set(turn, calls);
|
|
97
|
+
const callId = typeof data.callId === "string" ? data.callId : void 0;
|
|
98
|
+
if (callId === void 0) continue;
|
|
99
|
+
if (event.type === "call.requested") {
|
|
100
|
+
const capability = data.capability;
|
|
101
|
+
calls.set(callId, {
|
|
102
|
+
tool: typeof capability?.name === "string" ? capability.name : "unknown",
|
|
103
|
+
input: data.input
|
|
104
|
+
});
|
|
105
|
+
} else if (event.type === "call.settled") {
|
|
106
|
+
const call = calls.get(callId);
|
|
107
|
+
if (call !== void 0) call.output = data.outcome === "completed" ? data.output : {
|
|
108
|
+
outcome: data.outcome,
|
|
109
|
+
error: data.error
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const lines = [];
|
|
114
|
+
let characters = 0;
|
|
115
|
+
for (const call of turnId === void 0 ? [] : turns.get(turnId)?.values() ?? []) {
|
|
116
|
+
const line = JSON.stringify({
|
|
117
|
+
tool: call.tool,
|
|
118
|
+
input: shown(call.input),
|
|
119
|
+
output: shown(call.output)
|
|
120
|
+
});
|
|
121
|
+
if (characters + line.length > LOOKUPS_CHARACTERS) break;
|
|
122
|
+
lines.push(line);
|
|
123
|
+
characters += line.length;
|
|
124
|
+
}
|
|
125
|
+
return lines;
|
|
126
|
+
}
|
|
127
|
+
async function revisionContext(input) {
|
|
128
|
+
const { request } = input;
|
|
129
|
+
const log = input.log ?? ((message, detail) => console.error(message, detail));
|
|
130
|
+
const [chat, lookups] = await Promise.all([readChat(input.archive, {
|
|
131
|
+
provider: request.channel,
|
|
132
|
+
chatId: request.chatId,
|
|
133
|
+
threadId: request.threadId
|
|
134
|
+
}).catch((cause) => {
|
|
135
|
+
log("[segmentstream] revision_chat_unavailable", {
|
|
136
|
+
reviewId: request.reviewId,
|
|
137
|
+
cause
|
|
138
|
+
});
|
|
139
|
+
return [];
|
|
140
|
+
}), turnLookups(input.stream, request.sessionId, request.key.startsWith(`${request.sessionId}:`) ? request.key.slice(request.sessionId.length + 1) : request.key).catch((cause) => {
|
|
141
|
+
log("[segmentstream] revision_lookups_unavailable", {
|
|
142
|
+
reviewId: request.reviewId,
|
|
143
|
+
cause
|
|
144
|
+
});
|
|
145
|
+
return [];
|
|
146
|
+
})]);
|
|
147
|
+
return [
|
|
148
|
+
...chat.length === 0 ? [] : [`<chat_messages>\n[${chat.join(",\n")}]\n</chat_messages>`],
|
|
149
|
+
...lookups.length === 0 ? [] : [`<earlier_lookups>\n[${lookups.join(",\n")}]\n</earlier_lookups>`],
|
|
150
|
+
`<draft>\n${request.draft}\n</draft>`
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
const CALL_TIMEOUT_MS = 1e4;
|
|
154
|
+
const FIRST_RETRY_MS = 1e3;
|
|
155
|
+
const MAXIMUM_RETRY_MS = 3e4;
|
|
156
|
+
const REPORT_WINDOW_MS = 12e4;
|
|
157
|
+
function transient(status) {
|
|
158
|
+
return status === 408 || status === 429 || status >= 500;
|
|
159
|
+
}
|
|
160
|
+
function agentRevisions(input) {
|
|
161
|
+
const fetchImpl = input.fetch ?? fetch;
|
|
162
|
+
const sleep = input.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
163
|
+
const now = input.now ?? Date.now;
|
|
164
|
+
return async (report) => {
|
|
165
|
+
const body = JSON.stringify({
|
|
166
|
+
review_id: report.reviewId,
|
|
167
|
+
revision: report.revision,
|
|
168
|
+
...report.text === void 0 ? {} : { text: report.text.slice(0, TEXT_LIMIT) }
|
|
169
|
+
});
|
|
170
|
+
const stop = now() + REPORT_WINDOW_MS;
|
|
171
|
+
for (let delay = FIRST_RETRY_MS;; delay = Math.min(delay * 2, MAXIMUM_RETRY_MS)) {
|
|
172
|
+
const token = await input.token();
|
|
173
|
+
let response;
|
|
174
|
+
let failure;
|
|
175
|
+
try {
|
|
176
|
+
response = await fetchImpl(`${input.origin}/api/ontology/agent/reviews/revision`, {
|
|
177
|
+
method: "POST",
|
|
178
|
+
headers: {
|
|
179
|
+
authorization: `Bearer ${token}`,
|
|
180
|
+
accept: "application/json",
|
|
181
|
+
"content-type": "application/json"
|
|
182
|
+
},
|
|
183
|
+
body,
|
|
184
|
+
redirect: "error",
|
|
185
|
+
signal: AbortSignal.timeout(CALL_TIMEOUT_MS)
|
|
186
|
+
});
|
|
187
|
+
} catch (error) {
|
|
188
|
+
failure = new AgentIdentityError({
|
|
189
|
+
code: "unavailable",
|
|
190
|
+
message: "The ontology service could not be reached to report a redrafted reply.",
|
|
191
|
+
cause: redactDiagnostic(error, new Set([token]))
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (response?.ok === true) {
|
|
195
|
+
await response.body?.cancel();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (response !== void 0) {
|
|
199
|
+
const error = await refusal(response, "redrafted reply");
|
|
200
|
+
failure = new AgentIdentityError({
|
|
201
|
+
code: error.code,
|
|
202
|
+
...error.status === void 0 ? {} : { status: error.status },
|
|
203
|
+
message: redactDiagnostic(error.message, new Set([token])),
|
|
204
|
+
cause: redactDiagnostic(error, new Set([token]))
|
|
205
|
+
});
|
|
206
|
+
if (!transient(response.status)) throw failure;
|
|
207
|
+
}
|
|
208
|
+
if (now() + delay >= stop) throw failure;
|
|
209
|
+
await sleep(delay);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export { AGENT_SCOPE_HEADER, REVISION_AUTHENTICATOR, REVISION_ROUTE, REVISION_SCOPE, agentRevisions, eveSessionStream, revisionAddress, revisionContext, revisionOf, revisionPrincipal, revisionRequest, turnLookups };
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { a as rolesOf } from "../../_chunks/principal-
|
|
7
|
+
import { a as rolesOf } from "../../_chunks/principal-CDPJQgPO.mjs";
|
|
8
8
|
import { defineDynamic, defineSkill } from "eve/skills";
|
|
9
9
|
function forRoles(roles, skill) {
|
|
10
10
|
if (!Array.isArray(roles) || roles.length === 0 || !roles.every((role) => typeof role === "string" && role.trim() !== "")) throw new TypeError("forRoles() needs at least one role name; a skill for everyone is an ordinary skill file.");
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { Nt as RUNTIME_SOURCE_PROTOCOL, Pt as compatibleRuntimeEnvelope, Ft as principalRuntimeSource, It as runtimeEnvelope, Lt as telegramRuntimeSource } from "../../_chunks/principal-
|
|
7
|
+
export { Nt as RUNTIME_SOURCE_PROTOCOL, Pt as compatibleRuntimeEnvelope, Ft as principalRuntimeSource, It as runtimeEnvelope, Lt as telegramRuntimeSource } from "../../_chunks/principal-CDPJQgPO.mjs";
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { R as ACT_AS_HEADER, _ as AttachmentError, ht as SESSION_HEADER, mt as CHAT_HEADER, v as EARLIER_CHAT_HEADER } from "../../_chunks/principal-
|
|
7
|
+
import { R as ACT_AS_HEADER, _ as AttachmentError, ht as SESSION_HEADER, mt as CHAT_HEADER, v as EARLIER_CHAT_HEADER } from "../../_chunks/principal-CDPJQgPO.mjs";
|
|
8
8
|
import { fetchFileGrant, transientFileStatus } from "./file-grant.mjs";
|
|
9
9
|
var StoredFileError = class extends AttachmentError {
|
|
10
10
|
filename;
|
|
@@ -8,7 +8,7 @@ import { admitMessage, localizedText } from "../admission.mjs";
|
|
|
8
8
|
import { agentToolsAttribute } from "../agent-tools.mjs";
|
|
9
9
|
import { agentChats, channelChats } from "../chats.mjs";
|
|
10
10
|
import { withButtonDecision } from "../confirmation-buttons.mjs";
|
|
11
|
-
import { b as agentAttachments, bt as withChatAddress, d as prepareInboundMedia, m as turnContent } from "../../../_chunks/principal-
|
|
11
|
+
import { b as agentAttachments, bt as withChatAddress, d as prepareInboundMedia, m as turnContent } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
12
12
|
import { channelAttributes, currentChannel, withNamedRoutes, withSessionChannels } from "../channel-scope.mjs";
|
|
13
13
|
import { redactDiagnostic } from "../diagnostics.mjs";
|
|
14
14
|
import { MAXIMUM_DOWNLOAD_BYTES, connectionProxy } from "../connection-proxy.mjs";
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { _ as AttachmentError } from "../../../_chunks/principal-
|
|
7
|
+
import { _ as AttachmentError } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
8
8
|
import { sendStoredAttachments } from "../attachments-send.mjs";
|
|
9
9
|
import { MAXIMUM_PROXY_BODY_BYTES, connectionProxy } from "../connection-proxy.mjs";
|
|
10
10
|
import { redactDiagnostic } from "../diagnostics.mjs";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { object } from "./confirmation-description.mjs";
|
|
8
|
-
import { D as OntologyFileUnavailable, W as member, i as memberIdOf, j as ontologyTools } from "../../_chunks/principal-
|
|
8
|
+
import { D as OntologyFileUnavailable, W as member, i as memberIdOf, j as ontologyTools } from "../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
import { redactDiagnostic } from "./diagnostics.mjs";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
async function readStoredFile(input, principal, options = {}) {
|
|
@@ -10,12 +10,12 @@ import { groupRoutingHealth } from "../group-routing/health.mjs";
|
|
|
10
10
|
import { dispatchStructuredMessage, structuredMessage } from "./structured.mjs";
|
|
11
11
|
import { handleWorkspaceCallback, isWorkspaceCallback } from "./callbacks.mjs";
|
|
12
12
|
import { telegramText, withTelegramTexts } from "./texts.mjs";
|
|
13
|
-
import { t as agentBuild } from "../../../_chunks/build-metadata-
|
|
13
|
+
import { t as agentBuild } from "../../../_chunks/build-metadata-IxPkc2J2.mjs";
|
|
14
14
|
import { attachmentLifecycle } from "./lifecycle.mjs";
|
|
15
15
|
import { manifestOf } from "../../config.mjs";
|
|
16
16
|
import { gatewayAttachmentDescriber } from "./attachment-description.mjs";
|
|
17
17
|
import { chooseModel } from "../../model.mjs";
|
|
18
|
-
import { At as reportTelegramError, Ct as currentLocale, Mt as withDeliveryLocale, Ot as failureText, S as fetchStoredAttachment, b as agentAttachments, c as currentInboundRequest, jt as safeTelegramFetch, l as runInboundRequest, n as chatLanguage, o as telegramPrincipal, s as InboundRequest, u as withReplacedText } from "../../../_chunks/principal-
|
|
18
|
+
import { At as reportTelegramError, Ct as currentLocale, Mt as withDeliveryLocale, Ot as failureText, S as fetchStoredAttachment, b as agentAttachments, c as currentInboundRequest, jt as safeTelegramFetch, l as runInboundRequest, n as chatLanguage, o as telegramPrincipal, s as InboundRequest, u as withReplacedText } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
19
19
|
import { MAXIMUM_DOWNLOAD_BYTES, connectionProxy } from "../connection-proxy.mjs";
|
|
20
20
|
import { appOrigin, channelsEnabled, proxyEnvironment, runtimeIdentityEnvironment, webhookSecret } from "../environment.mjs";
|
|
21
21
|
import { agentIdentities } from "../identities.mjs";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { describableImage } from "../inbound-media/images.mjs";
|
|
8
|
-
import { At as reportTelegramError } from "../../../_chunks/principal-
|
|
8
|
+
import { At as reportTelegramError } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
import { gateway, generateText } from "ai";
|
|
10
10
|
const MAXIMUM_ROUTING_ATTACHMENT_BYTES = 5242880;
|
|
11
11
|
const ROUTING_ATTACHMENT_TIMEOUT_MS = 15e3;
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { attachmentOwner } from "../attachment-tools.mjs";
|
|
8
|
-
import { At as reportTelegramError, Et as customerMessage, Ot as failureText, _ as AttachmentError, kt as formattingRefused } from "../../../_chunks/principal-
|
|
8
|
+
import { At as reportTelegramError, Et as customerMessage, Ot as failureText, _ as AttachmentError, kt as formattingRefused } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
import { attachmentFailure } from "../attachments-send.mjs";
|
|
10
10
|
import { MAXIMUM_PROXY_BODY_BYTES, connectionProxy } from "../connection-proxy.mjs";
|
|
11
11
|
import { redactDiagnostic } from "../diagnostics.mjs";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { object } from "../confirmation-description.mjs";
|
|
8
|
-
import { At as reportTelegramError, It as runtimeEnvelope, Lt as telegramRuntimeSource, c as currentInboundRequest, i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-
|
|
8
|
+
import { At as reportTelegramError, It as runtimeEnvelope, Lt as telegramRuntimeSource, c as currentInboundRequest, i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
import { formatAddress, parseAddress, scopedAddress } from "./sessions.mjs";
|
|
10
10
|
import { telegramText } from "./texts.mjs";
|
|
11
11
|
import { workspaceAction } from "./workspace-action.mjs";
|
|
@@ -10,7 +10,7 @@ import { n as contentText, t as CONTENT_CAPS } from "../../../_chunks/content-cD
|
|
|
10
10
|
import { chatEvent, sessionFailureEventId } from "../chat-archive.mjs";
|
|
11
11
|
import { currentConfirmationPrompt } from "../group-routing/messages.mjs";
|
|
12
12
|
import { messageMetadata } from "./message-metadata.mjs";
|
|
13
|
-
import { At as reportTelegramError, c as currentInboundRequest, wt as currentThreadId } from "../../../_chunks/principal-
|
|
13
|
+
import { At as reportTelegramError, c as currentInboundRequest, wt as currentThreadId } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
14
14
|
import { reportMembership } from "./membership.mjs";
|
|
15
15
|
import { currentDeliveryScope } from "./delivery-diagnostics.mjs";
|
|
16
16
|
import { contentShape, messageContent } from "./content.mjs";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { telegramText } from "./texts.mjs";
|
|
8
|
-
import { At as reportTelegramError, F as confirmations, _t as chatChannel, c as currentInboundRequest, i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-
|
|
8
|
+
import { At as reportTelegramError, F as confirmations, _t as chatChannel, c as currentInboundRequest, i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
import { humanText } from "../confirmation-description.mjs";
|
|
10
10
|
import { withConfirmationPrompt } from "../group-routing/messages.mjs";
|
|
11
11
|
import { chatPostOperationId, isChatPost } from "../chat-post-confirmation.mjs";
|
|
@@ -5,5 +5,5 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { isTechnicalText } from "../customer-text-safety.mjs";
|
|
8
|
-
import { At as reportTelegramError, Ct as currentLocale, Dt as customerText, Et as customerMessage, Mt as withDeliveryLocale, Ot as failureText, St as TelegramDeliveryError, Tt as customerCopy, jt as safeTelegramFetch, kt as formattingRefused, wt as currentThreadId } from "../../../_chunks/principal-
|
|
8
|
+
import { At as reportTelegramError, Ct as currentLocale, Dt as customerText, Et as customerMessage, Mt as withDeliveryLocale, Ot as failureText, St as TelegramDeliveryError, Tt as customerCopy, jt as safeTelegramFetch, kt as formattingRefused, wt as currentThreadId } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
export { TelegramDeliveryError, currentLocale, currentThreadId, customerCopy, customerMessage, customerText, failureText, formattingRefused, isTechnicalText, reportTelegramError, safeTelegramFetch, withDeliveryLocale };
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { currentChannel } from "../channel-scope.mjs";
|
|
8
|
-
import { At as reportTelegramError, p as storeFiles } from "../../../_chunks/principal-
|
|
8
|
+
import { At as reportTelegramError, p as storeFiles } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
9
9
|
function telegramChat(chatId) {
|
|
10
10
|
return `${currentChannel("telegram")}:${chatId}`;
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { t as agentBuild } from "../../../_chunks/build-metadata-
|
|
7
|
+
import { t as agentBuild } from "../../../_chunks/build-metadata-IxPkc2J2.mjs";
|
|
8
8
|
import { runtimeRequestFailure } from "./runtime-request.mjs";
|
|
9
9
|
import { GET } from "eve/channels";
|
|
10
10
|
const HEALTH_ROUTE = "/eve/v1/telegram/health";
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { N as CONFIRMATION_TTL_MS } from "../../../_chunks/principal-
|
|
7
|
+
import { N as CONFIRMATION_TTL_MS } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
8
8
|
import { object } from "../confirmation-description.mjs";
|
|
9
9
|
import { SessionNotActiveError } from "eve/sessions";
|
|
10
10
|
function heldApprovals(events) {
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { s as InboundRequest, c as currentInboundRequest, l as runInboundRequest, u as withReplacedText } from "../../../_chunks/principal-
|
|
7
|
+
export { s as InboundRequest, c as currentInboundRequest, l as runInboundRequest, u as withReplacedText } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { WorkspaceActionAlreadyDispatched } from "./workspace-action.mjs";
|
|
8
8
|
import { structuredMessage } from "./structured.mjs";
|
|
9
9
|
import { currentChannel } from "../channel-scope.mjs";
|
|
10
|
-
import { At as reportTelegramError, It as runtimeEnvelope, Lt as telegramRuntimeSource, f as attachmentsContext, n as chatLanguage, o as telegramPrincipal, x as attachmentUrl } from "../../../_chunks/principal-
|
|
10
|
+
import { At as reportTelegramError, It as runtimeEnvelope, Lt as telegramRuntimeSource, f as attachmentsContext, n as chatLanguage, o as telegramPrincipal, x as attachmentUrl } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
11
11
|
import { routingBurst } from "../group-routing/burst.mjs";
|
|
12
12
|
import { telegramSignals } from "./signals.mjs";
|
|
13
13
|
import { addressingReason, chatKey, otherRecipient } from "../group-routing/signals.mjs";
|
|
@@ -4,8 +4,8 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { E as OntologyActionNotPermitted, Ft as principalRuntimeSource, It as runtimeEnvelope, L as needsConfirmation, Lt as telegramRuntimeSource, W as member, c as currentInboundRequest, j as ontologyTools, k as actionToolName } from "../../../_chunks/principal-
|
|
8
|
-
import { t as agentBuild } from "../../../_chunks/build-metadata-
|
|
7
|
+
import { E as OntologyActionNotPermitted, Ft as principalRuntimeSource, It as runtimeEnvelope, L as needsConfirmation, Lt as telegramRuntimeSource, W as member, c as currentInboundRequest, j as ontologyTools, k as actionToolName } from "../../../_chunks/principal-CDPJQgPO.mjs";
|
|
8
|
+
import { t as agentBuild } from "../../../_chunks/build-metadata-IxPkc2J2.mjs";
|
|
9
9
|
import { object } from "../confirmation-description.mjs";
|
|
10
10
|
var AttachmentLifecycleNotPermitted = class extends Error {
|
|
11
11
|
code = "attachment_lifecycle_not_permitted";
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { t as TELEGRAM_AUTHENTICATOR, n as chatLanguage, r as identityProviderOf, i as memberIdOf, a as rolesOf, o as telegramPrincipal } from "../../../_chunks/principal-
|
|
7
|
+
export { t as TELEGRAM_AUTHENTICATOR, n as chatLanguage, r as identityProviderOf, i as memberIdOf, a as rolesOf, o as telegramPrincipal } from "../../../_chunks/principal-CDPJQgPO.mjs";
|