unbrowse 3.1.0-experiments.995f8bb → 3.1.0-experiments.9cbcb13
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 +79 -33
- package/dist/index.js +2 -6
- package/dist/mcp.js +73 -22
- package/dist/server.js +25994 -0
- package/package.json +1 -2
- package/vendor/kuri/manifest.json +1 -1
- package/runtime-src/agent-outcome.ts +0 -166
- package/runtime-src/analytics-session.ts +0 -55
- package/runtime-src/api/browse-index.ts +0 -343
- package/runtime-src/api/browse-session.ts +0 -572
- package/runtime-src/api/browse-submit-prereqs.ts +0 -48
- package/runtime-src/api/browse-submit.ts +0 -1184
- package/runtime-src/api/routes.ts +0 -1833
- package/runtime-src/auth/browser-cookies.ts +0 -423
- package/runtime-src/auth/index.ts +0 -535
- package/runtime-src/auth/runtime.ts +0 -116
- package/runtime-src/browser/index.ts +0 -659
- package/runtime-src/browser/types.ts +0 -41
- package/runtime-src/build-info.generated.ts +0 -6
- package/runtime-src/capture/index.ts +0 -1929
- package/runtime-src/capture/prefetch.ts +0 -95
- package/runtime-src/capture/rsc.ts +0 -45
- package/runtime-src/cli/shortcuts.ts +0 -273
- package/runtime-src/cli.ts +0 -1734
- package/runtime-src/client/graph-client.ts +0 -100
- package/runtime-src/client/index.ts +0 -1425
- package/runtime-src/debug-trace.ts +0 -18
- package/runtime-src/domain.ts +0 -38
- package/runtime-src/execution/index.ts +0 -3407
- package/runtime-src/execution/retry.ts +0 -46
- package/runtime-src/execution/robots.ts +0 -167
- package/runtime-src/execution/search-forms.ts +0 -188
- package/runtime-src/execution/token-resolver.ts +0 -135
- package/runtime-src/extraction/index.ts +0 -1507
- package/runtime-src/foundry/publish-bundle.ts +0 -392
- package/runtime-src/graph/agent-augment.ts +0 -315
- package/runtime-src/graph/index.ts +0 -1532
- package/runtime-src/graph/local-fixtures.ts +0 -393
- package/runtime-src/graph/local-harness.ts +0 -646
- package/runtime-src/graph/planner.ts +0 -411
- package/runtime-src/graph/session.ts +0 -294
- package/runtime-src/graph/trace-store.ts +0 -136
- package/runtime-src/impact-log.ts +0 -227
- package/runtime-src/index.ts +0 -24
- package/runtime-src/indexer/index.ts +0 -465
- package/runtime-src/intent-match.ts +0 -1515
- package/runtime-src/kuri/client.ts +0 -1839
- package/runtime-src/logger.ts +0 -30
- package/runtime-src/marketplace/index.ts +0 -111
- package/runtime-src/mcp.ts +0 -1911
- package/runtime-src/orchestrator/browser-agent.ts +0 -374
- package/runtime-src/orchestrator/dag-advisor.ts +0 -59
- package/runtime-src/orchestrator/dag-feedback.ts +0 -257
- package/runtime-src/orchestrator/first-pass-action.ts +0 -403
- package/runtime-src/orchestrator/index.ts +0 -4480
- package/runtime-src/orchestrator/passive-publish.ts +0 -187
- package/runtime-src/orchestrator/timing-economics.ts +0 -80
- package/runtime-src/payments/cascade.ts +0 -137
- package/runtime-src/payments/index.ts +0 -270
- package/runtime-src/payments/lobster-pay.ts +0 -182
- package/runtime-src/payments/wallet.ts +0 -98
- package/runtime-src/publish/review-context.ts +0 -93
- package/runtime-src/publish/sanitize.ts +0 -197
- package/runtime-src/publish/schema-review.ts +0 -192
- package/runtime-src/publish-admission.ts +0 -388
- package/runtime-src/ratelimit/index.ts +0 -23
- package/runtime-src/reverse-engineer/bundle-scanner.ts +0 -127
- package/runtime-src/reverse-engineer/description-prompt.ts +0 -213
- package/runtime-src/reverse-engineer/index.ts +0 -1551
- package/runtime-src/reverse-engineer/token-sources.ts +0 -379
- package/runtime-src/router.ts +0 -17
- package/runtime-src/routing-telemetry.ts +0 -395
- package/runtime-src/runtime/browser-access.ts +0 -11
- package/runtime-src/runtime/browser-auth.ts +0 -12
- package/runtime-src/runtime/browser-host.ts +0 -48
- package/runtime-src/runtime/lifecycle.ts +0 -17
- package/runtime-src/runtime/local-server.ts +0 -311
- package/runtime-src/runtime/paths.ts +0 -99
- package/runtime-src/runtime/setup.ts +0 -251
- package/runtime-src/runtime/supervisor.ts +0 -69
- package/runtime-src/runtime/update-hints.ts +0 -351
- package/runtime-src/server.ts +0 -100
- package/runtime-src/session-logs.ts +0 -142
- package/runtime-src/settings.ts +0 -221
- package/runtime-src/single-binary.ts +0 -143
- package/runtime-src/site-policy.ts +0 -54
- package/runtime-src/stale-cleanup-runner.ts +0 -144
- package/runtime-src/stale-cleanup.ts +0 -133
- package/runtime-src/telemetry-attribution.ts +0 -120
- package/runtime-src/telemetry.ts +0 -253
- package/runtime-src/template-params.ts +0 -141
- package/runtime-src/transform/drift.ts +0 -60
- package/runtime-src/transform/index.ts +0 -277
- package/runtime-src/types/index.ts +0 -1
- package/runtime-src/types/skill.ts +0 -931
- package/runtime-src/vault/index.ts +0 -196
- package/runtime-src/verification/auth-gate.ts +0 -8
- package/runtime-src/verification/candidates.ts +0 -27
- package/runtime-src/verification/index.ts +0 -120
- package/runtime-src/verification/matrix.ts +0 -30
- package/runtime-src/version.ts +0 -148
- package/runtime-src/workflow/artifact.ts +0 -161
- package/runtime-src/workflow/compile.ts +0 -808
- package/runtime-src/workflow/publish.ts +0 -225
- package/runtime-src/workflow/runtime.ts +0 -213
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_BACKEND_URL } from "../version.js";
|
|
2
|
-
import { getApiKey } from "./index.js";
|
|
3
|
-
|
|
4
|
-
const API_URL = process.env.UNBROWSE_BACKEND_URL ?? DEFAULT_BACKEND_URL;
|
|
5
|
-
const GRAPH_TIMEOUT_MS = parseInt(process.env.UNBROWSE_GRAPH_TIMEOUT_MS ?? "4000", 10);
|
|
6
|
-
|
|
7
|
-
async function graphApi<T>(method: string, path: string, body?: unknown): Promise<T> {
|
|
8
|
-
const key = getApiKey();
|
|
9
|
-
const controller = new AbortController();
|
|
10
|
-
const timer = setTimeout(() => controller.abort(), GRAPH_TIMEOUT_MS);
|
|
11
|
-
let res: Response;
|
|
12
|
-
try {
|
|
13
|
-
res = await fetch(`${API_URL}${path}`, {
|
|
14
|
-
method,
|
|
15
|
-
headers: {
|
|
16
|
-
"Content-Type": "application/json",
|
|
17
|
-
"Accept-Encoding": "gzip, deflate",
|
|
18
|
-
...(key ? { Authorization: `Bearer ${key}` } : {}),
|
|
19
|
-
},
|
|
20
|
-
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
21
|
-
signal: controller.signal,
|
|
22
|
-
});
|
|
23
|
-
} finally {
|
|
24
|
-
clearTimeout(timer);
|
|
25
|
-
}
|
|
26
|
-
if (!res.ok) throw new Error(`graph API ${res.status} from ${path}`);
|
|
27
|
-
return res.json() as Promise<T>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface GraphChainLink {
|
|
31
|
-
endpoint_id: string;
|
|
32
|
-
requires?: string[];
|
|
33
|
-
provides?: string[];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface GraphChainResult {
|
|
37
|
-
chain: GraphChainLink[];
|
|
38
|
-
resolved: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface GraphPrediction {
|
|
42
|
-
endpoint_id: string;
|
|
43
|
-
score: number;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** POST /v1/graph/chain — resolve prerequisite chain for a target endpoint */
|
|
47
|
-
export async function fetchChain(
|
|
48
|
-
domain: string,
|
|
49
|
-
targetEndpointId: string,
|
|
50
|
-
availableBindings?: string[],
|
|
51
|
-
): Promise<GraphChainResult> {
|
|
52
|
-
return graphApi<GraphChainResult>("POST", "/v1/graph/chain", {
|
|
53
|
-
domain,
|
|
54
|
-
target_endpoint_id: targetEndpointId,
|
|
55
|
-
available_bindings: availableBindings,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** GET /v1/graph/predict/:domain — co-occurrence predictions from a starting node */
|
|
60
|
-
export async function fetchPredictions(
|
|
61
|
-
domain: string,
|
|
62
|
-
fromId: string,
|
|
63
|
-
k = 5,
|
|
64
|
-
): Promise<GraphPrediction[]> {
|
|
65
|
-
const qs = `from=${encodeURIComponent(fromId)}&k=${k}`;
|
|
66
|
-
return graphApi<GraphPrediction[]>("GET", `/v1/graph/predict/${encodeURIComponent(domain)}?${qs}`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** POST /v1/graph/session — report a session action (fire-and-forget) */
|
|
70
|
-
export async function recordSession(
|
|
71
|
-
domain: string,
|
|
72
|
-
sessionId: string,
|
|
73
|
-
endpointId: string,
|
|
74
|
-
intent: string,
|
|
75
|
-
result: "success" | "failure" | "skip",
|
|
76
|
-
): Promise<void> {
|
|
77
|
-
await graphApi<unknown>("POST", "/v1/graph/session", {
|
|
78
|
-
session_id: sessionId,
|
|
79
|
-
action: {
|
|
80
|
-
intent,
|
|
81
|
-
domain,
|
|
82
|
-
endpoint_id: endpointId,
|
|
83
|
-
result,
|
|
84
|
-
timestamp: new Date().toISOString(),
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** POST /v1/graph/negative — report an explicit negative signal (fire-and-forget) */
|
|
90
|
-
export async function recordNegative(
|
|
91
|
-
domain: string,
|
|
92
|
-
intentPattern: string,
|
|
93
|
-
endpointId: string,
|
|
94
|
-
): Promise<void> {
|
|
95
|
-
await graphApi<unknown>("POST", "/v1/graph/negative", {
|
|
96
|
-
domain,
|
|
97
|
-
intent_pattern: intentPattern,
|
|
98
|
-
endpoint_id: endpointId,
|
|
99
|
-
});
|
|
100
|
-
}
|