primitives.ts 370 B

1234567891011121314
  1. // 基础类型、字面量、字面量 union → enum。
  2. interface Basics {
  3. title: string;
  4. count: number;
  5. enabled: boolean;
  6. nothing: null;
  7. status: "draft" | "published" | "archived";
  8. priority: 1 | 2 | 3;
  9. exact: "only";
  10. }
  11. const worker = agent("worker");
  12. const result = await worker.ask<Basics>("produce the basics artifact");
  13. log(JSON.stringify(result));