Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Remove deprecated `audience` param from apps publish schema (#2130)

Joshua Francebafcf3f1a59c
diff --git a/src/harness/agent-tools.ts b/src/harness/agent-tools.ts
index ea4ec2e31..e6161b774 100644
--- a/src/harness/agent-tools.ts
+++ b/src/harness/agent-tools.ts
@@ -1170,18 +1170,6 @@ export function createAgentTools(ref: ToolContextRef, opts?: AgentToolsOptions):
"(an iframe) unless `embedAncestors` names that site; set it when someone asks for the app in " +
"a panel or extension, and `[]` to turn it back off.",
parameters: Type.Object({
- audience: Type.Optional(
- Type.Array(
- Type.Object({
- scope: Type.String({ description: "Scope ID or org." }),
- permission: Type.Union([Type.Literal("read"), Type.Literal("write")]),
- }),
- {
- description:
- "First-publish access grants only. Omit to use the conversation's default audience; [] suppresses default grants for owner-only publication. Refused when republishing an existing app; use apps action share instead.",
- },
- ),
- ),
dir: Type.Optional(
Type.String({
description:
@@ -1235,8 +1223,7 @@ export function createAgentTools(ref: ToolContextRef, opts?: AgentToolsOptions):
name: params.name,
});
try {
- const legacy = params as { audience?: PublishInput["share"] };
- const r = await tc.publish({ ...params, share: legacy.audience } as PublishInput);
+ const r = await tc.publish(params as PublishInput);
const reach = describePublishAudience(r.audience);
const alwaysOnNote = r.alwaysOn ? "\nAlways-on: the app is kept warm — no idle cold starts." : "";
const embedNote = r.embedAncestors?.length ? `\nEmbeddable by: ${r.embedAncestors.join(", ")}` : "";
diff --git a/test/agent-tools.test.ts b/test/agent-tools.test.ts
index fa3b0a404..ce364eeb4 100644
--- a/test/agent-tools.test.ts
+++ b/test/agent-tools.test.ts
@@ -3698,7 +3698,7 @@ test("a files read approval cannot authorize writes or sharing", async () => {
}
});
-test("apps publish forwards a legacy audience so it is refused, not silently dropped", async () => {
+test("apps publish schema no longer advertises audience and rejects it as an unknown argument", async () => {
const inputs: unknown[] = [];
const tc = {
...fakeToolContext(),
@@ -3708,8 +3708,11 @@ test("apps publish forwards a legacy audience so it is refused, not silently dro
},
};
const apps = createAgentTools({ current: tc }).find((tool) => tool.name === "apps")!;
- await call(apps, { action: "publish", name: "private", audience: [] });
- assert.deepEqual((inputs[0] as { share: unknown }).share, []);
+ assert.equal("audience" in (apps.parameters as { properties: Record<string, unknown> }).properties, false);
+ assert.match(textOut(await call(apps, { action: "publish", name: "private", audience: [] })), /Invalid arguments/);
+ assert.equal(inputs.length, 0);
+ await call(apps, { action: "publish", name: "private" });
+ assert.equal((inputs[0] as { share?: unknown }).share, undefined);
});
test("files share preserves artifact IDs, recipient resolution and authorization failures", async () => {
diff --git a/test/claude-harness.test.ts b/test/claude-harness.test.ts
index aafc365f3..5ad44917a 100644
--- a/test/claude-harness.test.ts
+++ b/test/claude-harness.test.ts
@@ -179,7 +179,7 @@ test("resource tools register with the actual Claude SDK and preserve flat argum
test("native children retain publication and file work without gaining artifact transfers", async () => {
const { nativeChildToolAllowed } = await import("../src/harness/harness-shared.ts");
- assert.equal(nativeChildToolAllowed("apps", { action: "publish", audience: [] }), true);
+ assert.equal(nativeChildToolAllowed("apps", { action: "publish" }), true);
assert.equal(nativeChildToolAllowed("files", { action: "share", path: "notes", scope: "org" }), true);
for (const [name, args] of [
["apps", { action: "move" }],