@downcity/type 0.1.213 → 0.1.218
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 +3 -1
- package/bin/index.d.ts +4 -2
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +2 -1
- package/bin/index.js.map +1 -1
- package/bin/session.d.ts +10 -2
- package/bin/session.d.ts.map +1 -1
- package/bin/session.js +4 -0
- package/bin/session.js.map +1 -1
- package/bin/shell.d.ts +0 -1
- package/bin/shell.d.ts.map +1 -1
- package/bin/types/city/CityRuntime.d.ts +23 -23
- package/bin/types/city/CityRuntime.d.ts.map +1 -1
- package/bin/types/city/CityRuntime.js +8 -2
- package/bin/types/city/CityRuntime.js.map +1 -1
- package/bin/types/session/SessionAction.d.ts +1 -16
- package/bin/types/session/SessionAction.d.ts.map +1 -1
- package/bin/types/session/SessionActionContract.d.ts +53 -0
- package/bin/types/session/SessionActionContract.d.ts.map +1 -0
- package/bin/types/session/SessionActionContract.js +16 -0
- package/bin/types/session/SessionActionContract.js.map +1 -0
- package/bin/types/session/SessionHook.d.ts +6 -62
- package/bin/types/session/SessionHook.d.ts.map +1 -1
- package/bin/types/session/SessionHook.js +3 -3
- package/bin/types/session/SessionHookPoints.d.ts +18 -0
- package/bin/types/session/SessionHookPoints.d.ts.map +1 -0
- package/bin/types/session/SessionHookPoints.js +18 -0
- package/bin/types/session/SessionHookPoints.js.map +1 -0
- package/bin/types/session/SessionInteraction.d.ts +112 -68
- package/bin/types/session/SessionInteraction.d.ts.map +1 -1
- package/bin/types/session/SessionInteraction.js +3 -1
- package/bin/types/session/SessionInteraction.js.map +1 -1
- package/bin/types/session/SessionMessage.d.ts +21 -11
- package/bin/types/session/SessionMessage.d.ts.map +1 -1
- package/bin/types/session/SessionSystem.d.ts +2 -2
- package/bin/types/session/SessionSystem.d.ts.map +1 -1
- package/bin/types/session/SessionSystem.js +1 -1
- package/bin/types/session/SessionUserContextTags.d.ts +25 -0
- package/bin/types/session/SessionUserContextTags.d.ts.map +1 -0
- package/bin/types/session/SessionUserContextTags.js +30 -0
- package/bin/types/session/SessionUserContextTags.js.map +1 -0
- package/bin/types/session/ToolCallContext.d.ts +59 -0
- package/bin/types/session/ToolCallContext.d.ts.map +1 -0
- package/bin/types/session/ToolCallContext.js +13 -0
- package/bin/types/session/ToolCallContext.js.map +1 -0
- package/bin/types/shell/Sandbox.d.ts +124 -3
- package/bin/types/shell/Sandbox.d.ts.map +1 -1
- package/bin/types/shell/Sandbox.js +2 -1
- package/bin/types/shell/Sandbox.js.map +1 -1
- package/bin/types/shell/ShellAction.d.ts +5 -10
- package/bin/types/shell/ShellAction.d.ts.map +1 -1
- package/bin/types/shell/ShellApproval.d.ts +5 -46
- package/bin/types/shell/ShellApproval.d.ts.map +1 -1
- package/bin/types/shell/ShellApproval.js +5 -5
- package/bin/types/shell/ShellApproval.js.map +1 -1
- package/bin/types/shell/ShellHostContext.d.ts +6 -4
- package/bin/types/shell/ShellHostContext.d.ts.map +1 -1
- package/bin/types/shell/ShellRuntime.d.ts +17 -9
- package/bin/types/shell/ShellRuntime.d.ts.map +1 -1
- package/bin/types/shell/ShellRuntimeOptions.d.ts +0 -8
- package/bin/types/shell/ShellRuntimeOptions.d.ts.map +1 -1
- package/bin/types/shell/WorkspaceShell.d.ts +9 -3
- package/bin/types/shell/WorkspaceShell.d.ts.map +1 -1
- package/bin/types/storage/Storage.d.ts +7 -0
- package/bin/types/storage/Storage.d.ts.map +1 -1
- package/bin/types/time/Time.d.ts +18 -0
- package/bin/types/time/Time.d.ts.map +1 -0
- package/bin/types/time/Time.js +62 -0
- package/bin/types/time/Time.js.map +1 -0
- package/bin/types/tool/AgentTool.d.ts +25 -0
- package/bin/types/tool/AgentTool.d.ts.map +1 -0
- package/bin/types/tool/AgentTool.js +12 -0
- package/bin/types/tool/AgentTool.js.map +1 -0
- package/bin/types/tool/RuntimeTool.d.ts +0 -2
- package/bin/types/tool/RuntimeTool.d.ts.map +1 -1
- package/bin/types/tool/RuntimeTool.js.map +1 -1
- package/bin/types/tool/ToolEffect.d.ts +14 -0
- package/bin/types/tool/ToolEffect.d.ts.map +1 -0
- package/bin/types/tool/ToolEffect.js +8 -0
- package/bin/types/tool/ToolEffect.js.map +1 -0
- package/bin/types/tool/ToolHook.d.ts +31 -0
- package/bin/types/tool/ToolHook.d.ts.map +1 -0
- package/bin/types/tool/ToolHook.js +18 -0
- package/bin/types/tool/ToolHook.js.map +1 -0
- package/bin/types/tool/index.d.ts +3 -2
- package/bin/types/tool/index.d.ts.map +1 -1
- package/bin/types/tool/index.js +2 -1
- package/bin/types/tool/index.js.map +1 -1
- package/bin/types/workspace/FileTool.d.ts +4 -4
- package/bin/types/workspace/FileTool.d.ts.map +1 -1
- package/bin/types/workspace/SearchTool.d.ts +3 -3
- package/bin/types/workspace/SearchTool.d.ts.map +1 -1
- package/bin/types/workspace/WorkspaceFileMutation.d.ts +2 -2
- package/bin/types/workspace/WorkspaceFileMutation.d.ts.map +1 -1
- package/bin/types/workspace/WorkspaceRuntime.d.ts +3 -0
- package/bin/types/workspace/WorkspaceRuntime.d.ts.map +1 -1
- package/bin/types/workspace/WorkspaceToolResult.d.ts +2 -2
- package/bin/types/workspace/WorkspaceToolResult.d.ts.map +1 -1
- package/bin/types/workspace/WorkspaceTools.d.ts +3 -3
- package/bin/types/workspace/WorkspaceTools.d.ts.map +1 -1
- package/bin/types/workspace/WorkspaceTools.js +1 -1
- package/bin/workspace.d.ts +1 -0
- package/bin/workspace.d.ts.map +1 -1
- package/bin/workspace.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,4 +9,6 @@
|
|
|
9
9
|
- `CityModelDescriptor`:City 模型目录返回的公开模型信息。
|
|
10
10
|
- `CityModel`:User City 返回的可执行 City 模型,可被支持 City model 的 SDK 直接消费。
|
|
11
11
|
- `isCityModel()`:判断一个值是否实现 City model 协议。
|
|
12
|
-
- `
|
|
12
|
+
- `ToolEffect`:Tool 向宿主报告已经发生、需要在当前 Turn 内收集的结构化副作用。
|
|
13
|
+
- `AgentTool` / `ToolCallContext`:Agent 可调用工具的协议与执行时注入的调用环境。
|
|
14
|
+
- `ToolHookSet`:扩展能力按检查点贡献内容的处理器集合。
|
package/bin/index.d.ts
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
export { CITY_MODEL_KIND, isCityModel, } from "./types/CityModel.js";
|
|
7
7
|
export type { CityModel, CityModelDescriptor, CityModelEnvRequirement, CityModelReasoning, CityModelReasoningEffort, ModelPricing, } from "./types/CityModel.js";
|
|
8
8
|
export type { AuthRoutePolicy } from "./types/auth/AuthRoute.js";
|
|
9
|
-
export type { CityRuntime } from "./types/city/CityRuntime.js";
|
|
9
|
+
export type { CityRuntime, PowerSurface } from "./types/city/CityRuntime.js";
|
|
10
10
|
export { MODEL_PROTOCOL_VERSION, ModelStreamValidator, read_model_context_window, read_model_label, } from "./types/model/index.js";
|
|
11
11
|
export type { ModelCall, ModelClient, ModelContent, ModelError, ModelErrorCode, ModelFileBase64Source, ModelFileContent, ModelFileSource, ModelFileUrlSource, ModelFinishReason, ModelJsonContent, ModelJsonValue, ModelMessage, ModelReasoningContent, ModelReasoningRequest, ModelRequestFailureNotice, ModelRequestKind, ModelResponseFormat, ModelStreamEnvelope, ModelStreamEvent, ModelStreamRequest, ModelTextContent, ModelTool, ModelToolCallContent, ModelToolChoice, ModelToolResultContent, ModelToolResultPart, ModelUsage, } from "./types/model/index.js";
|
|
12
|
-
export {
|
|
12
|
+
export { define_agent_tool, EMPTY_TOOL_HOOK_SET, type AgentTool, type EffectHook, type GuardHook, type PipelineHook, type ToolEffect, type ToolHookSet, } from "./types/tool/index.js";
|
|
13
|
+
export type { ToolCallContext, ToolCallUserMessage, } from "./types/session/ToolCallContext.js";
|
|
13
14
|
export * from "./workspace.js";
|
|
14
15
|
export * from "./shell.js";
|
|
15
16
|
export * from "./session.js";
|
|
17
|
+
export { format_date_in_timezone, format_date_time_in_timezone, format_year_in_timezone, resolve_runtime_timezone, } from "./types/time/Time.js";
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/bin/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE7E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,GACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAE5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC"}
|
package/bin/index.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { CITY_MODEL_KIND, isCityModel, } from "./types/CityModel.js";
|
|
7
7
|
export { MODEL_PROTOCOL_VERSION, ModelStreamValidator, read_model_context_window, read_model_label, } from "./types/model/index.js";
|
|
8
|
-
export {
|
|
8
|
+
export { define_agent_tool, EMPTY_TOOL_HOOK_SET, } from "./types/tool/index.js";
|
|
9
9
|
export * from "./workspace.js";
|
|
10
10
|
export * from "./shell.js";
|
|
11
11
|
export * from "./session.js";
|
|
12
|
+
export { format_date_in_timezone, format_date_time_in_timezone, format_year_in_timezone, resolve_runtime_timezone, } from "./types/time/Time.js";
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
package/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAe9B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAgChC,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAe9B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAgChC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAOpB,MAAM,uBAAuB,CAAC;AAO/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC"}
|
package/bin/session.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @downcity/type/session:Session 跨包数据协议入口。
|
|
3
|
+
*
|
|
4
|
+
* 这里同时导出 Session 领域类型与跨包共享的协议常量。
|
|
5
|
+
*/
|
|
2
6
|
export type { JsonObject, JsonPrimitive, JsonValue, } from "./types/json/Json.js";
|
|
3
7
|
export { normalize_session_origin, normalize_session_origin_type, restore_session_origin, type SessionOrigin, } from "./types/session/SessionOrigin.js";
|
|
4
8
|
export type * from "./types/session/SessionContent.js";
|
|
5
9
|
export type * from "./types/session/SessionMessage.js";
|
|
6
|
-
export type
|
|
10
|
+
export { MESSENGER_ENVIRONMENT_CONTEXT_TAG, MESSENGER_INFO_CONTEXT_TAG, MESSENGER_RUNTIME_CONTEXT_TAGS, is_messenger_runtime_context_tag, type MessengerRuntimeContextTag, } from "./types/session/SessionUserContextTags.js";
|
|
11
|
+
export * from "./types/session/SessionInteraction.js";
|
|
7
12
|
export type * from "./types/session/SessionAction.js";
|
|
13
|
+
export { SESSION_HOOK_POINTS } from "./types/session/SessionHookPoints.js";
|
|
14
|
+
export { is_action_result, type ActionResult, type ActionResultMessage, type SessionSystemMessage, } from "./types/session/SessionActionContract.js";
|
|
8
15
|
export type * from "./types/session/SessionTurnFileDiff.js";
|
|
9
16
|
export * from "./types/session/SessionMutation.js";
|
|
10
17
|
export type { SessionSystemBlock, SessionSystemBlockSource, } from "./types/session/SessionSystem.js";
|
|
11
18
|
export type * from "./types/session/SessionHook.js";
|
|
19
|
+
export type { ToolCallContext, ToolCallUserMessage, } from "./types/session/ToolCallContext.js";
|
|
12
20
|
//# sourceMappingURL=session.d.ts.map
|
package/bin/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,EACV,UAAU,EACV,aAAa,EACb,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,aAAa,GACnB,MAAM,kCAAkC,CAAC;AAC1C,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,mCAAmC,CAAC;AACvD,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,EAChC,KAAK,0BAA0B,GAChC,MAAM,2CAA2C,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,mBAAmB,kCAAkC,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,0CAA0C,CAAC;AAClD,mBAAmB,wCAAwC,CAAC;AAC5D,cAAc,oCAAoC,CAAC;AACnD,YAAY,EACV,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,mBAAmB,gCAAgC,CAAC;AACpD,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,oCAAoC,CAAC"}
|
package/bin/session.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { normalize_session_origin, normalize_session_origin_type, restore_session_origin, } from "./types/session/SessionOrigin.js";
|
|
2
|
+
export { MESSENGER_ENVIRONMENT_CONTEXT_TAG, MESSENGER_INFO_CONTEXT_TAG, MESSENGER_RUNTIME_CONTEXT_TAGS, is_messenger_runtime_context_tag, } from "./types/session/SessionUserContextTags.js";
|
|
3
|
+
export * from "./types/session/SessionInteraction.js";
|
|
4
|
+
export { SESSION_HOOK_POINTS } from "./types/session/SessionHookPoints.js";
|
|
5
|
+
export { is_action_result, } from "./types/session/SessionActionContract.js";
|
|
2
6
|
export * from "./types/session/SessionMutation.js";
|
|
3
7
|
//# sourceMappingURL=session.js.map
|
package/bin/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,GAEvB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,GAEjC,MAAM,2CAA2C,CAAC;AACnD,cAAc,uCAAuC,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,gBAAgB,GAIjB,MAAM,0CAA0C,CAAC;AAElD,cAAc,oCAAoC,CAAC"}
|
package/bin/shell.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export type * from "./types/shell/Sandbox.js";
|
|
3
3
|
export type { ShellExecInput, ShellSessionInput, ShellExecutionTarget, } from "./types/shell/Shell.js";
|
|
4
4
|
export type * from "./types/shell/ShellAction.js";
|
|
5
|
-
export type * from "./types/shell/ShellApproval.js";
|
|
6
5
|
export type * from "./types/shell/ShellCommand.js";
|
|
7
6
|
export type * from "./types/shell/ShellHostContext.js";
|
|
8
7
|
export type * from "./types/shell/ShellRuntime.js";
|
package/bin/shell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,mBAAmB,0BAA0B,CAAC;AAC9C,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,mBAAmB,0BAA0B,CAAC;AAC9C,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,sCAAsC,CAAC;AAC1D,mBAAmB,iCAAiC,CAAC"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* City 跨包最小运行协议。
|
|
3
3
|
*
|
|
4
|
-
* City 是 Agent 的可选组合根。Agent 只依赖这份能力投影,不依赖具体 City
|
|
5
|
-
*
|
|
4
|
+
* City 是 Agent 的可选组合根。Agent 与 Group 只依赖这份能力投影,不依赖具体 City
|
|
5
|
+
* package,也不理解 Power、Transport 或其他 City 内部实现。
|
|
6
|
+
*
|
|
7
|
+
* 关键点(中文)
|
|
8
|
+
* - 这是「环境句柄」:主体在绑定时收下它,之后只读,不向容器索取、不反向通知。
|
|
9
|
+
* - 环境是活的:容器可以在运行期增删 Power,主体读到的始终是当前值,不需要失效通知。
|
|
10
|
+
* - 不含 Workspace 查询:Workspace 由调用方在 `sessions.create({ workspace })` 时
|
|
11
|
+
* 显式传入,主体不回查容器;归属校验属于容器边界职责。
|
|
6
12
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
import type { AgentTool, ToolHookSet } from "../tool/index.js";
|
|
14
|
+
import type { StorageProvider } from "../storage/Storage.js";
|
|
15
|
+
/** 容器当前生效的 Power 能力产物。 */
|
|
16
|
+
export interface PowerSurface {
|
|
17
|
+
/** 当前 Power 工具集合,键为 power 名。 */
|
|
18
|
+
readonly tools: Readonly<Record<string, AgentTool>>;
|
|
19
|
+
/** 当前 Power 检查点处理器集合。 */
|
|
20
|
+
readonly hooks: ToolHookSet;
|
|
21
|
+
}
|
|
22
|
+
/** 主体加入容器后可以使用的容器运行环境。 */
|
|
11
23
|
export interface CityRuntime {
|
|
12
|
-
/**
|
|
24
|
+
/** 容器为主体私有运行数据提供的底层存储。 */
|
|
13
25
|
readonly storage: StorageProvider;
|
|
14
|
-
/**
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
/** 等待 Agent 执行依赖的 City 能力完成初始化。 */
|
|
20
|
-
ensure_ready(): Promise<void>;
|
|
21
|
-
/** 返回当前 Agent/Workspace 在一个执行检查点可见的 City Tool。 */
|
|
22
|
-
get_session_tools(agent_id: string, workspace: WorkspaceRuntime): Record<string, RuntimeTool>;
|
|
23
|
-
/** 返回当前 Agent/Workspace 在一个执行检查点可见的 Session Hook。 */
|
|
24
|
-
get_session_hooks(agent_id: string, workspace: WorkspaceRuntime): SessionHookRuntime;
|
|
25
|
-
/** Agent 主动释放时清除 City 持有的运行时引用。 */
|
|
26
|
-
release_agent(agent: {
|
|
27
|
-
/** Agent 的全局稳定标识。 */
|
|
28
|
-
readonly id: string;
|
|
29
|
-
}): Promise<void>;
|
|
26
|
+
/** 容器当前生效的 Power 工具集合,键为 power 名;主体只读,不缓存。 */
|
|
27
|
+
readonly power_tools: Readonly<Record<string, AgentTool>>;
|
|
28
|
+
/** 容器当前生效的 Power 检查点处理器;主体只读,不缓存。 */
|
|
29
|
+
readonly power_hooks: ToolHookSet;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=CityRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CityRuntime.d.ts","sourceRoot":"","sources":["../../../src/types/city/CityRuntime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CityRuntime.d.ts","sourceRoot":"","sources":["../../../src/types/city/CityRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,0BAA0B;AAC1B,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAEpD,yBAAyB;IACzB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,0BAA0B;AAC1B,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAElC,8CAA8C;IAC9C,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAE1D,qCAAqC;IACrC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* City 跨包最小运行协议。
|
|
3
3
|
*
|
|
4
|
-
* City 是 Agent 的可选组合根。Agent 只依赖这份能力投影,不依赖具体 City
|
|
5
|
-
*
|
|
4
|
+
* City 是 Agent 的可选组合根。Agent 与 Group 只依赖这份能力投影,不依赖具体 City
|
|
5
|
+
* package,也不理解 Power、Transport 或其他 City 内部实现。
|
|
6
|
+
*
|
|
7
|
+
* 关键点(中文)
|
|
8
|
+
* - 这是「环境句柄」:主体在绑定时收下它,之后只读,不向容器索取、不反向通知。
|
|
9
|
+
* - 环境是活的:容器可以在运行期增删 Power,主体读到的始终是当前值,不需要失效通知。
|
|
10
|
+
* - 不含 Workspace 查询:Workspace 由调用方在 `sessions.create({ workspace })` 时
|
|
11
|
+
* 显式传入,主体不回查容器;归属校验属于容器边界职责。
|
|
6
12
|
*/
|
|
7
13
|
export {};
|
|
8
14
|
//# sourceMappingURL=CityRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CityRuntime.js","sourceRoot":"","sources":["../../../src/types/city/CityRuntime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CityRuntime.js","sourceRoot":"","sources":["../../../src/types/city/CityRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export type SessionActionStatus = "running" | "completed" | "failed";
|
|
9
9
|
/** Session Action 运行事件。 */
|
|
10
10
|
export interface SessionActionEvent {
|
|
11
|
-
/** 同一 Action
|
|
11
|
+
/** 同一 Action 生命周期内稳定复用的标识;由调用方提供,使同一 Action 的多次事件落到同一条 canonical Part。 */
|
|
12
12
|
action_id: string;
|
|
13
13
|
/** Action 的业务类别。 */
|
|
14
14
|
action_type: string;
|
|
@@ -21,19 +21,4 @@ export interface SessionActionEvent {
|
|
|
21
21
|
/** Action 当前生命周期状态。 */
|
|
22
22
|
status: SessionActionStatus;
|
|
23
23
|
}
|
|
24
|
-
/** 创建 Session Action 事件的输入。 */
|
|
25
|
-
export interface SessionActionEventInput {
|
|
26
|
-
/** 可选稳定标识;省略时由 Session 分配。 */
|
|
27
|
-
action_id?: string;
|
|
28
|
-
/** Action 的业务类别。 */
|
|
29
|
-
action_type: string;
|
|
30
|
-
/** Action 所属 Turn;独立 Session 操作允许省略。 */
|
|
31
|
-
turn_id?: string;
|
|
32
|
-
/** Action 的用户可读标题。 */
|
|
33
|
-
title: string;
|
|
34
|
-
/** Action 的可选用户可读说明。 */
|
|
35
|
-
description?: string;
|
|
36
|
-
/** Action 当前生命周期状态。 */
|
|
37
|
-
status: SessionActionStatus;
|
|
38
|
-
}
|
|
39
24
|
//# sourceMappingURL=SessionAction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionAction.d.ts","sourceRoot":"","sources":["../../../src/types/session/SessionAction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6BAA6B;AAC7B,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAErE,2BAA2B;AAC3B,MAAM,WAAW,kBAAkB;IACjC,
|
|
1
|
+
{"version":3,"file":"SessionAction.d.ts","sourceRoot":"","sources":["../../../src/types/session/SessionAction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6BAA6B;AAC7B,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAErE,2BAA2B;AAC3B,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session system message 与 Action 结果的中立协议。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 这些结构同时被 Agent 执行链与 Power 动作返回值使用,属于跨侧数据契约。
|
|
6
|
+
* - 只描述数据形状,不引用任何实现包。
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolEffect } from "../tool/ToolEffect.js";
|
|
9
|
+
import type { SessionAgentContent, SessionModelUserContent } from "./SessionContent.js";
|
|
10
|
+
/**
|
|
11
|
+
* Session 运行阶段使用的 system message。
|
|
12
|
+
*
|
|
13
|
+
* 关键点(中文)
|
|
14
|
+
* - 该类型属于 Downcity Session,不依赖第三方 Provider。
|
|
15
|
+
*/
|
|
16
|
+
export interface SessionSystemMessage {
|
|
17
|
+
/** 消息角色固定为 system。 */
|
|
18
|
+
role: "system";
|
|
19
|
+
/** 当前 system block 的文本内容。 */
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
/** Action 执行后产生的一条 Session 消息。 */
|
|
23
|
+
export type ActionResultMessage = {
|
|
24
|
+
/** User 内容在下一 Step 生效。 */
|
|
25
|
+
role: "user";
|
|
26
|
+
/** 只在当前 Turn 生效、不会伪装成 canonical Message 的模型输入。 */
|
|
27
|
+
parts: SessionModelUserContent[];
|
|
28
|
+
} | {
|
|
29
|
+
/** Agent 内容写入当前 canonical 回复。 */
|
|
30
|
+
role: "agent";
|
|
31
|
+
/** 等待追加到 canonical Agent Message 的内容。 */
|
|
32
|
+
parts: SessionAgentContent[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Action 或 Tool 内部实现返回的统一结果。
|
|
36
|
+
*
|
|
37
|
+
* 关键点(中文)
|
|
38
|
+
* - `output` 是标准 Tool Result,原样交给模型执行器和 canonical Tool Part。
|
|
39
|
+
* - `messages` 是执行后产生的运行期 User 输入或 canonical Agent 内容。
|
|
40
|
+
* - `effects` 是当前 Turn 只追加收集、并在收口检查点解释的已发生副作用。
|
|
41
|
+
* - Message Parts 复用 Downcity Session UI 协议,不再建立文件、图片或 Power 专用桥接。
|
|
42
|
+
*/
|
|
43
|
+
export interface ActionResult<TOutput = unknown> {
|
|
44
|
+
/** 返回给调用方、模型执行器与 canonical Tool Part 的标准执行输出。 */
|
|
45
|
+
output: TOutput;
|
|
46
|
+
/** 执行产生的运行期 User 输入或 Agent 输出;没有附加内容时传入空数组。 */
|
|
47
|
+
messages: ActionResultMessage[];
|
|
48
|
+
/** 已经发生且需要由当前 Turn 收集的副作用;不会发送给模型或直接持久化。 */
|
|
49
|
+
effects?: readonly ToolEffect[];
|
|
50
|
+
}
|
|
51
|
+
/** 判断未知 Tool 输出是否使用统一 ActionResult 协议。 */
|
|
52
|
+
export declare function is_action_result(value: unknown): value is ActionResult;
|
|
53
|
+
//# sourceMappingURL=SessionActionContract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionActionContract.d.ts","sourceRoot":"","sources":["../../../src/types/session/SessionActionContract.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,sBAAsB;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kCAAkC;AAClC,MAAM,MAAM,mBAAmB,GAC3B;IACE,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,KAAK,EAAE,uBAAuB,EAAE,CAAC;CAClC,GACD;IACE,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,yCAAyC;IACzC,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B,CAAC;AAEN;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY,CAAC,OAAO,GAAG,OAAO;IAC7C,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;IAEhB,+CAA+C;IAC/C,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAEhC,4CAA4C;IAC5C,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACjC;AAED,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAKtE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session system message 与 Action 结果的中立协议。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 这些结构同时被 Agent 执行链与 Power 动作返回值使用,属于跨侧数据契约。
|
|
6
|
+
* - 只描述数据形状,不引用任何实现包。
|
|
7
|
+
*/
|
|
8
|
+
/** 判断未知 Tool 输出是否使用统一 ActionResult 协议。 */
|
|
9
|
+
export function is_action_result(value) {
|
|
10
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
11
|
+
return false;
|
|
12
|
+
const record = value;
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(record, "output") &&
|
|
14
|
+
Array.isArray(record.messages);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=SessionActionContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionActionContract.js","sourceRoot":"","sources":["../../../src/types/session/SessionActionContract.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwDH,0CAA0C;AAC1C,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9E,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;QAC3D,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,72 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Session
|
|
2
|
+
* Session 检查点值协议。
|
|
3
3
|
*
|
|
4
|
-
* Agent
|
|
5
|
-
*
|
|
4
|
+
* Agent 定义检查点,扩展能力在检查点上贡献内容。这里只描述「检查点看到什么值」,
|
|
5
|
+
* 不描述处理器如何注册或调度:处理器是普通函数,由编译产物直接提供给 Agent。
|
|
6
6
|
*/
|
|
7
|
-
import type { JsonValue } from "../json/Json.js";
|
|
8
7
|
import type { SessionMessage } from "./SessionMessage.js";
|
|
9
|
-
import type { SessionOrigin } from "./SessionOrigin.js";
|
|
10
8
|
import type { SessionSystemBlock } from "./SessionSystem.js";
|
|
11
|
-
/** Session 向 Hook 暴露的单次执行快照。 */
|
|
12
|
-
export interface SessionHookContext {
|
|
13
|
-
/** 当前 Session 标识;非 Session 调用时为空。 */
|
|
14
|
-
readonly session_id?: string;
|
|
15
|
-
/** 当前 Session 来源;非 Session 调用时为空。 */
|
|
16
|
-
readonly session_origin?: SessionOrigin;
|
|
17
|
-
/** 当前 Turn 标识;非 Turn 调用时为空。 */
|
|
18
|
-
readonly turn_id?: string;
|
|
19
|
-
/** 当前 Workspace 的逻辑根路径。 */
|
|
20
|
-
readonly project_root?: string;
|
|
21
|
-
/** 当前 Step 已提交的 Workspace 环境快照。 */
|
|
22
|
-
readonly workspace_env?: Readonly<Record<string, string>>;
|
|
23
|
-
/** 当前 Step 已提交的 Agent 指令快照。 */
|
|
24
|
-
readonly agent_systems?: readonly string[];
|
|
25
|
-
/** 当前 Turn 的协作式取消信号。 */
|
|
26
|
-
readonly abort_signal?: AbortSignal;
|
|
27
|
-
/** 当前 Tool 或宿主调用的稳定标识。 */
|
|
28
|
-
readonly call_id?: string;
|
|
29
|
-
}
|
|
30
|
-
/** 单个 Session Step 捕获的稳定 Hook 执行作用域。 */
|
|
31
|
-
export interface SessionHookScopeRuntime {
|
|
32
|
-
/** 解析当前作用域中生效的 system blocks。 */
|
|
33
|
-
system_blocks(context?: SessionHookContext): Promise<SessionSystemBlock[]>;
|
|
34
|
-
/** 按注册顺序运行一个可转换值的 Hook。 */
|
|
35
|
-
pipeline<TValue = JsonValue>(point_name: string, value: TValue): Promise<TValue>;
|
|
36
|
-
/** 按注册顺序运行一个只产生副作用的 Hook。 */
|
|
37
|
-
effect<TValue = JsonValue>(point_name: string, value: TValue): Promise<void>;
|
|
38
|
-
/** 幂等释放当前作用域捕获的长期资源。 */
|
|
39
|
-
close(): Promise<void>;
|
|
40
|
-
}
|
|
41
|
-
/** Session 在执行检查点消费的 Hook 集合协议。 */
|
|
42
|
-
export interface SessionHookRuntime {
|
|
43
|
-
/** 解析当前执行视图中生效的 system blocks。 */
|
|
44
|
-
system_blocks(context?: SessionHookContext): Promise<SessionSystemBlock[]>;
|
|
45
|
-
/** 按注册顺序运行一个可转换值的 Hook。 */
|
|
46
|
-
pipeline<TValue = JsonValue>(point_name: string, value: TValue): Promise<TValue>;
|
|
47
|
-
/** 按注册顺序运行一个只产生副作用的 Hook。 */
|
|
48
|
-
effect<TValue = JsonValue>(point_name: string, value: TValue): Promise<void>;
|
|
49
|
-
/** 为下一个 Session Step 捕获稳定 Hook 作用域。 */
|
|
50
|
-
open(): Promise<SessionHookScopeRuntime>;
|
|
51
|
-
}
|
|
52
|
-
/** SessionHooks 与 SessionHookScope 共用的具体处理函数。 */
|
|
53
|
-
export interface SessionHookHandlers {
|
|
54
|
-
/** 解析当前执行视图中生效的 system blocks。 */
|
|
55
|
-
readonly system_blocks?: (context?: SessionHookContext) => Promise<SessionSystemBlock[]>;
|
|
56
|
-
/** 按注册顺序运行一个可转换值的 Hook。 */
|
|
57
|
-
readonly pipeline?: <TValue = JsonValue>(point_name: string, value: TValue) => Promise<TValue>;
|
|
58
|
-
/** 按注册顺序运行一个只产生副作用的 Hook。 */
|
|
59
|
-
readonly effect?: <TValue = JsonValue>(point_name: string, value: TValue) => Promise<void>;
|
|
60
|
-
/** 幂等释放当前 Scope 捕获的长期资源占用。 */
|
|
61
|
-
readonly close?: () => Promise<void>;
|
|
62
|
-
/** 为下一个 Step 捕获一份稳定 Hook 作用域。 */
|
|
63
|
-
readonly open?: () => SessionHookHandlers | Promise<SessionHookHandlers>;
|
|
64
|
-
}
|
|
65
9
|
/** Hook 在当前 Turn 中返回的一条低权限动态参考内容。 */
|
|
66
10
|
export interface SessionHookContextBlock {
|
|
67
|
-
/** 产生当前内容块的
|
|
68
|
-
|
|
69
|
-
/**
|
|
11
|
+
/** 产生当前内容块的 Power 稳定名称。 */
|
|
12
|
+
source_power: string;
|
|
13
|
+
/** Power 内稳定且非空的内容块名称。 */
|
|
70
14
|
name: string;
|
|
71
15
|
/** 需要追加到当前 User 模型消息副本的完整文本。 */
|
|
72
16
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionHook.d.ts","sourceRoot":"","sources":["../../../src/types/session/SessionHook.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SessionHook.d.ts","sourceRoot":"","sources":["../../../src/types/session/SessionHook.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,qCAAqC;AACrC,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,4CAA4C;AAC5C,MAAM,WAAW,6BAA6B;IAC5C,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,0CAA0C;AAC1C,MAAM,WAAW,2BAA2B;IAC1C,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,8BAA8B;IAC9B,MAAM,EAAE,uBAAuB,EAAE,CAAC;CACnC;AAED,kCAAkC;AAClC,MAAM,MAAM,0BAA0B,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5E,0CAA0C;AAC1C,MAAM,WAAW,6BAA6B;IAC5C,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,MAAM,EAAE,0BAA0B,CAAC;IACnC,6CAA6C;IAC7C,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Session
|
|
2
|
+
* Session 检查点值协议。
|
|
3
3
|
*
|
|
4
|
-
* Agent
|
|
5
|
-
*
|
|
4
|
+
* Agent 定义检查点,扩展能力在检查点上贡献内容。这里只描述「检查点看到什么值」,
|
|
5
|
+
* 不描述处理器如何注册或调度:处理器是普通函数,由编译产物直接提供给 Agent。
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=SessionHook.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session 公开的稳定 Hook 检查点。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 检查点由 Session 定义并触发;Power 只选择是否注册处理器。
|
|
6
|
+
* - 该常量是 Agent 与 Power 必须就同一组名字达成一致的协议,因此定义在
|
|
7
|
+
* 共享定义层,不归属任何实现包。
|
|
8
|
+
*/
|
|
9
|
+
/** Session 运行时的 Hook point 目录。 */
|
|
10
|
+
export declare const SESSION_HOOK_POINTS: Readonly<{
|
|
11
|
+
/** 建立 Session system snapshot 时允许 Hook 追加命名 blocks。 */
|
|
12
|
+
readonly system_context: "session.system_context";
|
|
13
|
+
/** 当前 Turn 首次组装模型输入时允许 Hook 追加低权限参考 blocks。 */
|
|
14
|
+
readonly turn_context: "session.turn_context";
|
|
15
|
+
/** canonical Turn 完成提交后通知 Hook 执行副作用。 */
|
|
16
|
+
readonly turn_committed: "session.turn_committed";
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=SessionHookPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionHookPoints.d.ts","sourceRoot":"","sources":["../../../src/types/session/SessionHookPoints.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kCAAkC;AAClC,eAAO,MAAM,mBAAmB;IAC9B,uDAAuD;;IAGvD,+CAA+C;;IAG/C,yCAAyC;;EAEhC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session 公开的稳定 Hook 检查点。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 检查点由 Session 定义并触发;Power 只选择是否注册处理器。
|
|
6
|
+
* - 该常量是 Agent 与 Power 必须就同一组名字达成一致的协议,因此定义在
|
|
7
|
+
* 共享定义层,不归属任何实现包。
|
|
8
|
+
*/
|
|
9
|
+
/** Session 运行时的 Hook point 目录。 */
|
|
10
|
+
export const SESSION_HOOK_POINTS = Object.freeze({
|
|
11
|
+
/** 建立 Session system snapshot 时允许 Hook 追加命名 blocks。 */
|
|
12
|
+
system_context: "session.system_context",
|
|
13
|
+
/** 当前 Turn 首次组装模型输入时允许 Hook 追加低权限参考 blocks。 */
|
|
14
|
+
turn_context: "session.turn_context",
|
|
15
|
+
/** canonical Turn 完成提交后通知 Hook 执行副作用。 */
|
|
16
|
+
turn_committed: "session.turn_committed",
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=SessionHookPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionHookPoints.js","sourceRoot":"","sources":["../../../src/types/session/SessionHookPoints.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kCAAkC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,uDAAuD;IACvD,cAAc,EAAE,wBAAwB;IAExC,+CAA+C;IAC/C,YAAY,EAAE,sBAAsB;IAEpC,yCAAyC;IACzC,cAAc,EAAE,wBAAwB;CAChC,CAAC,CAAC"}
|