@downcity/city 0.2.200 → 0.2.211
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/README.md +89 -13
- package/bin/client/bureau.d.ts +41 -0
- package/bin/client/bureau.d.ts.map +1 -0
- package/bin/client/bureau.js +240 -0
- package/bin/client/bureau.js.map +1 -0
- package/bin/client/city.d.ts +15 -79
- package/bin/client/city.d.ts.map +1 -1
- package/bin/client/city.js +15 -99
- package/bin/client/city.js.map +1 -1
- package/bin/client/federation-admin.d.ts +32 -0
- package/bin/client/federation-admin.d.ts.map +1 -0
- package/bin/client/federation-admin.js +54 -0
- package/bin/client/federation-admin.js.map +1 -0
- package/bin/client/types.d.ts +10 -70
- package/bin/client/types.d.ts.map +1 -1
- package/bin/client/types.js +3 -3
- package/bin/federation/auth/authenticator.d.ts +17 -13
- package/bin/federation/auth/authenticator.d.ts.map +1 -1
- package/bin/federation/auth/authenticator.js +38 -27
- package/bin/federation/auth/authenticator.js.map +1 -1
- package/bin/federation/auth/bureau-token-schema.d.ts +274 -0
- package/bin/federation/auth/bureau-token-schema.d.ts.map +1 -0
- package/bin/federation/auth/bureau-token-schema.js +43 -0
- package/bin/federation/auth/bureau-token-schema.js.map +1 -0
- package/bin/federation/auth/bureau-token-store.d.ts +22 -0
- package/bin/federation/auth/bureau-token-store.d.ts.map +1 -0
- package/bin/federation/auth/bureau-token-store.js +122 -0
- package/bin/federation/auth/bureau-token-store.js.map +1 -0
- package/bin/federation/auth/federation-key-store.d.ts +26 -0
- package/bin/federation/auth/federation-key-store.d.ts.map +1 -0
- package/bin/federation/auth/federation-key-store.js +96 -0
- package/bin/federation/auth/federation-key-store.js.map +1 -0
- package/bin/federation/auth/key-schema.d.ts +275 -0
- package/bin/federation/auth/key-schema.d.ts.map +1 -0
- package/bin/federation/auth/key-schema.js +44 -0
- package/bin/federation/auth/key-schema.js.map +1 -0
- package/bin/federation/auth/types.d.ts +62 -4
- package/bin/federation/auth/types.d.ts.map +1 -1
- package/bin/federation/auth/user-token-authority.d.ts +26 -0
- package/bin/federation/auth/user-token-authority.d.ts.map +1 -0
- package/bin/federation/auth/user-token-authority.js +179 -0
- package/bin/federation/auth/user-token-authority.js.map +1 -0
- package/bin/federation/federation-init.d.ts.map +1 -1
- package/bin/federation/federation-init.js +23 -4
- package/bin/federation/federation-init.js.map +1 -1
- package/bin/federation/federation-router.d.ts +3 -1
- package/bin/federation/federation-router.d.ts.map +1 -1
- package/bin/federation/federation-router.js +17 -0
- package/bin/federation/federation-router.js.map +1 -1
- package/bin/federation/federation-runtime.d.ts.map +1 -1
- package/bin/federation/federation-runtime.js +14 -2
- package/bin/federation/federation-runtime.js.map +1 -1
- package/bin/federation/federation.d.ts.map +1 -1
- package/bin/federation/federation.js +2 -0
- package/bin/federation/federation.js.map +1 -1
- package/bin/federation/runtime.d.ts +4 -0
- package/bin/federation/runtime.d.ts.map +1 -1
- package/bin/index.d.ts +11 -10
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +5 -3
- package/bin/index.js.map +1 -1
- package/bin/pact/admin/index.d.ts +7 -19
- package/bin/pact/admin/index.d.ts.map +1 -1
- package/bin/pact/admin/index.js +10 -18
- package/bin/pact/admin/index.js.map +1 -1
- package/bin/pact/admin/types.d.ts +4 -10
- package/bin/pact/admin/types.d.ts.map +1 -1
- package/bin/pact/invoker/ai/CityModel.d.ts +1 -1
- package/bin/pact/invoker/ai/CityModel.d.ts.map +1 -1
- package/bin/pact/invoker/ai/CityModel.js +3 -65
- package/bin/pact/invoker/ai/CityModel.js.map +1 -1
- package/bin/pact/invoker/ai/types.d.ts +1 -1
- package/bin/pact/invoker/ai/types.js +1 -1
- package/bin/pact/invoker/bureaus/index.d.ts +25 -0
- package/bin/pact/invoker/bureaus/index.d.ts.map +1 -0
- package/bin/pact/invoker/bureaus/index.js +36 -0
- package/bin/pact/invoker/bureaus/index.js.map +1 -0
- package/bin/pact/invoker/cities/types.d.ts +2 -2
- package/bin/pact/invoker/cities/types.d.ts.map +1 -1
- package/bin/pact/invoker/user/index.d.ts +19 -0
- package/bin/pact/invoker/user/index.d.ts.map +1 -0
- package/bin/pact/invoker/user/index.js +24 -0
- package/bin/pact/invoker/user/index.js.map +1 -0
- package/bin/pact/user/index.d.ts +2 -1
- package/bin/pact/user/index.d.ts.map +1 -1
- package/bin/pact/user/index.js +7 -3
- package/bin/pact/user/index.js.map +1 -1
- package/bin/pact/user/types.d.ts +11 -6
- package/bin/pact/user/types.d.ts.map +1 -1
- package/bin/service/ai/AIChannel.d.ts +57 -0
- package/bin/service/ai/AIChannel.d.ts.map +1 -0
- package/bin/service/ai/AIChannel.js +151 -0
- package/bin/service/ai/AIChannel.js.map +1 -0
- package/bin/service/ai/OpenAIChatCompletionsAdapter.d.ts +23 -0
- package/bin/service/ai/OpenAIChatCompletionsAdapter.d.ts.map +1 -0
- package/bin/service/ai/OpenAIChatCompletionsAdapter.js +503 -0
- package/bin/service/ai/OpenAIChatCompletionsAdapter.js.map +1 -0
- package/bin/service/ai/ai-service-values.d.ts +16 -19
- package/bin/service/ai/ai-service-values.d.ts.map +1 -1
- package/bin/service/ai/ai-service-values.js +9 -13
- package/bin/service/ai/ai-service-values.js.map +1 -1
- package/bin/service/ai/ai-service.d.ts +16 -15
- package/bin/service/ai/ai-service.d.ts.map +1 -1
- package/bin/service/ai/ai-service.js +97 -106
- package/bin/service/ai/ai-service.js.map +1 -1
- package/bin/service/ai/helpers.d.ts +8 -35
- package/bin/service/ai/helpers.d.ts.map +1 -1
- package/bin/service/ai/helpers.js +8 -140
- package/bin/service/ai/helpers.js.map +1 -1
- package/bin/service/ai/image-job-store.d.ts +2 -3
- package/bin/service/ai/image-job-store.d.ts.map +1 -1
- package/bin/service/ai/image-job-store.js.map +1 -1
- package/bin/service/ai/language-model-stream.d.ts +9 -4
- package/bin/service/ai/language-model-stream.d.ts.map +1 -1
- package/bin/service/ai/language-model-stream.js +8 -4
- package/bin/service/ai/language-model-stream.js.map +1 -1
- package/bin/service/ai/language-model-text.d.ts +15 -0
- package/bin/service/ai/language-model-text.d.ts.map +1 -0
- package/bin/service/ai/language-model-text.js +67 -0
- package/bin/service/ai/language-model-text.js.map +1 -0
- package/bin/service/ai/model-context-window.d.ts +2 -2
- package/bin/service/ai/model-context-window.d.ts.map +1 -1
- package/bin/service/ai/model-context-window.js.map +1 -1
- package/bin/service/ai/model-registry.d.ts +9 -8
- package/bin/service/ai/model-registry.d.ts.map +1 -1
- package/bin/service/ai/model-registry.js +1 -5
- package/bin/service/ai/model-registry.js.map +1 -1
- package/bin/service/ai/model-routing.d.ts +1 -1
- package/bin/service/ai/model-routing.d.ts.map +1 -1
- package/bin/service/ai/model-routing.js +1 -1
- package/bin/service/ai/model-routing.js.map +1 -1
- package/bin/service/ai/reasoning.d.ts +4 -4
- package/bin/service/ai/reasoning.d.ts.map +1 -1
- package/bin/service/ai/reasoning.js.map +1 -1
- package/bin/service/bureaus/bureaus-service.d.ts +15 -0
- package/bin/service/bureaus/bureaus-service.d.ts.map +1 -0
- package/bin/service/bureaus/bureaus-service.js +55 -0
- package/bin/service/bureaus/bureaus-service.js.map +1 -0
- package/bin/service/installable-service.d.ts +5 -2
- package/bin/service/installable-service.d.ts.map +1 -1
- package/bin/service/installable-service.js +1 -0
- package/bin/service/installable-service.js.map +1 -1
- package/bin/service/instruction.js +1 -1
- package/bin/service/instruction.js.map +1 -1
- package/bin/service/service.d.ts +15 -2
- package/bin/service/service.d.ts.map +1 -1
- package/bin/service/service.js +2 -0
- package/bin/service/service.js.map +1 -1
- package/bin/types/AI.d.ts +289 -0
- package/bin/types/AI.d.ts.map +1 -0
- package/bin/types/AI.js +8 -0
- package/bin/types/AI.js.map +1 -0
- package/bin/types/AITransport.d.ts +251 -0
- package/bin/types/AITransport.d.ts.map +1 -0
- package/bin/types/AITransport.js +12 -0
- package/bin/types/AITransport.js.map +1 -0
- package/bin/types/Bureau.d.ts +96 -0
- package/bin/types/Bureau.d.ts.map +1 -0
- package/bin/types/Bureau.js +8 -0
- package/bin/types/Bureau.js.map +1 -0
- package/bin/types/FederationAdmin.d.ts +16 -0
- package/bin/types/FederationAdmin.d.ts.map +1 -0
- package/bin/types/FederationAdmin.js +7 -0
- package/bin/types/FederationAdmin.js.map +1 -0
- package/bin/types/Metering.d.ts +2 -2
- package/bin/types/Metering.d.ts.map +1 -1
- package/bin/types/User.d.ts +24 -0
- package/bin/types/User.d.ts.map +1 -0
- package/bin/types/User.js +8 -0
- package/bin/types/User.js.map +1 -0
- package/bin/utils/CityLanguageModelCodec.d.ts +1 -1
- package/bin/utils/CityLanguageModelCodec.d.ts.map +1 -1
- package/bin/utils/CityLanguageModelResult.d.ts +11 -0
- package/bin/utils/CityLanguageModelResult.d.ts.map +1 -0
- package/bin/utils/CityLanguageModelResult.js +76 -0
- package/bin/utils/CityLanguageModelResult.js.map +1 -0
- package/package.json +4 -3
- package/bin/federation/auth/token-signer.d.ts +0 -27
- package/bin/federation/auth/token-signer.d.ts.map +0 -1
- package/bin/federation/auth/token-signer.js +0 -116
- package/bin/federation/auth/token-signer.js.map +0 -1
- package/bin/service/ai/charge.d.ts +0 -76
- package/bin/service/ai/charge.d.ts.map +0 -1
- package/bin/service/ai/charge.js +0 -10
- package/bin/service/ai/charge.js.map +0 -1
- package/bin/service/ai/job-types.d.ts +0 -69
- package/bin/service/ai/job-types.d.ts.map +0 -1
- package/bin/service/ai/job-types.js +0 -9
- package/bin/service/ai/job-types.js.map +0 -1
- package/bin/service/ai/provider.d.ts +0 -143
- package/bin/service/ai/provider.d.ts.map +0 -1
- package/bin/service/ai/provider.js +0 -221
- package/bin/service/ai/provider.js.map +0 -1
- package/bin/service/ai/types.d.ts +0 -174
- package/bin/service/ai/types.d.ts.map +0 -1
- package/bin/service/ai/types.js +0 -7
- package/bin/service/ai/types.js.map +0 -1
- package/bin/types/AIImageJobClaim.d.ts +0 -14
- package/bin/types/AIImageJobClaim.d.ts.map +0 -1
- package/bin/types/AIImageJobClaim.js +0 -7
- package/bin/types/AIImageJobClaim.js.map +0 -1
- package/bin/types/AIReasoning.d.ts +0 -25
- package/bin/types/AIReasoning.d.ts.map +0 -1
- package/bin/types/AIReasoning.js +0 -7
- package/bin/types/AIReasoning.js.map +0 -1
- package/bin/types/AIRouting.d.ts +0 -37
- package/bin/types/AIRouting.d.ts.map +0 -1
- package/bin/types/AIRouting.js +0 -7
- package/bin/types/AIRouting.js.map +0 -1
- package/bin/types/CityLanguageModelRuntime.d.ts +0 -46
- package/bin/types/CityLanguageModelRuntime.d.ts.map +0 -1
- package/bin/types/CityLanguageModelRuntime.js +0 -8
- package/bin/types/CityLanguageModelRuntime.js.map +0 -1
- package/bin/types/CityLanguageModelTransport.d.ts +0 -49
- package/bin/types/CityLanguageModelTransport.d.ts.map +0 -1
- package/bin/types/CityLanguageModelTransport.js +0 -9
- package/bin/types/CityLanguageModelTransport.js.map +0 -1
- package/bin/types/CityModelRuntime.d.ts +0 -17
- package/bin/types/CityModelRuntime.d.ts.map +0 -1
- package/bin/types/CityModelRuntime.js +0 -8
- package/bin/types/CityModelRuntime.js.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI 图片任务领取类型模块。
|
|
3
|
-
*
|
|
4
|
-
* 该类型只用于 City 内部协调并发的 image/fetch worker,不属于 Provider 或客户端协议。
|
|
5
|
-
*/
|
|
6
|
-
import type { AsyncJobRecord } from "./AsyncJob.js";
|
|
7
|
-
/** 已被当前 worker 原子领取的图片任务。 */
|
|
8
|
-
export interface AIImageJobClaim {
|
|
9
|
-
/** 进入 fetching 状态后的完整任务记录。 */
|
|
10
|
-
record: AsyncJobRecord;
|
|
11
|
-
/** 本次领取写入的时间戳,同时作为后续 CAS 的所有权令牌。 */
|
|
12
|
-
claimed_at: string;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=AIImageJobClaim.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AIImageJobClaim.d.ts","sourceRoot":"","sources":["../../src/types/AIImageJobClaim.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,6BAA6B;AAC7B,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AIImageJobClaim.js","sourceRoot":"","sources":["../../src/types/AIImageJobClaim.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI 推理强度运行时类型。
|
|
3
|
-
*
|
|
4
|
-
* 这里的结构只表示 AIService 已完成模型校验后的可信结果,不能直接由请求体构造。
|
|
5
|
-
*/
|
|
6
|
-
/** 已解析的模型推理强度。 */
|
|
7
|
-
export interface AIResolvedReasoning {
|
|
8
|
-
/** 最终模型接受的推理强度档位 ID。 */
|
|
9
|
-
effort: string;
|
|
10
|
-
/** 档位来自调用方请求还是模型默认配置。 */
|
|
11
|
-
source: "request" | "default";
|
|
12
|
-
}
|
|
13
|
-
/** AI SDK provider option 支持的 JSON 值。 */
|
|
14
|
-
export type AIProviderOptionValue = null | string | number | boolean | AIProviderOptionObject | AIProviderOptionValue[];
|
|
15
|
-
/** 单个 AI SDK Provider 的 JSON 参数对象。 */
|
|
16
|
-
export interface AIProviderOptionObject {
|
|
17
|
-
/** Provider 私有参数值。 */
|
|
18
|
-
[key: string]: AIProviderOptionValue | undefined;
|
|
19
|
-
}
|
|
20
|
-
/** 按 AI SDK Provider ID 分组的 providerOptions。 */
|
|
21
|
-
export interface AIProviderOptions {
|
|
22
|
-
/** 指定 Provider 的私有参数对象。 */
|
|
23
|
-
[provider_id: string]: AIProviderOptionObject;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=AIReasoning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AIReasoning.d.ts","sourceRoot":"","sources":["../../src/types/AIReasoning.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kBAAkB;AAClB,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;CAC/B;AAED,yCAAyC;AACzC,MAAM,MAAM,qBAAqB,GAC7B,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GACP,sBAAsB,GACtB,qBAAqB,EAAE,CAAC;AAE5B,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACrC,sBAAsB;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAAC;CAClD;AAED,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,CAAC,WAAW,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAC/C"}
|
package/bin/types/AIReasoning.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AIReasoning.js","sourceRoot":"","sources":["../../src/types/AIReasoning.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/bin/types/AIRouting.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI 模型运行时路由类型。
|
|
3
|
-
*
|
|
4
|
-
* 用于描述模型 action 解析结果、媒体 fallback 计划以及路由模块所需的模型访问能力。
|
|
5
|
-
*/
|
|
6
|
-
import type { ActionFn } from "../service/action.js";
|
|
7
|
-
import type { ModelConfig } from "../service/ai/types.js";
|
|
8
|
-
/** 已解析的模型 action。 */
|
|
9
|
-
export interface AIResolvedAction {
|
|
10
|
-
/** 本次 action 绑定的最终模型配置。 */
|
|
11
|
-
model?: ModelConfig;
|
|
12
|
-
/** 本次请求实际执行的 Provider action。 */
|
|
13
|
-
action: ActionFn;
|
|
14
|
-
}
|
|
15
|
-
/** 模型发生 fallback 的标准原因。 */
|
|
16
|
-
export type AIRoutingFallbackReason = "input_requires_media";
|
|
17
|
-
/** 最终模型路由计划。 */
|
|
18
|
-
export interface AIResolvedRoutingPlan {
|
|
19
|
-
/** 最终执行的模型和 action。 */
|
|
20
|
-
resolved: AIResolvedAction;
|
|
21
|
-
/** 发生 fallback 时的原模型 ID。 */
|
|
22
|
-
fallback_from?: string;
|
|
23
|
-
/** 发生 fallback 时的标准原因。 */
|
|
24
|
-
fallback_reason?: AIRoutingFallbackReason;
|
|
25
|
-
/** 触发 fallback 的媒体类型。 */
|
|
26
|
-
fallback_media_type?: string;
|
|
27
|
-
}
|
|
28
|
-
/** 媒体 fallback 路由访问模型注册表所需的最小能力。 */
|
|
29
|
-
export interface AIModelRoutingAdapter {
|
|
30
|
-
/** 解析 fallback 规则中的模型 ID 或内联模型配置。 */
|
|
31
|
-
resolve_model(input: ModelConfig | string): ModelConfig | undefined;
|
|
32
|
-
/** 解析目标模型在指定通路下的 action。 */
|
|
33
|
-
resolve_action(model: ModelConfig, mode: string): ActionFn | undefined;
|
|
34
|
-
/** 判断目标模型当前是否满足环境变量等运行条件。 */
|
|
35
|
-
is_available(model: ModelConfig): boolean;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=AIRouting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AIRouting.d.ts","sourceRoot":"","sources":["../../src/types/AIRouting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,qBAAqB;AACrB,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iCAAiC;IACjC,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED,2BAA2B;AAC3B,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAE7D,gBAAgB;AAChB,MAAM,WAAW,qBAAqB;IACpC,uBAAuB;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0BAA0B;IAC1B,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,yBAAyB;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,oCAAoC;AACpC,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IACpE,4BAA4B;IAC5B,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvE,6BAA6B;IAC7B,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC;CAC3C"}
|
package/bin/types/AIRouting.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AIRouting.js","sourceRoot":"","sources":["../../src/types/AIRouting.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Federation City LanguageModel 流运行时类型模块。
|
|
3
|
-
*
|
|
4
|
-
* 类型仅描述 AIService 与 transport 流编码器之间的内部边界,避免服务层直接
|
|
5
|
-
* 操作未约束的 unknown 数据。
|
|
6
|
-
*/
|
|
7
|
-
import type { LanguageModel } from "ai";
|
|
8
|
-
import type { CityLanguageModelStreamRequestV1 } from "./CityLanguageModelTransport.js";
|
|
9
|
-
/** AI SDK LanguageModelV3。 */
|
|
10
|
-
export type CityRuntimeLanguageModelV3 = Extract<LanguageModel, {
|
|
11
|
-
readonly specificationVersion: "v3";
|
|
12
|
-
}>;
|
|
13
|
-
/** LanguageModelV3 的标准调用参数。 */
|
|
14
|
-
export type CityRuntimeCallOptions = Parameters<CityRuntimeLanguageModelV3["doStream"]>[0];
|
|
15
|
-
/** LanguageModelV3 的标准流结果。 */
|
|
16
|
-
export type CityRuntimeStreamResult = Awaited<ReturnType<CityRuntimeLanguageModelV3["doStream"]>>;
|
|
17
|
-
/** Provider `stream()` 收到的标准 CityModel 调用参数。 */
|
|
18
|
-
export type CityProviderStreamCall = CityRuntimeCallOptions;
|
|
19
|
-
/** Provider `stream()` 必须返回的标准 CityModel 流结果。 */
|
|
20
|
-
export type CityProviderStreamResult = CityRuntimeStreamResult;
|
|
21
|
-
/** LanguageModelV3 的标准流事件。 */
|
|
22
|
-
export type CityRuntimeStreamPart = CityRuntimeStreamResult["stream"] extends ReadableStream<infer T> ? T : never;
|
|
23
|
-
/** 已校验并解码的 transport 请求。 */
|
|
24
|
-
export interface DecodedCityLanguageModelRequest {
|
|
25
|
-
/** Federation 模型目录中的模型 ID。 */
|
|
26
|
-
model_id: string;
|
|
27
|
-
/** 解码后的标准 LanguageModelV3 调用参数。 */
|
|
28
|
-
call: CityRuntimeCallOptions;
|
|
29
|
-
/** 用户显式选择的推理强度。 */
|
|
30
|
-
reasoning_effort?: string;
|
|
31
|
-
}
|
|
32
|
-
/** 创建 Federation SSE 响应所需的输入。 */
|
|
33
|
-
export interface CreateCityLanguageModelStreamInput {
|
|
34
|
-
/** 最终 Provider `stream()` 返回的标准 LanguageModelV3 流结果。 */
|
|
35
|
-
result: CityRuntimeStreamResult;
|
|
36
|
-
}
|
|
37
|
-
/** Federation SSE 响应及其最终完成事件。 */
|
|
38
|
-
export interface CityLanguageModelStreamExecution {
|
|
39
|
-
/** 返回给 CityModel 客户端的 SSE Response。 */
|
|
40
|
-
response: Response;
|
|
41
|
-
/** 流结束后解析出的 finish 事件;异常或取消时为空。 */
|
|
42
|
-
completion: Promise<CityRuntimeStreamPart | undefined>;
|
|
43
|
-
}
|
|
44
|
-
/** 供运行时校验的原始 transport 请求输入。 */
|
|
45
|
-
export type RawCityLanguageModelRequest = CityLanguageModelStreamRequestV1 | Record<string, unknown>;
|
|
46
|
-
//# sourceMappingURL=CityLanguageModelRuntime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CityLanguageModelRuntime.d.ts","sourceRoot":"","sources":["../../src/types/CityLanguageModelRuntime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAExF,8BAA8B;AAC9B,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,aAAa,EACb;IAAE,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAA;CAAE,CACxC,CAAC;AAEF,+BAA+B;AAC/B,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3F,8BAA8B;AAC9B,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAElG,gDAAgD;AAChD,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAE5D,iDAAiD;AACjD,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAE/D,8BAA8B;AAC9B,MAAM,MAAM,qBAAqB,GAC/B,uBAAuB,CAAC,QAAQ,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEhF,4BAA4B;AAC5B,MAAM,WAAW,+BAA+B;IAC9C,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,mBAAmB;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,iCAAiC;AACjC,MAAM,WAAW,kCAAkC;IACjD,wDAAwD;IACxD,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED,iCAAiC;AACjC,MAAM,WAAW,gCAAgC;IAC/C,uCAAuC;IACvC,QAAQ,EAAE,QAAQ,CAAC;IACnB,mCAAmC;IACnC,UAAU,EAAE,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;CACxD;AAED,gCAAgC;AAChC,MAAM,MAAM,2BAA2B,GAAG,gCAAgC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CityLanguageModelRuntime.js","sourceRoot":"","sources":["../../src/types/CityLanguageModelRuntime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* City Language Model Transport v1 类型模块。
|
|
3
|
-
*
|
|
4
|
-
* 该协议只在 City 客户端模型与 Federation AIService 之间使用。所有负载都必须
|
|
5
|
-
* 可以经过 JSON 编解码,Provider 原始协议和密钥不得进入该边界。
|
|
6
|
-
*/
|
|
7
|
-
/** City Language Model Transport v1 的固定协议标识。 */
|
|
8
|
-
export declare const CITY_LANGUAGE_MODEL_PROTOCOL_V1: "downcity-language-model-v1";
|
|
9
|
-
/** JSON 原始值。 */
|
|
10
|
-
export type CityTransportJsonPrimitive = string | number | boolean | null;
|
|
11
|
-
/** JSON 对象。 */
|
|
12
|
-
export interface CityTransportJsonObject {
|
|
13
|
-
/** JSON 对象字段;值只能继续使用 City transport JSON 类型。 */
|
|
14
|
-
[key: string]: CityTransportJsonValue;
|
|
15
|
-
}
|
|
16
|
-
/** City transport 支持的完整 JSON 值。 */
|
|
17
|
-
export type CityTransportJsonValue = CityTransportJsonPrimitive | CityTransportJsonObject | CityTransportJsonValue[];
|
|
18
|
-
/** CityModel 发给 Federation 的一次标准模型调用。 */
|
|
19
|
-
export interface CityLanguageModelStreamRequestV1 {
|
|
20
|
-
/** 固定协议版本,用于拒绝不匹配的客户端与服务端。 */
|
|
21
|
-
protocol: typeof CITY_LANGUAGE_MODEL_PROTOCOL_V1;
|
|
22
|
-
/** Federation 模型目录中的模型 ID。 */
|
|
23
|
-
model_id: string;
|
|
24
|
-
/** JSON 编码后的 LanguageModelV3CallOptions,不包含 AbortSignal 和 HTTP headers。 */
|
|
25
|
-
call: CityTransportJsonObject;
|
|
26
|
-
/** 用户显式选择的 Downcity 推理强度。 */
|
|
27
|
-
reasoning_effort?: string;
|
|
28
|
-
}
|
|
29
|
-
/** Federation 流中返回的可诊断错误。 */
|
|
30
|
-
export interface CityLanguageModelErrorV1 {
|
|
31
|
-
/** 面向调用方的安全错误消息。 */
|
|
32
|
-
message: string;
|
|
33
|
-
/** 稳定错误类别或原始 Error name。 */
|
|
34
|
-
type: string;
|
|
35
|
-
/** Provider 或 Federation 返回的可选错误码。 */
|
|
36
|
-
code?: string;
|
|
37
|
-
/** 对应的可选 HTTP 状态码。 */
|
|
38
|
-
status?: number;
|
|
39
|
-
/** 调用方是否可以安全重试。 */
|
|
40
|
-
retryable?: boolean;
|
|
41
|
-
}
|
|
42
|
-
/** Federation 通过 SSE 返回的单个 LanguageModelV3 流事件。 */
|
|
43
|
-
export interface CityLanguageModelStreamEventV1 {
|
|
44
|
-
/** 固定协议版本,用于逐事件校验。 */
|
|
45
|
-
protocol: typeof CITY_LANGUAGE_MODEL_PROTOCOL_V1;
|
|
46
|
-
/** JSON 编码后的 LanguageModelV3StreamPart。 */
|
|
47
|
-
part: CityTransportJsonObject;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=CityLanguageModelTransport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CityLanguageModelTransport.d.ts","sourceRoot":"","sources":["../../src/types/CityLanguageModelTransport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gDAAgD;AAChD,eAAO,MAAM,+BAA+B,EAAG,4BAAqC,CAAC;AAErF,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE1E,eAAe;AACf,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,sBAAsB,CAAC;CACvC;AAED,mCAAmC;AACnC,MAAM,MAAM,sBAAsB,GAC9B,0BAA0B,GAC1B,uBAAuB,GACvB,sBAAsB,EAAE,CAAC;AAE7B,yCAAyC;AACzC,MAAM,WAAW,gCAAgC;IAC/C,8BAA8B;IAC9B,QAAQ,EAAE,OAAO,+BAA+B,CAAC;IACjD,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,IAAI,EAAE,uBAAuB,CAAC;IAC9B,6BAA6B;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,6BAA6B;AAC7B,MAAM,WAAW,wBAAwB;IACvC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,mDAAmD;AACnD,MAAM,WAAW,8BAA8B;IAC7C,sBAAsB;IACtB,QAAQ,EAAE,OAAO,+BAA+B,CAAC;IACjD,2CAA2C;IAC3C,IAAI,EAAE,uBAAuB,CAAC;CAC/B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* City Language Model Transport v1 类型模块。
|
|
3
|
-
*
|
|
4
|
-
* 该协议只在 City 客户端模型与 Federation AIService 之间使用。所有负载都必须
|
|
5
|
-
* 可以经过 JSON 编解码,Provider 原始协议和密钥不得进入该边界。
|
|
6
|
-
*/
|
|
7
|
-
/** City Language Model Transport v1 的固定协议标识。 */
|
|
8
|
-
export const CITY_LANGUAGE_MODEL_PROTOCOL_V1 = "downcity-language-model-v1";
|
|
9
|
-
//# sourceMappingURL=CityLanguageModelTransport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CityLanguageModelTransport.js","sourceRoot":"","sources":["../../src/types/CityLanguageModelTransport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gDAAgD;AAChD,MAAM,CAAC,MAAM,+BAA+B,GAAG,4BAAqC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CityModel 客户端运行时类型模块。
|
|
3
|
-
*
|
|
4
|
-
* 这些类型负责把模型目录数据与已鉴权的 City HTTP 请求器组合成可执行模型,
|
|
5
|
-
* 不向 Agent 暴露 Federation URL 或 user token。
|
|
6
|
-
*/
|
|
7
|
-
import type { CityModelDescriptor } from "@downcity/type";
|
|
8
|
-
import type { FetchResponseLike } from "../pact/http.js";
|
|
9
|
-
import type { CityLanguageModelStreamRequestV1 } from "./CityLanguageModelTransport.js";
|
|
10
|
-
/** CityModel 构造参数。 */
|
|
11
|
-
export interface CityModelOptions {
|
|
12
|
-
/** Federation 模型目录返回的公开描述。 */
|
|
13
|
-
descriptor: CityModelDescriptor;
|
|
14
|
-
/** 使用 City 客户端鉴权上下文发送原生模型请求。 */
|
|
15
|
-
request_stream(request: CityLanguageModelStreamRequestV1, signal?: AbortSignal): Promise<FetchResponseLike>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=CityModelRuntime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CityModelRuntime.d.ts","sourceRoot":"","sources":["../../src/types/CityModelRuntime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAExF,sBAAsB;AACtB,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gCAAgC;IAChC,cAAc,CACZ,OAAO,EAAE,gCAAgC,EACzC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CityModelRuntime.js","sourceRoot":"","sources":["../../src/types/CityModelRuntime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|