unfazed 0.2.0 → 0.4.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.
@@ -713,6 +713,141 @@ type CurrentActorResources {
713
713
  serviceLimit: Int!
714
714
  }
715
715
 
716
+ """
717
+ Per-owner compute usage for the current calendar month (docs/run-design.md,
718
+ "Metering (phase 0, ships alone)"): VM-seconds and MiB-seconds accrued across
719
+ every VM the runner has booted for this owner (service, box), keyed on the raw
720
+ owner id. No pricing, no currency — a price is a presentation decision made
721
+ later, on top of these raw numbers. Populated for both humans (session
722
+ callers) and agents, unlike `usage`/`resources` above, which are agent-only.
723
+ """
724
+ type CurrentActorCompute {
725
+ seconds: Float!
726
+ mibSeconds: Float!
727
+ since: String!
728
+ until: String!
729
+ }
730
+
731
+ enum RunStatus {
732
+ QUEUED
733
+ RUNNING
734
+ "Waiting for a human's answer (see Run.question); the VM stays up and the wall clock keeps running."
735
+ BLOCKED
736
+ SUCCEEDED
737
+ FAILED
738
+ CANCELLED
739
+ }
740
+
741
+ """
742
+ Compute metered to one run: VM seconds and MiB-seconds (VM seconds x memory).
743
+ """
744
+ type RunUsage {
745
+ vmSeconds: Float!
746
+ memoryMiB: Int!
747
+ mibSeconds: Float!
748
+ }
749
+
750
+ """
751
+ An agent run (docs/run-design.md): one ephemeral VM booted from the box image
752
+ that executed one task and was destroyed when it exited. Deployments answer
753
+ "what is running"; runs answer "what happened".
754
+ """
755
+ type Run {
756
+ id: ID!
757
+ workspaceID: ID!
758
+ ownerId: ID!
759
+ status: RunStatus!
760
+ rawStatus: String!
761
+ command: String
762
+ harness: String
763
+ prompt: String
764
+ setup: [String!]!
765
+ skills: [String!]!
766
+ "Shell commands run after the harness exited 0; their failure fails the run."
767
+ verify: [String!]!
768
+ "Who approves the harness's guarded actions: empty (the harness's defaults) or human."
769
+ approval: String!
770
+ "How the harness is asked to work: empty (do the task) or plan (write a plan only)."
771
+ mode: String!
772
+ "The run this one continues (a follow-up), if any."
773
+ parentRunID: ID
774
+ "Length of the follow-up chain; 0 for a root run."
775
+ depth: Int!
776
+ "Set while the run is BLOCKED on a human; answer with answerRun."
777
+ question: RunQuestion
778
+ memoryMiB: Int!
779
+ maxSeconds: Int!
780
+ metadata: JSON
781
+ "Terminal failure detail (FAILED only)."
782
+ error: String
783
+ exitCode: Int
784
+ "The harness's own report when the guest obtained one: final message and whether it considers the work done. SUCCEEDED alone means the harness exited cleanly."
785
+ result: RunResult
786
+ "Exit code of the verify commands when they ran."
787
+ verifyExitCode: Int
788
+ vmID: String
789
+ "True once the stored console transcript can be fetched (get_run_transcript / the runs API)."
790
+ transcriptAvailable: Boolean!
791
+ usage: RunUsage!
792
+ createdAt: String!
793
+ startedAt: String
794
+ settledAt: String
795
+ }
796
+
797
+ "How the harness said it finished: status success|error, detail in the harness's words, text its final message (bounded)."
798
+ type RunResult {
799
+ status: String!
800
+ detail: String
801
+ text: String
802
+ }
803
+
804
+ "One entry of a run's own history (started, cancel requested, settled)."
805
+ type RunEvent {
806
+ id: ID!
807
+ runID: ID!
808
+ type: String!
809
+ severity: DeploymentEventSeverity!
810
+ message: String!
811
+ metadata: JSON
812
+ createdAt: String!
813
+ }
814
+
815
+ """
816
+ The redacted end of a RUNNING run's live console, from the node the VM is on.
817
+ Empty with running=false once the run has settled — read runTranscript then.
818
+ """
819
+ type RunConsole {
820
+ runID: ID!
821
+ running: Boolean!
822
+ text: String!
823
+ }
824
+
825
+ "The human input a BLOCKED run is waiting for."
826
+ type RunQuestion {
827
+ id: ID!
828
+ text: String!
829
+ options: [String!]!
830
+ askedAt: String!
831
+ }
832
+
833
+ "The bounded end of a finished run's stored transcript."
834
+ type RunTranscript {
835
+ runID: ID!
836
+ available: Boolean!
837
+ text: String!
838
+ totalBytes: Int!
839
+ truncated: Boolean!
840
+ }
841
+
842
+ type RunPage {
843
+ items: [Run!]!
844
+ total: Int!
845
+ limit: Int!
846
+ offset: Int!
847
+ hasMore: Boolean!
848
+ nextOffset: Int
849
+ }
850
+
716
851
  type CurrentActorUser {
717
852
  kind: CurrentActorKind!
718
853
  userID: String!
@@ -743,6 +878,7 @@ type CurrentActor {
743
878
  expiresAt: String
744
879
  usage: CurrentActorUsage
745
880
  resources: CurrentActorResources
881
+ compute: CurrentActorCompute
746
882
  user: CurrentActorUser
747
883
  agent: CurrentActorAgent
748
884
  linkedAgents: [CurrentActorAgent!]!
@@ -806,6 +942,16 @@ type Query {
806
942
  deploymentReleases(alias: String!): [Deployment!]!
807
943
  deploymentEvents(deploymentID: ID!, limit: Int): [DeploymentEvent!]!
808
944
  deploymentEventsPage(input: ListDeploymentEventsInput!): DeploymentEventPage!
945
+ "One agent run visible to the caller; not-found otherwise."
946
+ run(id: ID!): Run!
947
+ "The caller's agent runs, newest first."
948
+ runs(input: ListRunsInput): RunPage!
949
+ "A run's own history, oldest first (at most limit, default 100)."
950
+ runEvents(runID: ID!, limit: Int): [RunEvent!]!
951
+ "The live console tail of a RUNNING run (tailBytes, default 16384)."
952
+ runConsole(id: ID!, tailBytes: Int): RunConsole!
953
+ "The end of a finished run's stored transcript (tailBytes, default 16384, max 65536)."
954
+ runTranscript(id: ID!, tailBytes: Int): RunTranscript!
809
955
  serviceStatus(deploymentID: ID!): ServiceRuntimeStatus!
810
956
  serviceLogs(deploymentID: ID!, tailBytes: Int): ServiceRuntimeLogs!
811
957
  appState(alias: String!, key: String!): AppStateValue!
@@ -816,6 +962,14 @@ type Query {
816
962
  }
817
963
 
818
964
  type Mutation {
965
+ "Start an agent run; returns once its VM has started (RUNNING) or FAILED with error."
966
+ createRun(input: CreateRunInput!): Run!
967
+ "Stop an agent run (idempotent on an already-cancelled run)."
968
+ cancelRun(id: ID!): Run!
969
+ "Answer a BLOCKED run's pending question; the run resumes."
970
+ answerRun(id: ID!, answer: String!): Run!
971
+ "Continue a finished run: a new run in the same workspace with the parent's context prepended to the prompt."
972
+ followUpRun(input: FollowUpRunInput!): Run!
819
973
  registerFunction(input: RegisterFunctionInput!): Function!
820
974
  invokeFunction(input: InvokeFunctionInput!): Invocation!
821
975
  createWorkspace(input: CreateWorkspaceInput!): CreateWorkspacePayload!
@@ -1259,6 +1413,45 @@ input ListDeploymentsInput {
1259
1413
  order: String
1260
1414
  }
1261
1415
 
1416
+ input CreateRunInput {
1417
+ workspaceID: ID!
1418
+ prompt: String
1419
+ harness: String
1420
+ command: String
1421
+ "Shell commands run in /work before the harness; the first failure fails the run."
1422
+ setup: [String!]
1423
+ "Skills fetched into .claude/skills before the harness, as owner/repo:path."
1424
+ skills: [String!]
1425
+ "Shell commands run after the harness exited 0 (tests, a build, a file check); the first failure FAILS the run. Skipped in plan mode."
1426
+ verify: [String!]
1427
+ "\"human\" routes the harness's permission prompts to you (the run BLOCKS until you answer); empty keeps the harness's own defaults."
1428
+ approval: String
1429
+ "\"plan\" asks the harness to write a plan without acting; empty does the task."
1430
+ mode: String
1431
+ "The run this one continues; usually set through followUpRun."
1432
+ parentRunID: ID
1433
+ memoryMiB: Int
1434
+ maxSeconds: Int
1435
+ metadata: JSON
1436
+ includeFiles: Boolean
1437
+ }
1438
+
1439
+ input FollowUpRunInput {
1440
+ runID: ID!
1441
+ prompt: String!
1442
+ mode: String
1443
+ approval: String
1444
+ maxSeconds: Int
1445
+ metadata: JSON
1446
+ }
1447
+
1448
+ input ListRunsInput {
1449
+ workspaceID: ID
1450
+ status: RunStatus
1451
+ limit: Int
1452
+ offset: Int
1453
+ }
1454
+
1262
1455
  input ListDeploymentEventsInput {
1263
1456
  deploymentID: ID!
1264
1457
  limit: Int