unbrowse 3.1.0-experiments.186be38 → 3.1.0-experiments.4499af2
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/cli.js +33 -1
- package/dist/mcp.js +51 -4
- package/dist/server.js +5181 -4985
- package/package.json +1 -1
- package/vendor/kuri/darwin-arm64/kuri +0 -0
- package/vendor/kuri/darwin-x64/kuri +0 -0
- package/vendor/kuri/linux-arm64/kuri +0 -0
- package/vendor/kuri/linux-x64/kuri +0 -0
- package/vendor/kuri/manifest.json +9 -6
- package/vendor/kuri/win-x64/kuri.exe +0 -0
package/dist/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ var __promiseAll = (args) => Promise.all(args);
|
|
|
31
31
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
32
32
|
|
|
33
33
|
// ../../src/build-info.generated.ts
|
|
34
|
-
var BUILD_RELEASE_VERSION = "3.1.0-experiments.
|
|
34
|
+
var BUILD_RELEASE_VERSION = "3.1.0-experiments.4499af2", BUILD_GIT_SHA = "4499af2aaeef", BUILD_CODE_HASH = "1488fc1d92b7", BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy4xLjAtZXhwZXJpbWVudHMuNDQ5OWFmMiIsImdpdF9zaGEiOiI0NDk5YWYyYWFlZWYiLCJjb2RlX2hhc2giOiIxNDg4ZmMxZDkyYjciLCJ0cmFjZV92ZXJzaW9uIjoiMTQ4OGZjMWQ5MmI3QDQ0OTlhZjJhYWVlZiIsImlzc3VlZF9hdCI6IjIwMjYtMDQtMDZUMDY6MTU6NTguMzQxWiJ9", BUILD_RELEASE_MANIFEST_SIGNATURE = "7ubu-WX8UeKTtx8vc4T3z2S1BklaHIdGNvftIPQ8jJ0", BUILD_DEFAULT_BACKEND_URL = "https://unbrowse-backend-experiments.lewis-6d8.workers.dev";
|
|
35
35
|
|
|
36
36
|
// ../../src/version.ts
|
|
37
37
|
import { createHash } from "crypto";
|
|
@@ -796,6 +796,14 @@ var init_bundle_scanner = __esm(() => {
|
|
|
796
796
|
init_logger();
|
|
797
797
|
});
|
|
798
798
|
|
|
799
|
+
// ../../src/reverse-engineer/token-sources.ts
|
|
800
|
+
var init_token_sources = () => {};
|
|
801
|
+
|
|
802
|
+
// ../../src/execution/token-resolver.ts
|
|
803
|
+
var init_token_resolver = __esm(() => {
|
|
804
|
+
init_token_sources();
|
|
805
|
+
});
|
|
806
|
+
|
|
799
807
|
// ../../src/vault/index.ts
|
|
800
808
|
import { join as join7 } from "path";
|
|
801
809
|
import { homedir as homedir5 } from "os";
|
|
@@ -1014,6 +1022,7 @@ var init_execution = __esm(async () => {
|
|
|
1014
1022
|
init_capture();
|
|
1015
1023
|
init_reverse_engineer();
|
|
1016
1024
|
init_bundle_scanner();
|
|
1025
|
+
init_token_resolver();
|
|
1017
1026
|
init_marketplace();
|
|
1018
1027
|
init_runtime();
|
|
1019
1028
|
init_transform();
|
|
@@ -3731,6 +3740,25 @@ async function cmdFeedback(flags) {
|
|
|
3731
3740
|
body.diagnostics = JSON.parse(flags.diagnostics);
|
|
3732
3741
|
output(await api2("POST", "/v1/feedback", body), !!flags.pretty);
|
|
3733
3742
|
}
|
|
3743
|
+
async function cmdAnnotate(flags) {
|
|
3744
|
+
const skillId = flags.skill;
|
|
3745
|
+
const endpointId = flags.endpoint;
|
|
3746
|
+
if (!skillId || !endpointId)
|
|
3747
|
+
die("--skill and --endpoint are required");
|
|
3748
|
+
const body = {};
|
|
3749
|
+
if (flags.text) {
|
|
3750
|
+
body.annotations = [{ text: flags.text }];
|
|
3751
|
+
}
|
|
3752
|
+
if (flags.constraint) {
|
|
3753
|
+
const parts = flags.constraint.split(":");
|
|
3754
|
+
if (parts.length >= 3) {
|
|
3755
|
+
body.constraints = [{ param: parts[0], rule: parts[1], message: parts.slice(2).join(":") }];
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
if (!body.annotations && !body.constraints)
|
|
3759
|
+
die("--text or --constraint required");
|
|
3760
|
+
output(await api2("POST", `/v1/skills/${skillId}/endpoints/${endpointId}/annotate`, body), !!flags.pretty);
|
|
3761
|
+
}
|
|
3734
3762
|
async function cmdReview(flags) {
|
|
3735
3763
|
const skillId = flags.skill;
|
|
3736
3764
|
if (!skillId)
|
|
@@ -3945,6 +3973,7 @@ var CLI_REFERENCE = {
|
|
|
3945
3973
|
{ name: "resolve", usage: '--intent "..." [--domain "..."] [--url "..."] [opts]', desc: "Search cached indexed/published routes and optionally execute the top trusted endpoint" },
|
|
3946
3974
|
{ name: "execute", usage: "--skill ID --endpoint ID [opts]", desc: "Execute a specific endpoint" },
|
|
3947
3975
|
{ name: "feedback", usage: "--skill ID --endpoint ID --rating N", desc: "Submit feedback (mandatory after resolve)" },
|
|
3976
|
+
{ name: "annotate", usage: "--skill ID --endpoint ID --text 'tip' [--constraint 'param:rule:message']", desc: "Contribute best practices or constraints for an endpoint" },
|
|
3948
3977
|
{ name: "review", usage: "--skill ID --endpoints '[...]'", desc: "Push reviewed descriptions/schema metadata back to a captured skill before publish" },
|
|
3949
3978
|
{ name: "index", usage: "--skill ID", desc: "Recompute local graph/contracts/export from cached skill state only" },
|
|
3950
3979
|
{ name: "publish", usage: "--skill ID [--confirm-publish] [--endpoints '[...]']", desc: "Re-index locally, inspect publish-review metadata, then publish/share from cached skill state" },
|
|
@@ -4571,6 +4600,7 @@ async function main() {
|
|
|
4571
4600
|
"exec",
|
|
4572
4601
|
"feedback",
|
|
4573
4602
|
"fb",
|
|
4603
|
+
"annotate",
|
|
4574
4604
|
"review",
|
|
4575
4605
|
"index",
|
|
4576
4606
|
"publish",
|
|
@@ -4642,6 +4672,8 @@ async function main() {
|
|
|
4642
4672
|
case "feedback":
|
|
4643
4673
|
case "fb":
|
|
4644
4674
|
return cmdFeedback(flags);
|
|
4675
|
+
case "annotate":
|
|
4676
|
+
return cmdAnnotate(flags);
|
|
4645
4677
|
case "review":
|
|
4646
4678
|
return cmdReview(flags);
|
|
4647
4679
|
case "index":
|
package/dist/mcp.js
CHANGED
|
@@ -225,11 +225,11 @@ import { dirname, join, parse } from "path";
|
|
|
225
225
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
226
226
|
|
|
227
227
|
// ../../src/build-info.generated.ts
|
|
228
|
-
var BUILD_RELEASE_VERSION = "3.1.0-experiments.
|
|
229
|
-
var BUILD_GIT_SHA = "
|
|
228
|
+
var BUILD_RELEASE_VERSION = "3.1.0-experiments.4499af2";
|
|
229
|
+
var BUILD_GIT_SHA = "4499af2aaeef";
|
|
230
230
|
var BUILD_CODE_HASH = "1488fc1d92b7";
|
|
231
|
-
var BUILD_RELEASE_MANIFEST_BASE64 = "
|
|
232
|
-
var BUILD_RELEASE_MANIFEST_SIGNATURE = "
|
|
231
|
+
var BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy4xLjAtZXhwZXJpbWVudHMuNDQ5OWFmMiIsImdpdF9zaGEiOiI0NDk5YWYyYWFlZWYiLCJjb2RlX2hhc2giOiIxNDg4ZmMxZDkyYjciLCJ0cmFjZV92ZXJzaW9uIjoiMTQ4OGZjMWQ5MmI3QDQ0OTlhZjJhYWVlZiIsImlzc3VlZF9hdCI6IjIwMjYtMDQtMDZUMDY6MTU6NTguMzQxWiJ9";
|
|
232
|
+
var BUILD_RELEASE_MANIFEST_SIGNATURE = "7ubu-WX8UeKTtx8vc4T3z2S1BklaHIdGNvftIPQ8jJ0";
|
|
233
233
|
var BUILD_DEFAULT_BACKEND_URL = "https://unbrowse-backend-experiments.lewis-6d8.workers.dev";
|
|
234
234
|
|
|
235
235
|
// ../../src/version.ts
|
|
@@ -1410,12 +1410,23 @@ function addExecuteNextStepHints(result, args) {
|
|
|
1410
1410
|
hints.feedback_skill = skillId;
|
|
1411
1411
|
if (endpointId)
|
|
1412
1412
|
hints.feedback_endpoint = endpointId;
|
|
1413
|
+
const constraints = isPlainObject(nested) && Array.isArray(nested.constraints) ? nested.constraints : undefined;
|
|
1414
|
+
if (constraints?.length) {
|
|
1415
|
+
hints.known_constraints = constraints;
|
|
1416
|
+
}
|
|
1417
|
+
const annotations = isPlainObject(nested) && Array.isArray(nested.annotations) ? nested.annotations : undefined;
|
|
1418
|
+
if (annotations?.length) {
|
|
1419
|
+
hints.community_notes = annotations;
|
|
1420
|
+
}
|
|
1413
1421
|
const desc = isPlainObject(nested) && typeof nested.description === "string" ? nested.description : "";
|
|
1414
1422
|
const looksGeneric = !desc || desc.startsWith("Captured ") || desc.startsWith("Returns results");
|
|
1415
1423
|
if (looksGeneric) {
|
|
1416
1424
|
hints.first_use_review_needed = true;
|
|
1417
1425
|
hints.review_step = "After feedback, call unbrowse_review to write proper endpoint descriptions, then unbrowse_publish to share to marketplace.";
|
|
1418
1426
|
}
|
|
1427
|
+
if (skillId && endpointId) {
|
|
1428
|
+
hints.contribute = "If you learned something about this endpoint (required params, gotchas, best practices), call unbrowse_annotate to share it with other agents.";
|
|
1429
|
+
}
|
|
1419
1430
|
return { ...result, _workflow_hints: hints };
|
|
1420
1431
|
}
|
|
1421
1432
|
function addCaptureNextStepHints(result, _args) {
|
|
@@ -2452,6 +2463,42 @@ var tools = [
|
|
|
2452
2463
|
const withHints = addCaptureNextStepHints(result, args);
|
|
2453
2464
|
return successResult(withHints, "Browse session closed. See _workflow_hints for required next steps: call unbrowse_review then unbrowse_publish.");
|
|
2454
2465
|
}
|
|
2466
|
+
},
|
|
2467
|
+
{
|
|
2468
|
+
name: "unbrowse_annotate",
|
|
2469
|
+
description: "Contribute constraints or best practices for an endpoint. Call this after executing an endpoint to share what you learned (required params, gotchas, tips) with other agents.",
|
|
2470
|
+
parameters: {
|
|
2471
|
+
type: "object",
|
|
2472
|
+
properties: {
|
|
2473
|
+
skill: { type: "string", description: "Skill ID" },
|
|
2474
|
+
endpoint: { type: "string", description: "Endpoint ID" },
|
|
2475
|
+
constraints: {
|
|
2476
|
+
type: "array",
|
|
2477
|
+
description: "Learned constraints (required params, deprecated fields, format rules)",
|
|
2478
|
+
items: { type: "object", properties: { param: { type: "string" }, rule: { type: "string" }, message: { type: "string" } }, required: ["param", "rule", "message"] }
|
|
2479
|
+
},
|
|
2480
|
+
annotations: {
|
|
2481
|
+
type: "array",
|
|
2482
|
+
description: "Free-text best practices, tips, or gotchas",
|
|
2483
|
+
items: { type: "object", properties: { text: { type: "string" } }, required: ["text"] }
|
|
2484
|
+
}
|
|
2485
|
+
},
|
|
2486
|
+
required: ["skill", "endpoint"]
|
|
2487
|
+
},
|
|
2488
|
+
handler: async (args) => {
|
|
2489
|
+
await ensureServerReady();
|
|
2490
|
+
const skillId = args.skill;
|
|
2491
|
+
const endpointId = args.endpoint;
|
|
2492
|
+
const body = {};
|
|
2493
|
+
if (Array.isArray(args.constraints))
|
|
2494
|
+
body.constraints = args.constraints;
|
|
2495
|
+
if (Array.isArray(args.annotations))
|
|
2496
|
+
body.annotations = args.annotations;
|
|
2497
|
+
if (!body.constraints && !body.annotations)
|
|
2498
|
+
return errorResult("Provide constraints and/or annotations");
|
|
2499
|
+
const result = await api2("POST", `/v1/skills/${skillId}/endpoints/${endpointId}/annotate`, body);
|
|
2500
|
+
return successResult(result, "Annotation saved. Other agents will see your contribution when using this endpoint.");
|
|
2501
|
+
}
|
|
2455
2502
|
}
|
|
2456
2503
|
];
|
|
2457
2504
|
var toolMap = new Map(tools.map((tool) => [tool.name, tool]));
|