@zackbart/connecta 0.7.7 → 0.7.9
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/CHANGELOG.md +88 -0
- package/dist/activity.d.ts +1 -1
- package/dist/activity.d.ts.map +1 -1
- package/dist/activity.js.map +1 -1
- package/dist/call-admission.d.ts +81 -0
- package/dist/call-admission.d.ts.map +1 -0
- package/dist/call-admission.js +339 -0
- package/dist/call-admission.js.map +1 -0
- package/dist/catalog.d.ts +5 -3
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +13 -4
- package/dist/catalog.js.map +1 -1
- package/dist/connectors/api.d.ts +3 -1
- package/dist/connectors/api.d.ts.map +1 -1
- package/dist/connectors/api.js +1 -0
- package/dist/connectors/api.js.map +1 -1
- package/dist/connectors/remote-mcp.d.ts +3 -1
- package/dist/connectors/remote-mcp.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.js +1 -0
- package/dist/connectors/remote-mcp.js.map +1 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +72 -30
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/meta-tools.d.ts +7 -4
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +212 -54
- package/dist/meta-tools.js.map +1 -1
- package/dist/registry.d.ts +37 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +45 -2
- package/dist/registry.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +5 -0
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +8 -4
- package/dist/ui.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/activity.ts +5 -1
- package/src/call-admission.ts +519 -0
- package/src/catalog.ts +24 -4
- package/src/connectors/api.ts +4 -0
- package/src/connectors/remote-mcp.ts +4 -0
- package/src/execute.ts +83 -35
- package/src/index.ts +14 -1
- package/src/meta-tools.ts +246 -70
- package/src/registry.ts +91 -1
- package/src/server.ts +5 -0
- package/src/types.ts +61 -0
- package/src/ui.ts +8 -4
- package/src/version.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -44,6 +44,61 @@ export interface ToolAnnotations extends Record<string, unknown> {
|
|
|
44
44
|
openWorldHint?: boolean;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/** Inputs a connector may reduce to a non-secret admission partition key. */
|
|
48
|
+
export interface ConnectorCallAdmissionInput {
|
|
49
|
+
toolName: string;
|
|
50
|
+
args: unknown;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Exact sliding-window budget for one connector-call partition. */
|
|
54
|
+
export interface ConnectorRollingWindowBudget {
|
|
55
|
+
kind: "rolling-window";
|
|
56
|
+
/** Calls admitted during `windowMs` before another is proactively refused. */
|
|
57
|
+
maxCalls: number;
|
|
58
|
+
/** Width of the rolling window in milliseconds. */
|
|
59
|
+
windowMs: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* One connector-level downstream call-admission rule.
|
|
64
|
+
*
|
|
65
|
+
* This release accepts the plural `rules` container below but enforces exactly
|
|
66
|
+
* one rule. That keeps the public shape ready for providers whose concurrency
|
|
67
|
+
* and budget limits eventually need different partition dimensions without
|
|
68
|
+
* pretending multi-rule admission is already atomic.
|
|
69
|
+
*/
|
|
70
|
+
export interface ConnectorCallAdmissionRule {
|
|
71
|
+
/** Maximum simultaneous Connector.callTool attempts in one partition. */
|
|
72
|
+
maxConcurrency?: number;
|
|
73
|
+
/** Callers allowed to wait behind the concurrency bound. Default 32. */
|
|
74
|
+
maxQueueSize?: number;
|
|
75
|
+
/** Maximum concurrency-queue wait in milliseconds. Default 5,000. */
|
|
76
|
+
queueTimeoutMs?: number;
|
|
77
|
+
/** Retry hint for concurrency overloads. Default 1,000. */
|
|
78
|
+
retryAfterMs?: number;
|
|
79
|
+
/** Optional exact rolling-window call-start budget. */
|
|
80
|
+
budget?: ConnectorRollingWindowBudget;
|
|
81
|
+
/**
|
|
82
|
+
* Derive a bounded, non-secret partition key from the tool call. Omit for
|
|
83
|
+
* one connector-wide partition. Connecta retains the returned key only; it
|
|
84
|
+
* never copies arguments into limiter state.
|
|
85
|
+
*/
|
|
86
|
+
partitionKey?(
|
|
87
|
+
input: Readonly<ConnectorCallAdmissionInput>,
|
|
88
|
+
): string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Optional downstream call-admission policy declared by one connector. */
|
|
92
|
+
export interface ConnectorCallAdmissionPolicy {
|
|
93
|
+
/**
|
|
94
|
+
* Plural-ready policy container. Exactly one rule is supported in this
|
|
95
|
+
* release; empty or multi-rule policies fail construction.
|
|
96
|
+
*/
|
|
97
|
+
rules: readonly ConnectorCallAdmissionRule[];
|
|
98
|
+
/** Maximum simultaneously retained partition states. Default 1,024. */
|
|
99
|
+
maxPartitions?: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
47
102
|
export type ConnectorCredentialValues = Record<string, string>;
|
|
48
103
|
|
|
49
104
|
/** Read-only access to the credentials assigned to one connector. */
|
|
@@ -145,6 +200,12 @@ export interface Connector {
|
|
|
145
200
|
* the connector inherits the deployment-wide cap.
|
|
146
201
|
*/
|
|
147
202
|
maxResultBytes?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Optional per-runtime admission policy for downstream tool calls. It covers
|
|
205
|
+
* call_tool, every batch_call child, and execute_code host calls, but not
|
|
206
|
+
* catalog/status/auth operations.
|
|
207
|
+
*/
|
|
208
|
+
callAdmission?: ConnectorCallAdmissionPolicy;
|
|
148
209
|
/**
|
|
149
210
|
* Optional agent-facing usage guide (markdown) for this connector — preferred
|
|
150
211
|
* tools, address quirks, pagination conventions, rate-limit etiquette, good
|
package/src/ui.ts
CHANGED
|
@@ -1064,7 +1064,8 @@ ${clerkScript}
|
|
|
1064
1064
|
.activity-address { font-family: var(--mono); font-size: .78rem; overflow-wrap: anywhere; }
|
|
1065
1065
|
.activity-outcome { font-size: .9em; }
|
|
1066
1066
|
.activity-item.error .activity-outcome,
|
|
1067
|
-
.activity-item.timeout .activity-outcome
|
|
1067
|
+
.activity-item.timeout .activity-outcome,
|
|
1068
|
+
.activity-item.cancelled .activity-outcome { text-decoration: underline; }
|
|
1068
1069
|
.activity-empty { border-top: 1px solid var(--rule); padding: .75rem 0; }
|
|
1069
1070
|
.activity-more { margin-top: .75rem; }
|
|
1070
1071
|
.unavailable {
|
|
@@ -1498,9 +1499,12 @@ function renderActivity() {
|
|
|
1498
1499
|
}
|
|
1499
1500
|
for (const event of visible) {
|
|
1500
1501
|
const item = document.createElement("article");
|
|
1501
|
-
const outcomeClass = [
|
|
1502
|
-
|
|
1503
|
-
|
|
1502
|
+
const outcomeClass = [
|
|
1503
|
+
"success",
|
|
1504
|
+
"error",
|
|
1505
|
+
"timeout",
|
|
1506
|
+
"cancelled",
|
|
1507
|
+
].includes(event.outcome) ? event.outcome : "error";
|
|
1504
1508
|
item.className = "activity-item " + outcomeClass;
|
|
1505
1509
|
const retryCopy = event.attempts > 1
|
|
1506
1510
|
? " · " + esc(event.attempts) + " attempts"
|
package/src/version.ts
CHANGED