nolo-cli 0.224.1 → 0.225.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/{_executeModel-5NA4USGG.js → _executeModel-UCWDB72C.js} +50 -50
- package/{action-X75O3XPH.js → action-24MZYW2B.js} +6 -6
- package/{addContentAction-GVC77QSN.js → addContentAction-HEMCSSHT.js} +9 -9
- package/{addDialogAgentAction-KKDVAMW3.js → addDialogAgentAction-SQYDOXHA.js} +8 -8
- package/{agentDeleteCommand-2RFGKFAB.js → agentDeleteCommand-P7O3ACNJ.js} +76 -77
- package/{agentEmailCommands-GQCQKKOR.js → agentEmailCommands-A5BRSYWK.js} +80 -81
- package/{agentListCommands-HSGLDPDQ.js → agentListCommands-LDRCOOMO.js} +37 -36
- package/{agentMachineCommands-BISF6PVV.js → agentMachineCommands-AYL53KJV.js} +31 -30
- package/{agentProviderCommands-O3Q25PKU.js → agentProviderCommands-N5EA3ED2.js} +2 -2
- package/{agentPullCommand-G6U2LHMW.js → agentPullCommand-QQQZSC6S.js} +1 -1
- package/{agentRecordCommands-AOXPGYAJ.js → agentRecordCommands-FICBZ57C.js} +75 -76
- package/{agentRunCommand-AFAIP7U7.js → agentRunCommand-CTXQGDUM.js} +81 -80
- package/{agentRunControl-VBL7UFSG.js → agentRunControl-CO6BASZF.js} +7 -7
- package/{agentRuntimeLocal-T7BX2WGL.js → agentRuntimeLocal-5YN4D5WT.js} +26 -25
- package/{agentSlice-XJNKE3PG.js → agentSlice-DJ5D4DU4.js} +9 -9
- package/{appDeleteCommands-LURUSPY7.js → appDeleteCommands-B4E7N7M2.js} +32 -31
- package/{appDeployCommands-SMEW4AK2.js → appDeployCommands-E4DTXRRM.js} +32 -31
- package/{appDeployStatusCommands-VYPJTBJK.js → appDeployStatusCommands-FCNHYHZM.js} +32 -31
- package/{appGetCommands-N4NI5GGJ.js → appGetCommands-4DXSQHUZ.js} +32 -31
- package/{appListCommands-5C6ONN3Z.js → appListCommands-2NN5E4F6.js} +32 -31
- package/{authCommand-4CVBDADE.js → authCommand-47DR6GZT.js} +22 -18
- package/{authCommands-EHU2BHOX.js → authCommands-ZZ3L5IFM.js} +10 -6
- package/builtinSkillRegistry-AYWYQVA4.js +1 -1
- package/{chromeOpsCommands-CSDG2HYN.js → chromeOpsCommands-VZWAY2KR.js} +1 -1
- package/{chunk-UFC4J7OY.js → chunk-24GVXSWK.js} +3 -3
- package/{chunk-4IQVE43Z.js → chunk-25OCZXSX.js} +15 -15
- package/{chunk-4X5AVCM7.js → chunk-2BSLGODA.js} +258 -23
- package/{chunk-U3G7RRXJ.js → chunk-2XMKW2OY.js} +4 -4
- package/{chunk-MYOSN6BT.js → chunk-3NFWMSTA.js} +31 -10
- package/{chunk-A74QP4FI.js → chunk-3V6JT6WN.js} +343 -136
- package/{chunk-2X7WFDT6.js → chunk-4FE3IWRE.js} +1 -1
- package/{chunk-XS5A3EKX.js → chunk-4YFC3DWW.js} +75 -1
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-H7ZYKHAZ.js → chunk-5TJE4QCL.js} +102 -31
- package/{chunk-FZKA3XFA.js → chunk-6BGJHJRN.js} +9 -9
- package/{chunk-6WOLPIPY.js → chunk-6RSNVJGO.js} +2 -102
- package/{chunk-L32W3PRP.js → chunk-6X3CS6NJ.js} +161 -12
- package/{chunk-3FBAVU2Y.js → chunk-6XBOPKUH.js} +11 -76
- package/{chunk-62HXNQVV.js → chunk-776CXKMX.js} +1 -1
- package/{chunk-7TTMMOKH.js → chunk-7OTNBI77.js} +1 -1
- package/{chunk-BGGV6B5O.js → chunk-7Q7MKJZN.js} +83 -50
- package/{chunk-2574ANSV.js → chunk-7U2TFUWW.js} +1 -1
- package/{chunk-A3LUWRQK.js → chunk-B72AFRR2.js} +4 -4
- package/{chunk-P3IZUMIC.js → chunk-BDERPCJW.js} +4 -4
- package/{chunk-MYPKBJJO.js → chunk-BIJTI5SX.js} +2 -2
- package/{chunk-ZEKUFJLW.js → chunk-BWW6WRX6.js} +3 -3
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-IUTUWIKE.js → chunk-C646JEUV.js} +1 -1
- package/{chunk-FFYE5ATM.js → chunk-CT6GT2BG.js} +7 -7
- package/{chunk-T6VROBY7.js → chunk-CZLSTOVM.js} +2 -2
- package/{chunk-SRCCSTIM.js → chunk-DGUUOHBF.js} +2 -2
- package/{chunk-A5EVA6HU.js → chunk-DIBQXNGW.js} +2 -2
- package/{chunk-AVJDELEA.js → chunk-DLT2DN4M.js} +1 -1
- package/{chunk-IJTXNLQE.js → chunk-DLTMAXLF.js} +6 -6
- package/{chunk-5QZSEQSK.js → chunk-DWWUVRB5.js} +1 -1
- package/{chunk-TRHJ4NJB.js → chunk-EIFSCI4C.js} +381 -155
- package/{chunk-DXW5WDHZ.js → chunk-EW37CXCQ.js} +3 -3
- package/{chunk-GXXY2NL3.js → chunk-F3FQPVHE.js} +37 -2
- package/{chunk-7AJRJGSQ.js → chunk-FCAMGBLY.js} +378 -146
- package/{chunk-YGCOJNFZ.js → chunk-FPMPWNVQ.js} +3 -3
- package/{chunk-MECDGHLK.js → chunk-FSIEHQNH.js} +2 -2
- package/{chunk-B7DE5XJW.js → chunk-FXX6VFMV.js} +208 -25
- package/{chunk-Z2WZAE4P.js → chunk-G6OPRPXH.js} +11 -11
- package/{chunk-VSRISJXZ.js → chunk-GAHJLSDO.js} +1 -1
- package/{chunk-PGKA77TZ.js → chunk-GCVFX6ZL.js} +169 -106
- package/{chunk-E5KJOZWY.js → chunk-H6CHPU6M.js} +3 -3
- package/{chunk-RETQOQ4D.js → chunk-HNWZJI4N.js} +1 -1
- package/{chunk-BGGAY6OK.js → chunk-IPRPYKBP.js} +3 -3
- package/{chunk-G22P367E.js → chunk-IUXBKS5L.js} +57 -13
- package/{chunk-PRMEU7BT.js → chunk-KGIIZXPL.js} +4 -4
- package/chunk-KK3FCYZM.js +647 -0
- package/{chunk-4Q6HQORG.js → chunk-KOIDLCAQ.js} +1 -1
- package/{chunk-PROOOQZ3.js → chunk-LCQJH7KN.js} +1 -1
- package/{chunk-Y2MF4DCJ.js → chunk-LELADM5Q.js} +1 -1
- package/{chunk-RTHFJZ6M.js → chunk-LMFMV5UC.js} +2 -2
- package/{chunk-ANJRDS6U.js → chunk-LMZRXDWG.js} +3 -3
- package/{chunk-6CKUO32A.js → chunk-LN4ZVSO7.js} +6 -3
- package/{chunk-N2JROHD3.js → chunk-LT3DMEIB.js} +3 -3
- package/{chunk-F6YWDVIB.js → chunk-MDVP5TLI.js} +1 -1
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-CBUZ6DKA.js → chunk-N6EN3HK3.js} +1 -1
- package/{chunk-3EMIEC27.js → chunk-NBB2EBQD.js} +1 -1
- package/{chunk-TWTJV35S.js → chunk-NL7J2J5Z.js} +3 -3
- package/{chunk-EEOOBRA7.js → chunk-NQQL2DKF.js} +2 -2
- package/{chunk-AEQMKYZN.js → chunk-NWWQY2J5.js} +4 -4
- package/{chunk-AH5R7BYW.js → chunk-OATIWAKN.js} +5 -5
- package/{chunk-CD3RU7XL.js → chunk-OJRTTERA.js} +62 -2
- package/{chunk-HOM6LTEW.js → chunk-OYHJ4TW7.js} +6 -6
- package/{chunk-BXSMFPTG.js → chunk-QES2NCVM.js} +3 -3
- package/{chunk-Y5OWZQMJ.js → chunk-QGMIUVBT.js} +5 -5
- package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
- package/{chunk-CKZPMJNU.js → chunk-T444ENEC.js} +3 -3
- package/{chunk-TEMLHVGX.js → chunk-TE2XH4KH.js} +1 -1
- package/{chunk-4FIO2S7Z.js → chunk-TFGGNRT6.js} +1 -1
- package/{chunk-HCNOO374.js → chunk-TTEBPPUV.js} +1 -1
- package/{chunk-RM4UMFY4.js → chunk-TXFYIWAW.js} +7 -7
- package/{chunk-6WZVM33D.js → chunk-TXQVH72L.js} +2 -2
- package/{chunk-OBSEKCVK.js → chunk-U4VSBDO5.js} +88 -0
- package/{chunk-OX6GNNVT.js → chunk-U5LOKQ2R.js} +24 -13
- package/{chunk-VM72HKW2.js → chunk-UAHUJ4HH.js} +11 -11
- package/{chunk-BIABIPGW.js → chunk-UAOFSUG7.js} +1 -1
- package/{chunk-D374I563.js → chunk-UKSKCDBG.js} +1 -1
- package/{chunk-IUMS6F53.js → chunk-WHO3LYDW.js} +9 -5
- package/{chunk-F3XI6WQP.js → chunk-X37RQEA3.js} +2 -2
- package/{chunk-B5SV4H3J.js → chunk-XAFOLWLU.js} +1 -1
- package/{chunk-HBRDSQ3M.js → chunk-XNEDFWT4.js} +2 -2
- package/{chunk-VREG6ANQ.js → chunk-Y5RN44VH.js} +8 -8
- package/{chunk-S2MHR4PU.js → chunk-YFRJAE3R.js} +178 -114
- package/{chunk-GDUC4VS2.js → chunk-YMCSR7PA.js} +7 -7
- package/{chunk-5ZUOVCKT.js → chunk-YUZ2DAIH.js} +3 -1
- package/{chunk-CVJRVBJL.js → chunk-ZBQ5UGYY.js} +3 -3
- package/{chunk-O6IPRAVV.js → chunk-ZQUCJBS4.js} +2 -2
- package/{chunk-KZPEGO6D.js → chunk-ZT3DYK5T.js} +3 -3
- package/{chunk-DNZ4JJ7C.js → chunk-ZTLTDUV6.js} +16 -3
- package/{cliAgentConfigHelpers-U5OAVAKQ.js → cliAgentConfigHelpers-RFR7ZCSK.js} +6 -6
- package/{cliAuthorityBrokerClient-S42VMGB6.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliLocalAgentRecordReader-HVZAQCUD.js → cliLocalAgentRecordReader-AJ4UKHKT.js} +30 -29
- package/{commandRegistry-TME7INFU.js → commandRegistry-IHWZVV4G.js} +86 -86
- package/{contentThunks-U6OC4R2N.js → contentThunks-YQRCBDKF.js} +22 -21
- package/{cooldownCommands-U7XSRVJP.js → cooldownCommands-W67DE765.js} +1 -1
- package/{createAgentAutomationAction-IP4LFN3W.js → createAgentAutomationAction-ERSDNR4R.js} +22 -21
- package/{createDialogAction-IAGQJ3LH.js → createDialogAction-QXC7JZPE.js} +23 -22
- package/{createPageAction-AZ3UIFKA.js → createPageAction-RLZ7776F.js} +24 -23
- package/{db-M7FU2GNK.js → db-6NRZLEW2.js} +1 -1
- package/{dbSlice-DKKMJJYY.js → dbSlice-7M2ESEUO.js} +8 -8
- package/{deleteFile-TQSONMVU.js → deleteFile-WO6WSSNK.js} +5 -5
- package/{dialogCommands-PCDRMBWG.js → dialogCommands-UIRO4QNN.js} +37 -36
- package/{dialogNotifyCommand-O35MWMOS.js → dialogNotifyCommand-VDUFYBZV.js} +8 -8
- package/{dialogSlice-QAKYN4DE.js → dialogSlice-A4U3C76D.js} +20 -19
- package/{dialogUsageCommand-2SSLTXKO.js → dialogUsageCommand-SEC6UZWM.js} +2 -2
- package/{docCreateCommands-CFQFZOAD.js → docCreateCommands-MHPYTJWR.js} +31 -30
- package/{docDeleteCommands-5CPNTIIS.js → docDeleteCommands-VYULMBAQ.js} +32 -31
- package/{docReadCommands-XQILYSAJ.js → docReadCommands-FV3GGZ7V.js} +31 -30
- package/{docStore-GIVRT7TQ.js → docStore-AWWI72FA.js} +9 -9
- package/{docUpdateCommands-VETKSUDD.js → docUpdateCommands-JNS3HX7F.js} +31 -30
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-LF5C4XSI.js → getPricing-U5AR7ZHS.js} +3 -3
- package/{handleSendMessageAction-HKIW4ZNO.js → handleSendMessageAction-WDJOUDNV.js} +41 -40
- package/{hostCredentialCreate-6VDJFNDO.js → hostCredentialCreate-H3FF2SAO.js} +75 -76
- package/index.js +8 -8
- package/keys-RWF7UCB4.js +1 -1
- package/{localDialogRead-AV2VKKPG.js → localDialogRead-3T2KMCRC.js} +1 -1
- package/{localRuntimeAdapter-BQ4F5PZV.js → localRuntimeAdapter-JAQQXZJP.js} +74 -73
- package/{localRuntimeAuthority-WCNA4A3G.js → localRuntimeAuthority-7DKIT7UH.js} +2 -2
- package/{localRuntimeDb-CRNIBOOM.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
- package/{machineCommands-K6XIGOAD.js → machineCommands-WYOFNB5I.js} +73 -74
- package/{machineWsRunDispatch-4OO7Z6UM.js → machineWsRunDispatch-Y7UIAZNM.js} +73 -74
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/{mcpLocalAuthorizeCommand-ZP6ESAGE.js → mcpLocalAuthorizeCommand-SCYEFLRK.js} +9 -9
- package/{memberThunks-PBJPZ2JU.js → memberThunks-DIITWU4M.js} +10 -10
- package/{models-H5NNZRLH.js → models-CINY5UZR.js} +2 -2
- package/package.json +1 -1
- package/{projectArchive-G7AOQPRW.js → projectArchive-IZJXBW5N.js} +26 -25
- package/{providerPresetApply-OPBCAONX.js → providerPresetApply-2QWXPJXZ.js} +5 -5
- package/{providerRegistry-J2HCVTHE.js → providerRegistry-W4LCKK6V.js} +5 -5
- package/{read-JEGPITEW.js → read-OBLJNMA2.js} +5 -5
- package/{readDocTool-TE3XIU4Y.js → readDocTool-QQZ4DAER.js} +1 -1
- package/{readlineWorkspace-SOW5QUGZ.js → readlineWorkspace-WF3SWZGR.js} +2914 -1240
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-CX3OAH4Y.js → removeDialogAgentAction-HC3SOY3G.js} +10 -10
- package/{runAgentClientLoop-HQJPDFGQ.js → runAgentClientLoop-Z7V6TA3O.js} +48 -48
- package/{runtimeDoctorCommands-GUH2YGMH.js → runtimeDoctorCommands-KX6YLPWV.js} +8 -8
- package/{secretCommands-NJXFVHZU.js → secretCommands-STRAX275.js} +2 -2
- package/{setDialogExtraReferencesAction-CGM67EEQ.js → setDialogExtraReferencesAction-DDZUQPY6.js} +9 -9
- package/{setPrimaryDialogAgentAction-3ABWPPXR.js → setPrimaryDialogAgentAction-EB67OMAJ.js} +10 -10
- package/{settingThunks-AY76OHYX.js → settingThunks-TN6GFASU.js} +8 -8
- package/{spaceCommands-G63QGYQO.js → spaceCommands-HBYQUVJI.js} +30 -29
- package/{streamAgentChatTurn-E3XH2KFD.js → streamAgentChatTurn-CM7QQXOS.js} +78 -78
- package/{switchDialogAgentAction-G6EZRKCQ.js → switchDialogAgentAction-XY5TKQQE.js} +8 -8
- package/{tableCommands-JI75ZHDI.js → tableCommands-MXFL3JIT.js} +2 -2
- package/{toolApiClient-62UUPDUA.js → toolApiClient-53YMJ2G6.js} +7 -3
- package/{tools-7RSX22FT.js → tools-AT6H73LD.js} +39 -40
- package/{tuiRestart-KAAA7TND.js → tuiRestart-272SAYSK.js} +8 -8
- package/{tuiSummaryLlmCaller-BVNHMWLR.js → tuiSummaryLlmCaller-K2OVRVHG.js} +13 -12
- package/{updateCommands-ASK5XYPH.js → updateCommands-O3BOVVVN.js} +3 -3
- package/{updateDialogTitleAction-SEWV252V.js → updateDialogTitleAction-PGY4UPLH.js} +22 -21
- package/{usageCommand-JVT5J3DC.js → usageCommand-SCF3ROV2.js} +3 -3
- package/{usageRebuildCommand-IZYYUTEW.js → usageRebuildCommand-K5WPIBA5.js} +4 -4
- package/{windowsSelfUpdate-BSDIS2J5.js → windowsSelfUpdate-WJDUZLEO.js} +2 -2
- package/{workContext-MM3P5GP5.js → workContext-Y3ADAPZU.js} +2 -1
- package/chunk-XBAEM4RI.js +0 -272
- package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +3 -3
- package/{chunk-ULLHVDTZ.js → chunk-C3GOEQJF.js} +3 -3
- package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
- package/{workloadLifecycle-YIZ7KLUP.js → workloadLifecycle-HFJIN5IZ.js} +5 -5
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applyMemoryInterpreterMutation
|
|
3
|
+
} from "./chunk-6RSNVJGO.js";
|
|
4
|
+
import {
|
|
5
|
+
getMemoryEvidenceVNextStrict,
|
|
6
|
+
listMemoryStatesForEntityVNext,
|
|
7
|
+
loadMemoryVNextCatalog
|
|
8
|
+
} from "./chunk-324FWHUA.js";
|
|
9
|
+
|
|
10
|
+
// packages/ai/memory/vnext/workContext.ts
|
|
11
|
+
import { createHash } from "crypto";
|
|
12
|
+
var facet = "work-context";
|
|
13
|
+
var statuses = ["active", "paused", "completed", "cancelled"];
|
|
14
|
+
var hash = (v) => createHash("sha256").update(JSON.stringify(v)).digest("hex");
|
|
15
|
+
var isWorkContextState = (state) => state.facet === facet;
|
|
16
|
+
var bounded = (s, max) => typeof s === "string" && s.trim().length > 0 && s.length <= max;
|
|
17
|
+
var list = (x, maxCount, maxLength) => Array.isArray(x) && x.length <= maxCount && x.every((v) => bounded(v, maxLength));
|
|
18
|
+
var object = (x) => !!x && typeof x === "object" && !Array.isArray(x);
|
|
19
|
+
var validScope = (s) => {
|
|
20
|
+
if (!s || !bounded(s.ownerId, 256) || !bounded(s.dialogId, 512) || !(s.spaceId === null || bounded(s.spaceId, 256))) throw new Error("invalid authorized scope");
|
|
21
|
+
};
|
|
22
|
+
function validValue(v) {
|
|
23
|
+
return object(v) && v.version === 1 && Number.isSafeInteger(v.revision) && v.revision > 0 && statuses.includes(v.status) && bounded(v.goal, 4096) && list(v.constraints, 50, 2048) && list(v.openItems, 50, 2048) && (v.nextStep === void 0 || typeof v.nextStep === "string" && v.nextStep.length <= 4096) && list(v.latestSourceRefs, 20, 2048) && v.latestSourceRefs.length > 0 && (v.spaceId === null || bounded(v.spaceId, 256)) && list(v.dialogIds, 100, 512) && v.dialogIds.length > 0;
|
|
24
|
+
}
|
|
25
|
+
function validPatch(p) {
|
|
26
|
+
if (!object(p) || Object.keys(p).some((k) => !["status", "goal", "constraints", "openItems", "nextStep"].includes(k))) throw new Error("invalid patch");
|
|
27
|
+
if (p.status !== void 0 && !statuses.includes(p.status)) throw new Error("invalid status");
|
|
28
|
+
if (p.goal !== void 0 && !bounded(p.goal, 4096)) throw new Error("invalid goal");
|
|
29
|
+
if (p.nextStep !== void 0 && (typeof p.nextStep !== "string" || p.nextStep.length > 4096)) throw new Error("invalid nextStep");
|
|
30
|
+
for (const a of [p.constraints, p.openItems]) if (a !== void 0 && !list(a, 50, 2048)) throw new Error("invalid list");
|
|
31
|
+
}
|
|
32
|
+
async function updateWorkContext(db, scope, input) {
|
|
33
|
+
validScope(scope);
|
|
34
|
+
if (!object(input) || Object.keys(input).some((k) => !["activityId", "expectedRevision", "itemKey", "originRef", "changeId", "sourceRefs", "patch"].includes(k))) throw new Error("invalid input");
|
|
35
|
+
validPatch(input.patch);
|
|
36
|
+
if (!bounded(input.changeId, 256) || !list(input.sourceRefs, 20, 2048) || !input.sourceRefs.length) throw new Error("source and changeId required");
|
|
37
|
+
const creating = input.activityId === void 0;
|
|
38
|
+
if (creating && (!bounded(input.itemKey, 256) || !bounded(input.originRef, 2048) || input.expectedRevision !== void 0)) throw new Error("origin and itemKey required");
|
|
39
|
+
if (!creating && (!bounded(input.activityId, 256) || !Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 1 || input.itemKey !== void 0 || input.originRef !== void 0)) throw new Error("activityId and revision required");
|
|
40
|
+
const activityId = creating ? `work-${hash([scope.ownerId, scope.spaceId, input.originRef, input.itemKey])}` : input.activityId;
|
|
41
|
+
const evidenceId = `work-change-${hash([activityId, input.changeId])}`;
|
|
42
|
+
const fingerprint = hash([scope.spaceId, scope.dialogId, input]);
|
|
43
|
+
let result;
|
|
44
|
+
await applyMemoryInterpreterMutation(db, scope.ownerId, async () => {
|
|
45
|
+
const states = (await listMemoryStatesForEntityVNext(db, scope.ownerId, activityId)).filter(isWorkContextState);
|
|
46
|
+
const currents = states.filter((s) => !s.retiredAt);
|
|
47
|
+
if (currents.length > 1 || currents[0] && !validValue(currents[0].value)) throw new Error("invalid work context state");
|
|
48
|
+
const current = currents[0];
|
|
49
|
+
const old = current?.value;
|
|
50
|
+
if (old && old.spaceId !== scope.spaceId) {
|
|
51
|
+
result = { activityId, revision: 0, outcome: "conflict" };
|
|
52
|
+
return { action: "no_op", reason: "scope mismatch" };
|
|
53
|
+
}
|
|
54
|
+
const receipt = await getMemoryEvidenceVNextStrict(db, scope.ownerId, evidenceId);
|
|
55
|
+
if (receipt) {
|
|
56
|
+
const matching = states.find((s) => s.evidenceIds.includes(evidenceId));
|
|
57
|
+
const savedValue = matching && validValue(matching.value) ? matching.value : void 0;
|
|
58
|
+
const match = receipt.text === fingerprint && !!savedValue;
|
|
59
|
+
result = { activityId, revision: match ? savedValue.revision : old?.revision ?? 0, outcome: match ? savedValue.revision === 1 ? "created" : "updated" : "conflict" };
|
|
60
|
+
return { action: "no_op", reason: "duplicate change" };
|
|
61
|
+
}
|
|
62
|
+
if (creating && current || !creating && (!old || old.revision !== input.expectedRevision)) {
|
|
63
|
+
result = { activityId, revision: old?.revision ?? 0, outcome: "conflict" };
|
|
64
|
+
return { action: "no_op", reason: "revision conflict" };
|
|
65
|
+
}
|
|
66
|
+
if (!old && !input.patch.goal) throw new Error("goal required");
|
|
67
|
+
const status = input.patch.status ?? old?.status ?? "active";
|
|
68
|
+
const dialogIds = [.../* @__PURE__ */ new Set([...old?.dialogIds ?? [], scope.dialogId])];
|
|
69
|
+
if (dialogIds.length > 100) throw new Error("dialog association limit exceeded");
|
|
70
|
+
const value = { version: 1, revision: (old?.revision ?? 0) + 1, status, goal: input.patch.goal ?? old.goal, constraints: input.patch.constraints ?? old?.constraints ?? [], openItems: input.patch.openItems ?? old?.openItems ?? [], nextStep: input.patch.nextStep ?? old?.nextStep, latestSourceRefs: input.sourceRefs, spaceId: scope.spaceId, dialogIds };
|
|
71
|
+
const unchanged = !!old && JSON.stringify([old.status, old.goal, old.constraints, old.openItems, old.nextStep]) === JSON.stringify([value.status, value.goal, value.constraints, value.openItems, value.nextStep]);
|
|
72
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
73
|
+
result = { activityId, revision: unchanged ? old.revision : value.revision, outcome: unchanged ? "unchanged" : old ? "updated" : "created" };
|
|
74
|
+
if (unchanged) return { action: "no_op", reason: "unchanged" };
|
|
75
|
+
const evidence = { id: evidenceId, ownerId: scope.ownerId, text: fingerprint, sourceRef: input.sourceRefs[0], confidence: 1, createdAt: now };
|
|
76
|
+
return { action: old ? "update" : "create", reason: "work context", entities: old ? [] : [{ id: activityId, ownerId: scope.ownerId, type: "activity", subtype: facet, name: value.goal, createdAt: now, updatedAt: now }], evidence: [evidence], states: [{ id: `work-state-${hash([activityId, value.revision])}`, ownerId: scope.ownerId, entityId: activityId, facet, value, text: value.goal, evidenceIds: [evidenceId], createdAt: now, updatedAt: now }], supersededStateIds: current ? [current.id] : [] };
|
|
77
|
+
});
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
async function readWorkContexts(db, scope, query = {}) {
|
|
81
|
+
validScope(scope);
|
|
82
|
+
if (!object(query) || Object.keys(query).some((k) => !["activityId", "status", "query", "limit", "discovery"].includes(k))) throw new Error("invalid query");
|
|
83
|
+
const limit = query.limit ?? 20;
|
|
84
|
+
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("limit must be 1..100");
|
|
85
|
+
if (query.status !== void 0 && query.status !== "all" && !statuses.some((status) => status === query.status)) throw new Error("invalid status");
|
|
86
|
+
if (query.discovery !== void 0 && query.discovery !== "dialog" && query.discovery !== "scope") throw new Error("invalid discovery");
|
|
87
|
+
if (query.activityId !== void 0 && !bounded(query.activityId, 256)) throw new Error("invalid activityId");
|
|
88
|
+
if (query.query !== void 0 && !bounded(query.query, 512)) throw new Error("invalid query text");
|
|
89
|
+
const states = query.activityId ? await listMemoryStatesForEntityVNext(db, scope.ownerId, query.activityId) : (await loadMemoryVNextCatalog(db, scope.ownerId)).states;
|
|
90
|
+
const items = [];
|
|
91
|
+
for (const state of states) {
|
|
92
|
+
if (!isWorkContextState(state) || state.retiredAt) continue;
|
|
93
|
+
if (!validValue(state.value) || !bounded(state.entityId, 256) || !bounded(state.updatedAt, 128)) throw new Error("invalid work context state");
|
|
94
|
+
const value = state.value;
|
|
95
|
+
if (value.spaceId !== scope.spaceId || !query.activityId && query.discovery !== "scope" && !value.dialogIds.includes(scope.dialogId)) continue;
|
|
96
|
+
if (query.status !== "all" && value.status !== (query.status ?? (query.activityId ? value.status : "active"))) continue;
|
|
97
|
+
if (query.query && !JSON.stringify([value.goal, value.constraints, value.openItems, value.nextStep]).toLowerCase().includes(query.query.toLowerCase())) continue;
|
|
98
|
+
items.push({ activityId: state.entityId, value, updatedAt: state.updatedAt });
|
|
99
|
+
}
|
|
100
|
+
items.sort((a, b) => Number(b.value.dialogIds.includes(scope.dialogId)) - Number(a.value.dialogIds.includes(scope.dialogId)) || b.updatedAt.localeCompare(a.updatedAt) || a.activityId.localeCompare(b.activityId));
|
|
101
|
+
return { items: items.slice(0, limit), hasMore: items.length > limit };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
isWorkContextState,
|
|
106
|
+
updateWorkContext,
|
|
107
|
+
readWorkContexts
|
|
108
|
+
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
markdownToSlate
|
|
3
|
-
} from "./chunk-FJ23FZXF.js";
|
|
4
1
|
import {
|
|
5
2
|
createEmptyParagraph,
|
|
6
3
|
splitSlateTitleAndBody
|
|
@@ -11,19 +8,22 @@ import {
|
|
|
11
8
|
import {
|
|
12
9
|
buildSkillSummaryMarker
|
|
13
10
|
} from "./chunk-VF4K2QE6.js";
|
|
11
|
+
import {
|
|
12
|
+
markdownToSlate
|
|
13
|
+
} from "./chunk-VIYVRPMJ.js";
|
|
14
14
|
import {
|
|
15
15
|
addContentToSpace,
|
|
16
16
|
resolveCreationSpaceId
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6BGJHJRN.js";
|
|
18
18
|
import {
|
|
19
19
|
getCurrentSpaceId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-C646JEUV.js";
|
|
21
21
|
import {
|
|
22
22
|
runtime_default
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FXX6VFMV.js";
|
|
24
24
|
import {
|
|
25
25
|
write
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-TXFYIWAW.js";
|
|
27
27
|
import {
|
|
28
28
|
selectIdentityUserId
|
|
29
29
|
} from "./chunk-PXYBUFDB.js";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
patch,
|
|
7
7
|
read
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TXFYIWAW.js";
|
|
9
9
|
import {
|
|
10
10
|
DEVICE_LOCAL_OWNER_ID,
|
|
11
11
|
isDeviceLocalSpaceBody
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-F3FQPVHE.js";
|
|
13
13
|
import {
|
|
14
14
|
selectIdentityUserId
|
|
15
15
|
} from "./chunk-PXYBUFDB.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-U6VC4MU4.js";
|
|
10
10
|
import {
|
|
11
11
|
getModelConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OJRTTERA.js";
|
|
13
13
|
import {
|
|
14
14
|
asOptionalFiniteNumber
|
|
15
15
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isPlatformHostedImageModel,
|
|
18
18
|
isPlatformManagedProvider,
|
|
19
19
|
resolvePlatformEffectiveModel
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-U4VSBDO5.js";
|
|
21
21
|
|
|
22
22
|
// packages/ai/llm/getPricing.ts
|
|
23
23
|
var MAX_OUTPUT_TOKENS = 8192;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRuntimeServerContext,
|
|
3
3
|
scheduleDeleteReplication
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F3FQPVHE.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchFromClientDb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C3GOEQJF.js";
|
|
8
8
|
import {
|
|
9
9
|
selectIdentityToken
|
|
10
10
|
} from "./chunk-PXYBUFDB.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/cli/agentCommandSupport.ts
|
|
6
6
|
async function getDefaultCliDb() {
|
|
7
|
-
const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-
|
|
7
|
+
const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-5WZ4RJJO.js");
|
|
8
8
|
return getDefaultCliLocalRuntimeDb();
|
|
9
9
|
}
|
|
10
10
|
function createNullCliDb() {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
upsertSSREntity,
|
|
3
3
|
write
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TXFYIWAW.js";
|
|
5
5
|
import {
|
|
6
6
|
getRuntimeServerContext,
|
|
7
7
|
resolveRecordAuthority
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F3FQPVHE.js";
|
|
9
9
|
import {
|
|
10
10
|
TIMEOUT,
|
|
11
11
|
asyncThunkCreator,
|
|
12
12
|
buildCreateSlice,
|
|
13
13
|
noloRequest
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7OTNBI77.js";
|
|
15
15
|
import {
|
|
16
16
|
applyAgentSecretMigrationUpdates,
|
|
17
17
|
migrateAgentSecrets,
|
|
@@ -458,7 +458,7 @@ var slice = createSliceWithThunks({
|
|
|
458
458
|
const overrides = {};
|
|
459
459
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
460
460
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
461
|
-
const { _executeModel } = await import("./_executeModel-
|
|
461
|
+
const { _executeModel } = await import("./_executeModel-UCWDB72C.js");
|
|
462
462
|
return _executeModel(
|
|
463
463
|
{
|
|
464
464
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -479,7 +479,7 @@ var slice = createSliceWithThunks({
|
|
|
479
479
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
480
480
|
*/
|
|
481
481
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
482
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
482
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-Z7V6TA3O.js");
|
|
483
483
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
484
484
|
{
|
|
485
485
|
agentKey: args.agentKey,
|
|
@@ -495,7 +495,7 @@ var slice = createSliceWithThunks({
|
|
|
495
495
|
* 聊天轮次流式 Agent 调用
|
|
496
496
|
*/
|
|
497
497
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
498
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
498
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-CM7QQXOS.js");
|
|
499
499
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
500
500
|
}),
|
|
501
501
|
/**
|