nolo-cli 0.202.0-alpha.3 → 0.204.0-alpha.1
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-IPRTPSW7.js → _executeModel-P6PJZHAX.js} +16 -16
- package/{agentDeleteCommand-6HFA37FH.js → agentDeleteCommand-X5I5MWOV.js} +17 -16
- package/{agentEmailCommands-TDBNVIAT.js → agentEmailCommands-E5XLDF6C.js} +19 -18
- package/{agentListCommands-YSQSDQM3.js → agentListCommands-POQKNVWF.js} +3 -3
- package/{agentMachineCommands-5W23BLFR.js → agentMachineCommands-SKUVXH4H.js} +3 -3
- package/{agentProviderCommands-5ALOQLE5.js → agentProviderCommands-MEFUIECN.js} +30 -12
- package/{agentRecordCommands-SRIMZZFK.js → agentRecordCommands-Y4MDCVEW.js} +18 -17
- package/{agentRunCommand-BLYHIN6S.js → agentRunCommand-D3ZNM22C.js} +19 -18
- package/{agentRuntimeLocal-FE66EBRC.js → agentRuntimeLocal-M2RCAORY.js} +2 -2
- package/{agentSlice-BFDKYW6H.js → agentSlice-PQVS46OF.js} +1 -1
- package/{appDeleteCommands-BEVZGCAG.js → appDeleteCommands-JI6AEOJO.js} +4 -4
- package/{appDeployCommands-E7TFCHSP.js → appDeployCommands-W3W4T7BU.js} +4 -4
- package/{appDeployStatusCommands-MYY5Z5G3.js → appDeployStatusCommands-QXPI3XS4.js} +4 -4
- package/{appGetCommands-HNED5JUU.js → appGetCommands-SQV3MNFW.js} +4 -4
- package/{appListCommands-MSBFWPIY.js → appListCommands-DMYRVV7E.js} +4 -4
- package/{authCommand-W34UWJGR.js → authCommand-KPTIANH2.js} +1 -1
- package/{builtinSkillRegistry-NJVHQIKY.js → builtinSkillRegistry-HH75G5J3.js} +2 -2
- package/{chromeOpsCommands-USKE4B4K.js → chromeOpsCommands-JFT4J4LQ.js} +1 -1
- package/{chunk-326HCB6L.js → chunk-33OJHC3O.js} +8 -8
- package/{chunk-OIB4GARE.js → chunk-4JBJG7XB.js} +3 -3
- package/{chunk-RIKSN62L.js → chunk-4UCFQCD4.js} +3 -3
- package/{chunk-ETTDZBK5.js → chunk-6YY6MOCF.js} +3 -3
- package/{chunk-LAYFVGS4.js → chunk-7H3DHUWL.js} +9 -9
- package/{chunk-ASG7VWPK.js → chunk-COJ76M7O.js} +3 -3
- package/{chunk-TWVVTUNG.js → chunk-E4KACSRR.js} +2 -2
- package/{chunk-CLTGWJVT.js → chunk-E4LYPSYM.js} +2 -0
- package/{chunk-5E4FSR4J.js → chunk-EPJFGQYO.js} +1 -1
- package/{chunk-YV2RSLM4.js → chunk-EWAQ4DYY.js} +4 -4
- package/{chunk-SUBNV2JH.js → chunk-FC4MYLAX.js} +2 -2
- package/{chunk-BRZTSZBG.js → chunk-HMQUNXZ7.js} +24 -122
- package/{chunk-DKZJJ2NQ.js → chunk-I5PBXF7O.js} +1 -1
- package/{chunk-KDUYNEJ5.js → chunk-IK6AAUGM.js} +1 -1
- package/{chunk-BLFZULEQ.js → chunk-IVNI335J.js} +2 -2
- package/{chunk-DHJXDGC3.js → chunk-JL3YTCPQ.js} +1 -1
- package/{chunk-RS66RJLA.js → chunk-LV5V3KRZ.js} +1 -1
- package/{chunk-YAGFPXOX.js → chunk-N5E77S4C.js} +128 -7
- package/{chunk-Q7GNBUT4.js → chunk-NEZGPBL7.js} +2 -2
- package/{chunk-E2FC5RMU.js → chunk-PHNVUFU5.js} +29 -8
- package/{chunk-3CWF2EUZ.js → chunk-QUJ3IHEK.js} +1 -1
- package/{chunk-HKWGI3TM.js → chunk-QVJ7PDL7.js} +235 -11
- package/{chunk-WPQGLJHU.js → chunk-R7FPHYDS.js} +2 -2
- package/{chunk-D57YYGMD.js → chunk-SQTBTTAE.js} +2 -2
- package/{chunk-C7PKPHK6.js → chunk-SRDWWDBV.js} +5 -5
- package/{chunk-6OEPWZV7.js → chunk-TPCDYNJK.js} +3 -0
- package/{chunk-SSK4WNJA.js → chunk-WAECKLPA.js} +1 -1
- package/chunk-WOAZVUSN.js +126 -0
- package/{chunk-LEX6DEH4.js → chunk-Y6M7KJOA.js} +1 -1
- package/{chunk-HKMPGHFZ.js → chunk-ZZC64BCU.js} +4 -4
- package/{commandRegistry-ZU3RX7A2.js → commandRegistry-YQ47YCJW.js} +59 -59
- package/{contentThunks-I4IHSDTM.js → contentThunks-UI4LT732.js} +3 -3
- package/{cooldownCommands-5SJ74DNP.js → cooldownCommands-BLRMLW7Q.js} +1 -1
- package/{createAgentAutomationAction-WQCH5HR2.js → createAgentAutomationAction-52LH2MRZ.js} +3 -3
- package/{createDialogAction-CKMZK5JQ.js → createDialogAction-35JSC2RO.js} +5 -5
- package/{createPageAction-QAZHQGY7.js → createPageAction-BPVFIHSO.js} +3 -3
- package/{dialogCommands-NEQ6NW5H.js → dialogCommands-XBAEKJVC.js} +4 -4
- package/{dialogSlice-GEGACCH2.js → dialogSlice-KHGNTCKG.js} +2 -2
- package/{docCreateCommands-EXV267FP.js → docCreateCommands-XBI32MGB.js} +3 -3
- package/{docDeleteCommands-TSBILA2Z.js → docDeleteCommands-7EKY3XJR.js} +3 -3
- package/{docReadCommands-AKVYHITD.js → docReadCommands-LWDKFZKJ.js} +3 -3
- package/{docStore-B4EFT53J.js → docStore-6MKEBLHS.js} +1 -1
- package/{docUpdateCommands-G6GULDGZ.js → docUpdateCommands-VFB53K4G.js} +3 -3
- package/{handleSendMessageAction-4BACQWOG.js → handleSendMessageAction-24JWFHXL.js} +41 -12
- package/index.js +6 -6
- package/{localRuntimeAdapter-MTDULOUZ.js → localRuntimeAdapter-RLASCXQ5.js} +17 -16
- package/{machineCommands-OGHHBRV3.js → machineCommands-CF72WAXL.js} +18 -17
- package/{machineWsRunDispatch-R6DNC3H7.js → machineWsRunDispatch-HITLYZOL.js} +18 -17
- package/package.json +1 -1
- package/{readlineWorkspace-NC2O4DQP.js → readlineWorkspace-K5EIF774.js} +22 -21
- package/{runAgentClientLoop-QKV66PX5.js → runAgentClientLoop-V7XBFJYH.js} +14 -14
- package/{secretCommands-MKU25CDP.js → secretCommands-S2DDPIQ4.js} +1 -1
- package/{settingThunks-4WU7YE62.js → settingThunks-SWYDFUYT.js} +3 -3
- package/{spaceCommands-J7BRTTM3.js → spaceCommands-BFES7F7G.js} +2 -2
- package/{streamAgentChatTurn-GM3UNSLS.js → streamAgentChatTurn-RKRNK3P5.js} +28 -18
- package/{tools-UJLEQBKI.js → tools-5U5DDFBH.js} +10 -10
- package/{updateCommands-RVDAFHBT.js → updateCommands-LEJRRVBB.js} +3 -3
- package/{updateDialogTitleAction-24QO27NT.js → updateDialogTitleAction-EK2S55EO.js} +3 -3
- package/{windowsSelfUpdate-N2VH2OBW.js → windowsSelfUpdate-LSSQLXVS.js} +2 -2
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
toolRunUpdated,
|
|
39
39
|
uiCardFallback,
|
|
40
40
|
waitForAbortableDelay
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-SRDWWDBV.js";
|
|
42
42
|
import {
|
|
43
43
|
isGatewayHttpStatus
|
|
44
44
|
} from "./chunk-NF64D32W.js";
|
|
@@ -52,10 +52,10 @@ import {
|
|
|
52
52
|
import {
|
|
53
53
|
AGENT_UPDATE_FIELD_NAMES,
|
|
54
54
|
normalizeAgentUpdateFieldList
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-I5PBXF7O.js";
|
|
56
56
|
import {
|
|
57
57
|
createDocState
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-SQTBTTAE.js";
|
|
59
59
|
import {
|
|
60
60
|
ToolApiError,
|
|
61
61
|
buildToolRequestHeaders,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
} from "./chunk-63W5N6P3.js";
|
|
80
80
|
import {
|
|
81
81
|
createDialogAction
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-COJ76M7O.js";
|
|
83
83
|
import {
|
|
84
84
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
85
85
|
addContentToSpace,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
updateContentCategory,
|
|
97
97
|
updateContentTitle,
|
|
98
98
|
writeStoredCollapsedCategories
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-WAECKLPA.js";
|
|
100
100
|
import {
|
|
101
101
|
getCurrentSpaceId,
|
|
102
102
|
getCurrentSpaceIdRaw,
|
|
@@ -119,14 +119,14 @@ import {
|
|
|
119
119
|
selectMsgById,
|
|
120
120
|
uiAskChoiceFunc,
|
|
121
121
|
uiAskChoiceFunctionSchema
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-33OJHC3O.js";
|
|
123
123
|
import {
|
|
124
124
|
createAgent,
|
|
125
125
|
deleteServerSyncedCredential,
|
|
126
126
|
runLlm,
|
|
127
127
|
streamAgentChatTurn,
|
|
128
128
|
updateAgent
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-6YY6MOCF.js";
|
|
130
130
|
import {
|
|
131
131
|
buildMediaToolConfirmation,
|
|
132
132
|
normalizeMediaConfirmExecutionRevision
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
} from "./chunk-D2MDMY2M.js";
|
|
196
196
|
import {
|
|
197
197
|
CAPABILITY_PACKS
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-TPCDYNJK.js";
|
|
199
199
|
import {
|
|
200
200
|
buildSkillDocMarkdown,
|
|
201
201
|
normalizeSkillModalities,
|
|
@@ -1609,6 +1609,182 @@ async function createDocFunc(args, thunkApi) {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
}
|
|
1611
1611
|
|
|
1612
|
+
// packages/core/htmlArtifact.ts
|
|
1613
|
+
var DEFAULT_HTML_ARTIFACT_TITLE = "\u7F51\u9875\u6210\u54C1";
|
|
1614
|
+
|
|
1615
|
+
// packages/ai/tools/htmlArtifactTool.ts
|
|
1616
|
+
var createHtmlArtifactFunctionSchema = {
|
|
1617
|
+
name: "createHtmlArtifact",
|
|
1618
|
+
description: [
|
|
1619
|
+
"\u521B\u5EFA\u4E00\u4E2A\u72EC\u7ACB\u7684\u5355\u6587\u4EF6 HTML \u7F51\u9875\u6210\u54C1\u5E76\u6301\u4E45\u5316\u4FDD\u5B58\u3002",
|
|
1620
|
+
"\u5305\u542B\u5B8C\u6574\u7684 HTML/CSS/JavaScript\uFF0C\u5F00\u7BB1\u5373\u7528\u3002",
|
|
1621
|
+
"\u6CE8\u610F\uFF1A\u5982\u679C\u8981\u4FEE\u6539\u6216\u8FED\u4EE3\u5F53\u524D\u5DF2\u6709\u7F51\u9875\uFF0C\u5FC5\u987B\u4F7F\u7528 readHtmlArtifact + updateHtmlArtifact\uFF0C\u7981\u6B62\u65E0\u6761\u4EF6\u8C03\u7528 createHtmlArtifact \u521B\u5EFA\u65B0\u526F\u672C\u3002"
|
|
1622
|
+
].join("\n"),
|
|
1623
|
+
parameters: {
|
|
1624
|
+
type: "object",
|
|
1625
|
+
properties: {
|
|
1626
|
+
title: {
|
|
1627
|
+
type: "string",
|
|
1628
|
+
description: "\u7F51\u9875\u6210\u54C1\u7684\u6807\u9898\uFF08\u5982'\u5929\u6C14\u770B\u677F'\u3001'\u4E2A\u4EBA\u4E3B\u9875'\uFF09\u3002\u82E5\u672A\u63D0\u4F9B\u5219\u4F7F\u7528\u9ED8\u8BA4\u6807\u9898\u3002"
|
|
1629
|
+
},
|
|
1630
|
+
html: {
|
|
1631
|
+
type: "string",
|
|
1632
|
+
description: "\u5B8C\u6574\u7684\u5355\u6587\u4EF6 HTML \u6E90\u7801\uFF08\u5FC5\u987B\u5305\u542B <!DOCTYPE html> \u9AA8\u67B6\u53CA\u5185\u8054\u6837\u5F0F/\u811A\u672C\uFF09\u3002"
|
|
1633
|
+
},
|
|
1634
|
+
dialogKey: {
|
|
1635
|
+
type: "string",
|
|
1636
|
+
description: "\u6240\u5C5E\u5BF9\u8BDD\u7684 Key\u3002\u5982\u672A\u6307\u5B9A\uFF0C\u6267\u884C\u5668\u5C06\u81EA\u52A8\u4ECE\u5F53\u524D\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u89E3\u6790\u3002"
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
required: ["html"]
|
|
1640
|
+
}
|
|
1641
|
+
};
|
|
1642
|
+
var readHtmlArtifactFunctionSchema = {
|
|
1643
|
+
name: "readHtmlArtifact",
|
|
1644
|
+
description: "\u6839\u636E\u6210\u54C1 ID \u8BFB\u53D6\u6307\u5B9A HTML \u7F51\u9875\u7684\u5B8C\u6574\u4FE1\u606F\u4E0E\u6E90\u7801\uFF0C\u4F9B\u540E\u7EED\u7406\u89E3\u6216\u8FED\u4EE3\u66F4\u65B0\u3002",
|
|
1645
|
+
parameters: {
|
|
1646
|
+
type: "object",
|
|
1647
|
+
properties: {
|
|
1648
|
+
id: {
|
|
1649
|
+
type: "string",
|
|
1650
|
+
description: "HTML \u6210\u54C1\u7684\u552F\u4E00 ID\uFF08UUID \u683C\u5F0F\uFF09\u3002"
|
|
1651
|
+
}
|
|
1652
|
+
},
|
|
1653
|
+
required: ["id"]
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
var updateHtmlArtifactFunctionSchema = {
|
|
1657
|
+
name: "updateHtmlArtifact",
|
|
1658
|
+
description: [
|
|
1659
|
+
"\u66F4\u65B0\u6307\u5B9A ID \u7684 HTML \u7F51\u9875\u6210\u54C1\u5185\u5BB9\u4E0E\u6807\u9898\u3002",
|
|
1660
|
+
"\u4FDD\u6301\u8BE5\u6210\u54C1\u7684\u539F ID \u4E0E\u5BF9\u8BDD\u5F52\u5C5E\u4E0D\u53D8\uFF0C\u5728\u5DE5\u4F5C\u53F0\u4E2D\u5C31\u5730\u5237\u65B0\uFF0C\u907F\u514D\u4EA7\u751F\u65B0\u526F\u672C\u3002"
|
|
1661
|
+
].join("\n"),
|
|
1662
|
+
parameters: {
|
|
1663
|
+
type: "object",
|
|
1664
|
+
properties: {
|
|
1665
|
+
id: {
|
|
1666
|
+
type: "string",
|
|
1667
|
+
description: "\u8981\u66F4\u65B0\u7684\u76EE\u6807 HTML \u6210\u54C1 ID\u3002"
|
|
1668
|
+
},
|
|
1669
|
+
title: {
|
|
1670
|
+
type: "string",
|
|
1671
|
+
description: "\u53EF\u9009\u7684\u65B0\u6807\u9898\uFF1B\u4E0D\u4F20\u5219\u4FDD\u6301\u539F\u6807\u9898\u3002"
|
|
1672
|
+
},
|
|
1673
|
+
html: {
|
|
1674
|
+
type: "string",
|
|
1675
|
+
description: "\u66F4\u65B0\u540E\u7684\u5B8C\u6574\u5355\u6587\u4EF6 HTML \u6E90\u7801\u3002"
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1678
|
+
required: ["id", "html"]
|
|
1679
|
+
}
|
|
1680
|
+
};
|
|
1681
|
+
var resolveCurrentDialogKey = (thunkApi, explicitDialogKey) => {
|
|
1682
|
+
if (explicitDialogKey && typeof explicitDialogKey === "string" && explicitDialogKey.trim()) {
|
|
1683
|
+
return explicitDialogKey.trim();
|
|
1684
|
+
}
|
|
1685
|
+
const activeDialogKey = getActiveDialogKey();
|
|
1686
|
+
if (activeDialogKey && typeof activeDialogKey === "string" && activeDialogKey.trim()) {
|
|
1687
|
+
return activeDialogKey.trim();
|
|
1688
|
+
}
|
|
1689
|
+
const stateDialogKey = thunkApi?.getState?.()?.dialogs?.currentDialogKey;
|
|
1690
|
+
if (stateDialogKey && typeof stateDialogKey === "string" && stateDialogKey.trim()) {
|
|
1691
|
+
return stateDialogKey.trim();
|
|
1692
|
+
}
|
|
1693
|
+
throw new Error("\u65E0\u6CD5\u786E\u5B9A\u5F53\u524D\u5BF9\u8BDD dialogKey\uFF0C\u8BF7\u663E\u5F0F\u63D0\u4F9B dialogKey\u3002");
|
|
1694
|
+
};
|
|
1695
|
+
async function createHtmlArtifactFunc(args, thunkApi) {
|
|
1696
|
+
const html = typeof args?.html === "string" ? args.html : "";
|
|
1697
|
+
if (!html.trim()) {
|
|
1698
|
+
throw new Error("createHtmlArtifact: html \u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A\u3002");
|
|
1699
|
+
}
|
|
1700
|
+
const dialogKey = resolveCurrentDialogKey(thunkApi, args?.dialogKey);
|
|
1701
|
+
const title = typeof args?.title === "string" && args.title.trim() ? args.title.trim() : DEFAULT_HTML_ARTIFACT_TITLE;
|
|
1702
|
+
const response = await callToolApi(
|
|
1703
|
+
thunkApi,
|
|
1704
|
+
"/api/html-artifacts",
|
|
1705
|
+
{
|
|
1706
|
+
action: "create",
|
|
1707
|
+
title,
|
|
1708
|
+
html,
|
|
1709
|
+
dialogKey
|
|
1710
|
+
},
|
|
1711
|
+
{ withAuth: true }
|
|
1712
|
+
);
|
|
1713
|
+
const artifact = response.artifact;
|
|
1714
|
+
if (!artifact?.id) {
|
|
1715
|
+
throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u6709\u6548\u7684 artifact \u8BB0\u5F55\u3002");
|
|
1716
|
+
}
|
|
1717
|
+
return {
|
|
1718
|
+
rawData: {
|
|
1719
|
+
artifact,
|
|
1720
|
+
id: artifact.id,
|
|
1721
|
+
dialogKey: artifact.dialogKey
|
|
1722
|
+
},
|
|
1723
|
+
displayData: `\u5DF2\u521B\u5EFA HTML \u7F51\u9875\u6210\u54C1\u300A${artifact.title}\u300B\uFF08ID: ${artifact.id}\uFF09\u3002\u53EF\u5728\u5DE5\u4F5C\u53F0\u6253\u5F00\u9884\u89C8\u3002`
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
async function readHtmlArtifactFunc(args, thunkApi) {
|
|
1727
|
+
const id = typeof args?.id === "string" ? args.id.trim() : "";
|
|
1728
|
+
if (!id) {
|
|
1729
|
+
throw new Error("readHtmlArtifact: \u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 artifact id\u3002");
|
|
1730
|
+
}
|
|
1731
|
+
const response = await callToolApi(
|
|
1732
|
+
thunkApi,
|
|
1733
|
+
"/api/html-artifacts",
|
|
1734
|
+
{
|
|
1735
|
+
action: "read",
|
|
1736
|
+
id
|
|
1737
|
+
},
|
|
1738
|
+
{ withAuth: true }
|
|
1739
|
+
);
|
|
1740
|
+
const artifact = response.artifact;
|
|
1741
|
+
if (!artifact?.id) {
|
|
1742
|
+
throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684 HTML \u6210\u54C1\u3002`);
|
|
1743
|
+
}
|
|
1744
|
+
return {
|
|
1745
|
+
rawData: {
|
|
1746
|
+
artifact,
|
|
1747
|
+
id: artifact.id,
|
|
1748
|
+
dialogKey: artifact.dialogKey
|
|
1749
|
+
},
|
|
1750
|
+
displayData: `\u5DF2\u8BFB\u53D6 HTML \u7F51\u9875\u6210\u54C1\u300A${artifact.title}\u300B\uFF08ID: ${artifact.id}\uFF0C\u5171 ${artifact.html.length} \u5B57\u7B26\uFF09\u3002\u6E90\u7801\u5DF2\u8F7D\u5165\u5DE5\u5177\u4E0A\u4E0B\u6587\u3002`
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
async function updateHtmlArtifactFunc(args, thunkApi) {
|
|
1754
|
+
const id = typeof args?.id === "string" ? args.id.trim() : "";
|
|
1755
|
+
if (!id) {
|
|
1756
|
+
throw new Error("updateHtmlArtifact: \u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 artifact id\u3002");
|
|
1757
|
+
}
|
|
1758
|
+
const html = typeof args?.html === "string" ? args.html : "";
|
|
1759
|
+
if (!html.trim()) {
|
|
1760
|
+
throw new Error("updateHtmlArtifact: html \u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A\u3002");
|
|
1761
|
+
}
|
|
1762
|
+
const title = typeof args?.title === "string" && args.title.trim() ? args.title.trim() : void 0;
|
|
1763
|
+
const response = await callToolApi(
|
|
1764
|
+
thunkApi,
|
|
1765
|
+
"/api/html-artifacts",
|
|
1766
|
+
{
|
|
1767
|
+
action: "update",
|
|
1768
|
+
id,
|
|
1769
|
+
...title !== void 0 ? { title } : {},
|
|
1770
|
+
html
|
|
1771
|
+
},
|
|
1772
|
+
{ withAuth: true }
|
|
1773
|
+
);
|
|
1774
|
+
const artifact = response.artifact;
|
|
1775
|
+
if (!artifact?.id) {
|
|
1776
|
+
throw new Error("\u670D\u52A1\u7AEF\u66F4\u65B0\u5931\u8D25\uFF0C\u672A\u8FD4\u56DE\u6709\u6548\u7684 artifact \u8BB0\u5F55\u3002");
|
|
1777
|
+
}
|
|
1778
|
+
return {
|
|
1779
|
+
rawData: {
|
|
1780
|
+
artifact,
|
|
1781
|
+
id: artifact.id,
|
|
1782
|
+
dialogKey: artifact.dialogKey
|
|
1783
|
+
},
|
|
1784
|
+
displayData: `\u5DF2\u66F4\u65B0 HTML \u7F51\u9875\u6210\u54C1\u300A${artifact.title}\u300B\uFF08ID: ${artifact.id}\uFF09\u3002\u53EF\u5728\u5DE5\u4F5C\u53F0\u8BFB\u53D6\u6700\u65B0\u5185\u5BB9\u3002`
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1612
1788
|
// packages/ai/skills/skillDocBuilder.ts
|
|
1613
1789
|
var slugify = (value) => value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "skill";
|
|
1614
1790
|
var normalizeEvalCases = (value) => {
|
|
@@ -3706,7 +3882,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3706
3882
|
const deletedDialogIds = [];
|
|
3707
3883
|
const deletedDialogKeys = [];
|
|
3708
3884
|
const failures = [];
|
|
3709
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3885
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-KHGNTCKG.js");
|
|
3710
3886
|
for (const target of targets) {
|
|
3711
3887
|
try {
|
|
3712
3888
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -18517,7 +18693,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18517
18693
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18518
18694
|
};
|
|
18519
18695
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18520
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
18696
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-6MKEBLHS.js");
|
|
18521
18697
|
if (getDocState().pageKey === id) {
|
|
18522
18698
|
applyExternalDocUpdate({
|
|
18523
18699
|
slateData: finalSlateData,
|
|
@@ -18542,7 +18718,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18542
18718
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
18543
18719
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
18544
18720
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
18545
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-
|
|
18721
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-SWYDFUYT.js")).setSettings;
|
|
18546
18722
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
18547
18723
|
}
|
|
18548
18724
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
@@ -19325,6 +19501,54 @@ var baseToolDefinitions = [
|
|
|
19325
19501
|
defaultConsent: "auto"
|
|
19326
19502
|
},
|
|
19327
19503
|
// --- 内容管理 ---
|
|
19504
|
+
{
|
|
19505
|
+
id: "createHtmlArtifact",
|
|
19506
|
+
schema: createHtmlArtifactFunctionSchema,
|
|
19507
|
+
executor: createHtmlArtifactFunc,
|
|
19508
|
+
description: {
|
|
19509
|
+
name: "createHtmlArtifact",
|
|
19510
|
+
description: "\u521B\u5EFA\u5E76\u6301\u4E45\u5316\u4FDD\u5B58\u5355\u6587\u4EF6 HTML \u7F51\u9875\u6210\u54C1",
|
|
19511
|
+
category: "\u5185\u5BB9\u7BA1\u7406"
|
|
19512
|
+
},
|
|
19513
|
+
behavior: "action",
|
|
19514
|
+
uiGroup: "content",
|
|
19515
|
+
capability: "knowledge_capture",
|
|
19516
|
+
riskLevel: "low",
|
|
19517
|
+
costLevel: "low",
|
|
19518
|
+
defaultConsent: "auto"
|
|
19519
|
+
},
|
|
19520
|
+
{
|
|
19521
|
+
id: "readHtmlArtifact",
|
|
19522
|
+
schema: readHtmlArtifactFunctionSchema,
|
|
19523
|
+
executor: readHtmlArtifactFunc,
|
|
19524
|
+
description: {
|
|
19525
|
+
name: "readHtmlArtifact",
|
|
19526
|
+
description: "\u8BFB\u53D6\u6307\u5B9A ID \u7684 HTML \u7F51\u9875\u6210\u54C1\u4FE1\u606F\u4E0E\u6E90\u7801",
|
|
19527
|
+
category: "\u5185\u5BB9\u7BA1\u7406"
|
|
19528
|
+
},
|
|
19529
|
+
behavior: "data",
|
|
19530
|
+
uiGroup: "content",
|
|
19531
|
+
capability: "knowledge_capture",
|
|
19532
|
+
riskLevel: "low",
|
|
19533
|
+
costLevel: "low",
|
|
19534
|
+
defaultConsent: "auto"
|
|
19535
|
+
},
|
|
19536
|
+
{
|
|
19537
|
+
id: "updateHtmlArtifact",
|
|
19538
|
+
schema: updateHtmlArtifactFunctionSchema,
|
|
19539
|
+
executor: updateHtmlArtifactFunc,
|
|
19540
|
+
description: {
|
|
19541
|
+
name: "updateHtmlArtifact",
|
|
19542
|
+
description: "\u66F4\u65B0\u6307\u5B9A ID \u7684 HTML \u7F51\u9875\u6210\u54C1\u5185\u5BB9\u4E0E\u6807\u9898",
|
|
19543
|
+
category: "\u5185\u5BB9\u7BA1\u7406"
|
|
19544
|
+
},
|
|
19545
|
+
behavior: "action",
|
|
19546
|
+
uiGroup: "content",
|
|
19547
|
+
capability: "knowledge_capture",
|
|
19548
|
+
riskLevel: "low",
|
|
19549
|
+
costLevel: "low",
|
|
19550
|
+
defaultConsent: "auto"
|
|
19551
|
+
},
|
|
19328
19552
|
{
|
|
19329
19553
|
id: "createDoc",
|
|
19330
19554
|
schema: createDocFunctionSchema,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-CJ37ZMCQ.js";
|
|
17
17
|
import {
|
|
18
18
|
clearCliLocalRuntimePreparedAgentCache
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HMQUNXZ7.js";
|
|
20
20
|
import {
|
|
21
21
|
readCredentialAvailability
|
|
22
22
|
} from "./chunk-HAB2UDLT.js";
|
|
@@ -244,7 +244,7 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
244
244
|
let verifyResult;
|
|
245
245
|
if (parsed.verify) {
|
|
246
246
|
try {
|
|
247
|
-
const { verifyCustomProvider } = await import("./agentProviderCommands-
|
|
247
|
+
const { verifyCustomProvider } = await import("./agentProviderCommands-MEFUIECN.js");
|
|
248
248
|
const rec = built.nextRecord;
|
|
249
249
|
verifyResult = await verifyCustomProvider({
|
|
250
250
|
providerUrl: rec.customProviderUrl,
|
|
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
333
333
|
).unwrap();
|
|
334
334
|
if (dbSpaceId) {
|
|
335
335
|
try {
|
|
336
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
336
|
+
const { updateContentTitle } = await import("./contentThunks-UI4LT732.js");
|
|
337
337
|
await dispatch(
|
|
338
338
|
updateContentTitle({
|
|
339
339
|
spaceId: dbSpaceId,
|
|
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
async function createDocState(args, thunkApi) {
|
|
375
|
-
const { createPageAction } = await import("./createPageAction-
|
|
375
|
+
const { createPageAction } = await import("./createPageAction-BPVFIHSO.js");
|
|
376
376
|
return createPageAction(args, thunkApi);
|
|
377
377
|
}
|
|
378
378
|
function subscribe(listener) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
normalizeSystemBuiltinSkills,
|
|
8
8
|
normalizeTonePresetSetting,
|
|
9
9
|
resolveUserEnabledSkills
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-I5PBXF7O.js";
|
|
11
11
|
import {
|
|
12
12
|
isSkillSummaryMarker
|
|
13
13
|
} from "./chunk-VF4K2QE6.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-RXUKDHS5.js";
|
|
17
17
|
import {
|
|
18
18
|
fetchAndCacheTableRows
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WAECKLPA.js";
|
|
20
20
|
import {
|
|
21
21
|
createSpaceKey
|
|
22
22
|
} from "./chunk-UAD2WT54.js";
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
import {
|
|
43
43
|
listBuiltinSkills,
|
|
44
44
|
resolveBuiltinSkillByName
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-Y6M7KJOA.js";
|
|
46
46
|
import {
|
|
47
47
|
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TPCDYNJK.js";
|
|
49
49
|
import {
|
|
50
50
|
parseSkillDocProtocol
|
|
51
51
|
} from "./chunk-AETZ7AD6.js";
|
|
@@ -783,7 +783,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
783
783
|
if (!executionInput) {
|
|
784
784
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
785
785
|
}
|
|
786
|
-
const { findToolExecutor } = await import("./tools-
|
|
786
|
+
const { findToolExecutor } = await import("./tools-5U5DDFBH.js");
|
|
787
787
|
const { executor } = findToolExecutor(run.toolName);
|
|
788
788
|
toolRunStarted({
|
|
789
789
|
id: run.id,
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAbortError
|
|
3
|
+
} from "./chunk-7DPNBQSV.js";
|
|
4
|
+
|
|
5
|
+
// packages/agent-runtime/customNativeWire.ts
|
|
6
|
+
var CHAT_COMPLETIONS_SUFFIX = /\/chat\/completions\/?$/;
|
|
7
|
+
function resolveCustomNativeBase(endpoint) {
|
|
8
|
+
return endpoint.replace(CHAT_COMPLETIONS_SUFFIX, "").replace(/\/+$/, "");
|
|
9
|
+
}
|
|
10
|
+
var NATIVE_PATH_SUFFIX = {
|
|
11
|
+
"openai-responses": "/responses",
|
|
12
|
+
"anthropic-messages": "/messages"
|
|
13
|
+
};
|
|
14
|
+
var ANTHROPIC_MESSAGES_VERSION = "2023-06-01";
|
|
15
|
+
var OPENCODE_HOST = "opencode.ai";
|
|
16
|
+
var OPENCODE_ZEN_GO_PREFIX = "/zen/go";
|
|
17
|
+
var OPENCODE_INFERENCE_GO_PREFIX = "/inference/go";
|
|
18
|
+
function normalizeOpencodeGoGeminiBase(base, wire) {
|
|
19
|
+
if (wire !== "gemini") return base;
|
|
20
|
+
const schemeEnd = base.indexOf("://");
|
|
21
|
+
if (schemeEnd <= 0 || base.slice(0, schemeEnd).toLowerCase() !== "https") return base;
|
|
22
|
+
const authorityStart = schemeEnd + 3;
|
|
23
|
+
const pathStart = base.indexOf("/", authorityStart);
|
|
24
|
+
if (pathStart < 0) return base;
|
|
25
|
+
const host = base.slice(authorityStart, pathStart).toLowerCase();
|
|
26
|
+
if (host !== OPENCODE_HOST) return base;
|
|
27
|
+
const pathAndQuery = base.slice(pathStart);
|
|
28
|
+
const isZenGoPath = pathAndQuery === OPENCODE_ZEN_GO_PREFIX || pathAndQuery.startsWith(`${OPENCODE_ZEN_GO_PREFIX}/`);
|
|
29
|
+
if (!isZenGoPath) return base;
|
|
30
|
+
return `${base.slice(0, authorityStart)}${OPENCODE_HOST}${OPENCODE_INFERENCE_GO_PREFIX}${pathAndQuery.slice(
|
|
31
|
+
OPENCODE_ZEN_GO_PREFIX.length
|
|
32
|
+
)}`;
|
|
33
|
+
}
|
|
34
|
+
function detectDeclaredCustomNativeWire(endpoint) {
|
|
35
|
+
const trimmed = typeof endpoint === "string" ? endpoint.trim().replace(/\/+$/, "") : "";
|
|
36
|
+
if (!trimmed) return null;
|
|
37
|
+
const pathname = trimmed.split(/[?#]/)[0] ?? "";
|
|
38
|
+
if (pathname.endsWith(NATIVE_PATH_SUFFIX["openai-responses"])) return "openai-responses";
|
|
39
|
+
if (pathname.endsWith(NATIVE_PATH_SUFFIX["anthropic-messages"])) return "anthropic-messages";
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
function resolveCustomNativeEndpoint(endpoint, wire, model) {
|
|
43
|
+
const base = normalizeOpencodeGoGeminiBase(resolveCustomNativeBase(endpoint), wire);
|
|
44
|
+
switch (wire) {
|
|
45
|
+
case "gemini":
|
|
46
|
+
return `${base}/models/${model}:streamGenerateContent?alt=sse`;
|
|
47
|
+
case "openai-responses":
|
|
48
|
+
case "anthropic-messages": {
|
|
49
|
+
const suffix = NATIVE_PATH_SUFFIX[wire];
|
|
50
|
+
return detectDeclaredCustomNativeWire(base) === wire ? base : `${base}${suffix}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var RESERVED_CUSTOM_NATIVE_AUTH_HEADERS = [
|
|
55
|
+
// 凭据之外、由通道自己决定的头
|
|
56
|
+
"accept",
|
|
57
|
+
"accept-encoding",
|
|
58
|
+
"anthropic-version",
|
|
59
|
+
"content-type",
|
|
60
|
+
"content-length",
|
|
61
|
+
"user-agent",
|
|
62
|
+
"x-opencode-session",
|
|
63
|
+
// 请求走私 / 连接语义(hop-by-hop 与 Host/Cookie 家族)
|
|
64
|
+
"connection",
|
|
65
|
+
"cookie",
|
|
66
|
+
"host",
|
|
67
|
+
"keep-alive",
|
|
68
|
+
"proxy-authenticate",
|
|
69
|
+
"proxy-authorization",
|
|
70
|
+
"proxy-connection",
|
|
71
|
+
"te",
|
|
72
|
+
"trailer",
|
|
73
|
+
"transfer-encoding",
|
|
74
|
+
"upgrade"
|
|
75
|
+
];
|
|
76
|
+
var HTTP_HEADER_TOKEN_RE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
77
|
+
var CustomNativeApiKeyHeaderError = class extends Error {
|
|
78
|
+
code = "INVALID_API_KEY_HEADER";
|
|
79
|
+
constructor(message) {
|
|
80
|
+
super(message);
|
|
81
|
+
this.name = "CustomNativeApiKeyHeaderError";
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
function resolveCustomNativeApiKeyHeader(apiKeyHeader) {
|
|
85
|
+
const headerName = apiKeyHeader?.trim();
|
|
86
|
+
if (!headerName) return void 0;
|
|
87
|
+
if (!HTTP_HEADER_TOKEN_RE.test(headerName)) {
|
|
88
|
+
throw new CustomNativeApiKeyHeaderError(
|
|
89
|
+
`Invalid apiKeyHeader "${headerName}": not a valid HTTP header name (spaces, ":", CR/LF, control characters and other non-token characters are not allowed).`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
if (RESERVED_CUSTOM_NATIVE_AUTH_HEADERS.includes(headerName.toLowerCase())) {
|
|
93
|
+
throw new CustomNativeApiKeyHeaderError(
|
|
94
|
+
`Invalid apiKeyHeader "${headerName}": reserved header, it cannot be used as the API key header.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
return headerName;
|
|
98
|
+
}
|
|
99
|
+
function customNativeAuthHeaderValue(headerName, apiKey) {
|
|
100
|
+
return headerName.toLowerCase() === "authorization" ? apiKey.startsWith("Bearer ") ? apiKey : `Bearer ${apiKey}` : apiKey;
|
|
101
|
+
}
|
|
102
|
+
function customNativeAuthHeaders(wire, apiKey, apiKeyHeader) {
|
|
103
|
+
const overrideName = resolveCustomNativeApiKeyHeader(apiKeyHeader);
|
|
104
|
+
switch (wire) {
|
|
105
|
+
case "gemini":
|
|
106
|
+
return overrideName ? { [overrideName]: customNativeAuthHeaderValue(overrideName, apiKey) } : { "x-goog-api-key": apiKey };
|
|
107
|
+
case "openai-responses":
|
|
108
|
+
return overrideName ? { [overrideName]: customNativeAuthHeaderValue(overrideName, apiKey) } : { Authorization: `Bearer ${apiKey}` };
|
|
109
|
+
case "anthropic-messages":
|
|
110
|
+
return {
|
|
111
|
+
...overrideName ? { [overrideName]: customNativeAuthHeaderValue(overrideName, apiKey) } : { "x-api-key": apiKey },
|
|
112
|
+
"anthropic-version": ANTHROPIC_MESSAGES_VERSION
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function isCallerCancellation(error, callerSignal) {
|
|
117
|
+
return isAbortError(error) || callerSignal?.aborted === true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
detectDeclaredCustomNativeWire,
|
|
122
|
+
resolveCustomNativeEndpoint,
|
|
123
|
+
resolveCustomNativeApiKeyHeader,
|
|
124
|
+
customNativeAuthHeaders,
|
|
125
|
+
isCallerCancellation
|
|
126
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HMQUNXZ7.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SRDWWDBV.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4JBJG7XB.js";
|
|
11
11
|
import {
|
|
12
12
|
applyToolSurfaceConstraints
|
|
13
13
|
} from "./chunk-2Q3LOAFE.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-Y6ROFCZO.js";
|
|
39
39
|
import {
|
|
40
40
|
t
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-E4LYPSYM.js";
|
|
42
42
|
import {
|
|
43
43
|
asTrimmedNonEmptyStringArray
|
|
44
44
|
} from "./chunk-I42VC5KR.js";
|