@zackbart/connecta 0.24.4 → 0.26.0
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/AGENTS.md +43 -12
- package/CHANGELOG.md +524 -0
- package/README.md +32 -15
- package/SECURITY.md +6 -5
- package/bin/connecta.mjs +5 -1
- package/dist/activity.d.ts +10 -3
- package/dist/activity.js +10 -1
- package/dist/advertised-schema.js +53 -0
- package/dist/artifacts/connector.d.ts +55 -0
- package/dist/artifacts/connector.js +724 -0
- package/dist/artifacts/document.js +76 -0
- package/dist/artifacts/guide.js +140 -0
- package/dist/artifacts/html-scan.js +329 -0
- package/dist/artifacts/json.js +68 -0
- package/dist/artifacts/kv-store.d.ts +20 -0
- package/dist/artifacts/kv-store.js +140 -0
- package/dist/artifacts/markdown.js +449 -0
- package/dist/artifacts/module.d.ts +37 -0
- package/dist/artifacts/module.js +60 -0
- package/dist/artifacts/operations.d.ts +195 -0
- package/dist/artifacts/operations.js +944 -0
- package/dist/artifacts/refresh.d.ts +53 -0
- package/dist/artifacts/refresh.js +235 -0
- package/dist/artifacts/routes.js +194 -0
- package/dist/artifacts/types.d.ts +214 -0
- package/dist/artifacts/types.js +22 -0
- package/dist/artifacts/validate.d.ts +62 -0
- package/dist/artifacts/validate.js +652 -0
- package/dist/artifacts.d.ts +6 -0
- package/dist/artifacts.js +9 -0
- package/dist/auth/downstream-oauth.js +490 -106
- package/dist/call-admission.js +139 -113
- package/dist/catalog-service.js +152 -106
- package/dist/catalog.js +297 -38
- package/dist/concurrency.js +24 -23
- package/dist/connector-access.d.ts +18 -4
- package/dist/connector-access.js +65 -20
- package/dist/connector-caller.d.ts +8 -0
- package/dist/connector-caller.js +19 -0
- package/dist/connector-scope.js +6 -37
- package/dist/connectors/api.d.ts +2 -2
- package/dist/connectors/remote-mcp.d.ts +6 -5
- package/dist/connectors/remote-mcp.js +330 -240
- package/dist/credential-contract.d.ts +9 -0
- package/dist/credential-rules.js +2 -2
- package/dist/credentials.d.ts +6 -1
- package/dist/credentials.js +45 -3
- package/dist/errors.d.ts +16 -1
- package/dist/errors.js +28 -0
- package/dist/execute.js +745 -282
- package/dist/executor-admission.d.ts +11 -1
- package/dist/executor-admission.js +145 -63
- package/dist/executors/quickjs-runtime.js +4 -2
- package/dist/executors/quickjs.js +255 -212
- package/dist/fix-prompt.js +37 -0
- package/dist/index.d.ts +72 -7
- package/dist/index.js +281 -26
- package/dist/invocation.js +371 -286
- package/dist/meta-tools.js +213 -94
- package/dist/module-contracts.d.ts +21 -1
- package/dist/oauth-callback-outcome.js +94 -0
- package/dist/oauth-sealing.js +29 -0
- package/dist/operator-ui/fix-prompts.js +87 -0
- package/dist/operator-ui/generated.js +2 -2
- package/dist/operator-ui/model.d.ts +103 -1
- package/dist/operator-ui/setup-commands.js +53 -0
- package/dist/operator-ui/view.js +128 -3
- package/dist/program-source.js +321 -0
- package/dist/providers/notion.js +2 -2
- package/dist/providers/revenuecat.js +32 -5
- package/dist/providers/stripe.d.ts +3 -2
- package/dist/providers/vercel.js +1 -1
- package/dist/registry.d.ts +43 -7
- package/dist/registry.js +434 -288
- package/dist/resumable.js +1291 -0
- package/dist/routes/activity.js +74 -154
- package/dist/routes/actor-labels.js +114 -0
- package/dist/routes/credentials.js +196 -163
- package/dist/routes/mcp.js +228 -112
- package/dist/routes/oauth-management.js +73 -71
- package/dist/routes/oauth.js +44 -16
- package/dist/routes/operator.js +83 -0
- package/dist/routes/shared.d.ts +25 -1
- package/dist/routes/shared.js +20 -2
- package/dist/routes/ui-data.js +211 -0
- package/dist/routes/ui.js +76 -35
- package/dist/run-journal.js +347 -0
- package/dist/runtime/admission.js +43 -0
- package/dist/runtime/call-admission.js +67 -0
- package/dist/runtime/connector-scope.js +72 -0
- package/dist/runtime/run.js +174 -0
- package/dist/runtime/services.js +130 -0
- package/dist/runtime/shared-read.js +106 -0
- package/dist/runtime/storage.js +66 -0
- package/dist/server.js +137 -89
- package/dist/skills.js +28 -9
- package/dist/storage/file.js +39 -2
- package/dist/storage/memory.js +28 -16
- package/dist/timeout.js +39 -43
- package/dist/tool-safety.d.ts +27 -1
- package/dist/tool-safety.js +31 -0
- package/dist/types.d.ts +45 -7
- package/dist/ui.d.ts +25 -4
- package/dist/ui.js +77 -167
- package/dist/url-safety.js +157 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/documentation/architecture.md +367 -16
- package/documentation/auth.md +163 -2
- package/documentation/code-mode.md +274 -56
- package/documentation/meta-tools.md +200 -44
- package/ethos.md +46 -47
- package/examples/worker/AGENTS.md +6 -0
- package/examples/worker/README.md +224 -14
- package/examples/worker/src/d1-activity-row.ts +14 -2
- package/examples/worker/src/d1-activity.ts +4 -2
- package/examples/worker/src/d1-storage.ts +116 -0
- package/examples/worker/src/index.ts +42 -7
- package/examples/worker/src/r2-artifact-blobs.ts +29 -0
- package/examples/worker/wrangler.jsonc +21 -5
- package/package.json +16 -4
- package/templates/node/AGENTS.md +9 -2
- package/templates/node/README.md +31 -3
- package/templates/node/package.json +1 -1
- package/templates/node/src/index.ts +27 -0
- package/dist/auth/downstream-oauth.d.ts +0 -200
- package/dist/catalog-fingerprint.d.ts +0 -19
- package/dist/catalog-limits.d.ts +0 -9
- package/dist/catalog-service.d.ts +0 -263
- package/dist/catalog.d.ts +0 -87
- package/dist/concurrency.d.ts +0 -3
- package/dist/connectors/guarded-fetch.d.ts +0 -96
- package/dist/credential-rules.d.ts +0 -85
- package/dist/execute.d.ts +0 -154
- package/dist/executor-result.d.ts +0 -10
- package/dist/executors/quickjs-child.d.ts +0 -1
- package/dist/executors/quickjs-protocol.d.ts +0 -67
- package/dist/favicon.d.ts +0 -1
- package/dist/identity.d.ts +0 -4
- package/dist/invocation.d.ts +0 -74
- package/dist/mcp-result.d.ts +0 -8
- package/dist/meta-tools.d.ts +0 -129
- package/dist/operator-ui/generated.d.ts +0 -2
- package/dist/operator-ui/view.d.ts +0 -188
- package/dist/result-shapes.d.ts +0 -13
- package/dist/retired-toolkits.d.ts +0 -2
- package/dist/routes/activity.d.ts +0 -2
- package/dist/routes/credentials.d.ts +0 -2
- package/dist/routes/mcp.d.ts +0 -10
- package/dist/routes/oauth-management.d.ts +0 -2
- package/dist/routes/oauth.d.ts +0 -2
- package/dist/routes/ui.d.ts +0 -2
- package/dist/server.d.ts +0 -9
- package/dist/skills.d.ts +0 -44
- package/dist/timeout.d.ts +0 -21
package/dist/routes/mcp.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type RouteContext, type ServerOptions } from "./shared.js";
|
|
2
|
-
export declare const MCP_CORS_HEADERS: {
|
|
3
|
-
"Access-Control-Allow-Origin": string;
|
|
4
|
-
"Access-Control-Allow-Methods": string;
|
|
5
|
-
"Access-Control-Allow-Headers": string;
|
|
6
|
-
};
|
|
7
|
-
export declare function createMcpRoute(opts: ServerOptions): {
|
|
8
|
-
handle(context: RouteContext): Promise<Response | null>;
|
|
9
|
-
rejectOrigin(request: Request): Response | null;
|
|
10
|
-
};
|
package/dist/routes/oauth.d.ts
DELETED
package/dist/routes/ui.d.ts
DELETED
package/dist/server.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type RuntimeExecutionContext, type ServerOptions } from "./routes/shared.js";
|
|
2
|
-
export type { ServerOptions } from "./routes/shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Build the Web-standard fetch handler.
|
|
5
|
-
*
|
|
6
|
-
* Route ordering is the contract: private mutation routes precede wildcard
|
|
7
|
-
* OPTIONS, and the security wrapper is applied to every response, including 404s.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createFetchHandler(opts: ServerOptions): (request: Request, runtimeContext?: RuntimeExecutionContext) => Promise<Response>;
|
package/dist/skills.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Connector } from "./types.js";
|
|
2
|
-
export declare const CONNECTA_INSTRUCTIONS = "Choose a route before discovery. A known-address read needs only call_tool. Unknown-address read-only work starts with execute_code to discover, call, and return the answer; use the same route for reduction, multiple or dependent calls, loops, joins, or branches. Keep discovery and calls together when schemas suffice; do not return catalog matches alone. Inspect unfamiliar result shapes with a small sample before proceeding. Only readOnlyHint: true tools run there. Keep catalog inspection and unannotated, write-capable, or destructive work top level: search_tools then call_destructive_tool when a call is needed. After auth_required use authorize_connector. After a truncated direct result use get_result. Guidance is on demand: fetch skills({ name: \"usage\" }) only when these instructions and the tool description are insufficient or a run needs repair.";
|
|
3
|
-
/** Shared Connecta routing guidance, byte-identical across deployments. */
|
|
4
|
-
export declare const USAGE_SKILL: string;
|
|
5
|
-
/** The always-loaded MCP `instructions` string. */
|
|
6
|
-
export declare function instructionsFor(): string;
|
|
7
|
-
/** True when at least one of `connectors` carries a usage guide. */
|
|
8
|
-
export declare function hasConnectorGuides(connectors: readonly Connector[]): boolean;
|
|
9
|
-
/** The skill name that fetches `connector`'s guide. */
|
|
10
|
-
export declare function connectorSkillName(connectorId: string): string;
|
|
11
|
-
/** The connector's guide, or undefined when it declares none (or a blank one). */
|
|
12
|
-
export declare function connectorGuide(connector: Connector): string | undefined;
|
|
13
|
-
/** Discovery budget for one connector-guide summary, including an ellipsis. */
|
|
14
|
-
export declare const GUIDE_SUMMARY_LENGTH = 120;
|
|
15
|
-
/** Normalize authored and derived summaries under one construction contract. */
|
|
16
|
-
export declare function normalizeGuideSummary(summary: string): string | undefined;
|
|
17
|
-
/** Bounded, decision-useful discovery summary for a connector guide. */
|
|
18
|
-
export declare function connectorGuideSummary(connector: Connector): string | undefined;
|
|
19
|
-
/** Whether correct use always depends on conventions outside the tool schema. */
|
|
20
|
-
export declare function connectorGuideRequired(connector: Connector): boolean;
|
|
21
|
-
export interface SkillListing {
|
|
22
|
-
name: string;
|
|
23
|
-
description: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Every fetchable skill: the built-in guides plus one entry per connector that
|
|
27
|
-
* carries a usage guide. Derived from the connector list passed in — the single
|
|
28
|
-
* place guide visibility is decided.
|
|
29
|
-
*/
|
|
30
|
-
export declare function listSkills(connectors: readonly Connector[]): SkillListing[];
|
|
31
|
-
export type SkillLookup = {
|
|
32
|
-
found: true;
|
|
33
|
-
content: string;
|
|
34
|
-
} | {
|
|
35
|
-
found: false;
|
|
36
|
-
message: string;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Resolve one skill name. Built-in names match exactly; connector guides are
|
|
40
|
-
* reachable only through the `connector:` prefix. Every miss — unknown name,
|
|
41
|
-
* unknown connector, connector without a guide — is an explicit error, never a
|
|
42
|
-
* silent fallback to the generic guide.
|
|
43
|
-
*/
|
|
44
|
-
export declare function resolveSkill(name: string, connectors: readonly Connector[]): SkillLookup;
|
package/dist/timeout.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generous default bound for a single downstream probe/catalog call. High enough
|
|
3
|
-
* to trip only on a pathological hang, not a realistically slow probe.
|
|
4
|
-
*/
|
|
5
|
-
export declare const DEFAULT_PROBE_TIMEOUT_MS = 30000;
|
|
6
|
-
/** A finite, positive integer number of milliseconds, or undefined. */
|
|
7
|
-
export declare function normalizeTimeoutMs(value: number | undefined): number | undefined;
|
|
8
|
-
/** Resolve after `ms`, or false when the caller aborts first. */
|
|
9
|
-
export declare function sleep(ms: number, signal?: AbortSignal): Promise<boolean>;
|
|
10
|
-
export interface DeadlineOptions {
|
|
11
|
-
timeoutMs?: number;
|
|
12
|
-
signal?: AbortSignal;
|
|
13
|
-
timeoutError: Error;
|
|
14
|
-
}
|
|
15
|
-
export declare function withDeadline<T>(operation: (signal: AbortSignal) => Promise<T>, options: DeadlineOptions): Promise<T>;
|
|
16
|
-
/**
|
|
17
|
-
* Give one operation a caller-facing deadline and the matching cancellation
|
|
18
|
-
* signal. The timeout rejects with the stable, labelled error while aborting
|
|
19
|
-
* any in-flight work that honors the signal.
|
|
20
|
-
*/
|
|
21
|
-
export declare function withAbortableTimeout<T>(operation: (signal: AbortSignal) => Promise<T>, ms: number, label: string): Promise<T>;
|