Merge remote-tracking branch 'origin/feat/send-unify' into feat/send-unify

# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/architecture.md
This commit is contained in:
Turtle
2026-07-24 16:58:32 +08:00
114 changed files with 974 additions and 785 deletions

View File

@@ -32,16 +32,13 @@ function quote(value: string): string {
/**
* Reduce an exported class to its type shape: drop method/constructor bodies
* and property initializers so the catalog serves member signatures, not
* implementation. An abstract class (e.g. `Agent`) is a public type consumers
* program against, so it belongs in the type closure alongside interfaces.
* implementation.
*/
function classShape(node: ts.ClassDeclaration): ts.ClassDeclaration {
const isNonPublic = (member: ts.ClassElement): boolean =>
(ts.canHaveModifiers(member) ? ts.getModifiers(member) : undefined)?.some(m =>
m.kind === ts.SyntaxKind.PrivateKeyword || m.kind === ts.SyntaxKind.ProtectedKeyword) ?? false
const members = node.members.flatMap((member): ts.ClassElement[] => {
// A model-facing type shape carries only the public surface — drop private,
// protected, and #private members, and strip every kept member's body.
if (isNonPublic(member) || (ts.isPropertyDeclaration(member) && ts.isPrivateIdentifier(member.name))) return []
if (ts.isMethodDeclaration(member)) {
return [ts.factory.updateMethodDeclaration(
@@ -70,9 +67,8 @@ function classShape(node: ts.ClassDeclaration): ts.ClassDeclaration {
}
/**
* Collect exported interface, type-alias, and (body-stripped) class shapes;
* omit names declared in multiple packages rather than risk serving the wrong
* package's shape.
* Collect exported interface, type-alias, and body-stripped class shapes; omit
* names declared in multiple packages rather than serve the wrong shape.
*/
function collectTypeDecls(scanRoot: string = root): Map<string, string> {
const printer = ts.createPrinter({ removeComments: true })

View File

@@ -918,7 +918,7 @@ function renderLifecycle(): string {
' participant Session',
' participant Persistence',
' participant SDK as UI or SDK listener',
' User->>Agent: send(content)',
' User->>Agent: followup(content)',
` Agent-->>SDK: ${mermaidCode('agent/inbox/enqueue')}`,
' Agent->>Driver: queued work wakes driver',
` Driver-->>SDK: ${mermaidCode('agent/status')} running`,

View File

@@ -66,11 +66,6 @@
"symbol": "SessionEvent",
"source": "packages/core/session/src/types.ts"
},
{
"doc": "docs/core-data-structures/core.md",
"symbol": "SendTarget",
"source": "packages/core/agent/src/types.ts"
},
{
"doc": "docs/core-data-structures/core.md",
"symbol": "SendOptions",
@@ -78,7 +73,12 @@
},
{
"doc": "docs/core-data-structures/core.md",
"symbol": "AliasSendOptions",
"symbol": "InjectOptions",
"source": "packages/core/agent/src/types.ts"
},
{
"doc": "docs/core-data-structures/core.md",
"symbol": "ResolvedAgentInput",
"source": "packages/core/agent/src/types.ts"
},
{