unfazed 0.2.0 → 0.3.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,128 @@ 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
+ "Who approves the harness's guarded actions: empty (the harness's defaults) or human."
767
+ approval: String!
768
+ "How the harness is asked to work: empty (do the task) or plan (write a plan only)."
769
+ mode: String!
770
+ "The run this one continues (a follow-up), if any."
771
+ parentRunID: ID
772
+ "Length of the follow-up chain; 0 for a root run."
773
+ depth: Int!
774
+ "Set while the run is BLOCKED on a human; answer with answerRun."
775
+ question: RunQuestion
776
+ memoryMiB: Int!
777
+ maxSeconds: Int!
778
+ metadata: JSON
779
+ "Terminal failure detail (FAILED only)."
780
+ error: String
781
+ exitCode: Int
782
+ vmID: String
783
+ "True once the stored console transcript can be fetched (get_run_transcript / the runs API)."
784
+ transcriptAvailable: Boolean!
785
+ usage: RunUsage!
786
+ createdAt: String!
787
+ startedAt: String
788
+ settledAt: String
789
+ }
790
+
791
+ "One entry of a run's own history (started, cancel requested, settled)."
792
+ type RunEvent {
793
+ id: ID!
794
+ runID: ID!
795
+ type: String!
796
+ severity: DeploymentEventSeverity!
797
+ message: String!
798
+ metadata: JSON
799
+ createdAt: String!
800
+ }
801
+
802
+ """
803
+ The redacted end of a RUNNING run's live console, from the node the VM is on.
804
+ Empty with running=false once the run has settled — read runTranscript then.
805
+ """
806
+ type RunConsole {
807
+ runID: ID!
808
+ running: Boolean!
809
+ text: String!
810
+ }
811
+
812
+ "The human input a BLOCKED run is waiting for."
813
+ type RunQuestion {
814
+ id: ID!
815
+ text: String!
816
+ options: [String!]!
817
+ askedAt: String!
818
+ }
819
+
820
+ "The bounded end of a finished run's stored transcript."
821
+ type RunTranscript {
822
+ runID: ID!
823
+ available: Boolean!
824
+ text: String!
825
+ totalBytes: Int!
826
+ truncated: Boolean!
827
+ }
828
+
829
+ type RunPage {
830
+ items: [Run!]!
831
+ total: Int!
832
+ limit: Int!
833
+ offset: Int!
834
+ hasMore: Boolean!
835
+ nextOffset: Int
836
+ }
837
+
716
838
  type CurrentActorUser {
717
839
  kind: CurrentActorKind!
718
840
  userID: String!
@@ -743,6 +865,7 @@ type CurrentActor {
743
865
  expiresAt: String
744
866
  usage: CurrentActorUsage
745
867
  resources: CurrentActorResources
868
+ compute: CurrentActorCompute
746
869
  user: CurrentActorUser
747
870
  agent: CurrentActorAgent
748
871
  linkedAgents: [CurrentActorAgent!]!
@@ -806,6 +929,16 @@ type Query {
806
929
  deploymentReleases(alias: String!): [Deployment!]!
807
930
  deploymentEvents(deploymentID: ID!, limit: Int): [DeploymentEvent!]!
808
931
  deploymentEventsPage(input: ListDeploymentEventsInput!): DeploymentEventPage!
932
+ "One agent run visible to the caller; not-found otherwise."
933
+ run(id: ID!): Run!
934
+ "The caller's agent runs, newest first."
935
+ runs(input: ListRunsInput): RunPage!
936
+ "A run's own history, oldest first (at most limit, default 100)."
937
+ runEvents(runID: ID!, limit: Int): [RunEvent!]!
938
+ "The live console tail of a RUNNING run (tailBytes, default 16384)."
939
+ runConsole(id: ID!, tailBytes: Int): RunConsole!
940
+ "The end of a finished run's stored transcript (tailBytes, default 16384, max 65536)."
941
+ runTranscript(id: ID!, tailBytes: Int): RunTranscript!
809
942
  serviceStatus(deploymentID: ID!): ServiceRuntimeStatus!
810
943
  serviceLogs(deploymentID: ID!, tailBytes: Int): ServiceRuntimeLogs!
811
944
  appState(alias: String!, key: String!): AppStateValue!
@@ -816,6 +949,14 @@ type Query {
816
949
  }
817
950
 
818
951
  type Mutation {
952
+ "Start an agent run; returns once its VM has started (RUNNING) or FAILED with error."
953
+ createRun(input: CreateRunInput!): Run!
954
+ "Stop an agent run (idempotent on an already-cancelled run)."
955
+ cancelRun(id: ID!): Run!
956
+ "Answer a BLOCKED run's pending question; the run resumes."
957
+ answerRun(id: ID!, answer: String!): Run!
958
+ "Continue a finished run: a new run in the same workspace with the parent's context prepended to the prompt."
959
+ followUpRun(input: FollowUpRunInput!): Run!
819
960
  registerFunction(input: RegisterFunctionInput!): Function!
820
961
  invokeFunction(input: InvokeFunctionInput!): Invocation!
821
962
  createWorkspace(input: CreateWorkspaceInput!): CreateWorkspacePayload!
@@ -1259,6 +1400,43 @@ input ListDeploymentsInput {
1259
1400
  order: String
1260
1401
  }
1261
1402
 
1403
+ input CreateRunInput {
1404
+ workspaceID: ID!
1405
+ prompt: String
1406
+ harness: String
1407
+ command: String
1408
+ "Shell commands run in /work before the harness; the first failure fails the run."
1409
+ setup: [String!]
1410
+ "Skills fetched into .claude/skills before the harness, as owner/repo:path."
1411
+ skills: [String!]
1412
+ "\"human\" routes the harness's permission prompts to you (the run BLOCKS until you answer); empty keeps the harness's own defaults."
1413
+ approval: String
1414
+ "\"plan\" asks the harness to write a plan without acting; empty does the task."
1415
+ mode: String
1416
+ "The run this one continues; usually set through followUpRun."
1417
+ parentRunID: ID
1418
+ memoryMiB: Int
1419
+ maxSeconds: Int
1420
+ metadata: JSON
1421
+ includeFiles: Boolean
1422
+ }
1423
+
1424
+ input FollowUpRunInput {
1425
+ runID: ID!
1426
+ prompt: String!
1427
+ mode: String
1428
+ approval: String
1429
+ maxSeconds: Int
1430
+ metadata: JSON
1431
+ }
1432
+
1433
+ input ListRunsInput {
1434
+ workspaceID: ID
1435
+ status: RunStatus
1436
+ limit: Int
1437
+ offset: Int
1438
+ }
1439
+
1262
1440
  input ListDeploymentEventsInput {
1263
1441
  deploymentID: ID!
1264
1442
  limit: Int