@agent-native/core 0.203.1 → 0.204.0-nightly-20261008011018
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/a2a/handlers.js +57 -1
- package/dist/a2a/server.js +37 -1
- package/dist/action.js +22 -1
- package/dist/agent/contain-principal.d.ts +9 -0
- package/dist/agent/contain-principal.js +53 -0
- package/dist/agent/production-agent.js +32 -2
- package/dist/agent/run-manager.js +14 -2
- package/dist/agent/run-store.js +66 -12
- package/dist/agent/thread-message-projection.d.ts +1 -0
- package/dist/agent/thread-message-projection.js +56 -6
- package/dist/audit/actions/export-audit-events.d.ts +1 -1
- package/dist/audit/actions/export-audit-events.js +2 -2
- package/dist/audit/actions/export-audit-ocsf.d.ts +11 -0
- package/dist/audit/actions/export-audit-ocsf.js +183 -0
- package/dist/audit/actions/list-audit-events.d.ts +1 -1
- package/dist/audit/actions/list-audit-events.js +3 -3
- package/dist/audit/config.d.ts +1 -1
- package/dist/audit/config.js +5 -1
- package/dist/audit/index.d.ts +1 -0
- package/dist/audit/index.js +1 -0
- package/dist/audit/ocsf.d.ts +70 -0
- package/dist/audit/ocsf.js +228 -0
- package/dist/audit/record.js +1 -1
- package/dist/audit/store.js +9 -2
- package/dist/audit/types.d.ts +12 -1
- package/dist/cli/connect.js +7 -2
- package/dist/client/chat/agentkit-agent-native.js +104 -24
- package/dist/coding-tools/run-code.js +22 -1
- package/dist/coding-tools/sandbox/local-child-process-adapter.js +20 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +2 -2
- package/dist/file-upload/builder.js +18 -4
- package/dist/framework-tools.js +3 -0
- package/dist/identity/rekey.js +6 -0
- package/dist/localization/core-messages/supplemental/ar-SA.js +15 -0
- package/dist/localization/core-messages/supplemental/de-DE.js +15 -0
- package/dist/localization/core-messages/supplemental/en-US.js +15 -0
- package/dist/localization/core-messages/supplemental/es-ES.js +15 -0
- package/dist/localization/core-messages/supplemental/fr-FR.js +15 -0
- package/dist/localization/core-messages/supplemental/hi-IN.js +15 -0
- package/dist/localization/core-messages/supplemental/ja-JP.js +15 -0
- package/dist/localization/core-messages/supplemental/ko-KR.js +15 -0
- package/dist/localization/core-messages/supplemental/pt-BR.js +15 -0
- package/dist/localization/core-messages/supplemental/zh-CN.js +15 -0
- package/dist/localization/core-messages/supplemental/zh-TW.js +15 -0
- package/dist/localization/mcp-settings-messages.d.ts +15 -0
- package/dist/mcp/actions/create-org-service-token.d.ts +8 -0
- package/dist/mcp/actions/create-org-service-token.js +92 -4
- package/dist/mcp/actions/list-org-service-tokens.d.ts +2 -0
- package/dist/mcp/actions/list-org-service-tokens.js +36 -8
- package/dist/mcp/actions/service-principal-input.d.ts +48 -0
- package/dist/mcp/actions/service-principal-input.js +102 -0
- package/dist/mcp/actions/set-service-principal-lifecycle.d.ts +15 -0
- package/dist/mcp/actions/set-service-principal-lifecycle.js +150 -0
- package/dist/mcp/actions/set-service-principal-policy.d.ts +14 -0
- package/dist/mcp/actions/set-service-principal-policy.js +105 -0
- package/dist/mcp/build-server.js +105 -4
- package/dist/mcp/connect-route.js +116 -4
- package/dist/mcp/connect-store.d.ts +7 -0
- package/dist/mcp/connect-store.js +21 -14
- package/dist/observability/routes.d.ts +4 -4
- package/dist/observability/store.js +11 -5
- package/dist/observability/traces.js +6 -0
- package/dist/observability/types.d.ts +2 -0
- package/dist/org/index.d.ts +2 -2
- package/dist/org/service-principal-guard.d.ts +64 -0
- package/dist/org/service-principal-guard.js +140 -0
- package/dist/org/service-principal-policy.d.ts +104 -0
- package/dist/org/service-principal-policy.js +272 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts +2 -2
- package/dist/provider-api/actions/provider-api.d.ts +13 -13
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/action-discovery.js +12 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-default-model-route.d.ts +1 -1
- package/dist/server/core-routes-plugin.js +39 -12
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/release-schema.js +4 -0
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +59 -70
- package/dist/templates/factory/.agents/skills/review-latest-feedback/references/reproduction-and-verification.md +46 -0
- package/dist/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +33 -0
- package/dist/templates/factory/.agents/skills/review-prs/SKILL.md +5 -3
- package/dist/triggers/actions/manage-automation.d.ts +2 -2
- package/dist/vite/client.js +1 -0
- package/docs/content/audit-log.mdx +15 -0
- package/docs/content/http-api.mdx +21 -2
- package/docs/content/pr-visual-recap.mdx +3 -1
- package/docs/content/template-clips-embed.mdx +1 -1
- package/docs/content/turn-into-app.mdx +118 -0
- package/package.json +4 -4
- package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +59 -70
- package/src/templates/factory/.agents/skills/review-latest-feedback/references/reproduction-and-verification.md +46 -0
- package/src/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +33 -0
- package/src/templates/factory/.agents/skills/review-prs/SKILL.md +5 -3
|
@@ -412,6 +412,80 @@ function withRefusedTurnMetadata(message, stored) {
|
|
|
412
412
|
},
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
|
+
function orderMessagesByDurableSequence(snapshotMessages, missingMessages, durableMessages, durableIndexById, durableIdBySnapshotId) {
|
|
416
|
+
const messageByDurableId = new Map(missingMessages.map((message) => [message.id, message]));
|
|
417
|
+
const snapshotIdByDurableId = new Map();
|
|
418
|
+
const durableIndexBySnapshotId = new Map();
|
|
419
|
+
for (const message of snapshotMessages) {
|
|
420
|
+
const durableId = durableIdBySnapshotId.get(message.id) ??
|
|
421
|
+
(durableIndexById.has(message.id) ? message.id : undefined);
|
|
422
|
+
const durableIndex = durableId
|
|
423
|
+
? durableIndexById.get(durableId)
|
|
424
|
+
: undefined;
|
|
425
|
+
if (!durableId ||
|
|
426
|
+
durableIndex === undefined ||
|
|
427
|
+
snapshotIdByDurableId.has(durableId)) {
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
snapshotIdByDurableId.set(durableId, message.id);
|
|
431
|
+
durableIndexBySnapshotId.set(message.id, durableIndex);
|
|
432
|
+
messageByDurableId.set(durableId, message);
|
|
433
|
+
}
|
|
434
|
+
if (snapshotIdByDurableId.size === 0) {
|
|
435
|
+
return [...snapshotMessages, ...missingMessages]
|
|
436
|
+
.map((message, index) => ({ message, index }))
|
|
437
|
+
.sort((left, right) => {
|
|
438
|
+
const leftCreatedAt = Date.parse(left.message.createdAt ?? "");
|
|
439
|
+
const rightCreatedAt = Date.parse(right.message.createdAt ?? "");
|
|
440
|
+
if (Number.isFinite(leftCreatedAt) &&
|
|
441
|
+
Number.isFinite(rightCreatedAt) &&
|
|
442
|
+
leftCreatedAt !== rightCreatedAt) {
|
|
443
|
+
return leftCreatedAt - rightCreatedAt;
|
|
444
|
+
}
|
|
445
|
+
return left.index - right.index;
|
|
446
|
+
})
|
|
447
|
+
.map(({ message }) => message);
|
|
448
|
+
}
|
|
449
|
+
const insertions = new Map();
|
|
450
|
+
for (let index = 0; index < snapshotMessages.length; index += 1) {
|
|
451
|
+
const message = snapshotMessages[index];
|
|
452
|
+
if (durableIndexBySnapshotId.has(message.id))
|
|
453
|
+
continue;
|
|
454
|
+
let insertionIndex;
|
|
455
|
+
for (let next = index + 1; next < snapshotMessages.length; next += 1) {
|
|
456
|
+
const durableIndex = durableIndexBySnapshotId.get(snapshotMessages[next].id);
|
|
457
|
+
if (durableIndex !== undefined) {
|
|
458
|
+
insertionIndex = durableIndex;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (insertionIndex === undefined) {
|
|
463
|
+
for (let previous = index - 1; previous >= 0; previous -= 1) {
|
|
464
|
+
const durableIndex = durableIndexBySnapshotId.get(snapshotMessages[previous].id);
|
|
465
|
+
if (durableIndex !== undefined) {
|
|
466
|
+
insertionIndex = durableIndex + 1;
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (insertionIndex === undefined)
|
|
472
|
+
continue;
|
|
473
|
+
const messages = insertions.get(insertionIndex) ?? [];
|
|
474
|
+
messages.push(message);
|
|
475
|
+
insertions.set(insertionIndex, messages);
|
|
476
|
+
}
|
|
477
|
+
const ordered = [];
|
|
478
|
+
for (let index = 0; index <= durableMessages.length; index += 1) {
|
|
479
|
+
ordered.push(...(insertions.get(index) ?? []));
|
|
480
|
+
const durableMessage = durableMessages[index];
|
|
481
|
+
if (!durableMessage)
|
|
482
|
+
continue;
|
|
483
|
+
const projected = messageByDurableId.get(durableMessage.id);
|
|
484
|
+
if (projected)
|
|
485
|
+
ordered.push(projected);
|
|
486
|
+
}
|
|
487
|
+
return ordered;
|
|
488
|
+
}
|
|
415
489
|
function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
416
490
|
const submittedRunId = (message) => {
|
|
417
491
|
const value = asRecord(asRecord(message.metadata)?.custom)?.submittedRunId;
|
|
@@ -495,6 +569,7 @@ function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
|
495
569
|
toolCalls,
|
|
496
570
|
});
|
|
497
571
|
const representedDurableAssistantIds = rootAssistantProjection.representedRootMessageIds;
|
|
572
|
+
const snapshotRunIdsByMessageId = rootAssistantProjection.snapshotRunIdsByMessageId;
|
|
498
573
|
const rootMessageIdsBySnapshotMessageId = new Map([...rootAssistantProjection.snapshotMessageIdsByRootMessageId].map(([rootId, snapshotId]) => [snapshotId, rootId]));
|
|
499
574
|
const deduplicatedMessages = messages.filter((message) => !representedDurableAssistantIds.has(message.id));
|
|
500
575
|
const representedSubmittedUserIds = new Set();
|
|
@@ -526,7 +601,8 @@ function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
|
526
601
|
const metadataRunId = asRecord(message.metadata)?.runId;
|
|
527
602
|
const runId = typeof metadataRunId === "string"
|
|
528
603
|
? metadataRunId
|
|
529
|
-
:
|
|
604
|
+
: (snapshotRunIdsByMessageId.get(message.id) ??
|
|
605
|
+
runByAssistantId.get(message.id));
|
|
530
606
|
if (runId)
|
|
531
607
|
snapshotAssistantRunIds.add(runId);
|
|
532
608
|
}
|
|
@@ -565,6 +641,9 @@ function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
|
565
641
|
for (const message of matchingSnapshots) {
|
|
566
642
|
matchedSnapshotUserIds.add(message.id);
|
|
567
643
|
}
|
|
644
|
+
for (let index = 0; index < matchingSnapshots.length; index += 1) {
|
|
645
|
+
storedUserBySnapshotId.set(matchingSnapshots[index].id, candidates[index]);
|
|
646
|
+
}
|
|
568
647
|
}
|
|
569
648
|
const missingMessages = submittedUsers.filter((message) => !representedSubmittedUserIds.has(message.id));
|
|
570
649
|
const completedRunIds = new Set([
|
|
@@ -600,39 +679,35 @@ function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
|
600
679
|
missingMessages.push(message);
|
|
601
680
|
representedAssistantIds.add(message.id);
|
|
602
681
|
}
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
]
|
|
608
|
-
.
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
.sort((left, right) => {
|
|
613
|
-
const leftCreatedAt = Date.parse(left.message.createdAt ?? "");
|
|
614
|
-
const rightCreatedAt = Date.parse(right.message.createdAt ?? "");
|
|
615
|
-
if (Number.isFinite(leftCreatedAt) &&
|
|
616
|
-
Number.isFinite(rightCreatedAt) &&
|
|
617
|
-
leftCreatedAt !== rightCreatedAt) {
|
|
618
|
-
return leftCreatedAt - rightCreatedAt;
|
|
619
|
-
}
|
|
620
|
-
return left.index - right.index;
|
|
621
|
-
})
|
|
622
|
-
.map(({ message }) => message);
|
|
682
|
+
const durableIdBySnapshotId = new Map();
|
|
683
|
+
for (const [snapshotId, stored] of storedUserBySnapshotId) {
|
|
684
|
+
durableIdBySnapshotId.set(snapshotId, stored.id);
|
|
685
|
+
}
|
|
686
|
+
for (const [snapshotId, rootId] of rootMessageIdsBySnapshotMessageId) {
|
|
687
|
+
durableIdBySnapshotId.set(snapshotId, rootId);
|
|
688
|
+
}
|
|
689
|
+
const projectedMessages = orderMessagesByDurableSequence(deduplicatedMessages, missingMessages.sort((left, right) => (durableIndexById.get(left.id) ?? 0) -
|
|
690
|
+
(durableIndexById.get(right.id) ?? 0)), durable, durableIndexById, durableIdBySnapshotId);
|
|
623
691
|
const snapshotRunId = (message) => {
|
|
624
692
|
const metadataRunId = asRecord(message.metadata)?.runId;
|
|
625
693
|
return (runByAssistantId.get(message.id) ??
|
|
694
|
+
snapshotRunIdsByMessageId.get(message.id) ??
|
|
626
695
|
(typeof metadataRunId === "string" ? metadataRunId : undefined));
|
|
627
696
|
};
|
|
628
697
|
const textOf = (parts) => parts
|
|
629
698
|
.filter((part) => part.type === "text")
|
|
630
699
|
.map((part) => part.text)
|
|
631
700
|
.join("");
|
|
632
|
-
|
|
701
|
+
const reconciledMessages = projectedMessages.map((message) => {
|
|
633
702
|
if (message.role === "user") {
|
|
634
703
|
const stored = storedUserBySnapshotId.get(message.id);
|
|
635
|
-
|
|
704
|
+
if (!stored)
|
|
705
|
+
return message;
|
|
706
|
+
const createdAt = message.createdAt ?? stored.createdAt;
|
|
707
|
+
const reconciled = createdAt === message.createdAt
|
|
708
|
+
? message
|
|
709
|
+
: { ...message, ...(createdAt ? { createdAt } : {}) };
|
|
710
|
+
return withRefusedTurnMetadata(reconciled, stored);
|
|
636
711
|
}
|
|
637
712
|
if (message.role !== "assistant")
|
|
638
713
|
return message;
|
|
@@ -646,10 +721,14 @@ function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
|
646
721
|
representedRoot.status === "error"
|
|
647
722
|
? representedRoot.status
|
|
648
723
|
: undefined;
|
|
649
|
-
|
|
724
|
+
const createdAt = message.createdAt ?? representedRoot.createdAt;
|
|
725
|
+
if (parts !== message.parts ||
|
|
726
|
+
terminalStatus !== undefined ||
|
|
727
|
+
createdAt !== message.createdAt) {
|
|
650
728
|
message = {
|
|
651
729
|
...message,
|
|
652
730
|
...(parts !== message.parts ? { parts } : {}),
|
|
731
|
+
...(createdAt ? { createdAt } : {}),
|
|
653
732
|
...(terminalStatus ? { status: terminalStatus } : {}),
|
|
654
733
|
};
|
|
655
734
|
}
|
|
@@ -759,6 +838,7 @@ function reconcileDurableMessages(messages, durable, events, runs, toolCalls) {
|
|
|
759
838
|
}
|
|
760
839
|
return { ...reconciled, parts };
|
|
761
840
|
});
|
|
841
|
+
return reconciledMessages;
|
|
762
842
|
}
|
|
763
843
|
function messageStatus(value) {
|
|
764
844
|
const status = asRecord(value)?.type ?? value;
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
import crypto from "node:crypto";
|
|
32
32
|
import http from "node:http";
|
|
33
33
|
import { createRunner, RunError } from "run";
|
|
34
|
+
import { parseServiceIdentityEmail } from "../org/service-identity.js";
|
|
34
35
|
import { getRequestContext, getRequestRunContext, getRequestUserEmail, runWithRequestContext, } from "../server/request-context.js";
|
|
35
36
|
import { failExpiredSandboxExecution, getSandboxExecutionForOwner, } from "./sandbox/executions-store.js";
|
|
36
37
|
import { BACKGROUND_DEFAULT_TIMEOUT_MS, BACKGROUND_MAX_TIMEOUT_MS, SANDBOX_EXECUTION_REDRIVE_AFTER_MS, driveSandboxExecution, enqueueSandboxExecution, getSandboxAdapter, isQueuedSandboxAdapter, registerSandboxExecutionRunner, resolveExecutionSandboxAdapter, } from "./sandbox/index.js";
|
|
@@ -501,8 +502,22 @@ function createBridgeInvoker(options) {
|
|
|
501
502
|
if (callBudget)
|
|
502
503
|
callBudget.count += 1;
|
|
503
504
|
usedTools.add(toolName);
|
|
505
|
+
let servicePrincipalRefusedError;
|
|
504
506
|
try {
|
|
505
|
-
const
|
|
507
|
+
const context = options.context;
|
|
508
|
+
if (context && parseServiceIdentityEmail(context.userEmail)) {
|
|
509
|
+
const guard = await import("../org/service-principal-guard.js");
|
|
510
|
+
servicePrincipalRefusedError = guard.ServicePrincipalRefusedError;
|
|
511
|
+
await guard.enforceServicePrincipalActionGrant({
|
|
512
|
+
email: context.userEmail,
|
|
513
|
+
orgId: context.orgId,
|
|
514
|
+
actionName: toolName,
|
|
515
|
+
caller: context.caller,
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
// Name the child, not `run-code`: a service principal's grant is checked
|
|
519
|
+
// against the action actually being run.
|
|
520
|
+
const run = () => entry.run(childArgs, options.context && { ...options.context, actionName: toolName });
|
|
506
521
|
const result = options.context?.credentialScope === "org"
|
|
507
522
|
? await runWithRequestContext({
|
|
508
523
|
...getRequestContext(),
|
|
@@ -516,6 +531,12 @@ function createBridgeInvoker(options) {
|
|
|
516
531
|
return formatBridgeResult(result);
|
|
517
532
|
}
|
|
518
533
|
catch (error) {
|
|
534
|
+
if (error instanceof BridgeInvocationError)
|
|
535
|
+
throw error;
|
|
536
|
+
if (servicePrincipalRefusedError &&
|
|
537
|
+
error instanceof servicePrincipalRefusedError) {
|
|
538
|
+
throw new BridgeInvocationError(error.statusCode, error.message);
|
|
539
|
+
}
|
|
519
540
|
throw new BridgeInvocationError(500, error instanceof Error ? error.message : String(error));
|
|
520
541
|
}
|
|
521
542
|
};
|
|
@@ -21,6 +21,7 @@ function sandboxWriteAllowPaths(tmpDir) {
|
|
|
21
21
|
return [...paths];
|
|
22
22
|
}
|
|
23
23
|
let cachedPermissionFlag;
|
|
24
|
+
let cachedNetPermissionSupport;
|
|
24
25
|
function resolvePermissionFlag() {
|
|
25
26
|
if (cachedPermissionFlag !== undefined)
|
|
26
27
|
return cachedPermissionFlag;
|
|
@@ -42,6 +43,19 @@ function resolvePermissionFlag() {
|
|
|
42
43
|
cachedPermissionFlag = null;
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
46
|
+
function supportsNetPermissionFlag(permissionFlag) {
|
|
47
|
+
if (cachedNetPermissionSupport !== undefined) {
|
|
48
|
+
return cachedNetPermissionSupport;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const probe = spawnSync(process.execPath, [permissionFlag, "--allow-net", "-e", "process.exit(0)"], { timeout: 10_000, stdio: "ignore" });
|
|
52
|
+
cachedNetPermissionSupport = probe.status === 0;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
cachedNetPermissionSupport = false;
|
|
56
|
+
}
|
|
57
|
+
return cachedNetPermissionSupport;
|
|
58
|
+
}
|
|
45
59
|
export class LocalChildProcessAdapter {
|
|
46
60
|
id = "local-child-process";
|
|
47
61
|
async run(request) {
|
|
@@ -60,6 +74,12 @@ export class LocalChildProcessAdapter {
|
|
|
60
74
|
const nodeArgs = permissionFlag
|
|
61
75
|
? [
|
|
62
76
|
permissionFlag,
|
|
77
|
+
// Node 25+ also denies network under --permission. The sandbox
|
|
78
|
+
// bridge uses loopback HTTP, and direct outbound requests are
|
|
79
|
+
// already part of its unauthenticated execution contract.
|
|
80
|
+
...(supportsNetPermissionFlag(permissionFlag)
|
|
81
|
+
? ["--allow-net"]
|
|
82
|
+
: []),
|
|
63
83
|
...sandboxReadAllowPaths(tmpDir).map((allowedPath) => `--allow-fs-read=${allowedPath}`),
|
|
64
84
|
...sandboxWriteAllowPaths(tmpDir).map((allowedPath) => `--allow-fs-write=${allowedPath}`),
|
|
65
85
|
tmpFile,
|
|
@@ -38,19 +38,19 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
38
38
|
error: string;
|
|
39
39
|
states?: undefined;
|
|
40
40
|
} | {
|
|
41
|
-
error?: undefined;
|
|
42
41
|
states: {
|
|
43
42
|
clientId: number;
|
|
44
43
|
state: string;
|
|
45
44
|
}[];
|
|
45
|
+
error?: undefined;
|
|
46
46
|
}>>;
|
|
47
47
|
export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
48
48
|
error: string;
|
|
49
49
|
users?: undefined;
|
|
50
50
|
} | {
|
|
51
|
-
error?: undefined;
|
|
52
51
|
users: {
|
|
53
52
|
clientId: number;
|
|
54
53
|
lastSeen: number;
|
|
55
54
|
}[];
|
|
55
|
+
error?: undefined;
|
|
56
56
|
}>>;
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -8,16 +8,16 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
8
8
|
state: string;
|
|
9
9
|
}>>;
|
|
10
10
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
11
|
-
error: string;
|
|
12
11
|
ok?: undefined;
|
|
12
|
+
error: string;
|
|
13
13
|
} | {
|
|
14
14
|
error?: undefined;
|
|
15
15
|
ok: boolean;
|
|
16
16
|
}>>;
|
|
17
17
|
export declare const postCollabText: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
18
|
-
text?: undefined;
|
|
19
18
|
ok?: undefined;
|
|
20
19
|
error: string;
|
|
20
|
+
text?: undefined;
|
|
21
21
|
} | {
|
|
22
22
|
error?: undefined;
|
|
23
23
|
ok: boolean;
|
|
@@ -12,8 +12,22 @@ function makeBody(bytes, mimeType) {
|
|
|
12
12
|
? new Blob([bytes], { type: mimeType })
|
|
13
13
|
: bytes;
|
|
14
14
|
}
|
|
15
|
+
// Builder's `/api/v1/upload` endpoint sniffs these two Content-Types as a
|
|
16
|
+
// JSON-bodied request (its legacy `{ image: "data:..." }` upload shape)
|
|
17
|
+
// instead of raw file bytes, so it responds 400 "No image specified" for any
|
|
18
|
+
// real `application/json` or `text/plain` file — even though every other
|
|
19
|
+
// mimetype in `UPLOAD_ALLOWED_MIME_PREFIXES` (csv, pdf, zip, docs, video,
|
|
20
|
+
// octet-stream, other text/* subtypes) uploads through it without issue. The
|
|
21
|
+
// signed-URL flow PUTs raw bytes straight to GCS, so it never hits that
|
|
22
|
+
// body-sniffing path.
|
|
23
|
+
function builderMisparsesContentTypeAsJsonBody(mimeType) {
|
|
24
|
+
const normalized = mimeType.toLowerCase();
|
|
25
|
+
return normalized === "application/json" || normalized === "text/plain";
|
|
26
|
+
}
|
|
15
27
|
function shouldUseSignedUrlUpload(bytes, mimeType) {
|
|
16
|
-
return (bytes.byteLength > LARGE_FILE_THRESHOLD_BYTES ||
|
|
28
|
+
return (bytes.byteLength > LARGE_FILE_THRESHOLD_BYTES ||
|
|
29
|
+
/^video\//i.test(mimeType) ||
|
|
30
|
+
builderMisparsesContentTypeAsJsonBody(mimeType));
|
|
17
31
|
}
|
|
18
32
|
function fetchWithTimeout(url, init) {
|
|
19
33
|
const controller = new AbortController();
|
|
@@ -75,10 +89,10 @@ async function withAssetAuthorization(run, held = {}) {
|
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
|
-
async function
|
|
92
|
+
async function uploadViaSignedUrl(input, held, bareMimeType, bytes) {
|
|
79
93
|
const name = input.filename ?? "upload";
|
|
80
94
|
const mb = (bytes.byteLength / (1024 * 1024)).toFixed(1);
|
|
81
|
-
console.log(`[builder-upload]
|
|
95
|
+
console.log(`[builder-upload] signed-url path: ${name} ${mb}MB ${bareMimeType}`);
|
|
82
96
|
console.log(`[builder-upload] step 1: requesting signed URL`);
|
|
83
97
|
const { uploadUrl, assetId, requiredHeaders } = await withAssetAuthorization(({ authorization, apiKey }) => requestBuilderSignedUrl(authorization, apiKey, name, bareMimeType, bytes.byteLength), held);
|
|
84
98
|
console.log(`[builder-upload] step 1 ok: assetId=${assetId}`);
|
|
@@ -228,7 +242,7 @@ export const builderFileUploadProvider = {
|
|
|
228
242
|
const bytes = data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
229
243
|
const mb = (bytes.byteLength / (1024 * 1024)).toFixed(1);
|
|
230
244
|
if (shouldUseSignedUrlUpload(bytes, bareMimeType)) {
|
|
231
|
-
return
|
|
245
|
+
return uploadViaSignedUrl(input, held, bareMimeType, bytes);
|
|
232
246
|
}
|
|
233
247
|
console.log(`[builder-upload] small-file path: ${filename ?? "upload"} ${mb}MB ${bareMimeType}`);
|
|
234
248
|
const response = await withAssetAuthorization(({ authorization, apiKey }) => {
|
package/dist/framework-tools.js
CHANGED
|
@@ -165,6 +165,7 @@ export const CORE_ACTION_GROUPS = {
|
|
|
165
165
|
"list-audit-events": "audit",
|
|
166
166
|
"get-audit-event": "audit",
|
|
167
167
|
"export-audit-events": "audit",
|
|
168
|
+
"export-audit-ocsf": "audit",
|
|
168
169
|
// Observability promotion reuses `labs` until a dedicated group exists.
|
|
169
170
|
// A new FRAMEWORK_TOOL_GROUPS member is filtered at thirteen composition
|
|
170
171
|
// sites; do not add `observability` in the same change as this action.
|
|
@@ -189,6 +190,8 @@ export const CORE_ACTION_GROUPS = {
|
|
|
189
190
|
"create-org-service-token": "orgServiceTokens",
|
|
190
191
|
"list-org-service-tokens": "orgServiceTokens",
|
|
191
192
|
"revoke-org-service-token": "orgServiceTokens",
|
|
193
|
+
"set-service-principal-policy": "orgServiceTokens",
|
|
194
|
+
"set-service-principal-lifecycle": "orgServiceTokens",
|
|
192
195
|
"list-review-comments": "review",
|
|
193
196
|
"create-review-comment": "review",
|
|
194
197
|
"reply-review-comment": "review",
|
package/dist/identity/rekey.js
CHANGED
|
@@ -112,6 +112,12 @@ export const IDENTITY_REKEY_COLUMNS = [
|
|
|
112
112
|
// A missing connect-token row reads as "not revoked", so revoke, never delete.
|
|
113
113
|
{ table: "mcp_connect_tokens", column: "owner_email", offboard: "revoke" },
|
|
114
114
|
{ table: "mcp_connect_tokens", column: "created_by" },
|
|
115
|
+
// The accountable owner outlives their account: the principal stays governed and its owner reads as stale.
|
|
116
|
+
{
|
|
117
|
+
table: "service_principal_policies",
|
|
118
|
+
column: "owner_email",
|
|
119
|
+
offboard: "retain",
|
|
120
|
+
},
|
|
115
121
|
{ table: "mcp_oauth_codes", column: "owner_email", offboard: "delete" },
|
|
116
122
|
{
|
|
117
123
|
table: "mcp_oauth_codes",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "تعذر إنشاء الرمز.",
|
|
55
55
|
networkError: "حدث خطأ في الشبكة. حاول مرة أخرى.",
|
|
56
56
|
urlTitle: "عنوان MCP الخاص بك",
|
|
57
|
+
servicePrincipals: "كيانات الخدمة",
|
|
58
|
+
principalUngoverned: "غير خاضع للحوكمة",
|
|
59
|
+
principalActive: "نشط",
|
|
60
|
+
principalSuspended: "معلّق",
|
|
61
|
+
principalRetired: "متقاعد",
|
|
62
|
+
principalUngovernedHint: "لم يتم تعيين مالك أو إذن للإجراءات.",
|
|
63
|
+
principalOwner: "المالك",
|
|
64
|
+
principalRisk: "المخاطر",
|
|
65
|
+
riskLow: "منخفضة",
|
|
66
|
+
riskMedium: "متوسطة",
|
|
67
|
+
riskHigh: "عالية",
|
|
68
|
+
suspend: "تعليق",
|
|
69
|
+
resume: "استئناف",
|
|
70
|
+
couldNotUpdatePrincipal: "تعذّر تحديث كيان الخدمة.",
|
|
71
|
+
containmentIncomplete: "تم التحديث، لكن تعذّر إيقاف بعض عمليات التشغيل أو الرموز. حاول مرة أخرى.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "Token konnte nicht erstellt werden.",
|
|
55
55
|
networkError: "Netzwerkfehler. Bitte versuche es erneut.",
|
|
56
56
|
urlTitle: "Deine MCP-URL",
|
|
57
|
+
servicePrincipals: "Dienstprinzipale",
|
|
58
|
+
principalUngoverned: "Nicht verwaltet",
|
|
59
|
+
principalActive: "Aktiv",
|
|
60
|
+
principalSuspended: "Gesperrt",
|
|
61
|
+
principalRetired: "Stillgelegt",
|
|
62
|
+
principalUngovernedHint: "Kein Eigentümer und keine Aktionsfreigabe festgelegt.",
|
|
63
|
+
principalOwner: "Eigentümer",
|
|
64
|
+
principalRisk: "Risiko",
|
|
65
|
+
riskLow: "niedrig",
|
|
66
|
+
riskMedium: "mittel",
|
|
67
|
+
riskHigh: "hoch",
|
|
68
|
+
suspend: "Sperren",
|
|
69
|
+
resume: "Fortsetzen",
|
|
70
|
+
couldNotUpdatePrincipal: "Der Dienstprinzipal konnte nicht aktualisiert werden.",
|
|
71
|
+
containmentIncomplete: "Aktualisiert, aber einige Ausführungen oder Token konnten nicht gestoppt werden. Versuche es erneut.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "Could not create token.",
|
|
55
55
|
networkError: "Network error. Please try again.",
|
|
56
56
|
urlTitle: "Your MCP URL",
|
|
57
|
+
servicePrincipals: "Service principals",
|
|
58
|
+
principalUngoverned: "Ungoverned",
|
|
59
|
+
principalActive: "Active",
|
|
60
|
+
principalSuspended: "Suspended",
|
|
61
|
+
principalRetired: "Retired",
|
|
62
|
+
principalUngovernedHint: "No owner or action grant is set.",
|
|
63
|
+
principalOwner: "Owner",
|
|
64
|
+
principalRisk: "Risk",
|
|
65
|
+
riskLow: "low",
|
|
66
|
+
riskMedium: "medium",
|
|
67
|
+
riskHigh: "high",
|
|
68
|
+
suspend: "Suspend",
|
|
69
|
+
resume: "Resume",
|
|
70
|
+
couldNotUpdatePrincipal: "Could not update the service principal.",
|
|
71
|
+
containmentIncomplete: "Updated, but some runs or tokens could not be stopped. Try again.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "No se pudo crear el token.",
|
|
55
55
|
networkError: "Error de red. Inténtalo de nuevo.",
|
|
56
56
|
urlTitle: "Tu URL de MCP",
|
|
57
|
+
servicePrincipals: "Principales de servicio",
|
|
58
|
+
principalUngoverned: "Sin gobernanza",
|
|
59
|
+
principalActive: "Activo",
|
|
60
|
+
principalSuspended: "Suspendido",
|
|
61
|
+
principalRetired: "Retirado",
|
|
62
|
+
principalUngovernedHint: "No hay propietario ni permisos de acciones definidos.",
|
|
63
|
+
principalOwner: "Propietario",
|
|
64
|
+
principalRisk: "Riesgo",
|
|
65
|
+
riskLow: "bajo",
|
|
66
|
+
riskMedium: "medio",
|
|
67
|
+
riskHigh: "alto",
|
|
68
|
+
suspend: "Suspender",
|
|
69
|
+
resume: "Reanudar",
|
|
70
|
+
couldNotUpdatePrincipal: "No se pudo actualizar el principal de servicio.",
|
|
71
|
+
containmentIncomplete: "Actualizado, pero no se pudieron detener algunas ejecuciones o tokens. Inténtalo de nuevo.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "Impossible de créer le jeton.",
|
|
55
55
|
networkError: "Erreur réseau. Réessayez.",
|
|
56
56
|
urlTitle: "Votre URL MCP",
|
|
57
|
+
servicePrincipals: "Principaux de service",
|
|
58
|
+
principalUngoverned: "Non gouverné",
|
|
59
|
+
principalActive: "Actif",
|
|
60
|
+
principalSuspended: "Suspendu",
|
|
61
|
+
principalRetired: "Retiré",
|
|
62
|
+
principalUngovernedHint: "Aucun propriétaire ni autorisation d'actions n'est défini.",
|
|
63
|
+
principalOwner: "Propriétaire",
|
|
64
|
+
principalRisk: "Risque",
|
|
65
|
+
riskLow: "faible",
|
|
66
|
+
riskMedium: "moyen",
|
|
67
|
+
riskHigh: "élevé",
|
|
68
|
+
suspend: "Suspendre",
|
|
69
|
+
resume: "Reprendre",
|
|
70
|
+
couldNotUpdatePrincipal: "Impossible de mettre à jour le principal de service.",
|
|
71
|
+
containmentIncomplete: "Mis à jour, mais certaines exécutions ou certains jetons n'ont pas pu être arrêtés. Réessayez.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "Token बनाया नहीं जा सका।",
|
|
55
55
|
networkError: "Network error. फिर से कोशिश करें।",
|
|
56
56
|
urlTitle: "आपका MCP URL",
|
|
57
|
+
servicePrincipals: "सर्विस प्रिंसिपल",
|
|
58
|
+
principalUngoverned: "अनियंत्रित",
|
|
59
|
+
principalActive: "सक्रिय",
|
|
60
|
+
principalSuspended: "निलंबित",
|
|
61
|
+
principalRetired: "सेवानिवृत्त",
|
|
62
|
+
principalUngovernedHint: "कोई स्वामी या कार्रवाई अनुमति सेट नहीं है।",
|
|
63
|
+
principalOwner: "स्वामी",
|
|
64
|
+
principalRisk: "जोखिम",
|
|
65
|
+
riskLow: "कम",
|
|
66
|
+
riskMedium: "मध्यम",
|
|
67
|
+
riskHigh: "उच्च",
|
|
68
|
+
suspend: "निलंबित करें",
|
|
69
|
+
resume: "फिर शुरू करें",
|
|
70
|
+
couldNotUpdatePrincipal: "सर्विस प्रिंसिपल अपडेट नहीं किया जा सका।",
|
|
71
|
+
containmentIncomplete: "अपडेट हो गया, लेकिन कुछ रन या टोकन रोके नहीं जा सके। फिर से प्रयास करें।",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "トークンを作成できませんでした。",
|
|
55
55
|
networkError: "ネットワークエラーです。もう一度お試しください。",
|
|
56
56
|
urlTitle: "MCP URL",
|
|
57
|
+
servicePrincipals: "サービスプリンシパル",
|
|
58
|
+
principalUngoverned: "未管理",
|
|
59
|
+
principalActive: "有効",
|
|
60
|
+
principalSuspended: "一時停止中",
|
|
61
|
+
principalRetired: "廃止済み",
|
|
62
|
+
principalUngovernedHint: "オーナーも操作の許可も設定されていません。",
|
|
63
|
+
principalOwner: "オーナー",
|
|
64
|
+
principalRisk: "リスク",
|
|
65
|
+
riskLow: "低",
|
|
66
|
+
riskMedium: "中",
|
|
67
|
+
riskHigh: "高",
|
|
68
|
+
suspend: "一時停止",
|
|
69
|
+
resume: "再開",
|
|
70
|
+
couldNotUpdatePrincipal: "サービスプリンシパルを更新できませんでした。",
|
|
71
|
+
containmentIncomplete: "更新しましたが、停止できない実行またはトークンがあります。もう一度お試しください。",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "토큰을 생성할 수 없습니다.",
|
|
55
55
|
networkError: "네트워크 오류입니다. 다시 시도하세요.",
|
|
56
56
|
urlTitle: "MCP URL",
|
|
57
|
+
servicePrincipals: "서비스 주체",
|
|
58
|
+
principalUngoverned: "미관리",
|
|
59
|
+
principalActive: "활성",
|
|
60
|
+
principalSuspended: "일시 중지됨",
|
|
61
|
+
principalRetired: "폐기됨",
|
|
62
|
+
principalUngovernedHint: "소유자 또는 작업 권한이 설정되지 않았습니다.",
|
|
63
|
+
principalOwner: "소유자",
|
|
64
|
+
principalRisk: "위험",
|
|
65
|
+
riskLow: "낮음",
|
|
66
|
+
riskMedium: "보통",
|
|
67
|
+
riskHigh: "높음",
|
|
68
|
+
suspend: "일시 중지",
|
|
69
|
+
resume: "재개",
|
|
70
|
+
couldNotUpdatePrincipal: "서비스 주체를 업데이트할 수 없습니다.",
|
|
71
|
+
containmentIncomplete: "업데이트했지만 일부 실행 또는 토큰을 중지하지 못했습니다. 다시 시도하세요.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "Não foi possível criar o token.",
|
|
55
55
|
networkError: "Erro de rede. Tente novamente.",
|
|
56
56
|
urlTitle: "Sua URL MCP",
|
|
57
|
+
servicePrincipals: "Principais de serviço",
|
|
58
|
+
principalUngoverned: "Sem governança",
|
|
59
|
+
principalActive: "Ativo",
|
|
60
|
+
principalSuspended: "Suspenso",
|
|
61
|
+
principalRetired: "Desativado",
|
|
62
|
+
principalUngovernedHint: "Nenhum proprietário ou permissão de ações definido.",
|
|
63
|
+
principalOwner: "Proprietário",
|
|
64
|
+
principalRisk: "Risco",
|
|
65
|
+
riskLow: "baixo",
|
|
66
|
+
riskMedium: "médio",
|
|
67
|
+
riskHigh: "alto",
|
|
68
|
+
suspend: "Suspender",
|
|
69
|
+
resume: "Retomar",
|
|
70
|
+
couldNotUpdatePrincipal: "Não foi possível atualizar o principal de serviço.",
|
|
71
|
+
containmentIncomplete: "Atualizado, mas algumas execuções ou tokens não puderam ser interrompidos. Tente novamente.",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "无法创建令牌。",
|
|
55
55
|
networkError: "网络错误。请重试。",
|
|
56
56
|
urlTitle: "你的 MCP URL",
|
|
57
|
+
servicePrincipals: "服务主体",
|
|
58
|
+
principalUngoverned: "未治理",
|
|
59
|
+
principalActive: "活动",
|
|
60
|
+
principalSuspended: "已暂停",
|
|
61
|
+
principalRetired: "已停用",
|
|
62
|
+
principalUngovernedHint: "未设置所有者或操作授权。",
|
|
63
|
+
principalOwner: "所有者",
|
|
64
|
+
principalRisk: "风险",
|
|
65
|
+
riskLow: "低",
|
|
66
|
+
riskMedium: "中",
|
|
67
|
+
riskHigh: "高",
|
|
68
|
+
suspend: "暂停",
|
|
69
|
+
resume: "恢复",
|
|
70
|
+
couldNotUpdatePrincipal: "无法更新服务主体。",
|
|
71
|
+
containmentIncomplete: "已更新,但部分运行或令牌无法停止。请重试。",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|
|
@@ -54,6 +54,21 @@ export const mcpConnectMessages = {
|
|
|
54
54
|
couldNotCreate: "無法建立權杖。",
|
|
55
55
|
networkError: "網路錯誤。請再試一次。",
|
|
56
56
|
urlTitle: "你的 MCP URL",
|
|
57
|
+
servicePrincipals: "服務主體",
|
|
58
|
+
principalUngoverned: "未治理",
|
|
59
|
+
principalActive: "啟用中",
|
|
60
|
+
principalSuspended: "已暫停",
|
|
61
|
+
principalRetired: "已停用",
|
|
62
|
+
principalUngovernedHint: "尚未設定擁有者或動作授權。",
|
|
63
|
+
principalOwner: "擁有者",
|
|
64
|
+
principalRisk: "風險",
|
|
65
|
+
riskLow: "低",
|
|
66
|
+
riskMedium: "中",
|
|
67
|
+
riskHigh: "高",
|
|
68
|
+
suspend: "暫停",
|
|
69
|
+
resume: "恢復",
|
|
70
|
+
couldNotUpdatePrincipal: "無法更新服務主體。",
|
|
71
|
+
containmentIncomplete: "已更新,但部分執行或權杖無法停止。請重試。",
|
|
57
72
|
};
|
|
58
73
|
export const mcpSettingsMessages = {
|
|
59
74
|
mcpTitle: "MCP",
|