channelstack 0.1.1 → 0.2.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.
Files changed (28) hide show
  1. package/README.md +1 -1
  2. package/dist/integrations/checks/index.d.ts +40 -7
  3. package/dist/integrations/checks/index.js +525 -69
  4. package/dist/integrations/matchers-core/index.d.ts +90 -11
  5. package/dist/integrations/matchers-core/index.js +356 -15
  6. package/dist/integrations/matchers-core/matchers.test.js +251 -3
  7. package/dist/integrations/vitest/index.d.ts +4 -2
  8. package/dist/integrations/vitest/setup.js +33 -3
  9. package/dist/sdks/typescript/client.d.ts +5 -4
  10. package/dist/sdks/typescript/client.js +4 -4
  11. package/dist/sdks/typescript/generated/channels.d.ts +17 -9
  12. package/dist/sdks/typescript/generated/channels.js +3 -1
  13. package/dist/sdks/typescript/generated/index.d.ts +1744 -313
  14. package/dist/sdks/typescript/generated/index.js +1991 -422
  15. package/dist/sdks/typescript/generated/normalisation.d.ts +18 -0
  16. package/dist/sdks/typescript/generated/normalisation.js +14 -0
  17. package/dist/sdks/typescript/runtime/client.d.ts +9 -0
  18. package/dist/sdks/typescript/runtime/client.js +5 -0
  19. package/dist/sdks/typescript/runtime/files.d.ts +17 -2
  20. package/dist/sdks/typescript/runtime/files.js +11 -3
  21. package/dist/sdks/typescript/runtime/launcher.d.ts +5 -2
  22. package/dist/sdks/typescript/runtime/launcher.js +6 -3
  23. package/dist/sdks/typescript/runtime/responder.d.ts +26 -0
  24. package/dist/sdks/typescript/runtime/responder.js +42 -0
  25. package/dist/sdks/typescript/runtime/wait.d.ts +14 -0
  26. package/dist/sdks/typescript/runtime/wait.js +23 -0
  27. package/dist/sdks/typescript/types.d.ts +16 -6
  28. package/package.json +9 -7
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # channelstack
2
2
 
3
- A test harness for the apps and agents you build for Slack, GitHub, Linear, Notion, Resend and Gmail. channelstack runs fake versions of those platforms on your machine. Your tests script the people, your app answers through its real code path, and you check what a person would see.
3
+ A test harness for the apps and agents you build for Slack, GitHub, Linear, Notion, Resend, Gmail and Discord. channelstack runs fake versions of those platforms on your machine, and of OpenAI's API for your agent's model. Your tests script the people, your app answers through its real code path, and you check what a person would see.
4
4
 
5
5
  This package has the `channelstack` CLI and server, the TypeScript SDK, the Vitest plugin (`channelstack/vitest`) and the standard behaviour checks (`channelstack/checks`). The server binary for your platform comes with it, as an optional dependency (`@channelstack/server-<platform>-<arch>`).
6
6
 
@@ -1,4 +1,4 @@
1
- import type { Duration } from "../../sdks/typescript/client.ts";
1
+ import { type Duration } from "../../sdks/typescript/client.ts";
2
2
  export interface ChecksOptions {
3
3
  /** The app's name, as people mention it. */
4
4
  app: string;
@@ -17,23 +17,49 @@ export interface ChecksOptions {
17
17
  prompt: string;
18
18
  button: string;
19
19
  };
20
+ /**
21
+ * Discord: a slash command the agent answers, as a person types it (`/deploy web`). Without it
22
+ * the interaction checks are left out.
23
+ */
24
+ command?: `/${string}`;
25
+ /**
26
+ * Discord: text that makes the agent write an answer longer than one message may be (2000
27
+ * characters). Without it the long-answer check is left out.
28
+ */
29
+ longPrompt?: string;
20
30
  /** Leave out checks by id, e.g. `["slack.stream-stop"]`. */
21
31
  skip?: string[];
22
32
  /** How long each check waits for the agent. Default: the integration's timeout. */
23
33
  timeout?: Duration;
34
+ /**
35
+ * The agent's model is the fake OpenAI (decision 0029): every check that scripts nothing itself
36
+ * gets a plain answer for each call, so a model-backed agent passes the channel's checks. On
37
+ * Slack the stream checks also need no `streamPrompt`, and the model checks are added
38
+ * (`SLACK_MODEL_CHECKS`); the other channels' model checks are issue #120.
39
+ */
40
+ model?: "openai";
41
+ /**
42
+ * How many times the agent may answer another app that answers everything, with no person
43
+ * between them, before `<channel>.no-reply-loop` fails (decision 0027). Default: 3.
44
+ */
45
+ loopTurns?: number;
24
46
  }
25
47
  /** The ids of the Slack checks, in the order they are registered. */
26
- export declare const SLACK_CHECKS: readonly ["slack.dm-once", "slack.mention-once", "slack.in-thread", "slack.retry", "slack.redelivery", "slack.ignores-bots", "slack.bad-signature", "slack.ack", "slack.msg-too-long", "slack.stream-stop", "slack.stop", "slack.click-unauthorized", "slack.double-click"];
48
+ export declare const SLACK_CHECKS: readonly ["slack.dm-once", "slack.mention-once", "slack.in-thread", "slack.retry", "slack.redelivery", "slack.ignores-bots", "slack.no-reply-loop", "slack.bad-signature", "slack.ack", "slack.msg-too-long", "slack.stream-stop", "slack.stop", "slack.click-unauthorized", "slack.double-click"];
49
+ /** The ids of the Slack checks of an agent on the fake OpenAI (`model: "openai"`), in the order they are registered. */
50
+ export declare const SLACK_MODEL_CHECKS: readonly ["slack.slow-model", "slack.model-error", "slack.model-retry", "slack.stream-breaks", "slack.stop-cancels-model", "slack.no-secrets-to-model"];
27
51
  /** The ids of the GitHub checks, in the order they are registered. */
28
- export declare const GITHUB_CHECKS: readonly ["github.ignores-own-comments", "github.one-comment", "github.review-thread", "github.redelivery", "github.check-run", "github.bad-signature"];
52
+ export declare const GITHUB_CHECKS: readonly ["github.ignores-own-comments", "github.one-comment", "github.review-thread", "github.redelivery", "github.check-run", "github.bad-signature", "github.no-reply-loop"];
29
53
  /** The ids of the Linear checks, in the order they are registered. */
30
- export declare const LINEAR_CHECKS: readonly ["linear.first-activity", "linear.ends-turn", "linear.stop", "linear.redelivery", "linear.stale", "linear.bad-signature"];
54
+ export declare const LINEAR_CHECKS: readonly ["linear.first-activity", "linear.ends-turn", "linear.stop", "linear.redelivery", "linear.stale", "linear.bad-signature", "linear.no-reply-loop"];
31
55
  /** The ids of the Notion checks, in the order they are registered. */
32
- export declare const NOTION_CHECKS: readonly ["notion.reply-in-discussion", "notion.ignores-own-comments", "notion.redelivery", "notion.bad-signature"];
56
+ export declare const NOTION_CHECKS: readonly ["notion.reply-in-discussion", "notion.ignores-own-comments", "notion.redelivery", "notion.bad-signature", "notion.no-reply-loop"];
33
57
  /** The ids of the Resend checks, in the order they are registered. */
34
- export declare const RESEND_CHECKS: readonly ["resend.reply-in-thread", "resend.redelivery", "resend.bad-signature", "resend.stale"];
58
+ export declare const RESEND_CHECKS: readonly ["resend.reply-in-thread", "resend.redelivery", "resend.bad-signature", "resend.stale", "resend.no-reply-loop"];
35
59
  /** The ids of the Google checks, in the order they are registered. */
36
- export declare const GOOGLE_CHECKS: readonly ["google.reply-in-thread", "google.history", "google.redelivery", "google.bad-signature", "google.wrong-audience", "google.stale"];
60
+ export declare const GOOGLE_CHECKS: readonly ["google.reply-in-thread", "google.history", "google.redelivery", "google.bad-signature", "google.wrong-audience", "google.stale", "google.no-reply-loop"];
61
+ /** The ids of the Discord checks, in the order they are registered. */
62
+ export declare const DISCORD_CHECKS: readonly ["discord.mention-once", "discord.dm-once", "discord.ignores-bots", "discord.no-reply-loop", "discord.resume", "discord.long-answer", "discord.interaction-3s", "discord.bad-signature"];
37
63
  /**
38
64
  * Registers: replies once to a DM · once to a mention · replies in the thread · survives Slack's
39
65
  * 3 s retry · handles redelivery idempotently · ignores other bots' messages · rejects a bad
@@ -67,3 +93,10 @@ export declare function resendChecks(options: ChecksOptions): void;
67
93
  * (default `hello`); the agent should answer once, in the email's thread, whatever Gmail pushes.
68
94
  */
69
95
  export declare function googleChecks(options: ChecksOptions): void;
96
+ /**
97
+ * Registers: answers a mention once · answers a DM once · ignores other bots · stops answering
98
+ * another app that answers everything · after a dropped Gateway connection, answers what it
99
+ * missed once · writes a long answer in messages Discord takes · answers an interaction within
100
+ * 3 s · rejects an interaction with a bad signature.
101
+ */
102
+ export declare function discordChecks(options: ChecksOptions): void;