apps 0.0.1-beta.16 → 0.0.1-beta.18
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/framework-reference.json +1 -1
- package/js/{chunk-RFVIONFX.js → chunk-4EMWIFFJ.js} +1 -1
- package/js/{chunk-5T57N25Q.js → chunk-4QQ62BVS.js} +22 -0
- package/js/{chunk-QAXLPXKL.js → chunk-7H44SOSX.js} +4 -4
- package/js/{chunk-CIUZ3HSV.js → chunk-F2IASQK2.js} +3 -3
- package/js/{chunk-L2QHGLWF.js → chunk-HQY4UTYX.js} +2 -2
- package/js/{chunk-S2HMUOAV.js → chunk-MAF4BRQF.js} +2 -2
- package/js/{chunk-TEFD5OBS.js → chunk-NMKHTJOQ.js} +2 -2
- package/js/{chunk-CL3O2NIN.js → chunk-VXWY44LE.js} +91 -7
- package/js/{chunk-TXFDBLWA.js → chunk-XNCYIB4D.js} +3 -3
- package/js/{chunk-ZBGV4RN4.js → chunk-ZKISLYWM.js} +22 -9
- package/js/client.js +1 -1
- package/js/contracts.js +5 -1
- package/js/effect.js +6 -6
- package/js/graphql.js +8 -8
- package/js/host.js +6 -6
- package/js/index.js +32 -7
- package/js/mcp/effect.js +8 -8
- package/js/mcp/stdio.js +8 -8
- package/js/mcp.js +10 -10
- package/js/openapi.js +5 -5
- package/js/skills.js +2 -2
- package/js/ui/serving.js +98 -1
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/host.d.ts +5 -4
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/7.d.ts +1784 -0
- package/types/apps/src/contracts/provider.d.ts +15 -0
- package/types/apps/src/contracts/ui.d.ts +18 -0
- package/types/apps/src/implementation/elicitation.d.ts +1 -1
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
- package/types/apps/src/implementation/provider.d.ts +11 -2
- package/types/apps/src/implementation/schema.d.ts +39 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-serving.d.ts +6 -2
- package/types/apps/src/index.d.ts +6 -4
|
@@ -1145,6 +1145,25 @@ function object(fields) {
|
|
|
1145
1145
|
) : Schema_exports.Struct(Object.fromEntries(entries));
|
|
1146
1146
|
return { ...wrap(decoder, false), fields: Object.freeze({ ...fields }) };
|
|
1147
1147
|
}
|
|
1148
|
+
var Exposure = /* @__PURE__ */ Symbol("apps.FieldExposure");
|
|
1149
|
+
var exposureOf = (schema) => Exposure in schema && (schema[Exposure] === "plain" || schema[Exposure] === "raw") ? schema[Exposure] : void 0;
|
|
1150
|
+
var expose = (schema, exposure) => (
|
|
1151
|
+
// SAFETY: the copy keeps every member of S, and `optional` and `default` keep the marking.
|
|
1152
|
+
{
|
|
1153
|
+
...schema,
|
|
1154
|
+
[Exposure]: exposure,
|
|
1155
|
+
optional: () => expose(schema.optional(), exposure),
|
|
1156
|
+
default: (value) => expose(schema.default(value), exposure)
|
|
1157
|
+
}
|
|
1158
|
+
);
|
|
1159
|
+
var plain = (schema) => expose(schema, "plain");
|
|
1160
|
+
var raw = (schema) => expose(schema, "raw");
|
|
1161
|
+
var fieldExposure = (fields) => Object.fromEntries(
|
|
1162
|
+
Object.entries(fields).flatMap(([name, field]) => {
|
|
1163
|
+
const exposure = exposureOf(field);
|
|
1164
|
+
return exposure === void 0 ? [] : [[name, exposure]];
|
|
1165
|
+
})
|
|
1166
|
+
);
|
|
1148
1167
|
var ImportedJsonSchema = /* @__PURE__ */ Symbol("apps.JsonSchemaDocument");
|
|
1149
1168
|
var importedJsonSchema = (decoder) => ImportedJsonSchema in decoder ? decoder[ImportedJsonSchema] : void 0;
|
|
1150
1169
|
var withJsonSchemaDocument = (decoder, document) => Object.assign(decoder, { [ImportedJsonSchema]: document });
|
|
@@ -1412,6 +1431,9 @@ export {
|
|
|
1412
1431
|
literal,
|
|
1413
1432
|
array,
|
|
1414
1433
|
object,
|
|
1434
|
+
plain,
|
|
1435
|
+
raw,
|
|
1436
|
+
fieldExposure,
|
|
1415
1437
|
importedJsonSchema,
|
|
1416
1438
|
once,
|
|
1417
1439
|
withLazyJsonSchemaDocument,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
prepareElicitation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZKISLYWM.js";
|
|
4
4
|
import {
|
|
5
5
|
fromPromise
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
7
7
|
import {
|
|
8
8
|
ElicitationFailed,
|
|
9
9
|
McpError,
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
defaultElicitationLimits,
|
|
16
16
|
defaultMcpClientLimits,
|
|
17
17
|
mcpSdkTimerCeilingMs
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VXWY44LE.js";
|
|
19
19
|
import {
|
|
20
20
|
compileJsonSchemaDecoder,
|
|
21
21
|
jsonSchemaDecoder
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4QQ62BVS.js";
|
|
23
23
|
import {
|
|
24
24
|
JsonObject
|
|
25
25
|
} from "./chunk-27F7W2LG.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
joinPath,
|
|
6
6
|
mergeMeta
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
8
8
|
import {
|
|
9
9
|
parseProviderError
|
|
10
10
|
} from "./chunk-MKWZPDR6.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
HostedToolSummary,
|
|
18
18
|
McpError,
|
|
19
19
|
maxFailureMessageLength
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VXWY44LE.js";
|
|
21
21
|
import {
|
|
22
22
|
AppDatabaseError
|
|
23
23
|
} from "./chunk-N7YDVXYJ.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-JU7VHODU.js";
|
|
28
28
|
import {
|
|
29
29
|
jsonSchemaDocument
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4QQ62BVS.js";
|
|
31
31
|
import {
|
|
32
32
|
AppStorageError,
|
|
33
33
|
AppStorageUnavailable
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fixedRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F2IASQK2.js";
|
|
4
4
|
import {
|
|
5
5
|
nativeOperation,
|
|
6
6
|
operationDeclaration,
|
|
7
7
|
routerDeclaration
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
9
9
|
|
|
10
10
|
// src/implementation/protocol-operations.ts
|
|
11
11
|
var protocolOperations = (operations, kinds = {}) => {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
adaptMcpTools,
|
|
3
3
|
mcpClient,
|
|
4
4
|
mcpJsonSchemaValidator
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7H44SOSX.js";
|
|
6
6
|
import {
|
|
7
7
|
accountProviderError,
|
|
8
8
|
httpProviderError
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
McpError,
|
|
12
12
|
McpToolsOptions,
|
|
13
13
|
defaultMcpClientLimits
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VXWY44LE.js";
|
|
15
15
|
import {
|
|
16
16
|
ProviderError
|
|
17
17
|
} from "./chunk-R3EV5FTO.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
RouterKey,
|
|
4
4
|
RouterMeta,
|
|
5
5
|
reservedRouterKeys
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VXWY44LE.js";
|
|
7
7
|
import {
|
|
8
8
|
decoderOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4QQ62BVS.js";
|
|
10
10
|
import {
|
|
11
11
|
Effect_exports,
|
|
12
12
|
Schema_exports
|
|
@@ -1954,7 +1954,7 @@ var ManyAccounts = class extends Data_exports.TaggedClass("many") {
|
|
|
1954
1954
|
};
|
|
1955
1955
|
|
|
1956
1956
|
// src/contracts/protocol-version.ts
|
|
1957
|
-
var frameworkProtocol =
|
|
1957
|
+
var frameworkProtocol = 7;
|
|
1958
1958
|
|
|
1959
1959
|
// src/contracts/protocols/oauth.ts
|
|
1960
1960
|
var OAuthClientAuth2 = Schema_exports.Literals([
|
|
@@ -2688,6 +2688,88 @@ var protocol6 = {
|
|
|
2688
2688
|
}
|
|
2689
2689
|
};
|
|
2690
2690
|
|
|
2691
|
+
// src/contracts/protocols/7.ts
|
|
2692
|
+
var CredentialHost = Schema_exports.String.check(
|
|
2693
|
+
Schema_exports.isPattern(
|
|
2694
|
+
/^(\*\.)?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*(?::[0-9]{1,5})?$/
|
|
2695
|
+
)
|
|
2696
|
+
);
|
|
2697
|
+
var exposure = {
|
|
2698
|
+
/** Not secret: app code reads the real value and forms show it. */
|
|
2699
|
+
plain: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
2700
|
+
/** Secret, but app code reads the real value, for signing and similar uses. */
|
|
2701
|
+
raw: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString))
|
|
2702
|
+
};
|
|
2703
|
+
var DeclaredAuthMethod3 = Schema_exports.Union([
|
|
2704
|
+
Schema_exports.Struct({
|
|
2705
|
+
type: Schema_exports.Literal("secrets"),
|
|
2706
|
+
label: Schema_exports.String,
|
|
2707
|
+
fields: JsonObject2,
|
|
2708
|
+
...exposure
|
|
2709
|
+
}),
|
|
2710
|
+
Schema_exports.Struct({
|
|
2711
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2712
|
+
...OAuth2Config.members[0].fields,
|
|
2713
|
+
response: JsonObject2,
|
|
2714
|
+
...exposure
|
|
2715
|
+
}),
|
|
2716
|
+
Schema_exports.Struct({
|
|
2717
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2718
|
+
...OAuth2Config.members[1].fields,
|
|
2719
|
+
response: JsonObject2,
|
|
2720
|
+
...exposure
|
|
2721
|
+
}),
|
|
2722
|
+
Schema_exports.Struct({
|
|
2723
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2724
|
+
...OAuth2Config.members[2].fields,
|
|
2725
|
+
response: JsonObject2,
|
|
2726
|
+
...exposure
|
|
2727
|
+
}),
|
|
2728
|
+
Schema_exports.Struct({
|
|
2729
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2730
|
+
...OAuth2Config.members[3].fields,
|
|
2731
|
+
response: JsonObject2,
|
|
2732
|
+
...exposure
|
|
2733
|
+
})
|
|
2734
|
+
]);
|
|
2735
|
+
var DeclaredProvider3 = Schema_exports.Struct({
|
|
2736
|
+
name: Schema_exports.NonEmptyString,
|
|
2737
|
+
auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod3),
|
|
2738
|
+
hosts: Schema_exports.optionalKey(Schema_exports.Array(CredentialHost))
|
|
2739
|
+
});
|
|
2740
|
+
var DeclaredRequirements4 = Schema_exports.Struct({
|
|
2741
|
+
...DeclaredRequirements3.fields,
|
|
2742
|
+
accounts: Schema_exports.Record(
|
|
2743
|
+
Schema_exports.NonEmptyString,
|
|
2744
|
+
Schema_exports.Struct({
|
|
2745
|
+
definition: DeclaredProvider3,
|
|
2746
|
+
cardinality: Schema_exports.Literals(["one", "many"]),
|
|
2747
|
+
health: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2748
|
+
})
|
|
2749
|
+
)
|
|
2750
|
+
});
|
|
2751
|
+
var ResolvedAccount3 = Schema_exports.Struct({
|
|
2752
|
+
...ResolvedAccount2.fields,
|
|
2753
|
+
provider: DeclaredProvider3
|
|
2754
|
+
});
|
|
2755
|
+
var ResolvedAccounts3 = Schema_exports.Record(
|
|
2756
|
+
Schema_exports.NonEmptyString,
|
|
2757
|
+
Schema_exports.Union([ResolvedAccount3, Schema_exports.Array(ResolvedAccount3)])
|
|
2758
|
+
);
|
|
2759
|
+
var HostInvocation5 = Schema_exports.Struct({
|
|
2760
|
+
...HostInvocation4.fields,
|
|
2761
|
+
accounts: ResolvedAccounts3
|
|
2762
|
+
});
|
|
2763
|
+
var protocol7 = {
|
|
2764
|
+
version: 7,
|
|
2765
|
+
schemas: {
|
|
2766
|
+
...protocol6.schemas,
|
|
2767
|
+
requirements: DeclaredRequirements4,
|
|
2768
|
+
accounts: ResolvedAccounts3,
|
|
2769
|
+
invocation: HostInvocation5
|
|
2770
|
+
}
|
|
2771
|
+
};
|
|
2772
|
+
|
|
2691
2773
|
// src/contracts/host.ts
|
|
2692
2774
|
var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
|
|
2693
2775
|
var skillCatalog = (response) => Schema_exports.is(SkillSources2)(response) ? response : { skills: response };
|
|
@@ -2857,13 +2939,15 @@ export {
|
|
|
2857
2939
|
AccountCheckCommand,
|
|
2858
2940
|
HostRequest3 as HostRequest,
|
|
2859
2941
|
protocol5,
|
|
2860
|
-
DeclaredAuthMethod2 as DeclaredAuthMethod,
|
|
2861
|
-
DeclaredProvider2 as DeclaredProvider,
|
|
2862
|
-
DeclaredRequirements3 as DeclaredRequirements,
|
|
2863
|
-
ResolvedAccount2 as ResolvedAccount,
|
|
2864
|
-
ResolvedAccounts2 as ResolvedAccounts,
|
|
2865
|
-
HostInvocation4 as HostInvocation,
|
|
2866
2942
|
protocol6,
|
|
2943
|
+
CredentialHost,
|
|
2944
|
+
DeclaredAuthMethod3 as DeclaredAuthMethod,
|
|
2945
|
+
DeclaredProvider3 as DeclaredProvider,
|
|
2946
|
+
DeclaredRequirements4 as DeclaredRequirements,
|
|
2947
|
+
ResolvedAccount3 as ResolvedAccount,
|
|
2948
|
+
ResolvedAccounts3 as ResolvedAccounts,
|
|
2949
|
+
HostInvocation5 as HostInvocation,
|
|
2950
|
+
protocol7,
|
|
2867
2951
|
skillsCommand,
|
|
2868
2952
|
skillCatalog,
|
|
2869
2953
|
inspectCommand,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
fromPromise,
|
|
7
7
|
nativeOperation,
|
|
8
8
|
nativeRouter
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
10
10
|
import {
|
|
11
11
|
ScheduleTiming
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VXWY44LE.js";
|
|
13
13
|
import {
|
|
14
14
|
DatabaseSchema
|
|
15
15
|
} from "./chunk-N7YDVXYJ.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
decoderOf,
|
|
18
18
|
isSchema,
|
|
19
19
|
storageFieldOf
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4QQ62BVS.js";
|
|
21
21
|
import {
|
|
22
22
|
AppStorageUnavailable
|
|
23
23
|
} from "./chunk-PZB6T6KU.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
failureDetail,
|
|
9
9
|
readCatalog,
|
|
10
10
|
routerSkills
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-F2IASQK2.js";
|
|
12
12
|
import {
|
|
13
13
|
folderSkillsEffect
|
|
14
14
|
} from "./chunk-IPI4MFSN.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isApp,
|
|
19
19
|
toEffectApp,
|
|
20
20
|
unavailableStorage
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XNCYIB4D.js";
|
|
22
22
|
import {
|
|
23
23
|
parseDatabaseSchema
|
|
24
24
|
} from "./chunk-ZQINWV4W.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
locate,
|
|
29
29
|
nativeOperation,
|
|
30
30
|
toPromise
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
32
32
|
import {
|
|
33
33
|
accountProviderError,
|
|
34
34
|
httpProviderError,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
defaultWebhookTransportLimits,
|
|
82
82
|
maxInputProblems,
|
|
83
83
|
workflowDurationMillis
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-VXWY44LE.js";
|
|
85
85
|
import {
|
|
86
86
|
CacheError
|
|
87
87
|
} from "./chunk-R3EV5FTO.js";
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
importedJsonSchema,
|
|
100
100
|
jsonSchemaDecoder,
|
|
101
101
|
jsonSchemaDocument
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-4QQ62BVS.js";
|
|
103
103
|
import {
|
|
104
104
|
JsonObject,
|
|
105
105
|
JsonValue
|
|
@@ -594,6 +594,12 @@ var declarationSafe = (work, summary) => Effect_exports.suspend(work).pipe(
|
|
|
594
594
|
(cause) => Cause_exports.hasInterrupts(cause) ? Effect_exports.interrupt : Effect_exports.fail(declarationInvalid(summary, Cause_exports.squash(cause)))
|
|
595
595
|
)
|
|
596
596
|
);
|
|
597
|
+
function declaredExposure(exposure) {
|
|
598
|
+
const named = (kind) => Object.entries(exposure ?? {}).filter(([, value]) => value === kind).map(([field]) => field).sort();
|
|
599
|
+
const plain = named("plain");
|
|
600
|
+
const raw = named("raw");
|
|
601
|
+
return { ...plain.length === 0 ? {} : { plain }, ...raw.length === 0 ? {} : { raw } };
|
|
602
|
+
}
|
|
597
603
|
function providerDeclaration(provider) {
|
|
598
604
|
return declarationSafe(
|
|
599
605
|
() => Effect_exports.gen(function* () {
|
|
@@ -604,21 +610,25 @@ function providerDeclaration(provider) {
|
|
|
604
610
|
auth.set(name, {
|
|
605
611
|
type: "secrets",
|
|
606
612
|
label: method.label,
|
|
607
|
-
fields: yield* jsonSchemaDocument(method.fields)
|
|
613
|
+
fields: yield* jsonSchemaDocument(method.fields),
|
|
614
|
+
...declaredExposure(method.exposure)
|
|
608
615
|
});
|
|
609
616
|
break;
|
|
610
617
|
case "oauth2":
|
|
611
618
|
auth.set(name, {
|
|
612
619
|
type: "oauth2",
|
|
613
620
|
...method.config,
|
|
614
|
-
response: yield* jsonSchemaDocument(method.response)
|
|
621
|
+
response: yield* jsonSchemaDocument(method.response),
|
|
622
|
+
...declaredExposure(method.exposure)
|
|
615
623
|
});
|
|
616
624
|
break;
|
|
617
625
|
}
|
|
618
626
|
}
|
|
619
627
|
return yield* Schema_exports.decodeUnknownEffect(DeclaredProvider)({
|
|
620
628
|
name: provider.name,
|
|
621
|
-
auth: Object.fromEntries(auth)
|
|
629
|
+
auth: Object.fromEntries(auth),
|
|
630
|
+
// Order and repetition carry no meaning, so neither changes the provider's identity.
|
|
631
|
+
...provider.hosts === void 0 ? {} : { hosts: [...new Set(provider.hosts)].sort() }
|
|
622
632
|
});
|
|
623
633
|
}),
|
|
624
634
|
`Account provider "${provider.name}" has an invalid declaration`
|
|
@@ -653,6 +663,9 @@ function canonical(value) {
|
|
|
653
663
|
}
|
|
654
664
|
return JSON.stringify(value);
|
|
655
665
|
}
|
|
666
|
+
function withoutHosts({ hosts: _hosts, ...provider }) {
|
|
667
|
+
return provider;
|
|
668
|
+
}
|
|
656
669
|
function bindAccounts(slots, declarations, context) {
|
|
657
670
|
return safe2(
|
|
658
671
|
() => Effect_exports.gen(function* () {
|
|
@@ -678,7 +691,7 @@ function bindAccounts(slots, declarations, context) {
|
|
|
678
691
|
for (const account of accounts) {
|
|
679
692
|
if (ids.has(account.id)) return yield* Effect_exports.fail(new HostAccountsInvalid());
|
|
680
693
|
ids.add(account.id);
|
|
681
|
-
if (canonical(account.provider) !== canonical(requirement.definition) || !Object.hasOwn(provider.auth, account.method))
|
|
694
|
+
if (canonical(withoutHosts(account.provider)) !== canonical(withoutHosts(requirement.definition)) || !Object.hasOwn(provider.auth, account.method))
|
|
682
695
|
return yield* Effect_exports.fail(new HostAccountsInvalid());
|
|
683
696
|
const method = provider.auth[account.method];
|
|
684
697
|
if (method === void 0) return yield* Effect_exports.fail(new HostAccountsInvalid());
|
package/js/client.js
CHANGED
package/js/contracts.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ApprovalElicitation,
|
|
7
7
|
ApprovalResponse,
|
|
8
8
|
CalendarSchedule,
|
|
9
|
+
CredentialHost,
|
|
9
10
|
DeclaredAuthMethod,
|
|
10
11
|
DeclaredProvider,
|
|
11
12
|
DeclaredRequirements,
|
|
@@ -108,11 +109,12 @@ import {
|
|
|
108
109
|
protocol4,
|
|
109
110
|
protocol5,
|
|
110
111
|
protocol6,
|
|
112
|
+
protocol7,
|
|
111
113
|
selectTools,
|
|
112
114
|
skillCatalog,
|
|
113
115
|
skillsCommand,
|
|
114
116
|
workflowDurationMillis
|
|
115
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-VXWY44LE.js";
|
|
116
118
|
import {
|
|
117
119
|
DatabaseFieldReserved,
|
|
118
120
|
DatabaseLimitExceeded
|
|
@@ -159,6 +161,7 @@ export {
|
|
|
159
161
|
ApprovalElicitation,
|
|
160
162
|
ApprovalResponse,
|
|
161
163
|
CalendarSchedule,
|
|
164
|
+
CredentialHost,
|
|
162
165
|
DatabaseFieldReserved,
|
|
163
166
|
DatabaseLimitExceeded,
|
|
164
167
|
DeclaredAuthMethod,
|
|
@@ -271,6 +274,7 @@ export {
|
|
|
271
274
|
protocol4,
|
|
272
275
|
protocol5,
|
|
273
276
|
protocol6,
|
|
277
|
+
protocol7,
|
|
274
278
|
selectTools,
|
|
275
279
|
skillCatalog,
|
|
276
280
|
skillFormatLimits,
|
package/js/effect.js
CHANGED
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
ApprovalDecision,
|
|
4
4
|
createAppHandler,
|
|
5
5
|
prepareElicitation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZKISLYWM.js";
|
|
7
7
|
import "./chunk-NKLWZJLE.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-F2IASQK2.js";
|
|
9
9
|
import "./chunk-IPI4MFSN.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-XNCYIB4D.js";
|
|
11
11
|
import "./chunk-ZQINWV4W.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-NMKHTJOQ.js";
|
|
13
13
|
import "./chunk-MKWZPDR6.js";
|
|
14
14
|
import {
|
|
15
15
|
ToolAnnotations
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VXWY44LE.js";
|
|
17
17
|
import "./chunk-N7YDVXYJ.js";
|
|
18
18
|
import "./chunk-R3EV5FTO.js";
|
|
19
19
|
import "./chunk-JU7VHODU.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
decoderOf,
|
|
26
26
|
jsonSchemaDecoder,
|
|
27
27
|
wrap
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4QQ62BVS.js";
|
|
29
29
|
import "./chunk-PZB6T6KU.js";
|
|
30
30
|
import {
|
|
31
31
|
HttpUrl,
|
package/js/graphql.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4EMWIFFJ.js";
|
|
4
4
|
import {
|
|
5
5
|
protocolOperations
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HQY4UTYX.js";
|
|
7
7
|
import "./chunk-BCSNKUAC.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-ZKISLYWM.js";
|
|
9
9
|
import {
|
|
10
10
|
cacheKey
|
|
11
11
|
} from "./chunk-NKLWZJLE.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-F2IASQK2.js";
|
|
13
13
|
import "./chunk-IPI4MFSN.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-XNCYIB4D.js";
|
|
15
15
|
import "./chunk-ZQINWV4W.js";
|
|
16
16
|
import {
|
|
17
17
|
nativeOperation,
|
|
18
18
|
routerDeclaration
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
20
20
|
import {
|
|
21
21
|
accountProviderError,
|
|
22
22
|
graphqlProviderError,
|
|
23
23
|
httpProviderError
|
|
24
24
|
} from "./chunk-MKWZPDR6.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-VXWY44LE.js";
|
|
26
26
|
import "./chunk-N7YDVXYJ.js";
|
|
27
27
|
import {
|
|
28
28
|
ProviderError
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-UK573G7W.js";
|
|
39
39
|
import {
|
|
40
40
|
jsonSchemaDecoder
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-4QQ62BVS.js";
|
|
42
42
|
import "./chunk-PZB6T6KU.js";
|
|
43
43
|
import {
|
|
44
44
|
AccountId,
|
package/js/host.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAppHandler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZKISLYWM.js";
|
|
4
4
|
import "./chunk-NKLWZJLE.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-F2IASQK2.js";
|
|
6
6
|
import "./chunk-IPI4MFSN.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-XNCYIB4D.js";
|
|
8
8
|
import "./chunk-ZQINWV4W.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NMKHTJOQ.js";
|
|
10
10
|
import "./chunk-MKWZPDR6.js";
|
|
11
11
|
import {
|
|
12
12
|
ElicitationFailed,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
WorkflowRun,
|
|
22
22
|
WorkflowRunId,
|
|
23
23
|
WorkflowRunPage
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VXWY44LE.js";
|
|
25
25
|
import "./chunk-N7YDVXYJ.js";
|
|
26
26
|
import {
|
|
27
27
|
CacheCommand,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from "./chunk-ODEIDRGW.js";
|
|
36
36
|
import "./chunk-57RKNWL2.js";
|
|
37
37
|
import "./chunk-UK573G7W.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-4QQ62BVS.js";
|
|
39
39
|
import "./chunk-PZB6T6KU.js";
|
|
40
40
|
import "./chunk-27F7W2LG.js";
|
|
41
41
|
import {
|
package/js/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
defineDatabase,
|
|
6
6
|
table,
|
|
7
7
|
workflow
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XNCYIB4D.js";
|
|
9
9
|
import "./chunk-ZQINWV4W.js";
|
|
10
10
|
import {
|
|
11
11
|
dynamicRouter,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
toolAnnotations,
|
|
21
21
|
withApproval,
|
|
22
22
|
withApprovals
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
24
24
|
import {
|
|
25
25
|
accountProviderError
|
|
26
26
|
} from "./chunk-MKWZPDR6.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
ScheduleTiming,
|
|
39
39
|
SecretsMethod,
|
|
40
40
|
WorkflowFailure
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-VXWY44LE.js";
|
|
42
42
|
import "./chunk-N7YDVXYJ.js";
|
|
43
43
|
import {
|
|
44
44
|
CacheError,
|
|
@@ -49,8 +49,10 @@ import {
|
|
|
49
49
|
array,
|
|
50
50
|
boolean,
|
|
51
51
|
decoderOf,
|
|
52
|
+
fieldExposure,
|
|
52
53
|
id,
|
|
53
54
|
importedJsonSchema,
|
|
55
|
+
isSchema,
|
|
54
56
|
json,
|
|
55
57
|
jsonSchema,
|
|
56
58
|
literal,
|
|
@@ -59,12 +61,14 @@ import {
|
|
|
59
61
|
object,
|
|
60
62
|
once,
|
|
61
63
|
parse,
|
|
64
|
+
plain,
|
|
65
|
+
raw,
|
|
62
66
|
record,
|
|
63
67
|
string,
|
|
64
68
|
userId,
|
|
65
69
|
withLazyJsonSchemaDocument,
|
|
66
70
|
wrap
|
|
67
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-4QQ62BVS.js";
|
|
68
72
|
import "./chunk-PZB6T6KU.js";
|
|
69
73
|
import {
|
|
70
74
|
JsonObject,
|
|
@@ -88,7 +92,11 @@ var decodeJson = (response, schema) => Effect_exports.gen(function* () {
|
|
|
88
92
|
|
|
89
93
|
// src/implementation/provider.ts
|
|
90
94
|
var secrets = (options) => new SecretsMethod(options);
|
|
91
|
-
var oauth2 = (config, response) => parse(OAuth2Config, config).pipe(
|
|
95
|
+
var oauth2 = (config, response, exposure) => parse(OAuth2Config, config).pipe(
|
|
96
|
+
Effect_exports.map(
|
|
97
|
+
(config2) => new OAuth2Method({ config: config2, response, ...exposure === void 0 ? {} : { exposure } })
|
|
98
|
+
)
|
|
99
|
+
);
|
|
92
100
|
var defineProvider = ({
|
|
93
101
|
health,
|
|
94
102
|
...options
|
|
@@ -368,11 +376,26 @@ var cron = (calendar, operation, input) => declaration(
|
|
|
368
376
|
);
|
|
369
377
|
|
|
370
378
|
// src/index.ts
|
|
379
|
+
var isFields = (value) => typeof value === "object" && value !== null && Object.values(value).every(isSchema);
|
|
380
|
+
var accountDecoder = (schema) => (
|
|
381
|
+
// SAFETY: the brand exists only in types; secret values are strings at runtime.
|
|
382
|
+
decoderOf(schema)
|
|
383
|
+
);
|
|
384
|
+
var exposureOf = (schema) => {
|
|
385
|
+
const marked = "fields" in schema && isFields(schema.fields) ? fieldExposure(schema.fields) : {};
|
|
386
|
+
return Object.keys(marked).length === 0 ? {} : { exposure: marked };
|
|
387
|
+
};
|
|
371
388
|
var OAuth2AccessToken2 = wrap(OAuth2AccessToken, false);
|
|
372
|
-
var secrets2 = (options) => secrets({
|
|
389
|
+
var secrets2 = (options) => secrets({
|
|
390
|
+
label: options.label,
|
|
391
|
+
fields: accountDecoder(options.fields),
|
|
392
|
+
...exposureOf(options.fields)
|
|
393
|
+
});
|
|
373
394
|
function oauth22(options) {
|
|
374
395
|
const { response = OAuth2AccessToken2, ...config } = options;
|
|
375
|
-
return Effect_exports.runSync(
|
|
396
|
+
return Effect_exports.runSync(
|
|
397
|
+
oauth2(config, accountDecoder(response), exposureOf(response).exposure)
|
|
398
|
+
);
|
|
376
399
|
}
|
|
377
400
|
var decodeJson2 = (response, schema) => {
|
|
378
401
|
const native = {
|
|
@@ -418,7 +441,9 @@ export {
|
|
|
418
441
|
number,
|
|
419
442
|
oauth22 as oauth2,
|
|
420
443
|
object,
|
|
444
|
+
plain,
|
|
421
445
|
query,
|
|
446
|
+
raw,
|
|
422
447
|
record,
|
|
423
448
|
router,
|
|
424
449
|
secrets2 as secrets,
|