feat(sources,organize): site agent capabilities and organize.minSizeBytes setting (W10-pre2)
- site.list / site.health_check / site.refresh_login / site.user_data capabilities over the W9-A site center services; outputs whitelisted (no secret refs, cookies, passwords, login names); execute kinds need automation grant. IDs use snake_case (CapabilityId regex); registry count 17 -> 21. - settings.organize.minSizeBytes (default 50 MiB); file-manager identify / organize and planImport take request > setting > port default. - tests and runbook notes (sites, files). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c08d8ce62a
commit
81bf010e3e
18 files changed
+563
-15
No files matched your search
@@ -8,7 +8,20 @@ import { ExternalEntityType, ExternalIdentity } from "./identity.ts";
|
||||
import { ServerMapping } from "./ops.ts";
|
||||
import { OrganizationAction, OrganizationRecord } from "./organization.ts";
|
||||
import { AcquisitionSlot, PolicyRevision } from "./policy.ts";
|
||||
import { SourceRelease } from "./sources.ts";
|
||||
import {
|
||||
SiteAccountError,
|
||||
SiteAccountOverall,
|
||||
SiteAccountStatus,
|
||||
SiteAccountUserData,
|
||||
SiteAdapter,
|
||||
SiteAuthKind,
|
||||
SiteHealth,
|
||||
SiteHealthResult,
|
||||
SiteLastHealth,
|
||||
SiteLoginResult,
|
||||
SiteUserDataPoint,
|
||||
SourceRelease,
|
||||
} from "./sources.ts";
|
||||
|
||||
// 首批能力的输入/输出 schema;名字与 CAPABILITY_CATALOG 中的 inputSchema/outputSchema 一致。
|
||||
// 写能力的输入只接受计划/对象 ID,不接受模型自拟的幂等键或任意路径。
|
||||
@@ -236,6 +249,73 @@ export const AgentAwaitInput = z.object({
|
||||
});
|
||||
export const AgentAwaitOutput = z.object({ results: z.array(SubagentResult), allDone: z.boolean() });
|
||||
|
||||
// ── 站点能力(W10-pre2):输出只给状态与统计,不含凭证、Cookie、secret 引用、登录名与站点 config ──
|
||||
|
||||
/** 账号摘要:凭证只给"有没有" */
|
||||
export const SiteAccountBrief = z.object({
|
||||
id: Id,
|
||||
label: z.string(),
|
||||
authKind: SiteAuthKind,
|
||||
enabled: z.boolean(),
|
||||
status: SiteAccountStatus,
|
||||
lastLoginAt: z.string().nullable(),
|
||||
lastVerifiedAt: z.string().nullable(),
|
||||
lastError: SiteAccountError.nullable(),
|
||||
userDataAt: z.string().nullable(),
|
||||
hasSession: z.boolean(),
|
||||
hasPasskey: z.boolean(),
|
||||
});
|
||||
export const SiteBrief = z.object({
|
||||
id: Id,
|
||||
key: z.string(),
|
||||
name: z.string(),
|
||||
adapter: SiteAdapter,
|
||||
baseUrl: z.string(),
|
||||
enabled: z.boolean(),
|
||||
healthStatus: SiteHealth,
|
||||
lastHealth: SiteLastHealth.nullable(),
|
||||
lastHealthAt: z.string().nullable(),
|
||||
accountStatus: SiteAccountOverall,
|
||||
accounts: z.array(SiteAccountBrief),
|
||||
});
|
||||
export const SiteListInput = z.object({
|
||||
/** 缺省只列启用的站点 */
|
||||
includeDisabled: z.boolean().default(false),
|
||||
keys: z.array(z.string().min(1)).max(100).optional(),
|
||||
});
|
||||
export const SiteListOutput = z.object({ items: z.array(SiteBrief) });
|
||||
|
||||
export const SiteHealthCheckInput = z.object({ siteId: Id });
|
||||
export const SiteHealthCheckOutput = SiteHealthResult;
|
||||
|
||||
export const SiteLoginRefreshInput = z.object({
|
||||
siteId: Id,
|
||||
/** 缺省:该站第一个启用的非 passkey 账号 */
|
||||
accountId: Id.optional(),
|
||||
});
|
||||
/** 同步执行(≤ 30 s)的登录结果 */
|
||||
export const SiteLoginRefreshOutput = SiteLoginResult;
|
||||
|
||||
export const SiteUserDataInput = z.object({
|
||||
siteId: Id,
|
||||
accountId: Id.optional(),
|
||||
days: z.number().int().min(1).max(400).default(30),
|
||||
});
|
||||
export const SiteUserDataOutput = z.object({
|
||||
siteId: Id,
|
||||
/** 各账号最近一次成功的用户数据 */
|
||||
accounts: z.array(
|
||||
z.object({
|
||||
accountId: Id,
|
||||
label: z.string(),
|
||||
status: SiteAccountStatus,
|
||||
userData: SiteAccountUserData.nullable(),
|
||||
userDataAt: z.string().nullable(),
|
||||
}),
|
||||
),
|
||||
history: z.array(SiteUserDataPoint),
|
||||
});
|
||||
|
||||
/** 能力 ID → 输入/输出 schema(server 注册处理器、agent 生成工具定义时共用) */
|
||||
export const CAPABILITY_IO = {
|
||||
"catalog.lookup": { input: CatalogLookupInput, output: CatalogLookupOutput },
|
||||
@@ -255,6 +335,10 @@ export const CAPABILITY_IO = {
|
||||
"inventory.query": { input: InventoryQueryInput, output: InventoryQueryOutput },
|
||||
"agent.spawn": { input: AgentSpawnInput, output: AgentSpawnOutput },
|
||||
"agent.await": { input: AgentAwaitInput, output: AgentAwaitOutput },
|
||||
"site.list": { input: SiteListInput, output: SiteListOutput },
|
||||
"site.health_check": { input: SiteHealthCheckInput, output: SiteHealthCheckOutput },
|
||||
"site.refresh_login": { input: SiteLoginRefreshInput, output: SiteLoginRefreshOutput },
|
||||
"site.user_data": { input: SiteUserDataInput, output: SiteUserDataOutput },
|
||||
} as const satisfies Record<KnownCapabilityId, { input: z.ZodType; output: z.ZodType }>;
|
||||
|
||||
type CapabilityIo = typeof CAPABILITY_IO;
|
||||
@@ -309,4 +393,12 @@ export type AgentSpawnOutput = z.infer<typeof AgentSpawnOutput>;
|
||||
export type AgentAwaitInput = z.infer<typeof AgentAwaitInput>;
|
||||
export type AgentAwaitOutput = z.infer<typeof AgentAwaitOutput>;
|
||||
export type SubagentResult = z.infer<typeof SubagentResult>;
|
||||
export type SiteListInput = z.infer<typeof SiteListInput>;
|
||||
export type SiteListOutput = z.infer<typeof SiteListOutput>;
|
||||
export type SiteHealthCheckInput = z.infer<typeof SiteHealthCheckInput>;
|
||||
export type SiteHealthCheckOutput = z.infer<typeof SiteHealthCheckOutput>;
|
||||
export type SiteLoginRefreshInput = z.infer<typeof SiteLoginRefreshInput>;
|
||||
export type SiteLoginRefreshOutput = z.infer<typeof SiteLoginRefreshOutput>;
|
||||
export type SiteUserDataInput = z.infer<typeof SiteUserDataInput>;
|
||||
export type SiteUserDataOutput = z.infer<typeof SiteUserDataOutput>;
|
||||
export type SubagentBudget = z.infer<typeof SubagentBudget>;
|
||||
Reference in new issue
Block a user