@executor-js/sdk 0.2.1 → 1.4.20
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/{chunk-QQK7X3DM.js → chunk-I2OEQ2GJ.js} +3 -3
- package/dist/{chunk-QQK7X3DM.js.map → chunk-I2OEQ2GJ.js.map} +1 -1
- package/dist/{chunk-NPWV4R3N.js → chunk-OIJL6F6M.js} +67 -123
- package/dist/chunk-OIJL6F6M.js.map +1 -0
- package/dist/connections.d.ts +33 -22
- package/dist/connections.d.ts.map +1 -1
- package/dist/core.js +2 -4
- package/dist/core.js.map +1 -1
- package/dist/credential-bindings.d.ts +42 -45
- package/dist/credential-bindings.d.ts.map +1 -1
- package/dist/elicitation.d.ts +11 -14
- package/dist/elicitation.d.ts.map +1 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/oauth-popup-types.d.ts +3 -0
- package/dist/oauth-popup-types.d.ts.map +1 -1
- package/dist/promise-executor.d.ts.map +1 -1
- package/dist/scope.d.ts +3 -5
- package/dist/scope.d.ts.map +1 -1
- package/dist/secrets.d.ts +9 -13
- package/dist/secrets.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/types.d.ts +6 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/usages.d.ts +3 -5
- package/dist/usages.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-NPWV4R3N.js.map +0 -1
|
@@ -67,7 +67,7 @@ var CredentialBindingId = Schema.String.pipe(Schema.brand("CredentialBindingId")
|
|
|
67
67
|
// src/connections.ts
|
|
68
68
|
import { Data, Schema as Schema2 } from "effect";
|
|
69
69
|
var ConnectionProviderState = Schema2.Record(Schema2.String, Schema2.Unknown);
|
|
70
|
-
var ConnectionRef =
|
|
70
|
+
var ConnectionRef = Schema2.Struct({
|
|
71
71
|
id: ConnectionId,
|
|
72
72
|
scopeId: ScopeId,
|
|
73
73
|
provider: Schema2.String,
|
|
@@ -82,9 +82,8 @@ var ConnectionRef = class extends Schema2.Class("ConnectionRef")({
|
|
|
82
82
|
providerState: Schema2.NullOr(ConnectionProviderState),
|
|
83
83
|
createdAt: Schema2.Date,
|
|
84
84
|
updatedAt: Schema2.Date
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
var TokenMaterial = class extends Schema2.Class("TokenMaterial")({
|
|
85
|
+
});
|
|
86
|
+
var TokenMaterial = Schema2.Struct({
|
|
88
87
|
/** Target secret id. Plugins typically derive this from the source id
|
|
89
88
|
* + a stable suffix (e.g. `${sourceId}.access_token`). */
|
|
90
89
|
secretId: SecretId,
|
|
@@ -92,11 +91,8 @@ var TokenMaterial = class extends Schema2.Class("TokenMaterial")({
|
|
|
92
91
|
* Connections UI hides connection-owned secrets. */
|
|
93
92
|
name: Schema2.String,
|
|
94
93
|
value: Schema2.String
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
var CreateConnectionInput = class extends Schema2.Class(
|
|
98
|
-
"CreateConnectionInput"
|
|
99
|
-
)({
|
|
94
|
+
});
|
|
95
|
+
var CreateConnectionInput = Schema2.Struct({
|
|
100
96
|
id: ConnectionId,
|
|
101
97
|
/** Executor scope id that will own this connection + its backing
|
|
102
98
|
* secrets. This is the sharing boundary: a user scope is personal,
|
|
@@ -110,13 +106,10 @@ var CreateConnectionInput = class extends Schema2.Class(
|
|
|
110
106
|
/** OAuth-style scope string. Distinct from the executor scope above. */
|
|
111
107
|
oauthScope: Schema2.NullOr(Schema2.String),
|
|
112
108
|
providerState: Schema2.NullOr(ConnectionProviderState)
|
|
113
|
-
})
|
|
114
|
-
};
|
|
109
|
+
});
|
|
115
110
|
var ConnectionRefreshError = class extends Data.TaggedError("ConnectionRefreshError") {
|
|
116
111
|
};
|
|
117
|
-
var UpdateConnectionTokensInput =
|
|
118
|
-
"UpdateConnectionTokensInput"
|
|
119
|
-
)({
|
|
112
|
+
var UpdateConnectionTokensInput = Schema2.Struct({
|
|
120
113
|
id: ConnectionId,
|
|
121
114
|
accessToken: Schema2.String,
|
|
122
115
|
refreshToken: Schema2.optional(Schema2.NullOr(Schema2.String)),
|
|
@@ -124,16 +117,12 @@ var UpdateConnectionTokensInput = class extends Schema2.Class(
|
|
|
124
117
|
oauthScope: Schema2.optional(Schema2.NullOr(Schema2.String)),
|
|
125
118
|
providerState: Schema2.optional(Schema2.NullOr(ConnectionProviderState)),
|
|
126
119
|
identityLabel: Schema2.optional(Schema2.NullOr(Schema2.String))
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
var RemoveConnectionInput = class extends Schema2.Class(
|
|
130
|
-
"RemoveConnectionInput"
|
|
131
|
-
)({
|
|
120
|
+
});
|
|
121
|
+
var RemoveConnectionInput = Schema2.Struct({
|
|
132
122
|
id: ConnectionId,
|
|
133
123
|
/** Scope id whose connection row and owned token secrets should be removed. */
|
|
134
124
|
targetScope: ScopeId
|
|
135
|
-
})
|
|
136
|
-
};
|
|
125
|
+
});
|
|
137
126
|
|
|
138
127
|
// src/core-schema.ts
|
|
139
128
|
var credentialBindingKinds = ["text", "secret", "connection"];
|
|
@@ -364,29 +353,19 @@ var CredentialBindingValue = Schema3.Union([
|
|
|
364
353
|
connectionId: ConnectionId
|
|
365
354
|
})
|
|
366
355
|
]);
|
|
367
|
-
var
|
|
356
|
+
var ConfiguredCredentialBinding = Schema3.Struct({
|
|
368
357
|
kind: Schema3.Literal("binding"),
|
|
369
358
|
slot: Schema3.String,
|
|
370
359
|
prefix: Schema3.optional(Schema3.String)
|
|
371
360
|
});
|
|
372
|
-
var ConfiguredCredentialBinding = class extends Schema3.Class(
|
|
373
|
-
"ConfiguredCredentialBinding"
|
|
374
|
-
)(ConfiguredCredentialBindingSchema.fields) {
|
|
375
|
-
};
|
|
376
361
|
var ConfiguredCredentialValue = Schema3.Union([Schema3.String, ConfiguredCredentialBinding]);
|
|
377
|
-
var ConfiguredCredentialValueSchema = Schema3.Union([
|
|
378
|
-
Schema3.String,
|
|
379
|
-
ConfiguredCredentialBindingSchema
|
|
380
|
-
]);
|
|
381
362
|
var ScopedSecretCredentialInput = Schema3.Struct({
|
|
382
363
|
secretId: Schema3.String,
|
|
383
364
|
prefix: Schema3.optional(Schema3.String),
|
|
384
365
|
targetScope: ScopeId,
|
|
385
366
|
secretScopeId: Schema3.optional(ScopeId)
|
|
386
367
|
});
|
|
387
|
-
var CredentialBindingRef =
|
|
388
|
-
"CredentialBindingRef"
|
|
389
|
-
)({
|
|
368
|
+
var CredentialBindingRef = Schema3.Struct({
|
|
390
369
|
id: CredentialBindingId,
|
|
391
370
|
scopeId: ScopeId,
|
|
392
371
|
pluginId: Schema3.String,
|
|
@@ -396,72 +375,51 @@ var CredentialBindingRef = class extends Schema3.Class(
|
|
|
396
375
|
value: CredentialBindingValue,
|
|
397
376
|
createdAt: Schema3.Date,
|
|
398
377
|
updatedAt: Schema3.Date
|
|
399
|
-
})
|
|
400
|
-
|
|
401
|
-
var SetCredentialBindingInput = class extends Schema3.Class(
|
|
402
|
-
"SetCredentialBindingInput"
|
|
403
|
-
)({
|
|
378
|
+
});
|
|
379
|
+
var SetCredentialBindingInput = Schema3.Struct({
|
|
404
380
|
targetScope: ScopeId,
|
|
405
381
|
pluginId: Schema3.String,
|
|
406
382
|
sourceId: Schema3.String,
|
|
407
383
|
sourceScope: ScopeId,
|
|
408
384
|
slotKey: Schema3.String,
|
|
409
385
|
value: CredentialBindingValue
|
|
410
|
-
})
|
|
411
|
-
|
|
412
|
-
var CredentialBindingSourceInput = class extends Schema3.Class(
|
|
413
|
-
"CredentialBindingSourceInput"
|
|
414
|
-
)({
|
|
386
|
+
});
|
|
387
|
+
var CredentialBindingSourceInput = Schema3.Struct({
|
|
415
388
|
pluginId: Schema3.String,
|
|
416
389
|
sourceId: Schema3.String,
|
|
417
390
|
sourceScope: ScopeId
|
|
418
|
-
})
|
|
419
|
-
|
|
420
|
-
var CredentialBindingSlotInput = class extends Schema3.Class(
|
|
421
|
-
"CredentialBindingSlotInput"
|
|
422
|
-
)({
|
|
391
|
+
});
|
|
392
|
+
var CredentialBindingSlotInput = Schema3.Struct({
|
|
423
393
|
pluginId: Schema3.String,
|
|
424
394
|
sourceId: Schema3.String,
|
|
425
395
|
sourceScope: ScopeId,
|
|
426
396
|
slotKey: Schema3.String
|
|
427
|
-
})
|
|
428
|
-
|
|
429
|
-
var RemoveCredentialBindingInput = class extends Schema3.Class(
|
|
430
|
-
"RemoveCredentialBindingInput"
|
|
431
|
-
)({
|
|
397
|
+
});
|
|
398
|
+
var RemoveCredentialBindingInput = Schema3.Struct({
|
|
432
399
|
targetScope: ScopeId,
|
|
433
400
|
pluginId: Schema3.String,
|
|
434
401
|
sourceId: Schema3.String,
|
|
435
402
|
sourceScope: ScopeId,
|
|
436
403
|
slotKey: Schema3.String
|
|
437
|
-
})
|
|
438
|
-
|
|
439
|
-
var ReplaceCredentialBindingValue = class extends Schema3.Class(
|
|
440
|
-
"ReplaceCredentialBindingValue"
|
|
441
|
-
)({
|
|
404
|
+
});
|
|
405
|
+
var ReplaceCredentialBindingValue = Schema3.Struct({
|
|
442
406
|
slotKey: Schema3.String,
|
|
443
407
|
value: CredentialBindingValue
|
|
444
|
-
})
|
|
445
|
-
|
|
446
|
-
var ReplaceCredentialBindingsInput = class extends Schema3.Class(
|
|
447
|
-
"ReplaceCredentialBindingsInput"
|
|
448
|
-
)({
|
|
408
|
+
});
|
|
409
|
+
var ReplaceCredentialBindingsInput = Schema3.Struct({
|
|
449
410
|
targetScope: ScopeId,
|
|
450
411
|
pluginId: Schema3.String,
|
|
451
412
|
sourceId: Schema3.String,
|
|
452
413
|
sourceScope: ScopeId,
|
|
453
414
|
slotPrefixes: Schema3.Array(Schema3.String),
|
|
454
415
|
bindings: Schema3.Array(ReplaceCredentialBindingValue)
|
|
455
|
-
})
|
|
456
|
-
};
|
|
416
|
+
});
|
|
457
417
|
var CredentialBindingResolutionStatus = Schema3.Literals([
|
|
458
418
|
"resolved",
|
|
459
419
|
"missing",
|
|
460
420
|
"blocked"
|
|
461
421
|
]);
|
|
462
|
-
var ResolvedCredentialSlot =
|
|
463
|
-
"ResolvedCredentialSlot"
|
|
464
|
-
)({
|
|
422
|
+
var ResolvedCredentialSlot = Schema3.Struct({
|
|
465
423
|
pluginId: Schema3.String,
|
|
466
424
|
sourceId: Schema3.String,
|
|
467
425
|
sourceScopeId: ScopeId,
|
|
@@ -469,8 +427,7 @@ var ResolvedCredentialSlot = class extends Schema3.Class(
|
|
|
469
427
|
bindingScopeId: Schema3.NullOr(ScopeId),
|
|
470
428
|
kind: Schema3.NullOr(CredentialBindingKind),
|
|
471
429
|
status: CredentialBindingResolutionStatus
|
|
472
|
-
})
|
|
473
|
-
};
|
|
430
|
+
});
|
|
474
431
|
var credentialBindingId = (input) => CredentialBindingId.make(
|
|
475
432
|
JSON.stringify([input.pluginId, input.sourceScope, input.sourceId, input.slotKey])
|
|
476
433
|
);
|
|
@@ -494,7 +451,7 @@ var credentialBindingValueFromRow = (row) => Match.value(row).pipe(
|
|
|
494
451
|
);
|
|
495
452
|
var credentialBindingRowToRef = (row) => {
|
|
496
453
|
const value = credentialBindingValueFromRow(row);
|
|
497
|
-
return
|
|
454
|
+
return CredentialBindingRef.make({
|
|
498
455
|
id: CredentialBindingId.make(row.id),
|
|
499
456
|
scopeId: ScopeId.make(row.scope_id),
|
|
500
457
|
pluginId: row.plugin_id,
|
|
@@ -509,26 +466,23 @@ var credentialBindingRowToRef = (row) => {
|
|
|
509
466
|
|
|
510
467
|
// src/elicitation.ts
|
|
511
468
|
import { Schema as Schema4 } from "effect";
|
|
512
|
-
var FormElicitation =
|
|
469
|
+
var FormElicitation = Schema4.TaggedStruct("FormElicitation", {
|
|
513
470
|
message: Schema4.String,
|
|
514
471
|
/** JSON Schema describing the fields to collect */
|
|
515
472
|
requestedSchema: Schema4.Record(Schema4.String, Schema4.Unknown)
|
|
516
|
-
})
|
|
517
|
-
|
|
518
|
-
var UrlElicitation = class extends Schema4.TaggedClass()("UrlElicitation", {
|
|
473
|
+
});
|
|
474
|
+
var UrlElicitation = Schema4.TaggedStruct("UrlElicitation", {
|
|
519
475
|
message: Schema4.String,
|
|
520
476
|
url: Schema4.String,
|
|
521
477
|
/** Unique ID so the host can correlate the callback */
|
|
522
478
|
elicitationId: Schema4.String
|
|
523
|
-
})
|
|
524
|
-
};
|
|
479
|
+
});
|
|
525
480
|
var ElicitationAction = Schema4.Literals(["accept", "decline", "cancel"]);
|
|
526
|
-
var ElicitationResponse =
|
|
481
|
+
var ElicitationResponse = Schema4.Struct({
|
|
527
482
|
action: ElicitationAction,
|
|
528
483
|
/** Present when action is "accept" — the data the user provided */
|
|
529
484
|
content: Schema4.optional(Schema4.Record(Schema4.String, Schema4.Unknown))
|
|
530
|
-
})
|
|
531
|
-
};
|
|
485
|
+
});
|
|
532
486
|
var ElicitationDeclinedError = class extends Schema4.TaggedErrorClass()(
|
|
533
487
|
"ElicitationDeclinedError",
|
|
534
488
|
{
|
|
@@ -648,7 +602,7 @@ var ConnectionInUseError = class extends Schema5.TaggedErrorClass()(
|
|
|
648
602
|
|
|
649
603
|
// src/secrets.ts
|
|
650
604
|
import { Schema as Schema6 } from "effect";
|
|
651
|
-
var SecretRef =
|
|
605
|
+
var SecretRef = Schema6.Struct({
|
|
652
606
|
id: SecretId,
|
|
653
607
|
scopeId: ScopeId,
|
|
654
608
|
/** Human-readable label (e.g. "Cloudflare API Token") */
|
|
@@ -656,9 +610,8 @@ var SecretRef = class extends Schema6.Class("SecretRef")({
|
|
|
656
610
|
/** Which provider holds the value */
|
|
657
611
|
provider: Schema6.String,
|
|
658
612
|
createdAt: Schema6.Date
|
|
659
|
-
})
|
|
660
|
-
|
|
661
|
-
var SetSecretInput = class extends Schema6.Class("SetSecretInput")({
|
|
613
|
+
});
|
|
614
|
+
var SetSecretInput = Schema6.Struct({
|
|
662
615
|
id: SecretId,
|
|
663
616
|
/** Scope id to own this secret. Must be one of the executor's
|
|
664
617
|
* configured scopes. */
|
|
@@ -670,15 +623,13 @@ var SetSecretInput = class extends Schema6.Class("SetSecretInput")({
|
|
|
670
623
|
/** Optional provider routing. If unset the executor picks the first
|
|
671
624
|
* writable provider in registration order. */
|
|
672
625
|
provider: Schema6.optional(Schema6.String)
|
|
673
|
-
})
|
|
674
|
-
|
|
675
|
-
var RemoveSecretInput = class extends Schema6.Class("RemoveSecretInput")({
|
|
626
|
+
});
|
|
627
|
+
var RemoveSecretInput = Schema6.Struct({
|
|
676
628
|
id: SecretId,
|
|
677
629
|
/** Scope id whose secret row/value should be removed. Must be one of
|
|
678
630
|
* the executor's configured scopes. */
|
|
679
631
|
targetScope: ScopeId
|
|
680
|
-
})
|
|
681
|
-
};
|
|
632
|
+
});
|
|
682
633
|
|
|
683
634
|
// src/oauth.ts
|
|
684
635
|
import { Effect as Effect6, Schema as Schema7 } from "effect";
|
|
@@ -1884,12 +1835,12 @@ var makeOAuth2Service = (deps) => {
|
|
|
1884
1835
|
scope: tokens.scope ?? null
|
|
1885
1836
|
};
|
|
1886
1837
|
yield* deps.connectionsCreate(
|
|
1887
|
-
|
|
1838
|
+
CreateConnectionInput.make({
|
|
1888
1839
|
id: ConnectionId.make(input.connectionId),
|
|
1889
1840
|
scope: ScopeId.make(input.tokenScope),
|
|
1890
1841
|
provider: OAUTH2_PROVIDER_KEY,
|
|
1891
1842
|
identityLabel: input.identityLabel ?? safeHostname(input.endpoint),
|
|
1892
|
-
accessToken:
|
|
1843
|
+
accessToken: TokenMaterial.make({
|
|
1893
1844
|
secretId: SecretId.make(oauthSecretId(input.connectionId, "access-token")),
|
|
1894
1845
|
name: "OAuth Access Token",
|
|
1895
1846
|
value: tokens.access_token
|
|
@@ -2013,7 +1964,7 @@ var makeOAuth2Service = (deps) => {
|
|
|
2013
1964
|
}
|
|
2014
1965
|
const secretId = oauthSecretId(connectionId, "client-secret");
|
|
2015
1966
|
return deps.secretsSet(
|
|
2016
|
-
|
|
1967
|
+
SetSecretInput.make({
|
|
2017
1968
|
id: SecretId.make(secretId),
|
|
2018
1969
|
scope: ScopeId.make(tokenScope),
|
|
2019
1970
|
name: "OAuth Client Secret",
|
|
@@ -2063,19 +2014,19 @@ var makeOAuth2Service = (deps) => {
|
|
|
2063
2014
|
scope: exchangeResult.tokens.scope ?? null
|
|
2064
2015
|
};
|
|
2065
2016
|
yield* deps.connectionsCreate(
|
|
2066
|
-
|
|
2017
|
+
CreateConnectionInput.make({
|
|
2067
2018
|
id: ConnectionId.make(connectionId),
|
|
2068
2019
|
scope: ScopeId.make(tokenScope),
|
|
2069
2020
|
provider: OAUTH2_PROVIDER_KEY,
|
|
2070
2021
|
identityLabel: safeHostname(
|
|
2071
2022
|
payload.identityLabel ?? exchangeResult.endpointForDisplay ?? endpoint
|
|
2072
2023
|
),
|
|
2073
|
-
accessToken:
|
|
2024
|
+
accessToken: TokenMaterial.make({
|
|
2074
2025
|
secretId: SecretId.make(oauthSecretId(connectionId, "access-token")),
|
|
2075
2026
|
name: "OAuth Access Token",
|
|
2076
2027
|
value: exchangeResult.tokens.access_token
|
|
2077
2028
|
}),
|
|
2078
|
-
refreshToken: exchangeResult.tokens.refresh_token ?
|
|
2029
|
+
refreshToken: exchangeResult.tokens.refresh_token ? TokenMaterial.make({
|
|
2079
2030
|
secretId: SecretId.make(oauthSecretId(connectionId, "refresh-token")),
|
|
2080
2031
|
name: "OAuth Refresh Token",
|
|
2081
2032
|
value: exchangeResult.tokens.refresh_token
|
|
@@ -2497,19 +2448,18 @@ var ToolPolicyActionSchema = Schema10.Literals(["approve", "require_approval", "
|
|
|
2497
2448
|
|
|
2498
2449
|
// src/usages.ts
|
|
2499
2450
|
import { Schema as Schema11 } from "effect";
|
|
2500
|
-
var Usage =
|
|
2451
|
+
var Usage = Schema11.Struct({
|
|
2501
2452
|
pluginId: Schema11.String,
|
|
2502
2453
|
scopeId: ScopeId,
|
|
2503
2454
|
ownerKind: Schema11.String,
|
|
2504
2455
|
ownerId: Schema11.String,
|
|
2505
2456
|
ownerName: Schema11.NullOr(Schema11.String),
|
|
2506
2457
|
slot: Schema11.String
|
|
2507
|
-
})
|
|
2508
|
-
};
|
|
2458
|
+
});
|
|
2509
2459
|
|
|
2510
2460
|
// src/types.ts
|
|
2511
2461
|
import { Schema as Schema12 } from "effect";
|
|
2512
|
-
var ToolSchema =
|
|
2462
|
+
var ToolSchema = Schema12.Struct({
|
|
2513
2463
|
id: ToolId,
|
|
2514
2464
|
name: Schema12.optional(Schema12.String),
|
|
2515
2465
|
description: Schema12.optional(Schema12.String),
|
|
@@ -2518,11 +2468,8 @@ var ToolSchema = class extends Schema12.Class("ToolSchema")({
|
|
|
2518
2468
|
inputTypeScript: Schema12.optional(Schema12.String),
|
|
2519
2469
|
outputTypeScript: Schema12.optional(Schema12.String),
|
|
2520
2470
|
typeScriptDefinitions: Schema12.optional(Schema12.Record(Schema12.String, Schema12.String))
|
|
2521
|
-
})
|
|
2522
|
-
|
|
2523
|
-
var SourceDetectionResult = class extends Schema12.Class(
|
|
2524
|
-
"SourceDetectionResult"
|
|
2525
|
-
)({
|
|
2471
|
+
});
|
|
2472
|
+
var SourceDetectionResult = Schema12.Struct({
|
|
2526
2473
|
/** Plugin id that recognized the URL (e.g. "openapi", "graphql"). */
|
|
2527
2474
|
kind: Schema12.String,
|
|
2528
2475
|
/** Confidence tier — UI uses this to pick a winner when multiple
|
|
@@ -2536,8 +2483,7 @@ var SourceDetectionResult = class extends Schema12.Class(
|
|
|
2536
2483
|
/** Namespace suggestion — the plugin's recommendation for the source
|
|
2537
2484
|
* id. UI may override. */
|
|
2538
2485
|
namespace: Schema12.String
|
|
2539
|
-
})
|
|
2540
|
-
};
|
|
2486
|
+
});
|
|
2541
2487
|
|
|
2542
2488
|
// src/schema-types.ts
|
|
2543
2489
|
import { Match as Match4, Option as Option3 } from "effect";
|
|
@@ -3060,7 +3006,7 @@ var scopeAdapter = (inner, ctx, schema) => {
|
|
|
3060
3006
|
// src/executor.ts
|
|
3061
3007
|
var MAX_ANNOTATION_GROUPS = 64;
|
|
3062
3008
|
var MAX_APPROVAL_ARGUMENT_PREVIEW_CHARS = 4e3;
|
|
3063
|
-
var acceptAllHandler = () => Effect12.succeed(
|
|
3009
|
+
var acceptAllHandler = () => Effect12.succeed(ElicitationResponse.make({ action: "accept" }));
|
|
3064
3010
|
var resolveElicitationHandler = (onElicitation) => onElicitation === "accept-all" ? acceptAllHandler : onElicitation;
|
|
3065
3011
|
var collectSchemas = (plugins) => {
|
|
3066
3012
|
const merged = { ...coreSchema };
|
|
@@ -3505,7 +3451,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
3505
3451
|
},
|
|
3506
3452
|
forceAllowId: true
|
|
3507
3453
|
});
|
|
3508
|
-
return
|
|
3454
|
+
return SecretRef.make({
|
|
3509
3455
|
id: input.id,
|
|
3510
3456
|
scopeId: input.scope,
|
|
3511
3457
|
name: input.name,
|
|
@@ -3658,7 +3604,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
3658
3604
|
}
|
|
3659
3605
|
byId.set(
|
|
3660
3606
|
row.id,
|
|
3661
|
-
|
|
3607
|
+
SecretRef.make({
|
|
3662
3608
|
id: SecretId.make(row.id),
|
|
3663
3609
|
scopeId: ScopeId.make(incomingScope),
|
|
3664
3610
|
name: row.name,
|
|
@@ -3684,7 +3630,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
3684
3630
|
if (connectionOwnedIds.has(entry.id)) continue;
|
|
3685
3631
|
byId.set(
|
|
3686
3632
|
entry.id,
|
|
3687
|
-
|
|
3633
|
+
SecretRef.make({
|
|
3688
3634
|
id: SecretId.make(entry.id),
|
|
3689
3635
|
scopeId: ScopeId.make(innermostScopeId),
|
|
3690
3636
|
name: entry.name,
|
|
@@ -3707,7 +3653,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
3707
3653
|
const hasBackingValue = yield* secretRouteHasBackingValue(row);
|
|
3708
3654
|
if (!hasBackingValue) continue;
|
|
3709
3655
|
refs.push(
|
|
3710
|
-
|
|
3656
|
+
SecretRef.make({
|
|
3711
3657
|
id: SecretId.make(row.id),
|
|
3712
3658
|
scopeId: ScopeId.make(row.scope_id),
|
|
3713
3659
|
name: row.name,
|
|
@@ -3732,7 +3678,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
3732
3678
|
}));
|
|
3733
3679
|
});
|
|
3734
3680
|
const CONNECTION_REFRESH_SKEW_MS = 6e4;
|
|
3735
|
-
const rowToConnection = (row) =>
|
|
3681
|
+
const rowToConnection = (row) => ConnectionRef.make({
|
|
3736
3682
|
id: ConnectionId.make(row.id),
|
|
3737
3683
|
scopeId: ScopeId.make(row.scope_id),
|
|
3738
3684
|
provider: row.provider,
|
|
@@ -3892,7 +3838,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
3892
3838
|
},
|
|
3893
3839
|
forceAllowId: true
|
|
3894
3840
|
});
|
|
3895
|
-
return
|
|
3841
|
+
return ConnectionRef.make({
|
|
3896
3842
|
id: input.id,
|
|
3897
3843
|
scopeId: input.scope,
|
|
3898
3844
|
provider: input.provider,
|
|
@@ -4519,7 +4465,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
4519
4465
|
const rows = yield* credentialBindingRowsForSlot(input);
|
|
4520
4466
|
const row = findInnermost(rows);
|
|
4521
4467
|
if (!row) {
|
|
4522
|
-
return
|
|
4468
|
+
return ResolvedCredentialSlot.make({
|
|
4523
4469
|
pluginId: input.pluginId,
|
|
4524
4470
|
sourceId: input.sourceId,
|
|
4525
4471
|
sourceScopeId: input.sourceScope,
|
|
@@ -4529,7 +4475,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
4529
4475
|
status: "missing"
|
|
4530
4476
|
});
|
|
4531
4477
|
}
|
|
4532
|
-
return
|
|
4478
|
+
return ResolvedCredentialSlot.make({
|
|
4533
4479
|
pluginId: input.pluginId,
|
|
4534
4480
|
sourceId: input.sourceId,
|
|
4535
4481
|
sourceScopeId: input.sourceScope,
|
|
@@ -4553,7 +4499,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
4553
4499
|
const credentialBindingRowsToUsages = (rows) => Effect12.gen(function* () {
|
|
4554
4500
|
const names = yield* sourceNamesForCredentialBindings(rows);
|
|
4555
4501
|
return rows.map(
|
|
4556
|
-
(row) =>
|
|
4502
|
+
(row) => Usage.make({
|
|
4557
4503
|
pluginId: row.plugin_id,
|
|
4558
4504
|
scopeId: ScopeId.make(
|
|
4559
4505
|
row.kind === "secret" ? row.secret_scope_id ?? row.scope_id : row.scope_id
|
|
@@ -4935,7 +4881,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
4935
4881
|
}
|
|
4936
4882
|
})
|
|
4937
4883
|
);
|
|
4938
|
-
return
|
|
4884
|
+
return ToolSchema.make({
|
|
4939
4885
|
id: ToolId.make(opts.toolId),
|
|
4940
4886
|
name: opts.name,
|
|
4941
4887
|
description: opts.description,
|
|
@@ -5039,7 +4985,7 @@ var createExecutor = (config) => Effect12.gen(function* () {
|
|
|
5039
4985
|
if (!policyForcesApproval && !annotations?.requiresApproval) return;
|
|
5040
4986
|
const tid = ToolId.make(toolId);
|
|
5041
4987
|
const message = annotations?.approvalDescription ? annotations.approvalDescription : policyForcesApproval && policy ? `Approve ${toolId}? (matched policy: ${policy.pattern})` : `Approve ${toolId}?`;
|
|
5042
|
-
const request =
|
|
4988
|
+
const request = FormElicitation.make({
|
|
5043
4989
|
message: `${message}
|
|
5044
4990
|
|
|
5045
4991
|
Arguments:
|
|
@@ -5438,12 +5384,11 @@ ${approvalArgumentPreview(args)}`,
|
|
|
5438
5384
|
|
|
5439
5385
|
// src/scope.ts
|
|
5440
5386
|
import { Schema as Schema15 } from "effect";
|
|
5441
|
-
var Scope =
|
|
5387
|
+
var Scope = Schema15.Struct({
|
|
5442
5388
|
id: ScopeId,
|
|
5443
5389
|
name: Schema15.String,
|
|
5444
5390
|
createdAt: Schema15.Date
|
|
5445
|
-
})
|
|
5446
|
-
};
|
|
5391
|
+
});
|
|
5447
5392
|
|
|
5448
5393
|
export {
|
|
5449
5394
|
pluginBlobStore,
|
|
@@ -5468,7 +5413,6 @@ export {
|
|
|
5468
5413
|
CredentialBindingValue,
|
|
5469
5414
|
ConfiguredCredentialBinding,
|
|
5470
5415
|
ConfiguredCredentialValue,
|
|
5471
|
-
ConfiguredCredentialValueSchema,
|
|
5472
5416
|
ScopedSecretCredentialInput,
|
|
5473
5417
|
CredentialBindingRef,
|
|
5474
5418
|
SetCredentialBindingInput,
|
|
@@ -5560,4 +5504,4 @@ export {
|
|
|
5560
5504
|
createExecutor,
|
|
5561
5505
|
Scope
|
|
5562
5506
|
};
|
|
5563
|
-
//# sourceMappingURL=chunk-
|
|
5507
|
+
//# sourceMappingURL=chunk-OIJL6F6M.js.map
|