@apifuse/provider-sdk 2.2.0-beta.62 → 2.2.0-beta.64
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/AUTHORING.md +367 -9
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/bin/apifuse-check.ts +84 -2
- package/bin/apifuse-dev.ts +11 -31
- package/bin/apifuse-migrate-deployment.ts +200 -0
- package/bin/apifuse-pack-check.ts +11 -4
- package/bin/apifuse-pack-types.ts +187 -4
- package/bin/apifuse-record.ts +44 -32
- package/bin/apifuse-submit-check.ts +9 -5
- package/bin/apifuse-test.ts +3 -1
- package/dist/cli/commands.d.ts +1 -1
- package/dist/cli/commands.js +11 -0
- package/dist/cli/deployment-intent.d.ts +178 -0
- package/dist/cli/deployment-intent.js +277 -0
- package/dist/cli/migrate-deployment-intent.d.ts +132 -0
- package/dist/cli/migrate-deployment-intent.js +1552 -0
- package/dist/cli/migrate-provider-shape.d.ts +5 -1
- package/dist/cli/migrate-provider-shape.js +4 -2
- package/dist/cli/resolver-runtime.d.ts +21 -0
- package/dist/cli/resolver-runtime.js +31 -0
- package/dist/define.d.ts +3 -0
- package/dist/define.js +5 -0
- package/dist/dev.d.ts +3 -1
- package/dist/dev.js +6 -1
- package/dist/engine.d.ts +35 -1
- package/dist/engine.js +21 -2
- package/dist/error-resolution.d.ts +1 -0
- package/dist/error-resolution.js +54 -0
- package/dist/errors.d.ts +39 -1
- package/dist/errors.js +50 -0
- package/dist/handle-meta.d.ts +36 -1
- package/dist/handle-meta.js +16 -0
- package/dist/handle.d.ts +23 -5
- package/dist/handle.js +54 -8
- package/dist/health-scenario.d.ts +38 -0
- package/dist/i18n/error-messages.d.ts +86 -0
- package/dist/i18n/error-messages.js +192 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/keys.d.ts +12 -0
- package/dist/i18n/keys.js +76 -5
- package/dist/index.d.ts +11 -3
- package/dist/index.js +9 -1
- package/dist/lint.d.ts +15 -0
- package/dist/lint.js +469 -82
- package/dist/provider.d.ts +6 -6
- package/dist/provider.js +3 -3
- package/dist/runtime/browser-telemetry-binding.d.ts +5 -0
- package/dist/runtime/browser-telemetry-binding.js +83 -0
- package/dist/runtime/browser-telemetry.d.ts +76 -0
- package/dist/runtime/browser-telemetry.js +165 -0
- package/dist/runtime/browser.d.ts +3 -0
- package/dist/runtime/browser.js +208 -47
- package/dist/runtime/cache-telemetry.d.ts +71 -0
- package/dist/runtime/cache-telemetry.js +177 -0
- package/dist/runtime/cache.js +67 -7
- package/dist/runtime/capability-response.d.ts +3 -0
- package/dist/runtime/capability-response.js +56 -0
- package/dist/runtime/capability-telemetry.d.ts +46 -0
- package/dist/runtime/capability-telemetry.js +68 -0
- package/dist/runtime/diagnostic-env.d.ts +3 -0
- package/dist/runtime/diagnostic-env.js +10 -1
- package/dist/runtime/engine-mode.d.ts +74 -0
- package/dist/runtime/engine-mode.js +152 -0
- package/dist/runtime/handle.js +9 -1
- package/dist/runtime/http-telemetry-guard.d.ts +10 -0
- package/dist/runtime/http-telemetry-guard.js +62 -10
- package/dist/runtime/http.js +141 -35
- package/dist/runtime/instrumentation.js +92 -13
- package/dist/runtime/ocr-telemetry.d.ts +82 -0
- package/dist/runtime/ocr-telemetry.js +192 -0
- package/dist/runtime/ocr.js +35 -8
- package/dist/runtime/request-telemetry.d.ts +2 -0
- package/dist/runtime/request-telemetry.js +2 -1
- package/dist/runtime/resolver-runtime-options.d.ts +14 -0
- package/dist/runtime/resolver-runtime-options.js +33 -0
- package/dist/runtime/resolver-shared.d.ts +3 -2
- package/dist/runtime/resolver-shared.js +4 -4
- package/dist/runtime/resolver-telemetry.d.ts +1 -0
- package/dist/runtime/resolver-telemetry.js +1 -1
- package/dist/runtime/resolver-vendors/browser.d.ts +2 -0
- package/dist/runtime/resolver-vendors/browser.js +46 -0
- package/dist/runtime/resolver-vendors/hosts.d.ts +21 -0
- package/dist/runtime/resolver-vendors/hosts.js +35 -0
- package/dist/runtime/resolver-vendors/hypersolutions.js +2 -2
- package/dist/runtime/resolver-vendors/types.d.ts +5 -4
- package/dist/runtime/resolver.d.ts +4 -1
- package/dist/runtime/resolver.js +46 -13
- package/dist/runtime/state-telemetry.d.ts +79 -0
- package/dist/runtime/state-telemetry.js +194 -0
- package/dist/runtime/state.d.ts +3 -0
- package/dist/runtime/state.js +26 -7
- package/dist/runtime/stealth-cookies.d.ts +5 -1
- package/dist/runtime/stealth-cookies.js +21 -1
- package/dist/runtime/stealth-owned-headers.d.ts +26 -0
- package/dist/runtime/stealth-owned-headers.js +37 -0
- package/dist/runtime/stealth-telemetry.d.ts +92 -0
- package/dist/runtime/stealth-telemetry.js +179 -0
- package/dist/runtime/stealth.d.ts +4 -1
- package/dist/runtime/stealth.js +228 -85
- package/dist/runtime/stt-telemetry.d.ts +77 -0
- package/dist/runtime/stt-telemetry.js +176 -0
- package/dist/runtime/stt.js +15 -6
- package/dist/runtime-boundary-lint.d.ts +132 -0
- package/dist/runtime-boundary-lint.js +586 -0
- package/dist/server/error-stack-frames.d.ts +35 -0
- package/dist/server/error-stack-frames.js +219 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.js +4 -0
- package/dist/server/sdk-version.d.ts +3 -0
- package/dist/server/sdk-version.js +19 -0
- package/dist/server/self-test.js +1 -18
- package/dist/server/sensitive-values.d.ts +1 -1
- package/dist/server/sensitive-values.js +9 -0
- package/dist/server/serve-implementation.d.ts +51 -2
- package/dist/server/serve-implementation.js +337 -90
- package/dist/server/types.d.ts +1 -0
- package/dist/server/types.js +7 -0
- package/dist/stateful/stateful-provider-owner-forwarder.js +22 -0
- package/dist/stateful/stateful-provider-runtime-context.d.ts +3 -0
- package/dist/stateful/stateful-provider-runtime-context.js +1 -0
- package/dist/types.d.ts +123 -1
- package/dist/typescript-module.d.ts +39 -0
- package/dist/typescript-module.js +72 -0
- package/package.json +6 -1
- package/src/cli/commands.ts +14 -0
- package/src/cli/deployment-intent.ts +364 -0
- package/src/cli/migrate-deployment-intent.ts +1908 -0
- package/src/cli/migrate-provider-shape.ts +10 -4
- package/src/cli/resolver-runtime.ts +72 -0
- package/src/define.ts +13 -0
- package/src/dev.ts +9 -2
- package/src/engine.ts +38 -2
- package/src/error-resolution.ts +58 -0
- package/src/errors.ts +77 -1
- package/src/handle-meta.ts +51 -1
- package/src/handle.ts +92 -10
- package/src/health-scenario.ts +38 -0
- package/src/i18n/error-messages.ts +255 -0
- package/src/i18n/index.ts +1 -0
- package/src/i18n/keys.ts +80 -6
- package/src/index.ts +86 -0
- package/src/lint.ts +604 -91
- package/src/provider.ts +12 -0
- package/src/runtime/browser-telemetry-binding.ts +92 -0
- package/src/runtime/browser-telemetry.ts +289 -0
- package/src/runtime/browser.ts +249 -65
- package/src/runtime/cache-telemetry.ts +247 -0
- package/src/runtime/cache.ts +68 -17
- package/src/runtime/capability-response.ts +53 -0
- package/src/runtime/capability-telemetry.ts +101 -0
- package/src/runtime/diagnostic-env.ts +11 -1
- package/src/runtime/engine-mode.ts +233 -0
- package/src/runtime/handle.ts +9 -1
- package/src/runtime/http-telemetry-guard.ts +66 -13
- package/src/runtime/http.ts +168 -37
- package/src/runtime/instrumentation.ts +105 -16
- package/src/runtime/ocr-telemetry.ts +308 -0
- package/src/runtime/ocr.ts +114 -74
- package/src/runtime/request-telemetry.ts +2 -1
- package/src/runtime/resolver-runtime-options.ts +50 -0
- package/src/runtime/resolver-shared.ts +9 -4
- package/src/runtime/resolver-telemetry.ts +1 -1
- package/src/runtime/resolver-vendors/browser.ts +65 -7
- package/src/runtime/resolver-vendors/hosts.ts +43 -0
- package/src/runtime/resolver-vendors/hypersolutions.ts +2 -2
- package/src/runtime/resolver-vendors/types.ts +5 -4
- package/src/runtime/resolver.ts +64 -21
- package/src/runtime/state-telemetry.ts +298 -0
- package/src/runtime/state.ts +46 -45
- package/src/runtime/stealth-cookies.ts +24 -1
- package/src/runtime/stealth-owned-headers.ts +41 -0
- package/src/runtime/stealth-telemetry.ts +304 -0
- package/src/runtime/stealth.ts +355 -150
- package/src/runtime/stt-telemetry.ts +282 -0
- package/src/runtime/stt.ts +93 -71
- package/src/runtime-boundary-lint.ts +703 -0
- package/src/server/error-stack-frames.ts +214 -0
- package/src/server/index.ts +53 -0
- package/src/server/sdk-version.ts +22 -0
- package/src/server/self-test.ts +1 -21
- package/src/server/sensitive-values.ts +14 -0
- package/src/server/serve-implementation.ts +569 -108
- package/src/server/types.ts +7 -0
- package/src/stateful/stateful-provider-owner-forwarder.ts +23 -0
- package/src/stateful/stateful-provider-runtime-context.ts +4 -0
- package/src/types.ts +128 -1
- package/src/typescript-module.ts +100 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/approval-override.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/codemod-syntax.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/connection-precedence.ts.txt +0 -10
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-a.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-b.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-barrel.ts.txt +0 -2
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-computed.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-cycle-a.ts.txt +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-cycle-b.ts.txt +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-cycle-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-barrel.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-catalog.ts.txt +0 -19
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-docs.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-stores.ts.txt +0 -8
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-indirect-config.ts.txt +0 -5
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-nonstatic.ts.txt +0 -4
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-package-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-leaf.ts.txt +0 -10
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-one.ts.txt +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-two.ts.txt +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-runtime-composed-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-runtime-composed-one.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-runtime-composed-two.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-runtime-mixed-index.ts.txt +0 -14
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-runtime-registry.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-star-package-barrel.ts.txt +0 -2
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-star-package-index.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-star-package-leaf.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/docs-conflict.ts.txt +0 -8
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-hoisted-array-spread.ts.txt +0 -15
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-imported-array-spread.ts.txt +0 -9
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-kebab-operation-id.ts.txt +0 -17
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-map.ts.txt +0 -5
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-mixed-array-spread.ts.txt +0 -24
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-operation.ts.txt +0 -16
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-snake-operation-id.ts.txt +0 -21
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-duplicate-provider.ts.txt +0 -11
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-id-unresolved.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-map.ts.txt +0 -3
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-one-to-many.ts.txt +0 -18
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-one-to-one.ts.txt +0 -13
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/hoist-all.ts.txt +0 -31
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/hoisted-const.ts.txt +0 -11
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/imported-spread.ts.txt +0 -11
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-map.ts.txt +0 -11
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-spread-cast-tail.ts.txt +0 -21
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-spread-ekitan.ts.txt +0 -11
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-spread-override.ts.txt +0 -14
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/locale-canonical-en.json +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/locale-canonical-ja.json +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/locale-canonical-ko.json +0 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/locale-existing-operation-namespace-en.json +0 -8
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/missing-english-locale.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/no-safety.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/non-literal.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/redundant-approval.ts.txt +0 -6
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-binding-ambiguous.ts.txt +0 -12
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-imported-other.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-imported.ts.txt +0 -5
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-key-ambiguous.ts.txt +0 -19
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-shorthand.ts.txt +0 -9
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-typed.ts.txt +0 -11
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-unrelated.ts.txt +0 -13
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/safety-conflict.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/stream.ts.txt +0 -7
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/tool-router-spread.ts.txt +0 -15
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/unparseable.ts.txt +0 -4
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/verbatim-template.ts.txt +0 -12
package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-kebab-operation-id.ts.txt
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const listHospitalsOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
inputExamples: [
|
|
4
|
-
{
|
|
5
|
-
scenario: "List nearby hospitals",
|
|
6
|
-
input: { latitude: 37.5665, longitude: 126.978 },
|
|
7
|
-
rationale: "Exercises a kebab-case operation id.",
|
|
8
|
-
},
|
|
9
|
-
],
|
|
10
|
-
input: InputSchema,
|
|
11
|
-
output: OutputSchema,
|
|
12
|
-
handler,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export default buildProvider({
|
|
16
|
-
operations: { "list-hospitals": listHospitalsOperation },
|
|
17
|
-
});
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-mixed-array-spread.ts.txt
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const SHARED_INPUT_EXAMPLES = [
|
|
2
|
-
{
|
|
3
|
-
scenario: "Shared middle example",
|
|
4
|
-
input: { page: 2 },
|
|
5
|
-
},
|
|
6
|
-
] as const;
|
|
7
|
-
|
|
8
|
-
const mixedOperation = defineOperation<ProviderContext>()({
|
|
9
|
-
annotations: { readOnly: true },
|
|
10
|
-
inputExamples: [
|
|
11
|
-
{
|
|
12
|
-
scenario: "Literal first example",
|
|
13
|
-
input: { page: 1 },
|
|
14
|
-
},
|
|
15
|
-
...SHARED_INPUT_EXAMPLES,
|
|
16
|
-
{
|
|
17
|
-
scenario: "Literal last example",
|
|
18
|
-
input: { page: 3 },
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
input: InputSchema,
|
|
22
|
-
output: OutputSchema,
|
|
23
|
-
handler,
|
|
24
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const searchOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
inputExamples: [
|
|
4
|
-
{
|
|
5
|
-
scenario: "Search by a precise phrase",
|
|
6
|
-
input: {
|
|
7
|
-
query: `京都
|
|
8
|
-
ホテル`,
|
|
9
|
-
},
|
|
10
|
-
rationale: "Shows whitespace preservation",
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
input: InputSchema,
|
|
14
|
-
output: OutputSchema,
|
|
15
|
-
handler,
|
|
16
|
-
});
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/examples-snake-operation-id.ts.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const listRecentEarthquakesOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
docs: {
|
|
4
|
-
titleKey: "operations.listRecentEarthquakes.title",
|
|
5
|
-
descriptionKey: "operations.listRecentEarthquakes.description",
|
|
6
|
-
},
|
|
7
|
-
inputExamples: [
|
|
8
|
-
{
|
|
9
|
-
scenario: "List recent earthquakes",
|
|
10
|
-
input: { limit: 10 },
|
|
11
|
-
rationale: "Exercises a snake-case operation id.",
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
input: InputSchema,
|
|
15
|
-
output: OutputSchema,
|
|
16
|
-
handler,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export default buildProvider({
|
|
20
|
-
operations: { list_recent_earthquakes: listRecentEarthquakesOperation },
|
|
21
|
-
});
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-duplicate-provider.ts.txt
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function makePingOperation() {
|
|
2
|
-
return defineOperation<ProviderContext>()({
|
|
3
|
-
annotations: { readOnly: true },
|
|
4
|
-
input: InputSchema,
|
|
5
|
-
output: OutputSchema,
|
|
6
|
-
handler,
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const first = buildProvider({ operations: { ping: makePingOperation() } });
|
|
11
|
-
export default buildProvider({ operations: { ping: makePingOperation() } });
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
function makeSearchOperation(kind: string) {
|
|
2
|
-
return defineOperation<ProviderContext>()({
|
|
3
|
-
annotations: { readOnly: true },
|
|
4
|
-
inputExamples: [{ scenario: "Search items", input: { kind } }],
|
|
5
|
-
input: InputSchema,
|
|
6
|
-
output: OutputSchema,
|
|
7
|
-
handler,
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default buildProvider({
|
|
12
|
-
operations: {
|
|
13
|
-
"used-goods-search": makeSearchOperation("used"),
|
|
14
|
-
"realty-search-listings": makeSearchOperation("realty"),
|
|
15
|
-
"jobs-search": makeSearchOperation("jobs"),
|
|
16
|
-
"cars-search": makeSearchOperation("cars"),
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function makeSearchOperation(kind: string) {
|
|
2
|
-
return defineOperation<ProviderContext>()({
|
|
3
|
-
annotations: { readOnly: true },
|
|
4
|
-
inputExamples: [{ scenario: "Search items", input: { kind } }],
|
|
5
|
-
input: InputSchema,
|
|
6
|
-
output: OutputSchema,
|
|
7
|
-
handler,
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default buildProvider({
|
|
12
|
-
operations: { "search-items": makeSearchOperation("items") },
|
|
13
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const searchOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: {
|
|
3
|
-
readOnly: true,
|
|
4
|
-
openWorld: true,
|
|
5
|
-
idempotent: true,
|
|
6
|
-
rateLimit: { requests: 10 },
|
|
7
|
-
timeoutMs: 30_000,
|
|
8
|
-
},
|
|
9
|
-
toolRouter: {
|
|
10
|
-
name: "ignored",
|
|
11
|
-
requiresConnection: false,
|
|
12
|
-
connectionExternalRefParam: "accountId",
|
|
13
|
-
},
|
|
14
|
-
docs: {
|
|
15
|
-
titleKey: "operations.search.title",
|
|
16
|
-
descriptionKey: "operations.search.description",
|
|
17
|
-
summaryKey: "operations.search.summary",
|
|
18
|
-
markdownKey: "operations.search.markdown",
|
|
19
|
-
normalizationNotesKeys: ["operations.search.normalization.one"],
|
|
20
|
-
errorCodes: [{ code: "UPSTREAM" }],
|
|
21
|
-
requestExample: { query: "old" },
|
|
22
|
-
responseExample: { items: [] },
|
|
23
|
-
},
|
|
24
|
-
derivations: { value: "unused" } as unknown as Derivations,
|
|
25
|
-
retryOnAuthRefresh: true as unknown as boolean,
|
|
26
|
-
title: "Raw title" as unknown as string,
|
|
27
|
-
description: "Raw description" as unknown as string,
|
|
28
|
-
input: InputSchema,
|
|
29
|
-
output: OutputSchema,
|
|
30
|
-
handler,
|
|
31
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { toolRouterDefaults } from "./tool-router-defaults.js";
|
|
2
|
-
|
|
3
|
-
const importedSpreadOperation = defineOperation<ProviderContext>()({
|
|
4
|
-
annotations: { readOnly: true },
|
|
5
|
-
toolRouter: {
|
|
6
|
-
...toolRouterDefaults,
|
|
7
|
-
},
|
|
8
|
-
input: InputSchema,
|
|
9
|
-
output: OutputSchema,
|
|
10
|
-
handler,
|
|
11
|
-
});
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-spread-cast-tail.ts.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const castTailOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: {
|
|
3
|
-
...({ timeoutMs: 15_000 as Milliseconds } as unknown as LegacyAnnotations),
|
|
4
|
-
},
|
|
5
|
-
toolRouter: {
|
|
6
|
-
...({
|
|
7
|
-
riskClass: "write" as const,
|
|
8
|
-
approval: "always" as ApprovalMode,
|
|
9
|
-
connectionMode: "none" as ConnectionMode,
|
|
10
|
-
} as unknown as LegacyToolRouter),
|
|
11
|
-
},
|
|
12
|
-
docs: {
|
|
13
|
-
...({
|
|
14
|
-
titleKey: "operations.castTail.title" as const,
|
|
15
|
-
descriptionKey: "operations.castTail.description" as LocaleKey,
|
|
16
|
-
} as unknown as LegacyDocs),
|
|
17
|
-
},
|
|
18
|
-
input: InputSchema,
|
|
19
|
-
output: OutputSchema,
|
|
20
|
-
handler,
|
|
21
|
-
});
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-spread-ekitan.ts.txt
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const getStationInfoOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
toolRouter: {
|
|
3
|
-
riskClass: "read",
|
|
4
|
-
approval: "never",
|
|
5
|
-
requiresConnection: false,
|
|
6
|
-
...{ connectionMode: "none" as const },
|
|
7
|
-
},
|
|
8
|
-
input: InputSchema,
|
|
9
|
-
output: OutputSchema,
|
|
10
|
-
handler,
|
|
11
|
-
});
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/inline-spread-override.ts.txt
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const overrideOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
toolRouter: {
|
|
3
|
-
riskClass: "read",
|
|
4
|
-
connectionMode: "required" as const,
|
|
5
|
-
...{
|
|
6
|
-
connectionMode: "none" as const,
|
|
7
|
-
approval: "never" as const,
|
|
8
|
-
},
|
|
9
|
-
approval: "always" as const,
|
|
10
|
-
},
|
|
11
|
-
input: InputSchema,
|
|
12
|
-
output: OutputSchema,
|
|
13
|
-
handler,
|
|
14
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"meta":{"displayName":"Canonical fixture"},"operations":{"alpha":{"title":"Alpha"},"search":{"description":"English description","title":"English title","steps":[{"first":"one","second":"two"}]},"omega":{"title":"Omega"}},"tail":"English tail","enOnly":"Keep this last"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"jaOnlyFirst":"最初","operations":{"search":{"steps":[{"second":"二","first":"一"}],"title":"検索","jaOnly":"順序を保持","description":"日本語の説明"},"omega":{"title":"オメガ"},"jaOnlyOperation":{"title":"日本語のみ"},"alpha":{"title":"アルファ"}},"tail":"日本語の末尾","meta":{"displayName":"正規 fixture"},"jaOnlyLast":"最後"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"koOnlyFirst":"첫 번째","tail":"한국어 꼬리말","operations":{"omega":{"title":"오메가"},"search":{"title":"검색","steps":[{"second":"둘","first":"하나"}],"description":"한국어 설명","koOnly":"순서 유지"},"alpha":{"title":"알파"},"koOnlyOperation":{"title":"한국어 전용"}},"meta":{"displayName":"정규 fixture"},"koOnlyLast":"마지막"}
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-binding-ambiguous.ts.txt
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const operation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
inputExamples: [{ scenario: "Ambiguous", input: {} }],
|
|
4
|
-
input: InputSchema,
|
|
5
|
-
output: OutputSchema,
|
|
6
|
-
handler,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const registry = {
|
|
10
|
-
first: operation,
|
|
11
|
-
second: operation,
|
|
12
|
-
};
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/registry-key-ambiguous.ts.txt
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const firstOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
inputExamples: [{ scenario: "First", input: {} }],
|
|
4
|
-
input: InputSchema,
|
|
5
|
-
output: OutputSchema,
|
|
6
|
-
handler,
|
|
7
|
-
});
|
|
8
|
-
const secondOperation = defineOperation<ProviderContext>()({
|
|
9
|
-
annotations: { readOnly: true },
|
|
10
|
-
inputExamples: [{ scenario: "Second", input: {} }],
|
|
11
|
-
input: InputSchema,
|
|
12
|
-
output: OutputSchema,
|
|
13
|
-
handler,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const registry = {
|
|
17
|
-
shared: firstOperation,
|
|
18
|
-
"shared": secondOperation,
|
|
19
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const permissionsRevoke = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
inputExamples: [{ scenario: "Revoke permissions", input: {} }],
|
|
4
|
-
input: InputSchema,
|
|
5
|
-
output: OutputSchema,
|
|
6
|
-
handler,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const companionsOperations: Record<string, OperationDefinition> = {
|
|
10
|
-
"permissions-revoke": permissionsRevoke,
|
|
11
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const detailOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
inputExamples: [{ scenario: "Detail", input: {} }],
|
|
4
|
-
input: InputSchema,
|
|
5
|
-
output: OutputSchema,
|
|
6
|
-
handler,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const unrelated = {
|
|
10
|
-
detail: detailOperation,
|
|
11
|
-
count: 42,
|
|
12
|
-
created: makeValue(),
|
|
13
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const requiredConnection = {
|
|
2
|
-
requiresConnection: true,
|
|
3
|
-
connectionExternalRefParam: "profileId",
|
|
4
|
-
} as const;
|
|
5
|
-
|
|
6
|
-
const updateOperation = defineOperation<ProviderContext>()({
|
|
7
|
-
annotations: { destructive: true },
|
|
8
|
-
toolRouter: {
|
|
9
|
-
...requiredConnection,
|
|
10
|
-
approval: "always",
|
|
11
|
-
},
|
|
12
|
-
input: InputSchema,
|
|
13
|
-
output: OutputSchema,
|
|
14
|
-
handler,
|
|
15
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const explainOperation = defineOperation<ProviderContext>()({
|
|
2
|
-
annotations: { readOnly: true },
|
|
3
|
-
docs: { descriptionKey: "operations.explain.description" },
|
|
4
|
-
input: InputSchema,
|
|
5
|
-
output: OutputSchema,
|
|
6
|
-
handler: async () => {
|
|
7
|
-
const message = `最初の行
|
|
8
|
-
${value}
|
|
9
|
-
最後の行`;
|
|
10
|
-
return { message };
|
|
11
|
-
},
|
|
12
|
-
});
|