@sema-agent/server 7.123.0 → 7.124.0
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/MIGRATION.md +132 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/USAGE.md +53 -51
- package/dist/approval-ask-audit-store.d.ts +27 -32
- package/dist/approval-ask-audit-store.js +10 -9
- package/dist/approval-crash-convergence.d.ts +2 -2
- package/dist/approval-crash-convergence.js +5 -5
- package/dist/approval-deny-reasons.d.ts +163 -51
- package/dist/approval-deny-reasons.js +79 -8
- package/dist/approval-policy-settlement.d.ts +4 -1
- package/dist/approval-policy-settlement.js +3 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval-reconciler.js +10 -10
- package/dist/approval.d.ts +1 -1
- package/dist/approval.js +1 -1
- package/dist/audit.js +1 -1
- package/dist/auth-bridge.d.ts +8 -8
- package/dist/auth-bridge.js +6 -6
- package/dist/auth-keys.d.ts +2 -2
- package/dist/auto-mode-face.d.ts +1 -1
- package/dist/boot/budget-tracing.js +1 -1
- package/dist/boot/execution-env.js +1 -0
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-consolidation.d.ts +4 -4
- package/dist/boot/org-memory.d.ts +3 -3
- package/dist/boot/org-memory.js +5 -5
- package/dist/boot/resolve-spec.js +7 -7
- package/dist/boot/runner-deps.d.ts +1 -1
- package/dist/boot/runtime-caps.d.ts +1 -1
- package/dist/boot/runtime-caps.js +10 -10
- package/dist/boot/shutdown.d.ts +2 -2
- package/dist/boot/shutdown.js +2 -2
- package/dist/boot/side-query-lane.d.ts +3 -3
- package/dist/boot/{stage-02-registry-pull.d.ts → stage-02-web-admin-pull.d.ts} +2 -2
- package/dist/boot/{stage-02-registry-pull.js → stage-02-web-admin-pull.js} +4 -4
- package/dist/boot/stage-03-store-backend.d.ts +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +1 -1
- package/dist/boot/stage-06-runners.d.ts +2 -2
- package/dist/boot/stage-06-runners.js +6 -6
- package/dist/boot/stage-07-capability-layer.d.ts +2 -2
- package/dist/boot/stage-07-capability-layer.js +6 -5
- package/dist/boot/stage-08-reapers.d.ts +3 -3
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +3 -3
- package/dist/boot/stage-09-leader.js +7 -7
- package/dist/boot/stage-10-http-server.d.ts +3 -3
- package/dist/boot/stage-10-http-server.js +19 -19
- package/dist/boot/unpriced-ceiling-verdict.d.ts +1 -1
- package/dist/boot/{config-center.d.ts → web-admin.d.ts} +11 -11
- package/dist/boot/{config-center.js → web-admin.js} +38 -22
- package/dist/boot/webfetch-summarize-lane.d.ts +2 -2
- package/dist/brain.d.ts +1 -1
- package/dist/brain.js +1 -1
- package/dist/budget.d.ts +3 -3
- package/dist/canonical-json.d.ts +2 -2
- package/dist/capabilities/center-plugins.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +12 -5
- package/dist/capabilities/center-wiring.js +11 -2
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/composite-members.js +1 -1
- package/dist/capabilities/scenarios.js +2 -2
- package/dist/capabilities/team.d.ts +1 -1
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/center-credential-renewer.d.ts +1 -1
- package/dist/center-credential-renewer.js +7 -7
- package/dist/center-credential.d.ts +9 -9
- package/dist/center-credential.js +6 -6
- package/dist/config-catalog.d.ts +7 -10
- package/dist/config-catalog.js +15 -15
- package/dist/config-d-migration.d.ts +32 -0
- package/dist/config-d-migration.js +59 -0
- package/dist/config-invariants.d.ts +14 -4
- package/dist/config-invariants.js +31 -2
- package/dist/config-lkg.d.ts +26 -6
- package/dist/config-lkg.js +43 -14
- package/dist/config-provider.d.ts +23 -19
- package/dist/config-provider.js +24 -26
- package/dist/config-types.d.ts +52 -51
- package/dist/config.d.ts +9 -46
- package/dist/config.js +33 -92
- package/dist/execution-lane-caps.d.ts +1 -1
- package/dist/fleet/drain-entry.d.ts +1 -1
- package/dist/fleet/engine-signal.d.ts +8 -8
- package/dist/fleet/fleet-bus.d.ts +12 -3
- package/dist/fleet/fleet-bus.js +13 -9
- package/dist/fleet/serving-lease.d.ts +3 -3
- package/dist/fleet/serving-lease.js +1 -1
- package/dist/fleet-client.d.ts +7 -7
- package/dist/fleet-client.js +5 -4
- package/dist/fleet-lease.d.ts +3 -3
- package/dist/fleet-lease.js +2 -2
- package/dist/host-lsp-manager.d.ts +1 -1
- package/dist/hosted-posture.d.ts +4 -4
- package/dist/http/admission.js +4 -4
- package/dist/http/checkpoint-ctx.d.ts +20 -3
- package/dist/http/checkpoint-ctx.js +13 -5
- package/dist/http/dispatch.js +2 -2
- package/dist/http/durable-run-leg.js +2 -1
- package/dist/http/health-self-report.d.ts +4 -4
- package/dist/http/health-self-report.js +3 -3
- package/dist/http/idempotency.d.ts +1 -1
- package/dist/http/resume-legs.d.ts +4 -3
- package/dist/http/resume-legs.js +31 -18
- package/dist/http/route-ctx.d.ts +8 -0
- package/dist/http/routes/admin-config-refresh.d.ts +1 -1
- package/dist/http/routes/admin-config-refresh.js +1 -1
- package/dist/http/routes/admin-drain.d.ts +1 -1
- package/dist/http/routes/admin-drain.js +5 -4
- package/dist/http/routes/approvals-assistant.js +4 -4
- package/dist/http/routes/capabilities.js +5 -5
- package/dist/http/routes/config-catalog.js +2 -3
- package/dist/http/routes/diagnostics.js +1 -1
- package/dist/http/routes/runs.js +8 -4
- package/dist/http/routes/sessions-list.js +2 -1
- package/dist/http/routes/sessions.js +1 -1
- package/dist/http/routes/side-query.js +3 -3
- package/dist/http/routes/tasks.js +3 -2
- package/dist/http/run-meta.d.ts +1 -1
- package/dist/http/run-meta.js +2 -2
- package/dist/http/server.d.ts +7 -7
- package/dist/http/server.js +1 -1
- package/dist/http/stored-body-replay.js +3 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/key-resolver.d.ts +1 -1
- package/dist/leader/wire.d.ts +2 -2
- package/dist/leader/wire.js +2 -1
- package/dist/main.js +1 -1
- package/dist/mcp-tool-faces.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +3 -3
- package/dist/model-entry-refusal.js +4 -4
- package/dist/model-provider.d.ts +2 -2
- package/dist/model-route-endpoint.d.ts +1 -1
- package/dist/model-route-url.d.ts +1 -1
- package/dist/model-route-url.js +2 -1
- package/dist/model-select.d.ts +24 -21
- package/dist/model-select.js +22 -17
- package/dist/observability/metrics.d.ts +1 -1
- package/dist/org-memory-admission.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +4 -2
- package/dist/plugins/approval-ask-store-file.js +3 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +4 -3
- package/dist/plugins/approval-ask-store-memory.js +10 -4
- package/dist/plugins/approval-ask-store-sql.d.ts +16 -2
- package/dist/plugins/approval-ask-store-sql.js +20 -13
- package/dist/plugins/caching-session-store.d.ts +0 -10
- package/dist/plugins/caching-session-store.js +0 -3
- package/dist/plugins/file-run-store.js +9 -3
- package/dist/plugins/leader-run-store-sql.d.ts +3 -2
- package/dist/plugins/leader-run-store-sql.js +3 -2
- package/dist/plugins/local-session-store.d.ts +20 -27
- package/dist/plugins/local-session-store.js +19 -17
- package/dist/plugins/memory-run-store.js +9 -3
- package/dist/plugins/one-time-migrations.js +26 -2
- package/dist/plugins/scheduler-support.d.ts +26 -7
- package/dist/plugins/scheduler-support.js +96 -53
- package/dist/plugins/store-backend.js +1 -1
- package/dist/plugins/store-contracts.d.ts +20 -4
- package/dist/plugins/web-search.d.ts +1 -1
- package/dist/plugins/web-search.js +2 -1
- package/dist/posture-source.d.ts +1 -1
- package/dist/read-face-posture.d.ts +3 -3
- package/dist/read-face-posture.js +1 -1
- package/dist/run-local.js +6 -3
- package/dist/runtime-caps-resolver.d.ts +4 -4
- package/dist/runtime-caps-resolver.js +2 -2
- package/dist/runtime-governance.d.ts +5 -5
- package/dist/sealed-key.d.ts +4 -4
- package/dist/sealed-key.js +3 -2
- package/dist/security.d.ts +3 -3
- package/dist/service-version.d.ts +1 -1
- package/dist/service-version.js +5 -0
- package/dist/session-titler.d.ts +0 -11
- package/dist/session-titler.js +3 -5
- package/dist/shared-memory-scope-authorizer.d.ts +4 -4
- package/dist/task-a2a.d.ts +1 -1
- package/dist/tool-approval.d.ts +43 -4
- package/dist/tool-approval.js +147 -98
- package/dist/trace/core-keyset-guard.d.ts +1 -1
- package/dist/trace/project.d.ts +3 -3
- package/dist/trace/redact.d.ts +2 -23
- package/dist/trace/redact.js +1 -6
- package/dist/trace/self-minted-wire.d.ts +147 -3
- package/dist/trace/self-minted-wire.js +50 -9
- package/dist/url-refusal.d.ts +35 -0
- package/dist/url-refusal.js +15 -0
- package/dist/user-authored-text.d.ts +31 -0
- package/dist/user-authored-text.js +18 -0
- package/dist/{config-center → web-admin-client}/apply-effective.d.ts +13 -70
- package/dist/{config-center → web-admin-client}/apply-effective.js +100 -119
- package/dist/{config-center → web-admin-client}/apply-ledger.d.ts +2 -2
- package/dist/{config-center → web-admin-client}/center-request.d.ts +7 -7
- package/dist/{config-center → web-admin-client}/center-request.js +5 -4
- package/dist/{config-center → web-admin-client}/effective-keys.d.ts +1 -3
- package/dist/{config-center → web-admin-client}/effective-keys.js +0 -9
- package/dist/{config-center → web-admin-client}/facade.d.ts +6 -6
- package/dist/{config-center → web-admin-client}/facade.js +2 -2
- package/dist/{config-center → web-admin-client}/http-client.d.ts +6 -10
- package/dist/{config-center → web-admin-client}/http-client.js +12 -12
- package/dist/{config-center → web-admin-client}/pull-state.d.ts +1 -1
- package/dist/{config-center → web-admin-client}/read-face.js +4 -4
- package/dist/{config-center → web-admin-client}/read-warnings.d.ts +23 -16
- package/dist/{config-center → web-admin-client}/read-warnings.js +33 -23
- package/dist/{config-center → web-admin-client}/restart-signal.d.ts +5 -3
- package/dist/{config-center → web-admin-client}/restart-signal.js +3 -4
- package/dist/{config-center → web-admin-client}/skills-mcp.d.ts +1 -1
- package/dist/{config-center → web-admin-client}/skills-mcp.js +13 -13
- package/dist/{config-center → web-admin-client}/stage-limits.d.ts +1 -7
- package/dist/{config-center → web-admin-client}/stage-limits.js +6 -7
- package/dist/{config-center → web-admin-client}/types.d.ts +12 -39
- package/package.json +2 -2
- package/skills/find-skills.md +2 -2
- package/dist/url-shape.d.ts +0 -31
- package/dist/url-shape.js +0 -41
- /package/dist/{config-center → web-admin-client}/apply-ledger.js +0 -0
- /package/dist/{config-center → web-admin-client}/hot-keys-registry.d.ts +0 -0
- /package/dist/{config-center → web-admin-client}/hot-keys-registry.js +0 -0
- /package/dist/{config-center → web-admin-client}/mcp-revocation.d.ts +0 -0
- /package/dist/{config-center → web-admin-client}/mcp-revocation.js +0 -0
- /package/dist/{config-center → web-admin-client}/pull-state.js +0 -0
- /package/dist/{config-center → web-admin-client}/read-face.d.ts +0 -0
- /package/dist/{config-center → web-admin-client}/types.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* web-admin wire types — the web-admin `/api/config/effective` payload shapes (`CenterModel`,
|
|
3
3
|
* `CenterSkillManifest`, `CenterMcpServer`, `CenterA2aPeer`, `EffectiveConfig`) plus the per-principal
|
|
4
4
|
* execution/session-mirror ruling shapes riding the caps view (`ExecutionRuling`/`SessionMirrorRuling`).
|
|
5
5
|
* Pure type/interface declarations — no runtime logic. Split out of `facade.ts` ([ref] A13,
|
|
@@ -134,7 +134,7 @@ export interface CenterMcpServer {
|
|
|
134
134
|
* 的 `McpServerSpec` 是默认 strip 的 zod object 且没有 `contentOrigin` 可选键,本地腿在 FileConfigStore 的
|
|
135
135
|
* `parseDomainLoud(DOMAIN_SCHEMAS.mcp)`、远端腿在消费端边界 `readEffectiveWire`([ref] 裁B)**各被剥一次**。
|
|
136
136
|
* 修在 sema-settings-schema(补同名可选枚举键 + 发包),本仓提货后 `config-provider.ts` 的映射加一行即通;
|
|
137
|
-
* 两条 `it.fails` 绊线(test/
|
|
137
|
+
* 两条 `it.fails` 绊线(test/web-admin-wire-read.test.ts + test/config-provider.test.ts)在上游到货时
|
|
138
138
|
* 自动翻红逼销账。
|
|
139
139
|
*/
|
|
140
140
|
contentOrigin?: ToolContentOrigin;
|
|
@@ -195,7 +195,7 @@ export interface CenterA2aPeer {
|
|
|
195
195
|
* #A4([ref] 窗三件批 件1;[ref]/[ref] 承诺件)—— READ 容纳面的 center 下发形(`CenterA2aPeer` 的
|
|
196
196
|
* 同族:一个 additive 顶层域,server 声明它才不会被静默丢弃)。四个成员逐一对应部署 env 的四键
|
|
197
197
|
* (`READ_FACE` / `READ_DENY_PATTERNS` / `READ_DENY_BUILTIN_TIERS` / `READ_DENY_BUILTIN_EXCLUDE`),
|
|
198
|
-
* 消费半场 = `
|
|
198
|
+
* 消费半场 = `web-admin-client/read-face.ts` `applyCenterReadFace`。
|
|
199
199
|
*
|
|
200
200
|
* 🔴 **env 显式恒赢**(operator-knob 律,消费侧执法):env 是这台机器的部署主权,center 是组织下发;
|
|
201
201
|
* 冲突时本机 env 原样保留 + 一条点名 warn。所以本类型描述的是「组织想要什么」,不是「这台机器最终是什么」。
|
|
@@ -267,8 +267,10 @@ export interface EffectiveConfig {
|
|
|
267
267
|
models: {
|
|
268
268
|
models: CenterModel[];
|
|
269
269
|
roles: Record<string, CenterRoleTarget>;
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
/** `models.atMention`(settings-schema 11)的**承载位**:类型是 `unknown` 而不是那个三态,理由与 {@link CenterModel.compat} 同 ——
|
|
271
|
+
* 本类型描述到货 JSON,形与缺省读法的单一属主是契约座位 schema(`model-select.ts` `readAtMention`,stage 在那一刻调它)。
|
|
272
|
+
* 两条读腿恒物化它;只有一份 11.0.0 之前写下、迁移后仍没有这一键的 LKG 载荷缺席它(缺席 = 契约缺省)。 */
|
|
273
|
+
atMention?: unknown;
|
|
272
274
|
tierGroups?: unknown;
|
|
273
275
|
activeTierGroup?: string;
|
|
274
276
|
/** 🔴 S-712 / S-1295 —— **本仓读腿铸的**载体(不是 wire 键:中心在模型域里写同名键会被 schema 当未知键剥掉并进候选门):这次读
|
|
@@ -307,42 +309,13 @@ export interface EffectiveConfig {
|
|
|
307
309
|
enabled?: boolean;
|
|
308
310
|
}>;
|
|
309
311
|
};
|
|
310
|
-
/** `runtime` 域 = **限额残余五键**,与 settings-schema `RuntimeConfig` 的键集逐字相等([ref] 件3 对账门
|
|
311
|
-
* test/settings-schema-consumption-gates.test.ts 读 dist `RuntimeConfig.shape` 钉集合等式)。全部 center
|
|
312
|
-
* `.optional()`(center `f95438a`):缺席 = 不管 → 保 env;在场(含显式 0 = "publish OFF")= 覆盖。
|
|
313
|
-
* [ref] 批1 起五键全是**热**键(属主 stage-limits,boot+refresh 双腿);`limits` 域是它们的继任发布位
|
|
314
|
-
* (两处同现 ⇒ limits 赢,见 {@link EffectiveConfig.limits})。
|
|
315
|
-
*
|
|
316
|
-
* 🔴 治理三件(autonomy / commandPolicy / approvalRequire)**不在这里**([ref] 件3 退役键清除):它们自
|
|
317
|
-
* settings-schema 0.6 起住 `governance` 域,0.7.1 撤了 runtime 位的双写镜像;此后 `RuntimeConfig` 是 strip
|
|
318
|
-
* 的 zod object,两条腿(远端 `readEffectiveWire` / 本地 FileConfigStore→`buildEffective`)都把旧位 strip
|
|
319
|
-
* 掉、由 `legacyGovernanceFromRuntime` 抬进 governance ⇒ 本仓在 runtime 位上读它们的每一行都是死码。
|
|
320
|
-
* 旧类型面上留着这三键,让(已于 S-668 波 2 退役的)`runtime-gates` 重启片一直读着一个生产上恒缺席的位(审批闸收紧静默不生效)。 */
|
|
321
|
-
runtime?: {
|
|
322
|
-
rateLimitPerMin?: number;
|
|
323
|
-
maxTaskCostUsd?: number;
|
|
324
|
-
maxTaskTokens?: number;
|
|
325
|
-
maxPrincipalCostUsd?: number;
|
|
326
|
-
costQuotaWindowSec?: number;
|
|
327
|
-
};
|
|
328
312
|
/**
|
|
329
313
|
* [ref] 批1 —— **limitsHttp 组的热更新发布域**([ref] §6 批1)。
|
|
330
314
|
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* `
|
|
335
|
-
* `limits` 原样到手)——所以这是今天唯一能真的把这些键送到消费端的形,也与 governance 域当初从
|
|
336
|
-
* runtime 里拆出去的先例同族。
|
|
337
|
-
*
|
|
338
|
-
* 车道现状(如实):remote 腿即刻可用(center 发什么就到什么);**local 腿(config.d/)暂不可用** ——
|
|
339
|
-
* `FileConfigStore` 的域表是闭集,`config.d/limits.json` 根本不会被读进 effective。补法在 registry-core
|
|
340
|
-
* (加 `limits` 域 + PORTABLE_DOMAINS),与 `a2a`/`readFace` 当初的缺口同族;server 侧的消费半场(本键 +
|
|
341
|
-
* stage + commit)先落地,不在下游自建第二个读盘腿(源头修复纪律)。
|
|
342
|
-
*
|
|
343
|
-
* 与 `runtime` 的**优先级**:五个既有闸键(rateLimitPerMin/maxTaskCostUsd/maxTaskTokens/
|
|
344
|
-
* maxPrincipalCostUsd/costQuotaWindowSec)两处都可能出现 ⇒ `limits` 赢(新位是真值,旧位是过渡),
|
|
345
|
-
* 与 governance/runtime 的读取优先级契约同形。
|
|
315
|
+
* 限额五闸(rateLimitPerMin / maxTaskCostUsd / maxTaskTokens / maxPrincipalCostUsd / costQuotaWindowSec)与其余限额键的**唯一**发布位:
|
|
316
|
+
* settings-schema 11 退役了 `runtime` 域(它曾承载前五键;存量由一次性迁移 SS-M1 搬进本域,读腿对带事实的 `runtime` 整份拒),
|
|
317
|
+
* 本仓的旧位读法随之删 —— 一个键一个发布位,没有「两处同现谁赢」的优先级规则。两条腿都读它(本地腿:`config.d/limits.json`,
|
|
318
|
+
* `limits` 在 PORTABLE_DOMAINS 里)。
|
|
346
319
|
*/
|
|
347
320
|
limits?: EffectiveLimits;
|
|
348
321
|
/** 142-S4(registry-core 0.10.0 第 15 域):center 项目登记簿。wire 面 verbatim JSON —
|
|
@@ -387,7 +360,7 @@ export interface EffectiveConfig {
|
|
|
387
360
|
* `host` lane on purpose). ⚠️ Admins writing `required=true` policies must include `in-process` when such
|
|
388
361
|
* workers should stay admittable — center UI/doc 词表待补齐。
|
|
389
362
|
*
|
|
390
|
-
* 🔴 **`device` 是 per-principal 执行面上最需要写清的一条**(device-executor-lane-v2 §4.1 的
|
|
363
|
+
* 🔴 **`device` 是 per-principal 执行面上最需要写清的一条**(device-executor-lane-v2 §4.1 的 web-admin
|
|
391
364
|
* 行,车A-4 补):它是「在**员工自己的机器**上执行」的那条车道 —— 允许它 ≠ 允许一台云沙箱,而是允许
|
|
392
365
|
* 这个 principal 把裁决过的指令投到一台**受管设备**上。⚠️ 但**别把它当设备准入门用**:本 ruling 的
|
|
393
366
|
* 粒度是 lane 名,它表达不了 principal×device 绑定,而且 no-ruling 是 **fail-open** 的
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.124.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@sema-agent/core": "7.48.0",
|
|
68
|
-
"@sema-agent/settings-schema": "
|
|
68
|
+
"@sema-agent/settings-schema": "11.2.0",
|
|
69
69
|
"e2b": "^2.28.0",
|
|
70
70
|
"libsodium-wrappers": "^0.8.4",
|
|
71
71
|
"mysql2": "^3.22.4",
|
package/skills/find-skills.md
CHANGED
|
@@ -142,7 +142,7 @@ npx skills init my-xyz-skill
|
|
|
142
142
|
|
|
143
143
|
<!--
|
|
144
144
|
TODO (clay): add our own first-party skill sources here -
|
|
145
|
-
|
|
146
|
-
skills.sh ecosystem. Not every deployment ships a
|
|
145
|
+
web-admin / web-admin - as a discovery+install lane alongside the open
|
|
146
|
+
skills.sh ecosystem. Not every deployment ships a web-admin, so the section
|
|
147
147
|
must probe availability first and fall back to the public ecosystem cleanly.
|
|
148
148
|
-->
|
package/dist/url-shape.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** 座位可以禁掉的部件(闭集;判序 = 本数组序)。 */
|
|
2
|
-
export declare const HTTP_URL_PARTS: readonly ["userinfo", "query", "fragment"];
|
|
3
|
-
export type HttpUrlPart = (typeof HTTP_URL_PARTS)[number];
|
|
4
|
-
/** 判官的拒因词(闭集):形不对,或一件被禁的部件在场。 */
|
|
5
|
-
export type HttpUrlFlaw = "not-http-url" | HttpUrlPart;
|
|
6
|
-
/** 「不是一个 http(s) URL」的规则词 —— 不透明形、不可解析、层级式非 http(s) 同一句;只点名规则,不回显 scheme。钉读这一只,不手抄。 */
|
|
7
|
-
export declare const HTTP_URL_SHAPE_RULE = "is not a parseable http(s) URL (scheme must be http or https; it must look like http(s)://host[:port][/path])";
|
|
8
|
-
/**
|
|
9
|
-
* 判:合格 ⇒ `[]`;否则按判序交回规则词。形不对且不透明 ⇒ 只有 `not-http-url`(部件在不透明形上无从判,
|
|
10
|
-
* 也不需要判 —— 那一形整只不收);层级式非 http(s) ⇒ `not-http-url` 之后照判部件。
|
|
11
|
-
* 返回类型按 `forbid` 收窄:座位没禁的部件不会出现在答案里(调用方的穷举 switch 因此不需要一条「不可达」臂)。
|
|
12
|
-
*/
|
|
13
|
-
export declare function httpUrlFlaws<P extends HttpUrlPart>(raw: string, forbid: readonly P[]): ReadonlyArray<"not-http-url" | P>;
|
|
14
|
-
/** 一个拒因词的规则句(穷举;新词不补 = 编译红)。句子只说规则,不含值。 */
|
|
15
|
-
export declare function httpUrlRule(flaw: HttpUrlFlaw): string;
|
|
16
|
-
/**
|
|
17
|
-
* 拒句里值的样子(纯函数):合格的 http(s) 形 ⇒ 只到 origin(`scheme://host[:port]`,过展示铸点),origin 之后还有东西(userinfo /
|
|
18
|
-
* 路径 / query / fragment)⇒ 接一枚 `/…`;其余(不透明 / 不可解析 / 层级式非 http(s))⇒ 展示铸点的占位 `«redacted:url»` ——
|
|
19
|
-
* 拒句里不出现非 http(s) 的 scheme 词(主会话增补裁:写成 scheme 的令牌 `<48hex>://host` 曾原样进 fatal 行)。
|
|
20
|
-
*
|
|
21
|
-
* 🔴 为什么只到 origin(车内 codex 对抗复审 r1 [high],亲跑复现):展示铸点的路径段**逐字**保留、只靠形状律认令牌形 ——
|
|
22
|
-
* 形状律认不出的令牌(48 位十六进制拉取令牌就是一例)放在路径上会原样进拒句。拒句落在 fatal 行、stderr、每一轮的请求失败日志,
|
|
23
|
-
* 这几处不赌形状律的覆盖面:座位名 + 规则词已经说清了哪一席错在哪,值只需要认得出是哪一台主机。
|
|
24
|
-
*/
|
|
25
|
-
export declare function buildRefusalShownUrl(raw: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* 拒句的**唯一**铸点:`<subject> <规则句>[; <规则句>…]; got "<值的样子>"`(`build*` = 纯数据)。
|
|
28
|
-
* 值只经 {@link buildRefusalShownUrl} 出现;`flaws` 来自 {@link httpUrlFlaws}(调用方按首个拒因选自己的码与出路句)。
|
|
29
|
-
*/
|
|
30
|
-
export declare function buildHttpUrlRefusal(subject: string, raw: string, flaws: readonly HttpUrlFlaw[]): string;
|
|
31
|
-
//# sourceMappingURL=url-shape.d.ts.map
|
package/dist/url-shape.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { DISPLAY_SAFE_URL_TOKEN, buildDisplaySafeUrl, isHierarchicalUrl } from "./trace/redact.js";
|
|
2
|
-
export const HTTP_URL_PARTS = ["userinfo", "query", "fragment"];
|
|
3
|
-
export const HTTP_URL_SHAPE_RULE = "is not a parseable http(s) URL (scheme must be http or https; it must look like http(s)://host[:port][/path])";
|
|
4
|
-
export function httpUrlFlaws(raw, forbid) {
|
|
5
|
-
if (!isHierarchicalUrl(raw))
|
|
6
|
-
return ["not-http-url"];
|
|
7
|
-
const u = new URL(raw);
|
|
8
|
-
const hashAt = u.href.indexOf("#");
|
|
9
|
-
const present = {
|
|
10
|
-
userinfo: u.username !== "" || u.password !== "",
|
|
11
|
-
query: (hashAt < 0 ? u.href : u.href.slice(0, hashAt)).includes("?"),
|
|
12
|
-
fragment: hashAt >= 0,
|
|
13
|
-
};
|
|
14
|
-
const shape = u.protocol === "http:" || u.protocol === "https:" ? [] : ["not-http-url"];
|
|
15
|
-
return [...shape, ...HTTP_URL_PARTS.filter((p) => forbid.includes(p) && present[p])];
|
|
16
|
-
}
|
|
17
|
-
export function httpUrlRule(flaw) {
|
|
18
|
-
switch (flaw) {
|
|
19
|
-
case "not-http-url":
|
|
20
|
-
return HTTP_URL_SHAPE_RULE;
|
|
21
|
-
case "userinfo":
|
|
22
|
-
return "must not carry userinfo (credentials in the URL are logged, reported and handed to fetch; they belong in a credential setting)";
|
|
23
|
-
case "query":
|
|
24
|
-
return "must not carry a query (request paths are appended to this base)";
|
|
25
|
-
case "fragment":
|
|
26
|
-
return "must not carry a fragment (it is never sent, and anything appended after it is dropped with it)";
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export function buildRefusalShownUrl(raw) {
|
|
30
|
-
if (!isHierarchicalUrl(raw))
|
|
31
|
-
return DISPLAY_SAFE_URL_TOKEN;
|
|
32
|
-
const u = new URL(raw);
|
|
33
|
-
if (u.protocol !== "http:" && u.protocol !== "https:")
|
|
34
|
-
return DISPLAY_SAFE_URL_TOKEN;
|
|
35
|
-
const origin = `${u.protocol}//${u.host}`;
|
|
36
|
-
return `${buildDisplaySafeUrl(origin)}${u.href === `${origin}/` ? "" : "/…"}`;
|
|
37
|
-
}
|
|
38
|
-
export function buildHttpUrlRefusal(subject, raw, flaws) {
|
|
39
|
-
return `${subject} ${flaws.map(httpUrlRule).join("; ")}; got ${JSON.stringify(buildRefusalShownUrl(raw))}`;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=url-shape.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|