@burtson-labs/host-kit 0.4.62 → 0.4.63
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.
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `get_artifact` — fetch a published artifact you own from the cloud so the agent can
|
|
3
|
+
* REVISE it. Returns the current content INLINE (straight from the API) — deliberately
|
|
4
|
+
* does NOT write it to disk: Bandit's edit tools reject editing a pre-existing unread
|
|
5
|
+
* file, which would force a redundant read_file and make it look like the content came
|
|
6
|
+
* from the filesystem instead of the API. The model revises the returned content, writes
|
|
7
|
+
* the new version to a fresh file, and calls update_artifact. Cloud-only.
|
|
8
|
+
*/
|
|
1
9
|
import type { AgentTool } from '@burtson-labs/agent-core';
|
|
2
10
|
export declare function buildGetArtifactTool(opts: {
|
|
3
11
|
token: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getArtifactTool.d.ts","sourceRoot":"","sources":["../../src/tools/getArtifactTool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getArtifactTool.d.ts","sourceRoot":"","sources":["../../src/tools/getArtifactTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,0BAA0B,CAAC;AAKtE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,SAAS,CAsCZ"}
|
|
@@ -1,58 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.buildGetArtifactTool = buildGetArtifactTool;
|
|
37
|
-
/**
|
|
38
|
-
* `get_artifact` — fetch a published artifact you own back INTO the workspace so you can
|
|
39
|
-
* revise it, then republish with update_artifact (same URL). The read side of "make a
|
|
40
|
-
* revision". Cloud-only.
|
|
41
|
-
*/
|
|
42
|
-
const fs = __importStar(require("fs"));
|
|
43
|
-
const path = __importStar(require("path"));
|
|
44
4
|
const artifacts_1 = require("../artifacts");
|
|
5
|
+
const MAX_INLINE = 150000;
|
|
45
6
|
function buildGetArtifactTool(opts) {
|
|
46
7
|
return {
|
|
47
8
|
name: 'get_artifact',
|
|
48
|
-
description: 'Fetch a published artifact you own
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
9
|
+
description: 'Fetch a published artifact you own from the cloud so you can REVISE it. Pass its URL (the dashboard ' +
|
|
10
|
+
'link Bandit gave you, or from list_artifacts). Returns the CURRENT content inline, straight from the ' +
|
|
11
|
+
'API — revise it, write the updated version to a NEW file, then call update_artifact with the SAME URL ' +
|
|
12
|
+
'to publish the revision (the link stays the same). Cloud feature.',
|
|
52
13
|
parameters: [
|
|
53
14
|
{ name: 'url', description: 'The artifact URL (or key) to fetch. Must be one you own.', required: true }
|
|
54
15
|
],
|
|
55
|
-
async execute(params
|
|
16
|
+
async execute(params) {
|
|
56
17
|
const target = (params.url ?? '').trim();
|
|
57
18
|
if (!target)
|
|
58
19
|
return { output: 'Error: the `url` parameter is required (the artifact URL or key to fetch).', isError: true };
|
|
@@ -64,18 +25,15 @@ function buildGetArtifactTool(opts) {
|
|
|
64
25
|
keyOrUrl: target,
|
|
65
26
|
fetchImpl: opts.fetchImpl
|
|
66
27
|
});
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
await fs.promises.mkdir(outDir, { recursive: true });
|
|
71
|
-
const outPath = path.join(outDir, baseName);
|
|
72
|
-
await fs.promises.writeFile(outPath, fetched.content, 'utf8');
|
|
73
|
-
const rel = path.relative(root, outPath);
|
|
74
|
-
const preview = fetched.content.slice(0, 400);
|
|
28
|
+
const full = fetched.content.length <= MAX_INLINE;
|
|
29
|
+
const shown = full ? fetched.content : fetched.content.slice(0, MAX_INLINE);
|
|
30
|
+
const name = fetched.key.split('/').pop() || 'artifact';
|
|
75
31
|
return {
|
|
76
|
-
output: `
|
|
77
|
-
`
|
|
78
|
-
|
|
32
|
+
output: `Here is the CURRENT published content of the artifact (${fetched.contentType}, ${fetched.content.length} chars), ` +
|
|
33
|
+
`fetched from the API${full ? '' : ` — showing the first ${MAX_INLINE} chars`}. ` +
|
|
34
|
+
`To revise it: make your changes to this content, write the updated version to a new file (e.g. "${name}"), ` +
|
|
35
|
+
`then call update_artifact with url "${target}" and that file path — the link stays the same.\n\n` +
|
|
36
|
+
`--- current content ---\n${shown}`
|
|
79
37
|
};
|
|
80
38
|
}
|
|
81
39
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getArtifactTool.js","sourceRoot":"","sources":["../../src/tools/getArtifactTool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getArtifactTool.js","sourceRoot":"","sources":["../../src/tools/getArtifactTool.ts"],"names":[],"mappings":";;AAaA,oDA2CC;AA/CD,4CAA2C;AAE3C,MAAM,UAAU,GAAG,MAAO,CAAC;AAE3B,SAAgB,oBAAoB,CAAC,IAKpC;IACC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,sGAAsG;YACtG,uGAAuG;YACvG,wGAAwG;YACxG,mEAAmE;QACrE,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,0DAA0D,EAAE,QAAQ,EAAE,IAAI,EAAE;SACzG;QACD,KAAK,CAAC,OAAO,CAAC,MAA8B;YAC1C,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACzC,IAAI,CAAC,MAAM;gBAAE,OAAO,EAAE,MAAM,EAAE,4EAA4E,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC5H,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAW,EAAC;oBAChC,YAAY,EAAE,IAAI,CAAC,YAAY;oBAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,QAAQ,EAAE,MAAM;oBAChB,SAAS,EAAE,IAAI,CAAC,SAAS;iBAC1B,CAAC,CAAC;gBACH,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC;gBAClD,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;gBAC5E,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,UAAU,CAAC;gBACxD,OAAO;oBACL,MAAM,EACJ,0DAA0D,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,WAAW;wBACnH,uBAAuB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB,UAAU,QAAQ,IAAI;wBACjF,mGAAmG,IAAI,MAAM;wBAC7G,uCAAuC,MAAM,qDAAqD;wBAClG,4BAA4B,KAAK,EAAE;iBACtC,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,EAAE,MAAM,EAAE,4BAA4B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACnH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burtson-labs/host-kit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.63",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Burtson Labs",
|
|
6
6
|
"email": "team@burtson.ai",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@burtson-labs/agent-core": "1.6.
|
|
25
|
+
"@burtson-labs/agent-core": "1.6.80"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^20.11.0",
|