@arbidocs/sdk 0.3.66 → 0.3.67
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/{browser-6H2O896Y.d.cts → browser-B5xRfc7b.d.cts} +88 -2
- package/dist/{browser-6H2O896Y.d.ts → browser-B5xRfc7b.d.ts} +88 -2
- package/dist/browser.cjs +40 -0
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +40 -0
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +43 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +41 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4891,6 +4891,7 @@ async function uploadFile(auth, fileData, fileName, options) {
|
|
|
4891
4891
|
const params = new URLSearchParams();
|
|
4892
4892
|
if (options?.folder) params.set("folder", sanitizeFolderPath(options.folder));
|
|
4893
4893
|
if (options?.configExtId) params.set("config_ext_id", options.configExtId);
|
|
4894
|
+
if (options?.wpType) params.set("wp_type", options.wpType);
|
|
4894
4895
|
const qs = params.toString();
|
|
4895
4896
|
const res = await authenticatedFetch({
|
|
4896
4897
|
...auth,
|
|
@@ -4906,6 +4907,7 @@ async function uploadFiles(auth, files, options) {
|
|
|
4906
4907
|
const params = new URLSearchParams();
|
|
4907
4908
|
if (options?.folder) params.set("folder", sanitizeFolderPath(options.folder));
|
|
4908
4909
|
if (options?.configExtId) params.set("config_ext_id", options.configExtId);
|
|
4910
|
+
if (options?.wpType) params.set("wp_type", options.wpType);
|
|
4909
4911
|
const qs = params.toString();
|
|
4910
4912
|
const res = await authenticatedFetch({
|
|
4911
4913
|
...auth,
|
|
@@ -5231,6 +5233,10 @@ __export(assistant_exports, {
|
|
|
5231
5233
|
buildRetrievalChunkTool: () => buildRetrievalChunkTool,
|
|
5232
5234
|
buildRetrievalFullContextTool: () => buildRetrievalFullContextTool,
|
|
5233
5235
|
buildRetrievalTocTool: () => buildRetrievalTocTool,
|
|
5236
|
+
filterSkills: () => filterSkills,
|
|
5237
|
+
listSkills: () => listSkills,
|
|
5238
|
+
parseSlashCommand: () => parseSlashCommand,
|
|
5239
|
+
parseSlashTokenInProgress: () => parseSlashTokenInProgress,
|
|
5234
5240
|
queryAssistant: () => queryAssistant,
|
|
5235
5241
|
respondToAgent: () => respondToAgent,
|
|
5236
5242
|
retrieve: () => retrieve
|
|
@@ -5326,6 +5332,40 @@ async function respondToAgent(arbi, assistantMessageExtId, answer) {
|
|
|
5326
5332
|
"Failed to respond to agent"
|
|
5327
5333
|
);
|
|
5328
5334
|
}
|
|
5335
|
+
async function listSkills(arbi, options) {
|
|
5336
|
+
const result = requireData(
|
|
5337
|
+
await arbi.fetch.GET("/v1/assistant/skills", {
|
|
5338
|
+
params: { query: { include_hidden: options?.includeHidden ?? false } }
|
|
5339
|
+
}),
|
|
5340
|
+
"Failed to list skills"
|
|
5341
|
+
);
|
|
5342
|
+
return result.skills;
|
|
5343
|
+
}
|
|
5344
|
+
function parseSlashCommand(input) {
|
|
5345
|
+
const m2 = /^\s*\/([a-zA-Z0-9_-]+)(?:\s+([\s\S]*))?$/.exec(input);
|
|
5346
|
+
if (!m2) return null;
|
|
5347
|
+
return { slug: m2[1].toLowerCase(), args: m2[2] ?? "" };
|
|
5348
|
+
}
|
|
5349
|
+
function parseSlashTokenInProgress(buffer) {
|
|
5350
|
+
const m2 = /^\s*\/([a-zA-Z0-9_-]*)$/.exec(buffer);
|
|
5351
|
+
return m2 ? m2[1].toLowerCase() : null;
|
|
5352
|
+
}
|
|
5353
|
+
function filterSkills(items, query, pinned = []) {
|
|
5354
|
+
const q2 = query.toLowerCase();
|
|
5355
|
+
const pinnedSet = new Set(pinned);
|
|
5356
|
+
const key = (s2) => (s2.slug ?? s2.name).toLowerCase();
|
|
5357
|
+
const matched = q2 ? items.filter((s2) => key(s2).includes(q2)) : items.slice();
|
|
5358
|
+
matched.sort((a2, b2) => {
|
|
5359
|
+
const aPinned = pinnedSet.has(key(a2)) ? 0 : 1;
|
|
5360
|
+
const bPinned = pinnedSet.has(key(b2)) ? 0 : 1;
|
|
5361
|
+
if (aPinned !== bPinned) return aPinned - bPinned;
|
|
5362
|
+
const aPrefix = key(a2).startsWith(q2) ? 0 : 1;
|
|
5363
|
+
const bPrefix = key(b2).startsWith(q2) ? 0 : 1;
|
|
5364
|
+
if (aPrefix !== bPrefix) return aPrefix - bPrefix;
|
|
5365
|
+
return key(a2).localeCompare(key(b2));
|
|
5366
|
+
});
|
|
5367
|
+
return matched;
|
|
5368
|
+
}
|
|
5329
5369
|
|
|
5330
5370
|
// src/operations/tags.ts
|
|
5331
5371
|
var tags_exports = {};
|
|
@@ -7217,6 +7257,7 @@ exports.doctags = doctags_exports;
|
|
|
7217
7257
|
exports.documents = documents_exports;
|
|
7218
7258
|
exports.documentsNode = documents_node_exports;
|
|
7219
7259
|
exports.files = files_exports;
|
|
7260
|
+
exports.filterSkills = filterSkills;
|
|
7220
7261
|
exports.formatAgentStepLabel = formatAgentStepLabel;
|
|
7221
7262
|
exports.formatFileSize = formatFileSize;
|
|
7222
7263
|
exports.formatStreamSummary = formatStreamSummary;
|
|
@@ -7231,6 +7272,8 @@ exports.getRawWorkspaceKey = getRawWorkspaceKey;
|
|
|
7231
7272
|
exports.health = health_exports;
|
|
7232
7273
|
exports.listen = listen_exports;
|
|
7233
7274
|
exports.parseSSEEvents = parseSSEEvents;
|
|
7275
|
+
exports.parseSlashCommand = parseSlashCommand;
|
|
7276
|
+
exports.parseSlashTokenInProgress = parseSlashTokenInProgress;
|
|
7234
7277
|
exports.performPasswordLogin = performPasswordLogin;
|
|
7235
7278
|
exports.performSigningKeyLogin = performSigningKeyLogin;
|
|
7236
7279
|
exports.performSsoDeviceFlowLogin = performSsoDeviceFlowLogin;
|