@integrity-labs/agt-cli 0.28.1164 → 0.28.1166
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/dist/bin/agt.js +6 -6
- package/dist/{chunk-WPNCOXIB.js → chunk-6KJFIVYJ.js} +2 -2
- package/dist/{chunk-DR7PAO2Y.js → chunk-I5NQ762W.js} +187 -1
- package/dist/chunk-I5NQ762W.js.map +1 -0
- package/dist/{chunk-CHTG2VLG.js → chunk-NOCTCO7G.js} +3 -3
- package/dist/{chunk-6SIOI32E.js → chunk-UX3TDTVM.js} +5 -5
- package/dist/{chunk-J3LCXQGY.js → chunk-ZSCZDOHR.js} +2 -2
- package/dist/{claude-code-updater-L7C3DZJ3.js → claude-code-updater-VRZ7MMKO.js} +3 -3
- package/dist/{claude-pair-runtime-EQVMQMTF.js → claude-pair-runtime-HOIYDAGM.js} +3 -3
- package/dist/lib/manager-worker.js +19 -19
- package/dist/mcp/direct-chat-channel.js +188 -2
- package/dist/mcp/index.js +190 -4
- package/dist/mcp/origami.js +188 -2
- package/dist/mcp/slack-channel.js +188 -2
- package/dist/mcp/telegram-channel.js +188 -2
- package/dist/{persistent-session-BP3EXMFT.js → persistent-session-YQLP5NPI.js} +4 -4
- package/dist/{responsiveness-probe-ASP2NY2K.js → responsiveness-probe-6K6SVHRK.js} +4 -4
- package/dist/{session-auth-dead-KR2CABKC.js → session-auth-dead-M4KYOBXK.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-DR7PAO2Y.js.map +0 -1
- /package/dist/{chunk-WPNCOXIB.js.map → chunk-6KJFIVYJ.js.map} +0 -0
- /package/dist/{chunk-CHTG2VLG.js.map → chunk-NOCTCO7G.js.map} +0 -0
- /package/dist/{chunk-6SIOI32E.js.map → chunk-UX3TDTVM.js.map} +0 -0
- /package/dist/{chunk-J3LCXQGY.js.map → chunk-ZSCZDOHR.js.map} +0 -0
- /package/dist/{claude-code-updater-L7C3DZJ3.js.map → claude-code-updater-VRZ7MMKO.js.map} +0 -0
- /package/dist/{claude-pair-runtime-EQVMQMTF.js.map → claude-pair-runtime-HOIYDAGM.js.map} +0 -0
- /package/dist/{persistent-session-BP3EXMFT.js.map → persistent-session-YQLP5NPI.js.map} +0 -0
- /package/dist/{responsiveness-probe-ASP2NY2K.js.map → responsiveness-probe-6K6SVHRK.js.map} +0 -0
- /package/dist/{session-auth-dead-KR2CABKC.js.map → session-auth-dead-M4KYOBXK.js.map} +0 -0
|
@@ -19182,7 +19182,7 @@ var require_filters = __commonJS({
|
|
|
19182
19182
|
return r.copySafeness(str, str.replace(/^\s*|\s*$/g, ""));
|
|
19183
19183
|
}
|
|
19184
19184
|
_exports.trim = trim;
|
|
19185
|
-
function
|
|
19185
|
+
function truncate2(input, length, killwords, end) {
|
|
19186
19186
|
var orig = input;
|
|
19187
19187
|
input = normalize(input, "");
|
|
19188
19188
|
length = length || 255;
|
|
@@ -19201,7 +19201,7 @@ var require_filters = __commonJS({
|
|
|
19201
19201
|
input += end !== void 0 && end !== null ? end : "...";
|
|
19202
19202
|
return r.copySafeness(orig, input);
|
|
19203
19203
|
}
|
|
19204
|
-
_exports.truncate =
|
|
19204
|
+
_exports.truncate = truncate2;
|
|
19205
19205
|
function upper(str) {
|
|
19206
19206
|
str = normalize(str, "");
|
|
19207
19207
|
return str.toUpperCase();
|
|
@@ -35319,6 +35319,15 @@ var INTEGRATION_REGISTRY = [
|
|
|
35319
35319
|
// successor at the same cost to us); Sunburst is seeded at 4x.
|
|
35320
35320
|
{ event_type: "gpt_image_2_5_flare", unit: "image" },
|
|
35321
35321
|
{ event_type: "gpt_image_2_5_sunburst", unit: "image" },
|
|
35322
|
+
// CS-2360: quality medium/high price on their own rows (more image-output
|
|
35323
|
+
// tokens at the same per-token rate). `low` stays on the two meters above.
|
|
35324
|
+
// The handler refuses a medium/high render until its meter has a rate
|
|
35325
|
+
// card row in BOTH USD and AUD. Size does not change the meter: the rate
|
|
35326
|
+
// is set on the worst case (landscape/portrait).
|
|
35327
|
+
{ event_type: "gpt_image_2_5_flare_medium", unit: "image", label: "Flare, medium quality" },
|
|
35328
|
+
{ event_type: "gpt_image_2_5_flare_high", unit: "image", label: "Flare, high quality" },
|
|
35329
|
+
{ event_type: "gpt_image_2_5_sunburst_medium", unit: "image", label: "Sunburst, medium quality" },
|
|
35330
|
+
{ event_type: "gpt_image_2_5_sunburst_high", unit: "image", label: "Sunburst, high quality" },
|
|
35322
35331
|
// CS-1940: an edit also records one of these with units = the number of
|
|
35323
35332
|
// reference images. Declared here (obi-wan 3a515eaf41b0) because the admin
|
|
35324
35333
|
// pricing route only accepts a price for a declared meter, and the org
|
|
@@ -38263,6 +38272,183 @@ var videoRenderTriggerAdapter = {
|
|
|
38263
38272
|
};
|
|
38264
38273
|
registerTriggerSource(videoRenderTriggerAdapter);
|
|
38265
38274
|
|
|
38275
|
+
// ../core/dist/triggers/adapters/webhook.js
|
|
38276
|
+
var WEBHOOK_TRIGGER_PROVIDER = "webhook";
|
|
38277
|
+
var WEBHOOK_MAX_BODY_BYTES = 1280 * 1024;
|
|
38278
|
+
var WEBHOOK_PROMPT_MAX_CHARS = 8e3;
|
|
38279
|
+
var WEBHOOK_RAW_MAX_CHARS = 64 * 1024;
|
|
38280
|
+
var WEBHOOK_INSTRUCTION_MAX_CHARS = 2e3;
|
|
38281
|
+
var WEBHOOK_NAME_MAX_CHARS = 80;
|
|
38282
|
+
var WEBHOOK_DEFAULT_RATE_CAP = 60;
|
|
38283
|
+
var WEBHOOK_MAX_RATE_CAP = 1e3;
|
|
38284
|
+
var WEBHOOK_PRESETS = {
|
|
38285
|
+
// https://docs.aws.amazon.com/eventbridge/latest/ref/overiew-event-structure.html
|
|
38286
|
+
eventbridge: {
|
|
38287
|
+
dedupPath: "id",
|
|
38288
|
+
eventTypePaths: ["source", "detail-type"],
|
|
38289
|
+
payloadPath: "detail",
|
|
38290
|
+
timePath: "time"
|
|
38291
|
+
},
|
|
38292
|
+
// Raw-body hash dedup, whole body as payload. Set dedup_path when the
|
|
38293
|
+
// sender has a stable id, or two identical bodies collapse into one.
|
|
38294
|
+
generic: {}
|
|
38295
|
+
};
|
|
38296
|
+
var PATH_RE = /^[A-Za-z0-9_$-]+(\.[A-Za-z0-9_$-]+){0,9}$/;
|
|
38297
|
+
function readPath(value, path) {
|
|
38298
|
+
let cur = value;
|
|
38299
|
+
for (const key2 of path.split(".")) {
|
|
38300
|
+
if (cur === null || typeof cur !== "object" || Array.isArray(cur))
|
|
38301
|
+
return void 0;
|
|
38302
|
+
if (!Object.prototype.hasOwnProperty.call(cur, key2))
|
|
38303
|
+
return void 0;
|
|
38304
|
+
cur = cur[key2];
|
|
38305
|
+
}
|
|
38306
|
+
return cur;
|
|
38307
|
+
}
|
|
38308
|
+
function scalarString(v) {
|
|
38309
|
+
if (typeof v === "string")
|
|
38310
|
+
return v.length > 0 ? v : null;
|
|
38311
|
+
if (typeof v === "number" && Number.isFinite(v))
|
|
38312
|
+
return String(v);
|
|
38313
|
+
return null;
|
|
38314
|
+
}
|
|
38315
|
+
function truncate(text, max) {
|
|
38316
|
+
if (text.length <= max)
|
|
38317
|
+
return text;
|
|
38318
|
+
return `${text.slice(0, max)}
|
|
38319
|
+
... [truncated ${text.length - max} more characters]`;
|
|
38320
|
+
}
|
|
38321
|
+
function resolvePreset(config2) {
|
|
38322
|
+
const name = config2["preset"];
|
|
38323
|
+
const base = typeof name === "string" && Object.prototype.hasOwnProperty.call(WEBHOOK_PRESETS, name) ? WEBHOOK_PRESETS[name] : WEBHOOK_PRESETS.generic;
|
|
38324
|
+
const dedup = config2["dedup_path"];
|
|
38325
|
+
const type = config2["event_type_path"];
|
|
38326
|
+
const payload = config2["payload_path"];
|
|
38327
|
+
return {
|
|
38328
|
+
...base,
|
|
38329
|
+
...typeof dedup === "string" && dedup ? { dedupPath: dedup } : {},
|
|
38330
|
+
...typeof type === "string" && type ? { eventTypePaths: [type] } : {},
|
|
38331
|
+
...typeof payload === "string" && payload ? { payloadPath: payload } : {}
|
|
38332
|
+
};
|
|
38333
|
+
}
|
|
38334
|
+
function validateWebhookConfig(input) {
|
|
38335
|
+
const out = {};
|
|
38336
|
+
const name = input["name"];
|
|
38337
|
+
if (name !== void 0) {
|
|
38338
|
+
if (typeof name !== "string")
|
|
38339
|
+
return { ok: false, error: "name must be a string" };
|
|
38340
|
+
const trimmed = name.trim();
|
|
38341
|
+
if (trimmed.length > WEBHOOK_NAME_MAX_CHARS) {
|
|
38342
|
+
return { ok: false, error: `name must be at most ${WEBHOOK_NAME_MAX_CHARS} characters` };
|
|
38343
|
+
}
|
|
38344
|
+
if (trimmed)
|
|
38345
|
+
out["name"] = trimmed;
|
|
38346
|
+
}
|
|
38347
|
+
const instruction = input["instruction"];
|
|
38348
|
+
if (typeof instruction !== "string" || !instruction.trim()) {
|
|
38349
|
+
return {
|
|
38350
|
+
ok: false,
|
|
38351
|
+
error: "instruction is required: tell the agent what to do when an event arrives"
|
|
38352
|
+
};
|
|
38353
|
+
}
|
|
38354
|
+
if (instruction.trim().length > WEBHOOK_INSTRUCTION_MAX_CHARS) {
|
|
38355
|
+
return {
|
|
38356
|
+
ok: false,
|
|
38357
|
+
error: `instruction must be at most ${WEBHOOK_INSTRUCTION_MAX_CHARS} characters`
|
|
38358
|
+
};
|
|
38359
|
+
}
|
|
38360
|
+
out["instruction"] = instruction.trim();
|
|
38361
|
+
const preset = input["preset"] ?? "generic";
|
|
38362
|
+
if (typeof preset !== "string" || !Object.prototype.hasOwnProperty.call(WEBHOOK_PRESETS, preset)) {
|
|
38363
|
+
return {
|
|
38364
|
+
ok: false,
|
|
38365
|
+
error: `preset must be one of: ${Object.keys(WEBHOOK_PRESETS).join(", ")}`
|
|
38366
|
+
};
|
|
38367
|
+
}
|
|
38368
|
+
out["preset"] = preset;
|
|
38369
|
+
for (const key2 of ["dedup_path", "event_type_path", "payload_path"]) {
|
|
38370
|
+
const v = input[key2];
|
|
38371
|
+
if (v === void 0 || v === null || v === "")
|
|
38372
|
+
continue;
|
|
38373
|
+
if (typeof v !== "string" || !PATH_RE.test(v)) {
|
|
38374
|
+
return { ok: false, error: `${key2} must be a dot path like "detail.id"` };
|
|
38375
|
+
}
|
|
38376
|
+
out[key2] = v;
|
|
38377
|
+
}
|
|
38378
|
+
const cap = input["max_events_per_hour"];
|
|
38379
|
+
if (cap !== void 0 && cap !== null) {
|
|
38380
|
+
if (typeof cap !== "number" || !Number.isInteger(cap) || cap < 1 || cap > WEBHOOK_MAX_RATE_CAP) {
|
|
38381
|
+
return {
|
|
38382
|
+
ok: false,
|
|
38383
|
+
error: `max_events_per_hour must be an integer from 1 to ${WEBHOOK_MAX_RATE_CAP}`
|
|
38384
|
+
};
|
|
38385
|
+
}
|
|
38386
|
+
out["max_events_per_hour"] = cap;
|
|
38387
|
+
} else {
|
|
38388
|
+
out["max_events_per_hour"] = WEBHOOK_DEFAULT_RATE_CAP;
|
|
38389
|
+
}
|
|
38390
|
+
return { ok: true, config: out };
|
|
38391
|
+
}
|
|
38392
|
+
function webhookRateCap(trigger) {
|
|
38393
|
+
const cap = trigger.config["max_events_per_hour"];
|
|
38394
|
+
if (typeof cap === "number" && Number.isInteger(cap) && cap >= 1) {
|
|
38395
|
+
return Math.min(cap, WEBHOOK_MAX_RATE_CAP);
|
|
38396
|
+
}
|
|
38397
|
+
return WEBHOOK_DEFAULT_RATE_CAP;
|
|
38398
|
+
}
|
|
38399
|
+
function buildWebhookEvent(req, config2, now = /* @__PURE__ */ new Date()) {
|
|
38400
|
+
const preset = resolvePreset(config2);
|
|
38401
|
+
const body = req.body;
|
|
38402
|
+
const raw = req.rawBody ?? JSON.stringify(body ?? null);
|
|
38403
|
+
const idValue = preset.dedupPath ? scalarString(readPath(body, preset.dedupPath)) : null;
|
|
38404
|
+
const dedupKey = idValue ? `wh:id:${stableHash(idValue)}` : `wh:raw:${stableHash(raw)}`;
|
|
38405
|
+
const typeParts = (preset.eventTypePaths ?? []).map((p2) => scalarString(readPath(body, p2))).filter((v) => v !== null).map((v) => v.slice(0, 200));
|
|
38406
|
+
const eventType = typeParts.length > 0 ? typeParts.join(" / ") : "webhook event";
|
|
38407
|
+
const timeValue = preset.timePath ? scalarString(readPath(body, preset.timePath)) : null;
|
|
38408
|
+
const timeMs = timeValue ? Date.parse(timeValue) : NaN;
|
|
38409
|
+
const occurredAt = Number.isFinite(timeMs) ? new Date(timeMs).toISOString() : now.toISOString();
|
|
38410
|
+
let payload = body;
|
|
38411
|
+
if (preset.payloadPath) {
|
|
38412
|
+
const sub = readPath(body, preset.payloadPath);
|
|
38413
|
+
if (sub !== void 0)
|
|
38414
|
+
payload = sub;
|
|
38415
|
+
}
|
|
38416
|
+
const rendered = typeof payload === "string" ? payload : JSON.stringify(payload, null, 2) ?? "null";
|
|
38417
|
+
const lines = [`Event: ${eventType}`];
|
|
38418
|
+
if (idValue)
|
|
38419
|
+
lines.push(`Event id: ${idValue.slice(0, 200)}`);
|
|
38420
|
+
lines.push("", truncate(rendered, WEBHOOK_PROMPT_MAX_CHARS));
|
|
38421
|
+
return {
|
|
38422
|
+
provider: WEBHOOK_TRIGGER_PROVIDER,
|
|
38423
|
+
occurredAt,
|
|
38424
|
+
dedupKey,
|
|
38425
|
+
sourceTrust: "untrusted",
|
|
38426
|
+
title: eventType,
|
|
38427
|
+
body: lines.join("\n"),
|
|
38428
|
+
// Keep the ledger row bounded: the full body when small, else a marker
|
|
38429
|
+
// with the head of it. Never headers (the bearer token rides there).
|
|
38430
|
+
raw: raw.length <= WEBHOOK_RAW_MAX_CHARS ? body : { truncated: true, bytes: raw.length, head: raw.slice(0, WEBHOOK_RAW_MAX_CHARS) },
|
|
38431
|
+
meaningful: true
|
|
38432
|
+
};
|
|
38433
|
+
}
|
|
38434
|
+
var webhookTriggerAdapter = {
|
|
38435
|
+
provider: WEBHOOK_TRIGGER_PROVIDER,
|
|
38436
|
+
kind: "webhook",
|
|
38437
|
+
webhookAuth: "bearer",
|
|
38438
|
+
webhookEvents: [],
|
|
38439
|
+
multiInstance: true,
|
|
38440
|
+
maxBodyBytes: WEBHOOK_MAX_BODY_BYTES,
|
|
38441
|
+
validateConfig: validateWebhookConfig,
|
|
38442
|
+
rateCapPerHour: (trigger) => webhookRateCap(trigger),
|
|
38443
|
+
// Webhook-kind triggers are minted only on POST /agents/:id/triggers
|
|
38444
|
+
// (agent.edit); /host/triggers refuses non-poll providers.
|
|
38445
|
+
operatorInstruction: true,
|
|
38446
|
+
ingest(req, trigger) {
|
|
38447
|
+
return [buildWebhookEvent(req, trigger.config)];
|
|
38448
|
+
}
|
|
38449
|
+
};
|
|
38450
|
+
registerTriggerSource(webhookTriggerAdapter);
|
|
38451
|
+
|
|
38266
38452
|
// ../core/dist/feature-flags/registry.js
|
|
38267
38453
|
var FLAG_REGISTRY = [
|
|
38268
38454
|
{
|
|
@@ -68,12 +68,12 @@ import {
|
|
|
68
68
|
writeDirectChatSessionState,
|
|
69
69
|
writeEgressAllowlist,
|
|
70
70
|
writePersistentClaudeWrapper
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-NOCTCO7G.js";
|
|
72
|
+
import "./chunk-ZSCZDOHR.js";
|
|
73
73
|
import "./chunk-B6UYVEMD.js";
|
|
74
74
|
import "./chunk-OAWK4OBN.js";
|
|
75
75
|
import "./chunk-XWVM4KPK.js";
|
|
76
|
-
import "./chunk-
|
|
76
|
+
import "./chunk-I5NQ762W.js";
|
|
77
77
|
import "./chunk-EL5MWGGH.js";
|
|
78
78
|
import "./chunk-DGUM43GV.js";
|
|
79
79
|
export {
|
|
@@ -147,4 +147,4 @@ export {
|
|
|
147
147
|
writeEgressAllowlist,
|
|
148
148
|
writePersistentClaudeWrapper
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=persistent-session-
|
|
150
|
+
//# sourceMappingURL=persistent-session-YQLP5NPI.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-NOCTCO7G.js";
|
|
4
|
+
import "./chunk-ZSCZDOHR.js";
|
|
5
5
|
import "./chunk-B6UYVEMD.js";
|
|
6
6
|
import "./chunk-OAWK4OBN.js";
|
|
7
7
|
import "./chunk-XWVM4KPK.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-I5NQ762W.js";
|
|
9
9
|
import "./chunk-EL5MWGGH.js";
|
|
10
10
|
import "./chunk-DGUM43GV.js";
|
|
11
11
|
|
|
@@ -804,4 +804,4 @@ export {
|
|
|
804
804
|
readAndResetSlackReplyBindingClassifications,
|
|
805
805
|
readAndResetSlackReplyTargetClassifications
|
|
806
806
|
};
|
|
807
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
807
|
+
//# sourceMappingURL=responsiveness-probe-6K6SVHRK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionTranscriptDir
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZSCZDOHR.js";
|
|
4
|
+
import "./chunk-I5NQ762W.js";
|
|
5
5
|
import "./chunk-DGUM43GV.js";
|
|
6
6
|
|
|
7
7
|
// src/lib/session-auth-dead.ts
|
|
@@ -205,4 +205,4 @@ export {
|
|
|
205
205
|
decideSessionAuthState,
|
|
206
206
|
probeSessionAuth
|
|
207
207
|
};
|
|
208
|
-
//# sourceMappingURL=session-auth-dead-
|
|
208
|
+
//# sourceMappingURL=session-auth-dead-M4KYOBXK.js.map
|