@usenaive-sdk/blueprints 0.4.0 → 0.6.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/dist/index.d.ts CHANGED
@@ -174,6 +174,7 @@ declare const AgentDeclSchema: z.ZodObject<{
174
174
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
175
175
  allowed_apps: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
176
  identity: z.ZodOptional<z.ZodString>;
177
+ handoffs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"team">, z.ZodArray<z.ZodString>]>>;
177
178
  schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
178
179
  cron: z.ZodString;
179
180
  timezone: z.ZodOptional<z.ZodString>;
@@ -229,9 +230,33 @@ declare const SkillDeclSchema: z.ZodObject<{
229
230
  slug: z.ZodString;
230
231
  file: z.ZodString;
231
232
  }, z.core.$strip>;
233
+ /**
234
+ * `connections` is the accounts the studio asks an operator to connect to this persona BEFORE the
235
+ * crew exists (`canonical-spec §31.10`): `social.from` names a declared `choice` question and
236
+ * `social.map` maps its option labels to publishing networks. Published on the artifact, never read
237
+ * by the apply.
238
+ */
232
239
  declare const IdentityDeclSchema: z.ZodObject<{
233
240
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
234
241
  name: z.ZodString;
242
+ connections: z.ZodOptional<z.ZodObject<{
243
+ social: z.ZodOptional<z.ZodObject<{
244
+ from: z.ZodString;
245
+ map: z.ZodRecord<z.ZodString, z.ZodEnum<{
246
+ bluesky: "bluesky";
247
+ facebook: "facebook";
248
+ instagram: "instagram";
249
+ linkedin: "linkedin";
250
+ mastodon: "mastodon";
251
+ pinterest: "pinterest";
252
+ reddit: "reddit";
253
+ threads: "threads";
254
+ tiktok: "tiktok";
255
+ x: "x";
256
+ youtube: "youtube";
257
+ }>>;
258
+ }, z.core.$strip>>;
259
+ }, z.core.$strip>>;
235
260
  legal: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
261
  description: z.ZodString;
237
262
  state: z.ZodEnum<{
@@ -317,6 +342,19 @@ declare const IdentityDeclSchema: z.ZodObject<{
317
342
  load_micro_usd: z.ZodNumber;
318
343
  }, z.core.$strip>>>;
319
344
  }, z.core.$strip>;
345
+ /**
346
+ * One card the apply seeds on the organization's board (`canonical-spec §31.11`). `key` is the
347
+ * card's idempotency handle — `<project>:<key>` on the wire — so a re-apply finds the card it wrote;
348
+ * `assignee` is an agent NAME, which is what a board card carries (§28.11); `blocked_by` names
349
+ * sibling tasks by key and becomes their `crd_` ids at apply time.
350
+ */
351
+ declare const TaskDeclSchema: z.ZodObject<{
352
+ key: z.ZodString;
353
+ title: z.ZodString;
354
+ body: z.ZodOptional<z.ZodString>;
355
+ assignee: z.ZodOptional<z.ZodString>;
356
+ blocked_by: z.ZodOptional<z.ZodArray<z.ZodString>>;
357
+ }, z.core.$strip>;
320
358
  declare const ProjectSchema: z.ZodObject<{
321
359
  name: z.ZodString;
322
360
  blueprint: z.ZodOptional<z.ZodString>;
@@ -343,6 +381,24 @@ declare const ProjectSchema: z.ZodObject<{
343
381
  identities: z.ZodDefault<z.ZodArray<z.ZodObject<{
344
382
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
383
  name: z.ZodString;
384
+ connections: z.ZodOptional<z.ZodObject<{
385
+ social: z.ZodOptional<z.ZodObject<{
386
+ from: z.ZodString;
387
+ map: z.ZodRecord<z.ZodString, z.ZodEnum<{
388
+ bluesky: "bluesky";
389
+ facebook: "facebook";
390
+ instagram: "instagram";
391
+ linkedin: "linkedin";
392
+ mastodon: "mastodon";
393
+ pinterest: "pinterest";
394
+ reddit: "reddit";
395
+ threads: "threads";
396
+ tiktok: "tiktok";
397
+ x: "x";
398
+ youtube: "youtube";
399
+ }>>;
400
+ }, z.core.$strip>>;
401
+ }, z.core.$strip>>;
346
402
  legal: z.ZodOptional<z.ZodArray<z.ZodObject<{
347
403
  description: z.ZodString;
348
404
  state: z.ZodEnum<{
@@ -533,6 +589,7 @@ declare const ProjectSchema: z.ZodObject<{
533
589
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
534
590
  allowed_apps: z.ZodOptional<z.ZodArray<z.ZodString>>;
535
591
  identity: z.ZodOptional<z.ZodString>;
592
+ handoffs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"team">, z.ZodArray<z.ZodString>]>>;
536
593
  schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
537
594
  cron: z.ZodString;
538
595
  timezone: z.ZodOptional<z.ZodString>;
@@ -551,6 +608,13 @@ declare const ProjectSchema: z.ZodObject<{
551
608
  role: z.ZodOptional<z.ZodString>;
552
609
  description: z.ZodOptional<z.ZodString>;
553
610
  }, z.core.$strip>>>;
611
+ tasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
612
+ key: z.ZodString;
613
+ title: z.ZodString;
614
+ body: z.ZodOptional<z.ZodString>;
615
+ assignee: z.ZodOptional<z.ZodString>;
616
+ blocked_by: z.ZodOptional<z.ZodArray<z.ZodString>>;
617
+ }, z.core.$strip>>>;
554
618
  removed: z.ZodDefault<z.ZodObject<{
555
619
  apps: z.ZodDefault<z.ZodArray<z.ZodString>>;
556
620
  agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -570,6 +634,7 @@ type SkillDecl = z.infer<typeof SkillDeclSchema>;
570
634
  type IdentityDecl = z.infer<typeof IdentityDeclSchema>;
571
635
  type VaultDecl = z.infer<typeof VaultDeclSchema>;
572
636
  type CredentialDecl = z.infer<typeof CredentialDeclSchema>;
637
+ type TaskDecl = z.infer<typeof TaskDeclSchema>;
573
638
  type ProjectConfig = z.infer<typeof ProjectSchema>;
574
639
  /** Validate an untyped value (a loaded `.json`, an evaluated module) into a frozen project. */
575
640
  declare function parseProject(input: unknown): Readonly<ProjectConfig>;
@@ -777,6 +842,10 @@ declare const PLATFORM_ENV: {
777
842
  readonly identity_id: "NAIVE_IDENTITY_ID";
778
843
  /** The install's `project` — the row the app's own context lookup lands on (§31.8). */
779
844
  readonly project: "NAIVE_PROJECT";
845
+ /** The base URL of the Studio that installed the app, so it can send a signed-out visitor back. */
846
+ readonly studio_url: "NAIVE_STUDIO_URL";
847
+ /** The app's own `app_…` id — the one known value learnt from the row, not from the apply. */
848
+ readonly app_id: "NAIVE_APP_ID";
780
849
  /** A scoped organization API key minted for the app that asks for it. */
781
850
  readonly api_key: "NAIVE_API_KEY";
782
851
  };
@@ -807,6 +876,14 @@ interface PlatformEnv {
807
876
  */
808
877
  minted?: Record<string, (app: string) => Promise<string>>;
809
878
  }
879
+ /** A value nobody has: 256 bits, URL-safe, no alphabet an app secret or a header would mangle. */
880
+ declare const generatedSecret: () => string;
881
+ /**
882
+ * `kq7m-x2rt-8bvn-pz4h`: four groups of four from a 31-letter alphabet, 16·log2(31) ≈ 79 bits. Each
883
+ * character is drawn by rejection sampling so the alphabet is used evenly — a modulo over 256 would
884
+ * not be.
885
+ */
886
+ declare function generatedPassword(): string;
810
887
 
811
888
  /**
812
889
  * The reconciler behind `naive up` (`workstreams/10-blueprints.md §2`): a pure client of the
@@ -822,7 +899,9 @@ interface PlatformEnv {
822
899
  * One thing here is not a reconcile: an agent this apply **created** that declares an `intake` is
823
900
  * sent its briefing as a started session (`agents.ts`, `canonical-spec §31.4`). It is what turns a
824
901
  * provisioned crew into a crew that has started working, and it is idempotent for the same reason
825
- * everything else here is — the agent is created exactly once.
902
+ * everything else here is — the agent is created exactly once. `tasks` (`tasks.ts`, §31.11) is the
903
+ * reconcile that supersedes it: cards on the organization's board, keyed so a re-apply finds them,
904
+ * woken by the API's tick rather than started here.
826
905
  */
827
906
 
828
907
  interface UpReport {
@@ -844,6 +923,12 @@ interface UpReport {
844
923
  * agent is created once, so it is briefed once (`agents.ts`).
845
924
  */
846
925
  intake: ResourceReport[];
926
+ /**
927
+ * One line per declared task, named by its key, `id` the `crd_` (`tasks.ts`, `canonical-spec
928
+ * §31.11`): `created` on the apply that seeded the card, `unchanged` on every later one — the
929
+ * card's key stands for the task. The board's owner is a line under `agents` like any member.
930
+ */
931
+ tasks: ResourceReport[];
847
932
  /**
848
933
  * Live rows this client could not parse, named and stepped over (`report.ts`). One legacy row
849
934
  * used to abort the whole apply before any write; it is now a line here and nothing else.
@@ -970,4 +1055,4 @@ declare function up(config: Readonly<ProjectConfig>, client: VettaClient, opts?:
970
1055
  */
971
1056
  declare const PROJECT_CONTEXT_PREAMBLE: string;
972
1057
 
973
- export { type AgentDecl, type AppDecl, BLUEPRINTS, BlueprintRefusal, CONFIG_CANDIDATES, type ConfigLoad, type CredentialDecl, type CrewPerClientDecl, type DefineInput, type FileSource, type IdentityDecl, type MigrationFile, PLATFORM_ENV, PROJECT_CONTEXT_PREAMBLE, type PlatformEnv, type ProjectConfig, type ResourceAction, type ResourceReport, type ScheduleDecl, type SkillDecl, type Template, type TemplateChoice, type TemplateKind, type UpOptions, type UpReport, type VaultDecl, chooseTemplate, collectFiles, contentHash, defineProject, hasRoster, loadConfig, migrationFiles, parseProject, selectCrew, up };
1058
+ export { type AgentDecl, type AppDecl, BLUEPRINTS, BlueprintRefusal, CONFIG_CANDIDATES, type ConfigLoad, type CredentialDecl, type CrewPerClientDecl, type DefineInput, type FileSource, type IdentityDecl, type MigrationFile, PLATFORM_ENV, PROJECT_CONTEXT_PREAMBLE, type PlatformEnv, type ProjectConfig, type ResourceAction, type ResourceReport, type ScheduleDecl, type SkillDecl, type TaskDecl, type Template, type TemplateChoice, type TemplateKind, type UpOptions, type UpReport, type VaultDecl, chooseTemplate, collectFiles, contentHash, defineProject, generatedPassword, generatedSecret, hasRoster, loadConfig, migrationFiles, parseProject, selectCrew, up };