client

package
v0.167.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 33 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package client talks to a running TeaNode server's GraphQL API.

It exists so that the command line tool and the dashboard change configuration the same way: through the server. The alternative, editing teanode.yaml underneath a running process, loses whichever change the other writer made second, because the server holds the whole configuration in memory and rewrites the file from it.

Index

Constants

View Source
const (
	DocumentListGroups  = `query { ListGroups ` + groupFields + ` }`
	DocumentCreateGroup = `mutation ($name: String!, $description: String, $idpGroup: String,
		$userIds: [String!], $roleIds: [String!], $domainIds: [String!]) {
		CreateGroup(name: $name, description: $description, idpGroup: $idpGroup,
			userIds: $userIds, roleIds: $roleIds, domainIds: $domainIds) ` + groupFields + `
	}`
	DocumentUpdateGroup = `mutation ($groupId: String!, $name: String, $description: String, $idpGroup: String,
		$userIds: [String!], $roleIds: [String!], $domainIds: [String!]) {
		UpdateGroup(groupId: $groupId, name: $name, description: $description, idpGroup: $idpGroup,
			userIds: $userIds, roleIds: $roleIds, domainIds: $domainIds) ` + groupFields + `
	}`
	DocumentDeleteGroup = `mutation ($groupId: String!) { DeleteGroup(groupId: $groupId) }`

	DocumentListRoles       = `query { ListRoles ` + roleFields + ` }`
	DocumentListPermissions = `query { ListPermissions { key kind widens } }`
	DocumentCreateRole      = `mutation ($name: String!, $description: String, $permissions: [String!]!) {
		CreateRole(name: $name, description: $description, permissions: $permissions) ` + roleFields + `
	}`
	DocumentUpdateRole = `mutation ($roleId: String!, $name: String, $description: String, $permissions: [String!]) {
		UpdateRole(roleId: $roleId, name: $name, description: $description, permissions: $permissions) ` + roleFields + `
	}`
	DocumentDeleteRole = `mutation ($roleId: String!) { DeleteRole(roleId: $roleId) }`

	DocumentListAuditEvents = `` /* 460-byte string literal not displayed */

)

The documents this file sends, named so that a test can validate each one against the schema the server builds.

View Source
const (
	DocumentReadAgent = `query { ReadAgent ` + agentViewSelection + ` }`

	DocumentUpdateAgent = `mutation ($enabled: Boolean, $name: String, $instructions: String, $language: String, $knowledgeLanguage: String,
		$voice: AgentVoiceInput, $categories: [AgentCategoryInput!], $notifications: AgentNotificationsInput,
		$confirm: [String!], $unattendedAllowedRisks: [String!], $askModel: String, $speechVoice: String, $dreamFrom: String, $dreamUntil: String,
		$isAlertsEnabled: Boolean, $alertQuietStart: String, $alertQuietEnd: String, $alertDailyMost: Int,
		$forget: Boolean) {
		UpdateAgent(enabled: $enabled, name: $name, instructions: $instructions, language: $language, knowledgeLanguage: $knowledgeLanguage,
			voice: $voice, categories: $categories, notifications: $notifications, confirm: $confirm,
			unattendedAllowedRisks: $unattendedAllowedRisks, askModel: $askModel, speechVoice: $speechVoice, dreamFrom: $dreamFrom, dreamUntil: $dreamUntil,
			isAlertsEnabled: $isAlertsEnabled, alertQuietStart: $alertQuietStart, alertQuietEnd: $alertQuietEnd,
			alertDailyMost: $alertDailyMost, forget: $forget) ` + agentViewSelection + `
	}`

	DocumentGrantAgentMailbox = `mutation ($mailboxId: String!, $policy: AgentMailboxInput) {
		GrantAgentMailbox(mailboxId: $mailboxId, policy: $policy) ` + agentViewSelection + `
	}`

	DocumentRevokeAgentMailbox = `mutation ($mailboxId: String!) {
		RevokeAgentMailbox(mailboxId: $mailboxId) ` + agentViewSelection + `
	}`

	DocumentGrantAgentSource = `mutation ($kind: String!, $id: String!, $granted: Boolean!) {
		GrantAgentSource(kind: $kind, id: $id, granted: $granted) ` + agentViewSelection + `
	}`

	DocumentSetAgentBrief = `mutation ($enabled: Boolean!, $at: String, $days: [Int!]) {
		SetAgentBrief(enabled: $enabled, at: $at, days: $days) ` + scheduleFields + `
	}`

	DocumentRunAgentBriefNow = `mutation { RunAgentBriefNow ` + scheduleFields + ` }`

	DocumentAgentUsage = `` /* 198-byte string literal not displayed */

	DocumentListAgents = `query { ListAgents ` + agentSummarySelection + ` }`

	DocumentAgentServerUsage = `` /* 236-byte string literal not displayed */

	DocumentListAgentDeadLetters = `query { ListAgentDeadLetters ` + agentJobSelection + ` }`

	DocumentSetAgentLimit = `mutation ($agentId: String!, $dailyTokens: Int64, $dailyCost: Float) {
		SetAgentLimit(agentId: $agentId, dailyTokens: $dailyTokens, dailyCost: $dailyCost) ` + agentSummarySelection + `
	}`

	DocumentSetAgentDisabled = `mutation ($agentId: String!, $disabled: Boolean!) {
		SetAgentDisabled(agentId: $agentId, disabled: $disabled) ` + agentSummarySelection + `
	}`

	DocumentRetryAgentJob = `mutation ($jobId: String!) { RetryAgentJob(jobId: $jobId) ` + agentJobSelection + ` }`
)

The documents, exported so a test can compare them with the schema.

View Source
const (
	DocumentListAgentAlerts = `` /* 211-byte string literal not displayed */

	DocumentListAgentAlertMutes = `query { ListAgentAlertMutes ` + agentAlertMuteFields + ` }`

	DocumentMuteAgentAlert = `mutation ($alertId: String, $muteScope: String, $muteTarget: String) {
  MuteAgentAlert(alertId: $alertId, muteScope: $muteScope, muteTarget: $muteTarget) ` + agentAlertMuteFields + `
}`

	DocumentUnmuteAgentAlert = `mutation ($muteId: String!) { UnmuteAgentAlert(muteId: $muteId) }`
)
View Source
const (
	DocumentAskAgent = `` /* 378-byte string literal not displayed */

	DocumentReadAgentRun = `` /* 203-byte string literal not displayed */

	DocumentResolveAgentConfirmation = `` /* 147-byte string literal not displayed */

	DocumentStopAgentRun            = `mutation ($runId: String!) { StopAgentRun(runId: $runId) }`
	DocumentListAgentConversations  = `query ($archived: Boolean, $query: String) { ListAgentConversations(archived: $archived, query: $query) ` + conversationFields + ` }`
	DocumentDeleteAgentConversation = `mutation ($conversationId: String!) { DeleteAgentConversation(conversationId: $conversationId) }`
	DocumentListAgentRuns           = `query ($first: Int, $offset: Int, $jobId: String, $kinds: [String!], $query: String) { ListAgentRuns(first: $first, offset: $offset, jobId: $jobId, kinds: $kinds, query: $query) { total runs ` + runFields + ` } }`
	DocumentListAllAgentRuns        = `query ($first: Int, $offset: Int, $agentId: String, $kinds: [String!], $query: String) { ListAllAgentRuns(first: $first, offset: $offset, agentId: $agentId, kinds: $kinds, query: $query) { total runs ` + runFields + ` } }`
	DocumentReadAgentConversation   = `query ($conversationId: String, $first: Int, $offset: Int) {
		ReadAgentConversation(conversationId: $conversationId, first: $first, offset: $offset) {
			conversation ` + conversationFields + `
			messages { id createdAt role content name toolCallId toolCalls { id name arguments } usage { model kind promptTokens completionTokens } attachments { id name contentType size } references { itemId threadId subject from recordingId recordingTitle agentMessageId quotedRole quotedText } reactions { emoji reactorKind reactedAt } }
			total
			todos ` + todoFields + `
		}
	}`
	DocumentStartAgentConversation  = `mutation ($title: String) { StartAgentConversation(title: $title) ` + conversationFields + ` }`
	DocumentUpdateAgentConversation = `mutation ($conversationId: String!, $title: String, $archived: Boolean) {
		UpdateAgentConversation(conversationId: $conversationId, title: $title, archived: $archived) ` + conversationFields + `
	}`
	DocumentSetAgentMainConversation = `mutation ($conversationId: String) {
		SetAgentMainConversation(conversationId: $conversationId) ` + conversationFields + `
	}`
	DocumentListAgentTools      = `query { ListAgentTools { name family risk description confirms core } }`
	DocumentReactToAgentMessage = `mutation ($messageId: String!, $emoji: String!) { ReactToAgentMessage(messageId: $messageId, emoji: $emoji) }`
)

The documents.

View Source
const (
	DocumentListAgentBackgroundCommands = `query ($conversationId: String) {
		ListAgentBackgroundCommands(conversationId: $conversationId) { ` + backgroundCommandFields + ` }
	}`
	DocumentReadAgentBackgroundCommand = `query ($computer: String!, $id: String!, $tailBytes: Int) {
		ReadAgentBackgroundCommand(computer: $computer, id: $id, tailBytes: $tailBytes) {
			` + backgroundCommandFields + `
			stdout stderr isStdoutTruncated isStderrTruncated stdoutByteCount stderrByteCount
		}
	}`
	DocumentStopAgentBackgroundCommand = `` /* 169-byte string literal not displayed */

)

The documents the command line sends, exported so a test can check them against the schema.

View Source
const (
	DocumentStartAgentSurvey = `mutation ($question: String!, $scopePath: String) {
		StartAgentSurvey(question: $question, scopePath: $scopePath) { ` + backgroundWorkFields + ` question scopePath }
	}`
	DocumentListAgentBackgroundWork = `query ($first: Int) {
		ListAgentBackgroundWork(first: $first) { ` + backgroundWorkFields + ` errorMessage }
	}`
	DocumentGetAgentBackgroundWork = `query ($id: String!) {
		GetAgentBackgroundWork(id: $id) {
			` + backgroundWorkFields + `
			question scopePath prompt resultText runIds errorMessage
		}
	}`
	DocumentStopAgentBackgroundWork = `mutation ($id: String!) {
		StopAgentBackgroundWork(id: $id) { ` + backgroundWorkFields + ` errorMessage }
	}`
)

The documents the command line sends, exported so a test can check them against the schema.

View Source
const (
	DocumentAgentBillingChecks = `query { AgentBillingChecks { ` + agentBillingCheckFields + ` } }`

	DocumentCheckAgentProviderPrices = `mutation { CheckAgentProviderPrices { ` + agentBillingCheckFields + ` } }`
)
View Source
const (
	DocumentReadAgentCodingContext = `query ($directory: String!, $computerName: String, $homeDirectory: String, $sessionId: String, $remoteUrls: [String!], $head: String, $checkoutRoot: String) {
		ReadAgentCodingContext(directory: $directory, computerName: $computerName, homeDirectory: $homeDirectory, sessionId: $sessionId, remoteUrls: $remoteUrls, head: $head, checkoutRoot: $checkoutRoot) {
			` + agentCodingContextSelection + `
		}
	}`
	DocumentRecallAgentCodingMemory = `query ($prompt: String!, $directory: String!, $computerName: String, $homeDirectory: String, $shownPaths: [String!], $isEverywhere: Boolean, $remoteUrls: [String!], $head: String, $checkoutRoot: String) {
		RecallAgentCodingMemory(prompt: $prompt, directory: $directory, computerName: $computerName, homeDirectory: $homeDirectory, shownPaths: $shownPaths, isEverywhere: $isEverywhere, remoteUrls: $remoteUrls, head: $head, checkoutRoot: $checkoutRoot) {
			` + agentCodingContextSelection + `
		}
	}`
	DocumentCaptureAgentCodingSession = `` /* 139-byte string literal not displayed */

)
View Source
const (
	DocumentListAgentServers      = `query { ListAgentServers ` + serverFields + ` }`
	DocumentConnectAgentServer    = `mutation ($server: String!, $credential: String) { ConnectAgentServer(server: $server, credential: $credential) ` + serverFields + ` }`
	DocumentDisconnectAgentServer = `mutation ($server: String!) { DisconnectAgentServer(server: $server) ` + serverFields + ` }`
	DocumentBeginAgentServerOAuth = `mutation ($server: String!, $redirectUrl: String!) { BeginAgentServerOAuth(server: $server, redirectUrl: $redirectUrl) }`
)

The documents.

View Source
const (
	DocumentListAgentGoals = `query ($goalStates: [String!]) {
		ListAgentGoals(goalStates: $goalStates) { ` + goalFields + ` }
	}`
	DocumentGetAgentGoal = `query ($conversationId: String!) {
		GetAgentGoal(conversationId: $conversationId) {
			` + goalFields + `
			activity { id createdAt goalActivityKind activityHeadline activityDetail }
			schedules { id name cron enabled nextRunAt }
			backgroundWork { ` + backgroundWorkFields + ` }
			artifacts { id createdAt goalArtifactKind artifactReference artifactTitle }
		}
	}`
	DocumentStartAgentGoal = `mutation ($goalTitle: String!, $goalDescription: String!, $originConversationId: String, $scheduleIds: [String!]) {
		StartAgentGoal(goalTitle: $goalTitle, goalDescription: $goalDescription, originConversationId: $originConversationId, scheduleIds: $scheduleIds) { ` + goalFields + ` }
	}`
	DocumentMoveAgentScheduleToGoal = `` /* 196-byte string literal not displayed */

	DocumentTellAgentGoal = `mutation ($conversationId: String!, $text: String!) {
		TellAgentGoal(conversationId: $conversationId, text: $text) { ` + goalFields + ` }
	}`
	DocumentSetAgentGoalState = `mutation ($conversationId: String!, $goalState: String!) {
		SetAgentGoalState(conversationId: $conversationId, goalState: $goalState) { ` + goalFields + ` }
	}`
)

The documents the command line and the goal tool send, exported so a test can check them against the schema.

View Source
const (
	DocumentAgentGraphIndex = `query ($under: String, $first: Int) {
		AgentGraphIndex(under: $under, first: $first) ` + nodeFields + `
	}`
	DocumentAgentGraphPage = `query ($path: String!, $linkOffset: Int, $linkLimit: Int) {
		AgentGraphPage(path: $path, linkOffset: $linkOffset, linkLimit: $linkLimit) {
			node ` + pageNodeFields + `
			facts ` + factFields + `
			edges { relation status fromPath toPath }
			children ` + nodeFields + `
			contact { id name emails phones organization }
			linkCount nextLinkOffset recordLinkCount
		}
	}`
	DocumentSearchAgentGraph = `query ($query: String!, $first: Int, $offset: Int) {
		SearchAgentGraph(query: $query, first: $first, offset: $offset) {
			nodes ` + nodeFields + `
			facts { fact ` + factFields + ` path name }
			moreNodeCount isMoreNodeCountLowerBound moreFactCount isMoreFactCountLowerBound nextOffset
		}
	}`
	DocumentEvaluateAgentAnswer = `` /* 445-byte string literal not displayed */

	DocumentRecallAgentMemory = `` /* 254-byte string literal not displayed */

	DocumentAgentOverviewState = `` /* 246-byte string literal not displayed */

	DocumentJudgeAgentRetrievalPlan = `` /* 138-byte string literal not displayed */

	DocumentExplainAgentRecall = `` /* 716-byte string literal not displayed */

	DocumentListAgentLearned = `query ($days: Int, $first: Int) {
		ListAgentLearned(days: $days, first: $first) { fact ` + factFields + ` path name }
	}`
	DocumentSaveAgentNode = `mutation ($path: String!, $kind: String, $name: String, $summary: String, $aliases: [String!], $pinned: Boolean) {
		SaveAgentNode(path: $path, kind: $kind, name: $name, summary: $summary, aliases: $aliases, pinned: $pinned) ` + nodeFields + `
	}`
	DocumentMergeAgentNodes = `mutation ($path: String!, $into: String!) { MergeAgentNodes(path: $path, into: $into) { id path name } }`
	DocumentMoveAgentNode   = `mutation ($path: String!, $under: String!) {
		MoveAgentNode(path: $path, under: $under) ` + nodeFields + `
	}`
	DocumentDeleteAgentNode = `mutation ($path: String!) { DeleteAgentNode(path: $path) }`
	DocumentSaveAgentFact   = `mutation ($path: String!, $number: Int, $kind: String, $text: String!, $happened: String, $audiences: [String!]) {
		SaveAgentFact(path: $path, number: $number, kind: $kind, text: $text, happened: $happened, audiences: $audiences) ` + factFields + `
	}`
	DocumentMoveAgentFact = `mutation ($path: String!, $number: Int!, $to: String!) {
		MoveAgentFact(path: $path, number: $number, to: $to) ` + factFields + `
	}`
	DocumentDeleteAgentFact = `mutation ($path: String!, $number: Int!) { DeleteAgentFact(path: $path, number: $number) }`
	DocumentSetMyContact    = `mutation ($contactId: String) { SetMyContact(contactId: $contactId) }`

	DocumentListAgentKnowledgeSources = `query { ListAgentKnowledgeSources ` + sourceFields + ` }`
	DocumentSaveAgentKnowledgeSource  = `mutation ($sourceId: String, $kind: String, $name: String, $computer: String, $path: String, $format: String, $rootPath: String, $cron: String, $enabled: Boolean, $mailboxId: String, $readEveryCheckout: Boolean, $commitsPerPass: Int, $ownCommitsAtLeast: Int, $type: String, $settings: JSON) {
		SaveAgentKnowledgeSource(type: $type, settings: $settings, sourceId: $sourceId, kind: $kind, name: $name, computer: $computer, path: $path, format: $format, rootPath: $rootPath, cron: $cron, enabled: $enabled, mailboxId: $mailboxId, readEveryCheckout: $readEveryCheckout, commitsPerPass: $commitsPerPass, ownCommitsAtLeast: $ownCommitsAtLeast) ` + sourceFields + `
	}`
	DocumentSearchAgentDocuments = `query ($query: String!, $first: Int, $offset: Int, $sourceId: String, $directory: String, $computerName: String) {
		SearchAgentDocuments(query: $query, first: $first, offset: $offset, sourceId: $sourceId, directory: $directory, computerName: $computerName) {
			passages ` + passageFields + `
			definitions { symbol kind line documentId externalId title }
			directories { directory sourceId source passageCount }
			meaningful moreCount isMoreCountLowerBound nextOffset
		}
	}`
	DocumentReadAgentDocument = `query ($documentId: String!, $from: Int, $first: Int) {
		ReadAgentDocument(documentId: $documentId, from: $from, first: $first) ` + extractFields + `
	}`
	DocumentDeleteAgentKnowledgeSource = `mutation ($sourceId: String!) { DeleteAgentKnowledgeSource(sourceId: $sourceId) }`
	DocumentSyncAgentKnowledgeSource   = `mutation ($sourceId: String!) { SyncAgentKnowledgeSource(sourceId: $sourceId) }`
	DocumentDreamAgentNow              = `mutation ($bootstrap: Boolean) { DreamAgentNow(bootstrap: $bootstrap) }`
	DocumentRewriteAgentOverview       = `mutation ($path: String!) { RewriteAgentOverview(path: $path) }`
	DocumentRereadAgentDocuments       = `mutation ($minutes: Int!) { RereadAgentDocuments(minutes: $minutes) }`
	DocumentLinkAgentNodes             = `` /* 149-byte string literal not displayed */
	DocumentUnlinkAgentNodes           = `mutation ($path: String!, $to: String!, $relation: String!) { UnlinkAgentNodes(path: $path, to: $to, relation: $relation) }`
	DocumentListAgentDreams            = `query ($first: Int) { ListAgentDreams(first: $first) ` + dreamFields + ` }`
	DocumentAgentReadingProgress       = `query { AgentReadingProgress { waiting read perHour hoursLeft bootstrapping } }`
	DocumentListAgentPageHistory       = `query ($path: String!, $first: Int) { ListAgentPageHistory(path: $path, first: $first) ` + revisionFields + ` }`
)

The documents.

View Source
const (
	DocumentListAgentRecordLinks = `query ($path: String!, $first: Int, $offset: Int) {
		ListAgentRecordLinks(path: $path, first: $first, offset: $offset) {
			recordLinks ` + recordLinkFields + `
			recordLinkCount nextOffset
		}
	}`
	DocumentReadRecordMemoryLinks = `query ($recordKind: String!, $recordId: String!, $passageStartMS: Int64, $passageEndMS: Int64) {
		ReadRecordMemoryLinks(recordKind: $recordKind, recordId: $recordId, passageStartMS: $passageStartMS, passageEndMS: $passageEndMS) ` + recordLinkFields + `
	}`
	DocumentLinkAgentRecord = `mutation ($path: String!, $recordKind: String!, $recordId: String!, $recordRelation: String!, $passageStartMS: Int64, $passageEndMS: Int64, $transcriptRunId: String, $note: String) {
		LinkAgentRecord(path: $path, recordKind: $recordKind, recordId: $recordId, recordRelation: $recordRelation, passageStartMS: $passageStartMS, passageEndMS: $passageEndMS, transcriptRunId: $transcriptRunId, note: $note) ` + recordLinkFields + `
	}`
	DocumentUnlinkAgentRecord = `` /* 317-byte string literal not displayed */

	DocumentConfirmAgentRecord = `` /* 318-byte string literal not displayed */

	DocumentSetAgentNodeContact = `mutation ($path: String!, $contactId: String) { SetAgentNodeContact(path: $path, contactId: $contactId) }`
)

The documents.

View Source
const (
	DocumentListAgentHerdrSessions = `query ($computer: String) {
		ListAgentHerdrSessions(computer: $computer) { computerNames failedComputerNames sessions { ` + HerdrSessionFields + ` } }
	}`
	DocumentReadAgentHerdrSession = `query ($computer: String, $paneId: String!, $turnCount: Int) {
		ReadAgentHerdrSession(computer: $computer, paneId: $paneId, turnCount: $turnCount) {
			herdrSession { ` + HerdrSessionFields + ` } turns { herdrTurnRole turnText turnAt } isTruncated
		}
	}`
	DocumentReadAgentHerdrScreen = `query ($computer: String, $paneId: String!, $lineCount: Int) {
		ReadAgentHerdrScreen(computer: $computer, paneId: $paneId, lineCount: $lineCount) {
			herdrSession { ` + HerdrSessionFields + ` } screenText
		}
	}`
	DocumentSendAgentHerdrSession = `mutation ($computer: String, $paneId: String!, $text: String, $attachmentIds: [String!]) {
		SendAgentHerdrSession(computer: $computer, paneId: $paneId, text: $text, attachmentIds: $attachmentIds) { ` + HerdrSessionFields + ` }
	}`
	DocumentWaitAgentHerdrSession = `query ($computer: String, $paneId: String!, $waitSeconds: Int) {
		WaitAgentHerdrSession(computer: $computer, paneId: $paneId, waitSeconds: $waitSeconds) {
			herdrSession { ` + HerdrSessionFields + ` } isTimedOut
		}
	}`
	DocumentAnswerAgentHerdrQuestion = `mutation ($computer: String, $paneId: String!, $questionFingerprint: String!, $optionNumbers: [Int!], $optionLabels: [String!], $freeText: String) {
		AnswerAgentHerdrQuestion(computer: $computer, paneId: $paneId, questionFingerprint: $questionFingerprint, optionNumbers: $optionNumbers, optionLabels: $optionLabels, freeText: $freeText) {
			herdrSession { ` + HerdrSessionFields + ` } isAnswerAccepted answeredWith
		}
	}`
	DocumentWatchAgentHerdrSession = `mutation ($computer: String, $paneId: String!, $conversationId: String) {
		WatchAgentHerdrSession(computer: $computer, paneId: $paneId, conversationId: $conversationId) { ` + HerdrSessionFields + ` }
	}`
	DocumentOpenAgentHerdrSession = `mutation ($computer: String, $directory: String!, $codingAgentKind: String!, $agentName: String, $shouldSkipPermissions: Boolean) {
		OpenAgentHerdrSession(computer: $computer, directory: $directory, codingAgentKind: $codingAgentKind, agentName: $agentName, shouldSkipPermissions: $shouldSkipPermissions) { ` + HerdrSessionFields + ` }
	}`
	DocumentCloseAgentHerdrSession = `mutation ($computer: String, $paneId: String!) {
		CloseAgentHerdrSession(computer: $computer, paneId: $paneId) { ` + HerdrSessionFields + ` }
	}`
	DocumentSetUpAgentHerdrHooks = `` /* 196-byte string literal not displayed */

)

The documents the command line sends, exported so a test can check them against the schema.

View Source
const (
	DocumentListAgentIdeas = `query ($ideaStatuses: [String!], $ideaKinds: [String!], $ideaIds: [String!], $limit: Int, $offset: Int) {
  ListAgentIdeas(ideaStatuses: $ideaStatuses, ideaKinds: $ideaKinds, ideaIds: $ideaIds, limit: $limit, offset: $offset) {
    ideas ` + agentIdeaFields + ` ideaCategories { ideaCategory emojis } totalCount nextOffset }
}`

	// DocumentListAgentIdeaHeadlines is the same listing in the fields a
	// page of many ideas needs, and without the areas.
	DocumentListAgentIdeaHeadlines = `query ($ideaStatuses: [String!], $ideaKinds: [String!], $limit: Int, $offset: Int) {
  ListAgentIdeas(ideaStatuses: $ideaStatuses, ideaKinds: $ideaKinds, limit: $limit, offset: $offset) {
    ideas ` + agentIdeaHeadlineFields + ` totalCount nextOffset }
}`

	DocumentProposeAgentIdea = `mutation ($ideaCategory: String!, $emoji: String!, $headline: String!, $body: String!, $openingRequest: String!,
  $neededToolNames: [String!], $evidence: [AgentIdeaEvidenceInput!]!, $suggestionReason: String, $expiresOn: String) {
  ProposeAgentIdea(ideaCategory: $ideaCategory, emoji: $emoji, headline: $headline, body: $body, openingRequest: $openingRequest,
    neededToolNames: $neededToolNames, evidence: $evidence, suggestionReason: $suggestionReason, expiresOn: $expiresOn) ` + agentIdeaFields + `
}`

	DocumentStartAgentIdea = `mutation ($ideaId: String!, $conversationId: String) {
  StartAgentIdea(ideaId: $ideaId, conversationId: $conversationId) { idea ` + agentIdeaFields + ` conversation { id title } openingRequest }
}`

	DocumentSetAgentIdeaStatus = `mutation ($ideaId: String!, $ideaStatus: String!) {
  SetAgentIdeaStatus(ideaId: $ideaId, ideaStatus: $ideaStatus) ` + agentIdeaFields + `
}`
)
View Source
const (
	DocumentListAgentMemories = `query ($audience: String, $query: String, $first: Int) {
		ListAgentMemories(audience: $audience, query: $query, first: $first) ` + memoryFields + `
	}`
	DocumentSaveAgentMemory = `mutation ($memoryId: String, $title: String, $content: String, $tags: [String!], $appliesTo: [String!], $pinned: Boolean) {
		SaveAgentMemory(memoryId: $memoryId, title: $title, content: $content, tags: $tags, appliesTo: $appliesTo, pinned: $pinned) ` + memoryFields + `
	}`
	DocumentDeleteAgentMemory    = `mutation ($memoryId: String!) { DeleteAgentMemory(memoryId: $memoryId) }`
	DocumentListAgentCorrections = `query ($first: Int) { ListAgentCorrections(first: $first) { id createdAt kind mailId said } }`
	DocumentListAgentSchedules   = `query { ListAgentSchedules ` + scheduleFields + ` }`
	DocumentSaveAgentSchedule    = `mutation ($scheduleId: String, $name: String, $cron: String, $prompt: String, $deliver: String, $enabled: Boolean) {
		SaveAgentSchedule(scheduleId: $scheduleId, name: $name, cron: $cron, prompt: $prompt, deliver: $deliver, enabled: $enabled) ` + scheduleFields + `
	}`
	DocumentDeleteAgentSchedule = `mutation ($scheduleId: String!) { DeleteAgentSchedule(scheduleId: $scheduleId) }`
	DocumentRunAgentSchedule    = `mutation ($scheduleId: String!) { RunAgentSchedule(scheduleId: $scheduleId) }`
	DocumentAnswerAgentQuestion = `` /* 135-byte string literal not displayed */
)

The documents.

View Source
const (
	DocumentListAgentSourceTypes = `query { ListAgentSourceTypes { ` + sourceTypeFields + ` } }`

	DocumentSearchAgentSourceTypes = `query ($query: String) {
  SearchAgentSourceTypes(query: $query) { name description version tags installed newer }
}`

	DocumentInstallAgentSourceType = `mutation ($name: String!) { InstallAgentSourceType(name: $name) { ` + sourceTypeFields + ` } }`

	DocumentAddLocalAgentSourceType = `mutation ($content: String!) { AddLocalAgentSourceType(content: $content) { ` + sourceTypeFields + ` } }`

	DocumentRemoveAgentSourceType = `mutation ($name: String!) { RemoveAgentSourceType(name: $name) }`
)
View Source
const (
	DocumentListAgentKnowledgeSourceSecrets = `query ($sourceId: String!) {
  ListAgentKnowledgeSourceSecrets(sourceId: $sourceId) { key description isOptional isSet }
}`

	DocumentSetAgentKnowledgeSourceSecret = `` /* 181-byte string literal not displayed */

	DocumentClearAgentKnowledgeSourceSecret = `mutation ($sourceId: String!, $key: String!) { ClearAgentKnowledgeSourceSecret(sourceId: $sourceId, key: $key) }`
)
View Source
const (
	DocumentListCalendars = `query { ListCalendars { id name description colour timezone weekStart events calendarKind agentGranted } }`

	DocumentListCalendarEvents = `` /* 235-byte string literal not displayed */

	DocumentGetCalendarEvent = `` /* 290-byte string literal not displayed */

	DocumentSaveCalendarEvent = `` /* 601-byte string literal not displayed */

	DocumentSaveCalendarEventWithRequest = `` /* 645-byte string literal not displayed */

	DocumentGetCalendarRequest = `` /* 141-byte string literal not displayed */

	DocumentDeleteCalendarEvent = `mutation ($calendarId: String!, $id: String!) {
  DeleteCalendarEvent(calendarId: $calendarId, id: $id)
}`

	DocumentDeleteCalendarEventWithRequest = `` /* 150-byte string literal not displayed */

	DocumentSaveCalendar = `` /* 316-byte string literal not displayed */

)
View Source
const (
	DocumentListAddressBooks = `query { ListAddressBooks { id name description contacts } }`

	DocumentListContacts = `` /* 220-byte string literal not displayed */

	DocumentGetContact = `` /* 193-byte string literal not displayed */

	DocumentSaveContact = `` /* 392-byte string literal not displayed */

	DocumentDeleteContact = `mutation ($id: String!) { DeleteContact(id: $id) }`
)
View Source
const (
	DocumentFinanceProviders = `query { FinanceProviders { providerKind isBrowserRequired } }`

	DocumentFinanceSources = `query { FinanceSources ` + financeSourceFields + ` }`

	DocumentFinanceAccounts = `query ($currencyCode: String) { FinanceAccounts(currencyCode: $currencyCode) ` + financeAccountFields + ` }`

	DocumentCreditUsage = `` /* 423-byte string literal not displayed */

	DocumentFinanceTransactions = `query ($from: String, $to: String, $financeAccountId: String, $text: String, $minimumAmount: String, $maximumAmount: String, $providerCategory: String, $spendingCategoryId: String, $isUncategorized: Boolean, $duplicateOfTransactionId: String, $isDuplicateIncluded: Boolean, $limit: Int, $after: String, $offset: Int) {
  FinanceTransactions(from: $from, to: $to, financeAccountId: $financeAccountId, text: $text, minimumAmount: $minimumAmount, maximumAmount: $maximumAmount, providerCategory: $providerCategory, spendingCategoryId: $spendingCategoryId, isUncategorized: $isUncategorized, duplicateOfTransactionId: $duplicateOfTransactionId, isDuplicateIncluded: $isDuplicateIncluded, limit: $limit, after: $after, offset: $offset) {
    financeTransactions ` + financeTransactionFields + ` nextCursor totalCount leftOutDuplicateCount
  }
}`

	DocumentFinanceTrades = `query ($from: String, $to: String, $financeAccountId: String, $financeSecurityId: String, $limit: Int, $after: String, $offset: Int) {
  FinanceTrades(from: $from, to: $to, financeAccountId: $financeAccountId, financeSecurityId: $financeSecurityId, limit: $limit, after: $after, offset: $offset) {
    financeTrades ` + financeTradeFields + ` nextCursor totalCount
  }
}`

	DocumentFinanceSpendingSummary = `` /* 599-byte string literal not displayed */

	DocumentExchangeRate = `query ($fromCurrencyCode: String!, $toCurrencyCode: String!, $rateOn: String) {
  ExchangeRate(fromCurrencyCode: $fromCurrencyCode, toCurrencyCode: $toCurrencyCode, rateOn: $rateOn) ` + currencyPairRateFields + `
}`

	DocumentConvertCurrency = `` /* 303-byte string literal not displayed */

	DocumentNetWorth = `` /* 304-byte string literal not displayed */

	DocumentAssets = `query ($assetKind: String, $text: String, $financeAccountId: String, $isHolding: Boolean) {
  Assets(assetKind: $assetKind, text: $text, financeAccountId: $financeAccountId, isHolding: $isHolding) ` + assetFields + `
}`

	DocumentAssetHistory = `query ($assetId: String!) { AssetHistory(assetId: $assetId) { asset ` + assetFields + ` assetValuations ` + assetValuationFields + ` } }`

	DocumentSpendingCategories = `query { SpendingCategories ` + spendingCategoryFields + ` }`

	DocumentSpendingRules = `query { SpendingRules ` + spendingRuleFields + ` }`

	DocumentProposeSpendingRules = `query ($financeTransactionIds: [String!]!, $spendingCategoryId: String!) {
  ProposeSpendingRules(financeTransactionIds: $financeTransactionIds, spendingCategoryId: $spendingCategoryId) {
    spendingRuleProposals { matchText spendingCategoryId financeTransactionCount changedTransactionCount aheadOfSpendingRule ` + spendingRuleFields + ` }
    tooGenericMatchTextCount changingNumberMatchTextCount overLimitMatchTextCount
  }
}`

	DocumentBudgets = `query { Budgets ` + budgetFields + ` }`

	DocumentBudgetStatus = `` /* 831-byte string literal not displayed */

	DocumentSavingSummary = `` /* 592-byte string literal not displayed */

	DocumentSpendingByDay = `` /* 380-byte string literal not displayed */

	DocumentCashFlow = `` /* 407-byte string literal not displayed */

	DocumentSavingsTargets = `query { SavingsTargets ` + savingsTargetStandingFields + ` }`

	DocumentReportingCurrency = `query { ReportingCurrency { reportingCurrencyCode isChosen } }`

	DocumentStatementImport = `query { StatementImport ` + statementImportFields + ` }`

	DocumentImportStatement = `mutation ($agentAttachmentId: String, $mailboxItemId: String) {
  ImportStatement(agentAttachmentId: $agentAttachmentId, mailboxItemId: $mailboxItemId) ` + financeStatementImportFields + `
}`

	DocumentRegenerateStatementImportAddress = `mutation { RegenerateStatementImportAddress ` + statementImportFields + ` }`

	DocumentImportTransactions = `mutation ` + transactionRowsVariables + ` {
  ImportTransactions` + transactionRowsArguments + ` ` + financeStatementImportFields + `
}`

	DocumentPreviewImportTransactions = `query ` + transactionRowsVariables + ` {
  PreviewImportTransactions` + transactionRowsArguments + ` ` + transactionRowsPreviewFields + `
}`

	DocumentRenameStatementAccount = `mutation ($financeAccountId: String!, $accountName: String, $accountMask: String) {
  RenameStatementAccount(financeAccountId: $financeAccountId, accountName: $accountName, accountMask: $accountMask) ` + financeAccountFields + `
}`

	DocumentDeleteStatementAccount = `` /* 166-byte string literal not displayed */

	DocumentCreateFinanceLinkToken = `mutation ($sourceId: String) { CreateFinanceLinkToken(sourceId: $sourceId) { linkToken sourceId } }`

	DocumentCompleteFinanceLink = `mutation ($publicToken: String!, $institutionId: String, $institutionName: String) {
  CompleteFinanceLink(publicToken: $publicToken, institutionId: $institutionId, institutionName: $institutionName) ` + financeSourceFields + `
}`

	DocumentCompleteFinanceRepair = `mutation ($sourceId: String!) { CompleteFinanceRepair(sourceId: $sourceId) ` + financeSourceFields + ` }`

	DocumentLinkSimpleFIN = `mutation ($setupToken: String!) { LinkSimpleFIN(setupToken: $setupToken) ` + financeSourceFields + ` }`

	DocumentImportFinanceCredential = `mutation ($providerKind: String!, $credential: String!, $institutionName: String) {
  ImportFinanceCredential(providerKind: $providerKind, credential: $credential, institutionName: $institutionName) ` + financeSourceFields + `
}`

	DocumentSetReportingCurrency = `mutation ($currencyCode: String!) { SetReportingCurrency(currencyCode: $currencyCode) }`
	DocumentSetTaxFilingStatus   = `mutation ($taxFilingStatus: String!) { SetTaxFilingStatus(taxFilingStatus: $taxFilingStatus) }`
	DocumentTaxDocumentAddress   = `query { TaxDocumentAddress { taxDocumentAddress canReadPdfs } }`
	DocumentTaxYearSetting       = `query ($taxYear: Int!) { TaxYearSetting(taxYear: $taxYear) ` + taxYearSettingFields + ` }`
	DocumentSetTaxYearSetting    = `mutation ($taxYear: Int!, $childCount: Int, $otherDependentCount: Int, $dependentCareExpenseAmount: String, $otherIncomeAmount: String, $charitableContributionAmount: String, $propertyTaxAmount: String, $stateIncomeTaxPaidAmount: String, $estimatedShortTermGainAmount: String, $estimatedLongTermGainAmount: String, $estimatedGainNote: String, $isEstimatedGainCleared: Boolean) {
  SetTaxYearSetting(taxYear: $taxYear, childCount: $childCount, otherDependentCount: $otherDependentCount, dependentCareExpenseAmount: $dependentCareExpenseAmount, otherIncomeAmount: $otherIncomeAmount, charitableContributionAmount: $charitableContributionAmount, propertyTaxAmount: $propertyTaxAmount, stateIncomeTaxPaidAmount: $stateIncomeTaxPaidAmount, estimatedShortTermGainAmount: $estimatedShortTermGainAmount, estimatedLongTermGainAmount: $estimatedLongTermGainAmount, estimatedGainNote: $estimatedGainNote, isEstimatedGainCleared: $isEstimatedGainCleared) ` + taxYearSettingFields + `
}`
	DocumentRegenerateTaxDocumentAddress = `mutation { RegenerateTaxDocumentAddress { taxDocumentAddress canReadPdfs } }`

	DocumentCreateAsset = `mutation ($assetName: String!, $assetKind: String!, $currencyCode: String!, $valuationSource: String, $estimateDescription: String, $isEstimateAllowed: Boolean, $value: String, $valuedOn: String) {
  CreateAsset(assetName: $assetName, assetKind: $assetKind, currencyCode: $currencyCode, valuationSource: $valuationSource, estimateDescription: $estimateDescription, isEstimateAllowed: $isEstimateAllowed, value: $value, valuedOn: $valuedOn) ` + assetFields + `
}`

	DocumentUpdateAsset = `mutation ($assetId: String!, $assetName: String, $assetKind: String, $currencyCode: String, $valuationSource: String, $estimateDescription: String, $isEstimateAllowed: Boolean) {
  UpdateAsset(assetId: $assetId, assetName: $assetName, assetKind: $assetKind, currencyCode: $currencyCode, valuationSource: $valuationSource, estimateDescription: $estimateDescription, isEstimateAllowed: $isEstimateAllowed) ` + assetFields + `
}`

	DocumentCloseAsset = `mutation ($assetId: String!, $closedOn: String, $shouldReopen: Boolean) {
  CloseAsset(assetId: $assetId, closedOn: $closedOn, shouldReopen: $shouldReopen) ` + assetFields + `
}`

	DocumentDeleteAsset = `mutation ($assetId: String!) { DeleteAsset(assetId: $assetId) }`

	DocumentRecordValuation = `mutation ($assetId: String!, $value: String!, $valuedOn: String, $valuationSource: String, $estimateLow: String, $estimateHigh: String, $valuationNote: String, $evidenceUrls: [String!]) {
  RecordValuation(assetId: $assetId, value: $value, valuedOn: $valuedOn, valuationSource: $valuationSource, estimateLow: $estimateLow, estimateHigh: $estimateHigh, valuationNote: $valuationNote, evidenceUrls: $evidenceUrls) ` + assetValuationFields + `
}`

	DocumentDeleteValuation = `mutation ($valuationId: String!) { DeleteValuation(valuationId: $valuationId) }`

	DocumentCreateSpendingCategory = `mutation ($spendingCategoryName: String!, $parentSpendingCategoryId: String, $isIncome: Boolean, $isHidden: Boolean) {
  CreateSpendingCategory(spendingCategoryName: $spendingCategoryName, parentSpendingCategoryId: $parentSpendingCategoryId, isIncome: $isIncome, isHidden: $isHidden) ` + spendingCategoryFields + `
}`

	DocumentUpdateSpendingCategory = `mutation ($spendingCategoryId: String!, $spendingCategoryName: String, $parentSpendingCategoryId: String, $isIncome: Boolean, $isHidden: Boolean) {
  UpdateSpendingCategory(spendingCategoryId: $spendingCategoryId, spendingCategoryName: $spendingCategoryName, parentSpendingCategoryId: $parentSpendingCategoryId, isIncome: $isIncome, isHidden: $isHidden) ` + spendingCategoryFields + `
}`

	DocumentDeleteSpendingCategory = `mutation ($spendingCategoryId: String!) { DeleteSpendingCategory(spendingCategoryId: $spendingCategoryId) }`

	DocumentCreateSpendingRule = `mutation ($matchText: String!, $spendingCategoryId: String!, $financeAccountId: String, $minimumAmount: String, $maximumAmount: String, $rulePriority: Int) {
  CreateSpendingRule(matchText: $matchText, spendingCategoryId: $spendingCategoryId, financeAccountId: $financeAccountId, minimumAmount: $minimumAmount, maximumAmount: $maximumAmount, rulePriority: $rulePriority) ` + spendingRuleFields + `
}`

	DocumentUpdateSpendingRule = `mutation ($spendingRuleId: String!, $matchText: String, $spendingCategoryId: String, $financeAccountId: String, $minimumAmount: String, $maximumAmount: String, $rulePriority: Int) {
  UpdateSpendingRule(spendingRuleId: $spendingRuleId, matchText: $matchText, spendingCategoryId: $spendingCategoryId, financeAccountId: $financeAccountId, minimumAmount: $minimumAmount, maximumAmount: $maximumAmount, rulePriority: $rulePriority) ` + spendingRuleFields + `
}`

	DocumentDeleteSpendingRule = `mutation ($spendingRuleId: String!) { DeleteSpendingRule(spendingRuleId: $spendingRuleId) }`

	DocumentCategorizeTransaction = `mutation ($financeTransactionId: String!, $spendingCategoryId: String, $shouldCreateSpendingRule: Boolean) {
  CategorizeTransaction(financeTransactionId: $financeTransactionId, spendingCategoryId: $spendingCategoryId, shouldCreateSpendingRule: $shouldCreateSpendingRule) {
    financeTransaction ` + financeTransactionFields + ` spendingRule ` + spendingRuleFields + `
  }
}`

	DocumentCategorizeTransactions = `mutation ($financeTransactionIds: [String!]!, $spendingCategoryId: String, $spendingRules: [ConfirmedSpendingRuleInput!]) {
  CategorizeTransactions(financeTransactionIds: $financeTransactionIds, spendingCategoryId: $spendingCategoryId, spendingRules: $spendingRules) {
    financeTransactions ` + financeTransactionFields + ` spendingRules ` + spendingRuleFields + `
  }
}`

	DocumentCountTransaction = `mutation ($financeTransactionId: String!) {
  CountTransaction(financeTransactionId: $financeTransactionId) ` + financeTransactionFields + `
}`

	DocumentUndoCountTransaction = `mutation ($financeTransactionId: String!) {
  UndoCountTransaction(financeTransactionId: $financeTransactionId) ` + financeTransactionFields + `
}`

	DocumentAnnotateTransaction = `mutation ($financeTransactionId: String!, $annotation: String, $isAskedByPerson: Boolean) {
  AnnotateTransaction(financeTransactionId: $financeTransactionId, annotation: $annotation, isAskedByPerson: $isAskedByPerson) ` + financeTransactionFields + `
}`

	DocumentFinanceReceipts = `query ($financeTransactionId: String, $from: String, $to: String, $isUndated: Boolean, $isUnmatched: Boolean, $text: String, $limit: Int, $after: String, $offset: Int) {
  FinanceReceipts(financeTransactionId: $financeTransactionId, from: $from, to: $to, isUndated: $isUndated, isUnmatched: $isUnmatched, text: $text, limit: $limit, after: $after, offset: $offset) {
    financeReceipts ` + financeReceiptFields + ` nextCursor totalCount
  }
}`

	DocumentFinanceReceipt = `query ($receiptId: String!) { FinanceReceipt(receiptId: $receiptId) ` + financeReceiptFields + ` }`

	DocumentProposeReceiptMatches = `query ($receiptId: String!) { ProposeReceiptMatches(receiptId: $receiptId) ` + receiptMatchCandidateFields + ` }`

	DocumentRecordReceipt = `mutation ` + receiptVariables + ` {
  RecordReceipt` + receiptArguments + ` { financeReceipt ` + financeReceiptFields + ` receiptCheckSummary receiptMatchCandidates ` + receiptMatchCandidateFields + ` isReplaced droppedReceiptMatchReasons }
}`

	DocumentPreviewRecordReceipt = `query ` + receiptVariables + ` {
  PreviewRecordReceipt` + receiptArguments + ` { receiptCheckState checkDifferenceAmount receiptCheckSummary receiptMatchCandidates ` + receiptMatchCandidateFields + ` isReplacing }
}`

	DocumentMatchReceipt = `mutation ($receiptId: String!, $financeTransactionId: String!, $matchedAmount: String) {
  MatchReceipt(receiptId: $receiptId, financeTransactionId: $financeTransactionId, matchedAmount: $matchedAmount) ` + financeReceiptFields + `
}`

	DocumentUnmatchReceipt = `mutation ($receiptId: String!, $financeTransactionId: String!) {
  UnmatchReceipt(receiptId: $receiptId, financeTransactionId: $financeTransactionId) ` + financeReceiptFields + `
}`

	DocumentDeleteReceipt = `mutation ($receiptId: String!) { DeleteReceipt(receiptId: $receiptId) }`

	DocumentReadReceipt = `` /* 240-byte string literal not displayed */

	DocumentFinancePaystubs = `query ($taxYear: Int, $from: String, $to: String, $limit: Int, $offset: Int) {
  FinancePaystubs(taxYear: $taxYear, from: $from, to: $to, limit: $limit, offset: $offset) { financePaystubs ` + financePaystubFields + ` hasMore totalCount }
}`

	DocumentFinancePaystub = `query ($paystubId: String!) { FinancePaystub(paystubId: $paystubId) ` + financePaystubFields + ` }`

	DocumentFinanceTaxForms = `query ($taxYear: Int, $limit: Int, $offset: Int) {
  FinanceTaxForms(taxYear: $taxYear, limit: $limit, offset: $offset) { taxForms ` + taxFormViewFields + ` hasMore totalCount }
}`

	DocumentFinanceTaxForm = `query ($taxFormId: String!) { FinanceTaxForm(taxFormId: $taxFormId) ` + taxFormViewFields + ` }`

	DocumentTaxYear = `query ($taxYear: Int!, $taxFilingStatus: String) { TaxYear(taxYear: $taxYear, taxFilingStatus: $taxFilingStatus) ` + taxYearFields + ` }`

	DocumentRecordPaystub = `mutation ($agentAttachmentId: String!, $employerName: String!, $employerTaxId: String, $employeeName: String!, $employeeTaxIdMask: String, $payDate: String!, $periodStartOn: String, $periodEndOn: String, $currencyCode: String, $grossAmount: String!, $yearToDateGrossAmount: String, $totalTaxAmount: String, $totalDeductionAmount: String, $netAmount: String!, $paystubLines: [PaystubLineInput!]!, $isUnbalancedAccepted: Boolean) {
  RecordPaystub(agentAttachmentId: $agentAttachmentId, employerName: $employerName, employerTaxId: $employerTaxId, employeeName: $employeeName, employeeTaxIdMask: $employeeTaxIdMask, payDate: $payDate, periodStartOn: $periodStartOn, periodEndOn: $periodEndOn, currencyCode: $currencyCode, grossAmount: $grossAmount, yearToDateGrossAmount: $yearToDateGrossAmount, totalTaxAmount: $totalTaxAmount, totalDeductionAmount: $totalDeductionAmount, netAmount: $netAmount, paystubLines: $paystubLines, isUnbalancedAccepted: $isUnbalancedAccepted) ` + financePaystubFields + `
}`

	DocumentRecordTaxForm = `mutation ($agentAttachmentId: String!, $taxFormKind: String, $taxYear: Int!, $isCorrected: Boolean, $payerName: String!, $payerTaxId: String, $recipientName: String!, $recipientTaxIdMask: String, $taxFormEntries: [TaxFormEntryInput!]!) {
  RecordTaxForm(agentAttachmentId: $agentAttachmentId, taxFormKind: $taxFormKind, taxYear: $taxYear, isCorrected: $isCorrected, payerName: $payerName, payerTaxId: $payerTaxId, recipientName: $recipientName, recipientTaxIdMask: $recipientTaxIdMask, taxFormEntries: $taxFormEntries) ` + taxFormViewFields + `
}`

	DocumentReadTaxDocument = `` /* 188-byte string literal not displayed */

	DocumentDeletePaystub = `mutation ($paystubId: String!) { DeletePaystub(paystubId: $paystubId) }`

	DocumentDeleteTaxForm = `mutation ($taxFormId: String!) { DeleteTaxForm(taxFormId: $taxFormId) }`

	DocumentSetBudget = `mutation ($spendingCategoryId: String!, $monthlyAmount: String!, $currencyCode: String, $effectiveFrom: String) {
  SetBudget(spendingCategoryId: $spendingCategoryId, monthlyAmount: $monthlyAmount, currencyCode: $currencyCode, effectiveFrom: $effectiveFrom) ` + budgetFields + `
}`

	DocumentCreateSavingsTarget = `mutation ($savingsTargetName: String!, $targetAmount: String!, $currencyCode: String, $targetOn: String!, $targetMeasure: String, $startingAmount: String, $startedOn: String, $assetIds: [String!], $financeAccountIds: [String!]) {
  CreateSavingsTarget(savingsTargetName: $savingsTargetName, targetAmount: $targetAmount, currencyCode: $currencyCode, targetOn: $targetOn, targetMeasure: $targetMeasure, startingAmount: $startingAmount, startedOn: $startedOn, assetIds: $assetIds, financeAccountIds: $financeAccountIds) ` + savingsTargetStandingFields + `
}`

	DocumentUpdateSavingsTarget = `mutation ($savingsTargetId: String!, $savingsTargetName: String, $targetAmount: String, $currencyCode: String, $targetOn: String, $targetMeasure: String, $startingAmount: String, $startedOn: String, $assetIds: [String!], $financeAccountIds: [String!]) {
  UpdateSavingsTarget(savingsTargetId: $savingsTargetId, savingsTargetName: $savingsTargetName, targetAmount: $targetAmount, currencyCode: $currencyCode, targetOn: $targetOn, targetMeasure: $targetMeasure, startingAmount: $startingAmount, startedOn: $startedOn, assetIds: $assetIds, financeAccountIds: $financeAccountIds) ` + savingsTargetStandingFields + `
}`

	DocumentCloseSavingsTarget = `mutation ($savingsTargetId: String!, $closedOn: String, $shouldReopen: Boolean) {
  CloseSavingsTarget(savingsTargetId: $savingsTargetId, closedOn: $closedOn, shouldReopen: $shouldReopen) ` + savingsTargetStandingFields + `
}`
)

One document per finance operation, named for it.

View Source
const (
	DocumentListMailboxes    = `query { ListMailboxes ` + mailboxFields + ` }`
	DocumentListAllMailboxes = `query { ListAllMailboxes { id name userId username userName } }`

	DocumentCreateMailboxFolder = `mutation ($mailboxId: String!, $name: String!, $parentId: String) {
		CreateMailboxFolder(mailboxId: $mailboxId, name: $name, parentId: $parentId) ` + folderFields + `
	}`
	DocumentUpdateMailboxFolder = `mutation ($folderId: String!, $name: String, $parentId: String) {
		UpdateMailboxFolder(folderId: $folderId, name: $name, parentId: $parentId) ` + folderFields + `
	}`
	DocumentSetMailboxFolderPinned = `mutation ($folderId: String!, $pinned: Boolean!) {
		SetMailboxFolderPinned(folderId: $folderId, pinned: $pinned) ` + folderFields + `
	}`
	DocumentDeleteMailboxFolder = `mutation ($folderId: String!) { DeleteMailboxFolder(folderId: $folderId) }`

	DocumentUpdateMailbox = `mutation ($mailboxId: String!, $name: String, $signatureText: String, $signatureHtml: String,
		$rules: [MailboxRuleInput!], $autoReply: MailboxAutoReplyInput, $clearAutoReply: Boolean) {
		UpdateMailbox(mailboxId: $mailboxId, name: $name, signatureText: $signatureText, signatureHtml: $signatureHtml,
			rules: $rules, autoReply: $autoReply, clearAutoReply: $clearAutoReply) ` + mailboxFields + `
	}`

	DocumentTestMailboxRules = `` /* 286-byte string literal not displayed */

	DocumentApplyMailboxRules = `` /* 218-byte string literal not displayed */

	DocumentListMailboxAppPasswords = `query ($mailboxId: String!) {
		ListMailboxAppPasswords(mailboxId: $mailboxId) { id mailboxId name createdAt lastUsedAt }
	}`
	DocumentCreateMailboxAppPassword = `` /* 196-byte string literal not displayed */

	DocumentCreateMailboxSetupProfile = `` /* 316-byte string literal not displayed */

	DocumentDeleteMailboxAppPassword = `mutation ($appPasswordId: String!) {
		DeleteMailboxAppPassword(appPasswordId: $appPasswordId)
	}`

	DocumentGetMailProgramSettings = `query { GetMailProgramSettings { imapHost imapPort imapsPort submissionHost submissionPort } }`
)

DocumentListMailboxes and the rest are the documents this file sends, named so that a test can validate every one of them against the schema the server builds. A field renamed on the server is then a failing test rather than a command that fails in somebody's terminal.

View Source
const (
	DocumentListNotes = `` /* 138-byte string literal not displayed */

	DocumentGetNote = `` /* 181-byte string literal not displayed */

	DocumentSaveNote = `` /* 310-byte string literal not displayed */

	DocumentDeleteNote = `mutation ($mailboxId: String!, $noteId: String!) { DeleteNote(mailboxId: $mailboxId, noteId: $noteId) }`
)
View Source
const (
	DocumentListAgentPhones = `query {
  ListAgentPhones { phones { ` + agentPhoneFields + ` } isPushEnabled notificationKinds }
}`
	DocumentUpdateAgentPhone = `mutation ($phoneId: String!, $phoneName: String, $notificationKinds: [String!]) {
  UpdateAgentPhone(phoneId: $phoneId, phoneName: $phoneName, notificationKinds: $notificationKinds) { ` + agentPhoneFields + ` }
}`
	DocumentRemoveAgentPhone = `mutation ($phoneId: String!) {
  RemoveAgentPhone(phoneId: $phoneId)
}`
	DocumentTestAgentPhone = `mutation ($phoneId: String!) {
  TestAgentPhone(phoneId: $phoneId) { ` + agentPhoneFields + ` }
}`
)
View Source
const (
	RecordingPieceMinimumMS = 20_000
	RecordingPieceMaximumMS = 60_000
)

Where a recording is cut into pieces, by the rule the dashboard and the iPhone follow. The server transcribes each piece as it arrives, so a piece should end between sentences; a sentence that is cut anyway is put back together by the server, so correctness never depends on this.

  • Before a piece is RecordingPieceMinimumMS long nothing cuts it.
  • After that it is cut where the live transcription says an utterance ended, because the provider decides that from speech, not from loudness: music or a fan defeats a loudness rule.
  • When the live transcription is not connected it is cut at the first recordingQuietHoldMS during which the level stays within recordingQuietMarginDecibels of the lowest level of the last recordingQuietWindowMS.
  • At RecordingPieceMaximumMS it is cut wherever it is.
View Source
const (
	DocumentListReminders = `query ($isDone: Boolean) { ListReminders(isDone: $isDone) ` + reminderFields + ` }`

	DocumentSaveReminder = `mutation ($reminderId: String, $title: String, $notes: String, $dueAt: String, $dueOn: String, $isDueCleared: Boolean, $priority: Int) {
  SaveReminder(reminderId: $reminderId, title: $title, notes: $notes, dueAt: $dueAt, dueOn: $dueOn, isDueCleared: $isDueCleared, priority: $priority) ` + reminderFields + `
}`

	DocumentSetReminderDone = `mutation ($reminderId: String!, $isDone: Boolean!) {
  SetReminderDone(reminderId: $reminderId, isDone: $isDone) ` + reminderFields + `
}`

	DocumentDeleteReminder = `mutation ($reminderId: String!) { DeleteReminder(reminderId: $reminderId) }`
)
View Source
const DocumentCancelAgentReply = `mutation ($replyId: String!) {
  CancelAgentReply(replyId: $replyId) { id status reason subject to sendAfter }
}`

DocumentCancelAgentReply cancels a held reply.

View Source
const DocumentCreateDeviceSetupProfile = `` /* 687-byte string literal not displayed */
View Source
const DocumentCreateOAuthConnectCode = `mutation {
  CreateOAuthConnectCode { connectLink qrCodeSvg expiresAt }
}`
View Source
const DocumentDeviceSetupCapabilities = `` /* 161-byte string literal not displayed */
View Source
const DocumentDraftReply = `` /* 134-byte string literal not displayed */

DocumentDraftReply asks the agent to write a reply to a message.

View Source
const DocumentEvaluateAgentMemoryNow = `mutation { EvaluateAgentMemoryNow { id startedAt } }`

DocumentEvaluateAgentMemoryNow starts a run now.

View Source
const DocumentGetRecordingSettings = `query { GetSettings { agent { limits { maxRecordingMediaBytes maxRecordingAccountBytes } } } }`

DocumentGetRecordingSettings reads limits introduced with resumable media uploads.

View Source
const DocumentGetSettings = `query { GetSettings ` + settingsSelection + ` }`

DocumentGetSettings reads every section of the settings.

View Source
const DocumentGetTranscriptionSettings = `query { GetSettings { agent { models { transcription } } } }`

DocumentGetTranscriptionSettings keeps recording model reads compatible with older servers.

View Source
const DocumentImportAgentEvaluationQuestions = `mutation ($questions: [ImportedEvaluationQuestionInput!]!) { ImportAgentEvaluationQuestions(questions: $questions) }`

DocumentImportAgentEvaluationQuestions adds questions from a file.

View Source
const DocumentListAgentEvaluationQuestions = `` /* 217-byte string literal not displayed */

DocumentListAgentEvaluationQuestions reads the memory check's questions.

View Source
const DocumentListAgentEvaluationRuns = `` /* 224-byte string literal not displayed */

DocumentListAgentEvaluationRuns reads the memory check's runs.

View Source
const DocumentListAgentReplies = `` /* 336-byte string literal not displayed */

DocumentListAgentReplies lists the replies the agent wrote.

View Source
const DocumentReadAgentWaiting = `` /* 196-byte string literal not displayed */
View Source
const DocumentServiceCapabilities = `` /* 191-byte string literal not displayed */
View Source
const DocumentSetUpAssistant = `` /* 223-byte string literal not displayed */
View Source
const DocumentSpeakFirstNow = `mutation ($speakFirstReason: String!) { SpeakFirstNow(speakFirstReason: $speakFirstReason) }`

DocumentSpeakFirstNow has the agent start a conversation now.

View Source
const DocumentUpdateServices = `` /* 536-byte string literal not displayed */
View Source
const FinanceLinkPagePath = "/finance/link"

FinanceLinkPagePath is the dashboard page that opens Plaid Link, the one page whose security policy lets Plaid's window in. The command line and the agent's finance tool print it for the person to open; the server holds the same path (internal/web.FinanceLinkPagePath).

View Source
const HerdrSessionFields = `` /* 313-byte string literal not displayed */

HerdrSessionFields are a session's fields, with its question, for every document that answers with one; the dashboard asks for the same.

View Source
const LocalTokenLifetime = 5 * time.Minute

LocalTokenLifetime is how long a minted token lasts. One command's worth, with room for a slow reply and a clock that is a little out.

View Source
const MaximumSpendingRuleProposalCount = 50

MaximumSpendingRuleProposalCount is the most spending rules one ProposeSpendingRules offers and one CategorizeTransactions saves.

View Source
const (
	RecordingCaptureSampleRate = 16000
)

The audio a capture takes: mono 16-bit little-endian PCM at RecordingCaptureSampleRate, read in frames of recordingCaptureFrameMS.

Variables

View Source
var (
	// ErrUnauthorized means the server did not accept the token: HTTP 401,
	// or the API's own "not logged in".
	ErrUnauthorized = errors.New("client: the server refused the token")

	// ErrNotFound means the server has no such thing.
	ErrNotFound = errors.New("client: not found")
)
View Source
var FinanceDocuments = map[string]string{
	"FinanceProviders": DocumentFinanceProviders, "FinanceSources": DocumentFinanceSources,
	"FinanceAccounts": DocumentFinanceAccounts, "CreditUsage": DocumentCreditUsage, "FinanceTransactions": DocumentFinanceTransactions,
	"FinanceTrades":          DocumentFinanceTrades,
	"FinanceSpendingSummary": DocumentFinanceSpendingSummary, "ExchangeRate": DocumentExchangeRate,
	"ConvertCurrency": DocumentConvertCurrency, "NetWorth": DocumentNetWorth, "Assets": DocumentAssets,
	"AssetHistory": DocumentAssetHistory, "SpendingCategories": DocumentSpendingCategories,
	"SpendingRules": DocumentSpendingRules, "ProposeSpendingRules": DocumentProposeSpendingRules,
	"Budgets": DocumentBudgets, "BudgetStatus": DocumentBudgetStatus,
	"SavingSummary": DocumentSavingSummary, "SpendingByDay": DocumentSpendingByDay, "CashFlow": DocumentCashFlow, "SavingsTargets": DocumentSavingsTargets,
	"ReportingCurrency": DocumentReportingCurrency,
	"StatementImport":   DocumentStatementImport, "ImportStatement": DocumentImportStatement,
	"RegenerateStatementImportAddress": DocumentRegenerateStatementImportAddress,
	"ImportTransactions":               DocumentImportTransactions, "PreviewImportTransactions": DocumentPreviewImportTransactions,
	"RenameStatementAccount": DocumentRenameStatementAccount,
	"DeleteStatementAccount": DocumentDeleteStatementAccount,
	"CreateFinanceLinkToken": DocumentCreateFinanceLinkToken, "CompleteFinanceLink": DocumentCompleteFinanceLink,
	"CompleteFinanceRepair": DocumentCompleteFinanceRepair, "LinkSimpleFIN": DocumentLinkSimpleFIN,
	"ImportFinanceCredential": DocumentImportFinanceCredential, "SetReportingCurrency": DocumentSetReportingCurrency,
	"SetTaxFilingStatus": DocumentSetTaxFilingStatus, "TaxDocumentAddress": DocumentTaxDocumentAddress,
	"TaxYearSetting": DocumentTaxYearSetting, "SetTaxYearSetting": DocumentSetTaxYearSetting,
	"RegenerateTaxDocumentAddress": DocumentRegenerateTaxDocumentAddress,
	"CreateAsset":                  DocumentCreateAsset,
	"UpdateAsset":                  DocumentUpdateAsset, "CloseAsset": DocumentCloseAsset, "DeleteAsset": DocumentDeleteAsset,
	"RecordValuation": DocumentRecordValuation, "DeleteValuation": DocumentDeleteValuation,
	"CreateSpendingCategory": DocumentCreateSpendingCategory, "UpdateSpendingCategory": DocumentUpdateSpendingCategory,
	"DeleteSpendingCategory": DocumentDeleteSpendingCategory, "CreateSpendingRule": DocumentCreateSpendingRule,
	"UpdateSpendingRule": DocumentUpdateSpendingRule, "DeleteSpendingRule": DocumentDeleteSpendingRule,
	"CategorizeTransaction": DocumentCategorizeTransaction, "CategorizeTransactions": DocumentCategorizeTransactions,
	"SetBudget":        DocumentSetBudget,
	"CountTransaction": DocumentCountTransaction, "UndoCountTransaction": DocumentUndoCountTransaction,
	"CreateSavingsTarget": DocumentCreateSavingsTarget,
	"UpdateSavingsTarget": DocumentUpdateSavingsTarget, "CloseSavingsTarget": DocumentCloseSavingsTarget,
	"AnnotateTransaction": DocumentAnnotateTransaction, "FinanceReceipts": DocumentFinanceReceipts, "FinanceReceipt": DocumentFinanceReceipt,
	"ProposeReceiptMatches": DocumentProposeReceiptMatches, "RecordReceipt": DocumentRecordReceipt,
	"PreviewRecordReceipt": DocumentPreviewRecordReceipt, "MatchReceipt": DocumentMatchReceipt,
	"UnmatchReceipt": DocumentUnmatchReceipt, "DeleteReceipt": DocumentDeleteReceipt, "ReadReceipt": DocumentReadReceipt,
	"FinancePaystubs": DocumentFinancePaystubs, "FinancePaystub": DocumentFinancePaystub,
	"FinanceTaxForms": DocumentFinanceTaxForms, "FinanceTaxForm": DocumentFinanceTaxForm, "TaxYear": DocumentTaxYear,
	"RecordPaystub": DocumentRecordPaystub, "RecordTaxForm": DocumentRecordTaxForm, "ReadTaxDocument": DocumentReadTaxDocument,
	"DeletePaystub": DocumentDeletePaystub, "DeleteTaxForm": DocumentDeleteTaxForm,
}

FinanceDocuments is every finance document by the operation it runs, for the test that checks each against the schema.

View Source
var RecordingDocuments = map[string]string{
	"ListRecordings":         `query ($beforeRecordingId: String!, $pageSize: Int!, $searchText: String) { ListRecordings(beforeRecordingId: $beforeRecordingId, pageSize: $pageSize, searchText: $searchText) ` + recordingSelection + ` }`,
	"ReadRecording":          `query ($recordingId: String!) { ReadRecording(recordingId: $recordingId) { recording ` + recordingSelection + ` mediaFiles ` + recordingMediaSelection + ` uploadParts { recordingMediaId partIndex partSizeBytes partSha256 storedAt } } }`,
	"ReadRecordingLimits":    `query { ReadRecordingLimits { maximumMediaBytes maximumAccountBytes uploadPartBytes } }`,
	"CreateRecording":        `mutation ($clientRecordingId: String!, $recordingTitle: String!, $recordingOrigin: String!) { CreateRecording(clientRecordingId: $clientRecordingId, recordingTitle: $recordingTitle, recordingOrigin: $recordingOrigin) ` + recordingSelection + ` }`,
	"CreateRecordingMedia":   `mutation ($recordingId: String!, $clientMediaId: String!, $originalFilename: String!, $originalContentType: String!, $originalSizeBytes: Int64!, $originalSha256: String!, $timelineStartMS: Int64!, $mediaDurationMS: Int64!) { CreateRecordingMedia(recordingId: $recordingId, clientMediaId: $clientMediaId, originalFilename: $originalFilename, originalContentType: $originalContentType, originalSizeBytes: $originalSizeBytes, originalSha256: $originalSha256, timelineStartMS: $timelineStartMS, mediaDurationMS: $mediaDurationMS) ` + recordingMediaSelection + ` }`,
	"UpdateRecordingCapture": `mutation ($recordingId: String!, $expectedGeneration: Int64!, $recordingCaptureState: String!, $timelineDurationMS: Int64!, $captureGaps: [RecordingGapInput!]!) { UpdateRecordingCapture(recordingId: $recordingId, expectedGeneration: $expectedGeneration, recordingCaptureState: $recordingCaptureState, timelineDurationMS: $timelineDurationMS, captureGaps: $captureGaps) ` + recordingSelection + ` }`,
	"DeleteRecording":        `mutation ($recordingId: String!) { DeleteRecording(recordingId: $recordingId) }`,
}

RecordingDocuments are shared by the CLI and the recording tool. All calls use the signed-in account's API permissions and original-media ownership.

Functions

func AnswerAgentQuestion

func AnswerAgentQuestion(ctx context.Context, connection *Client, runId, callId, answer string) (bool, error)

AnswerAgentQuestion answers a question the agent asked in a turn.

func BeginAgentServerOAuth

func BeginAgentServerOAuth(ctx context.Context, connection *Client, server, redirectURL string) (string, error)

BeginAgentServerOAuth is the address to send the person to.

func CaptureAgentCodingSession added in v0.124.0

func CaptureAgentCodingSession(ctx context.Context, connection *Client, computerName, assistant string) (bool, error)

CaptureAgentCodingSession asks the computer's sources of a coding tool's transcripts to read again now. It says whether one was asked.

func ClearAgentKnowledgeSourceSecret added in v0.55.0

func ClearAgentKnowledgeSourceSecret(ctx context.Context, connection *Client, sourceId, key string) error

ClearAgentKnowledgeSourceSecret forgets one value of a source.

func ClearAgentSkillSecret

func ClearAgentSkillSecret(ctx context.Context, connection *Client, skill, key string) (bool, error)

ClearAgentSkillSecret forgets one, and says whether there was one to forget.

func ConfirmAgentRecord added in v0.161.1

func ConfirmAgentRecord(ctx context.Context, connection *Client, path, recordKind, recordId, recordRelation string, startMS, endMS int64) (int, error)

ConfirmAgentRecord states the agent's guesses at a page's links to a record, every passage of a recording at once unless a range names one, and says how many. No relation is every relation.

func DeleteAgentConversation

func DeleteAgentConversation(ctx context.Context, connection *Client, conversationId string) error

DeleteAgentConversation removes a named conversation and everything in it.

func DeleteAgentFact

func DeleteAgentFact(ctx context.Context, connection *Client, path string, number int) error

DeleteAgentFact strikes one.

func DeleteAgentKnowledgeSource

func DeleteAgentKnowledgeSource(ctx context.Context, connection *Client, sourceId string) error

DeleteAgentKnowledgeSource stops one and forgets what it found.

func DeleteAgentMemory

func DeleteAgentMemory(ctx context.Context, connection *Client, memoryId string) error

DeleteAgentMemory forgets one memory.

func DeleteAgentNode

func DeleteAgentNode(ctx context.Context, connection *Client, path string) error

DeleteAgentNode removes a page and what is under it.

func DeleteAgentSchedule

func DeleteAgentSchedule(ctx context.Context, connection *Client, scheduleId string) error

DeleteAgentSchedule removes a schedule.

func DeleteAlias

func DeleteAlias(ctx context.Context, connection *Client, aliasId string) error

DeleteAlias removes an alias.

func DeleteCalendarEvent

func DeleteCalendarEvent(ctx context.Context, connection *Client, calendarId, id string) error

DeleteCalendarEvent takes one away.

func DeleteCalendarEventWithRequest added in v0.48.0

func DeleteCalendarEventWithRequest(ctx context.Context, connection *Client, calendarId, id, requestId string) error

DeleteCalendarEventWithRequest retains a deletion identity across explicit retries.

func DeleteContact

func DeleteContact(ctx context.Context, connection *Client, id string) error

DeleteContact forgets one.

func DeleteCredential

func DeleteCredential(ctx context.Context, connection *Client, credentialId string) error

DeleteCredential removes a credential.

func DeleteDomain

func DeleteDomain(ctx context.Context, connection *Client, domainId string) error

DeleteDomain removes a domain with its aliases and credentials. Mail already received for it is kept.

func DeleteDomainLogo(ctx context.Context, connection *Client, domainId string) error

DeleteDomainLogo stops publishing a domain's mark, and removes the file.

func DeleteGroup

func DeleteGroup(ctx context.Context, connection *Client, groupId string) error

DeleteGroup removes a group. Its members keep their accounts and lose what the group gave them.

func DeleteLayout

func DeleteLayout(ctx context.Context, connection *Client, layoutId string) error

DeleteLayout removes a layout.

func DeleteMailboxAppPassword

func DeleteMailboxAppPassword(ctx context.Context, connection *Client, appPasswordId string) error

DeleteMailboxAppPassword revokes one device's app password.

func DeleteMailboxFolder

func DeleteMailboxFolder(ctx context.Context, connection *Client, folderId string) error

DeleteMailboxFolder removes a folder somebody made, and everything in it.

func DeleteNote added in v0.78.0

func DeleteNote(ctx context.Context, connection *Client, mailboxId, noteId string) error

DeleteNote removes a note.

func DeletePasskey

func DeletePasskey(ctx context.Context, connection *Client, passkeyId string) error

DeletePasskey removes a passkey, so that authenticator can no longer sign in.

func DeleteReminder added in v0.77.0

func DeleteReminder(ctx context.Context, connection *Client, reminderId string) error

DeleteReminder removes a reminder.

func DeleteRole

func DeleteRole(ctx context.Context, connection *Client, roleId string) error

DeleteRole removes a role. A seeded role cannot be removed.

func DeleteTemplate

func DeleteTemplate(ctx context.Context, connection *Client, templateId string) error

DeleteTemplate removes a template.

func DeleteToken

func DeleteToken(ctx context.Context, connection *Client, id, username string) error

DeleteToken revokes a token.

func DeleteUser

func DeleteUser(ctx context.Context, connection *Client, username string) error

DeleteUser removes an account and the tokens issued to it.

func DisconnectApp added in v0.53.0

func DisconnectApp(ctx context.Context, connection *Client, clientId, username string) error

DisconnectApp revokes every token an app holds.

func DreamAgentNow

func DreamAgentNow(ctx context.Context, connection *Client, bootstrap *bool) error

DreamAgentNow queues a dream now, whatever the agent's hours. bootstrap, when given, switches bootstrapping on or off: the night at every tick with wider limits until nothing waits to be read.

func ImportAgentEvaluationQuestions added in v0.61.0

func ImportAgentEvaluationQuestions(ctx context.Context, connection *Client, questions []ImportedEvaluationQuestion) (int, error)

ImportAgentEvaluationQuestions adds questions as confirmed, skipping those already on record, and says how many were added.

func IsMutationDocument

func IsMutationDocument(document string) bool

IsMutationDocument says whether a GraphQL document would change anything: whether any operation in it is a mutation.

A read-only client decides with this what to refuse, so it has to be right about documents it did not write — "teanode api graphql" sends whatever it was given. The document is parsed with the same library the server parses it with, so the two cannot disagree about where a comment ends, what a byte order mark is, or whether a "mutation" is a keyword or a field: a hand-written tokenizer was tried first and got two of those wrong.

A document that does not parse is reported as not a mutation, and is sent: the server, using the same parser, rejects it as a syntax error and executes nothing, and that error is the one the caller should see.

func IsTransient added in v0.81.0

func IsTransient(err error) bool

IsTransient says whether asking again later may well be answered: the server could not be reached, took too long, or it or a proxy in front of it failed or asked to be asked later. A refused token, a missing thing or a refused request is answered the same way every time.

func LinkAgentNodes

func LinkAgentNodes(ctx context.Context, connection *Client, path, to, relation, note string) error

LinkAgentNodes joins two pages.

func NormalizeURL

func NormalizeURL(url string) string

NormalizeURL is how a server is named everywhere the client remembers one: trimmed, without a trailing slash, and https unless a scheme was given.

func ReactToAgentMessage added in v0.134.0

func ReactToAgentMessage(ctx context.Context, connection *Client, messageId, reactionEmoji string) error

ReactToAgentMessage puts your emoji on a message of one of your conversations, replacing the one you had there; an empty emoji takes it away.

func RecordingAction added in v0.145.0

func RecordingAction(arguments RecordingActionArguments) (string, map[string]any, error)

RecordingAction resolves one reviewed operation and refuses incomplete edits.

func RecordingMediaPath added in v0.142.0

func RecordingMediaPath(mediaId string) string

RecordingMediaPath names private playback/download through the account API.

func RecordingPlaybackPath added in v0.150.0

func RecordingPlaybackPath(mediaId string) string

RecordingPlaybackPath names the account-owned ready preview route.

func RemoveAgentChannel

func RemoveAgentChannel(ctx context.Context, connection *Client, kind string) error

RemoveAgentChannel forgets a chat app's bot.

func RemoveAgentPhone added in v0.128.0

func RemoveAgentPhone(ctx context.Context, connection *Client, phoneId string) error

RemoveAgentPhone removes a phone and signs it out.

func RemoveAgentSkill

func RemoveAgentSkill(ctx context.Context, connection *Client, name string) error

RemoveAgentSkill takes one away.

func RemoveAgentSourceType added in v0.54.0

func RemoveAgentSourceType(ctx context.Context, connection *Client, name string) error

RemoveAgentSourceType takes one away.

func RenameApp added in v0.53.0

func RenameApp(ctx context.Context, connection *Client, clientId, username, name string) error

RenameApp names an app on every token it holds, and on each it renews into.

func RereadAgentDocuments

func RereadAgentDocuments(ctx context.Context, connection *Client, minutes int) (int, error)

RereadAgentDocuments puts back what a night marked read in the last so many minutes.

func ResolveAgentConfirmation

func ResolveAgentConfirmation(ctx context.Context, connection *Client, runId, callId string, approve bool) (bool, error)

ResolveAgentConfirmation answers a confirmation card.

func RevokeAllSessions

func RevokeAllSessions(ctx context.Context, connection *Client) error

RevokeAllSessions ends every browser the account is signed in on.

func RevokeSession

func RevokeSession(ctx context.Context, connection *Client, sessionId string) error

RevokeSession ends one signed-in browser.

func RewriteAgentOverview added in v0.79.0

func RewriteAgentOverview(ctx context.Context, connection *Client, path string) error

RewriteAgentOverview has the next night write a page's overview again, whether or not what it is written from has changed.

func RunAgentSchedule

func RunAgentSchedule(ctx context.Context, connection *Client, scheduleId string) error

RunAgentSchedule runs a schedule now.

func RunFinance added in v0.87.0

func RunFinance(ctx context.Context, executor Executor, operation string, variables map[string]any, result any) error

RunFinance runs one finance operation's document and decodes what the operation answered into result. Variables left out are sent as absent, which each optional argument reads as "not given".

func RunRecording added in v0.142.0

func RunRecording(ctx context.Context, executor Executor, operationName string, variables map[string]any, answered any) error

RunRecording runs the same named operation for a CLI connection or agent run.

func SetAgentNodeContact added in v0.154.0

func SetAgentNodeContact(ctx context.Context, connection *Client, path, contactId string) error

SetAgentNodeContact names the card a person's page is about; empty clears it.

func SetMyContact

func SetMyContact(ctx context.Context, connection *Client, contactId string) error

SetMyContact names the contact that is the caller.

func SpeakFirstNow added in v0.61.0

func SpeakFirstNow(ctx context.Context, connection *Client, speakFirstReason string) error

SpeakFirstNow has the agent start a conversation in the main one now, for a reason: onboarding, phone_tour, memory_check or idea.

func StopAgentRun

func StopAgentRun(ctx context.Context, connection *Client, runId string) error

StopAgentRun stops a turn where it is.

func SyncAgentKnowledgeSource

func SyncAgentKnowledgeSource(ctx context.Context, connection *Client, sourceId string) error

SyncAgentKnowledgeSource reads one again now.

func UnlinkAgentNodes

func UnlinkAgentNodes(ctx context.Context, connection *Client, path, to, relation string) error

UnlinkAgentNodes takes a join away.

func UnlinkAgentRecord added in v0.154.0

func UnlinkAgentRecord(ctx context.Context, connection *Client, path, recordKind, recordId, recordRelation string, startMS, endMS int64) (bool, error)

UnlinkAgentRecord takes a page's links to a record away, and says whether there were any. No relation is every relation.

func UnmuteAgentAlert added in v0.82.0

func UnmuteAgentAlert(ctx context.Context, connection *Client, muteId string) error

UnmuteAgentAlert takes a mute back.

Types

type Address

type Address struct {
	Label      string `json:"label,omitempty"`
	Street     string `json:"street,omitempty"`
	Locality   string `json:"locality,omitempty"`
	Region     string `json:"region,omitempty"`
	PostalCode string `json:"postalCode,omitempty"`
	Country    string `json:"country,omitempty"`
	Written    string `json:"written"`
}

Address is one postal address on a contact. Written is the same thing on one line, the way somebody would put it on an envelope.

type AddressBook

type AddressBook struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Contacts    int    `json:"contacts"`
}

AddressBook is one address book and how much is in it.

func ListAddressBooks

func ListAddressBooks(ctx context.Context, connection *Client) ([]*AddressBook, error)

ListAddressBooks are the caller's. An account that has never had one is given one by the server when it first looks.

type AgentAlert added in v0.82.0

type AgentAlert struct {
	ID         string               `json:"id"`
	AlertText  string               `json:"alertText"`
	SentAt     time.Time            `json:"sentAt"`
	SubjectKey string               `json:"subjectKey"`
	IsUrgent   bool                 `json:"isUrgent"`
	Covered    []*AgentAlertCovered `json:"covered"`

	// MuteChoices is what a mute of the alert offers, the default first.
	MuteChoices []*AgentAlertMuteChoice `json:"muteChoices"`
}

AgentAlert is one alert, with the messages it was about.

func ListAgentAlerts added in v0.82.0

func ListAgentAlerts(ctx context.Context, connection *Client, first int) ([]*AgentAlert, error)

ListAgentAlerts is the latest alerts, newest first; first of zero is the server's default.

type AgentAlertCovered added in v0.82.0

type AgentAlertCovered struct {
	MailID        string `json:"mailId"`
	Subject       string `json:"subject"`
	FromAddress   string `json:"fromAddress"`
	CandidateKind string `json:"candidateKind"`
	MailCategory  string `json:"mailCategory"`
}

AgentAlertCovered is one message an alert was about.

type AgentAlertMute added in v0.82.0

type AgentAlertMute struct {
	ID         string    `json:"id"`
	MuteScope  string    `json:"muteScope"`
	MuteTarget string    `json:"muteTarget"`
	AlertID    string    `json:"alertId"`
	CreatedAt  time.Time `json:"createdAt"`
}

AgentAlertMute is one thing the person asked not to be told about.

func ListAgentAlertMutes added in v0.82.0

func ListAgentAlertMutes(ctx context.Context, connection *Client) ([]*AgentAlertMute, error)

ListAgentAlertMutes is what the person asked not to be told about.

func MuteAgentAlert added in v0.82.0

func MuteAgentAlert(ctx context.Context, connection *Client, alertId, muteScope, muteTarget string) (*AgentAlertMute, error)

MuteAgentAlert stops the agent telling the person about something: by an alert, a scope and a target, or both.

type AgentAlertMuteChoice added in v0.82.0

type AgentAlertMuteChoice struct {
	MuteScope  string `json:"muteScope"`
	MuteTarget string `json:"muteTarget"`
}

AgentAlertMuteChoice is one way to mute an alert, and what it mutes.

type AgentAnswerEvaluation added in v0.60.0

type AgentAnswerEvaluation struct {
	AnswerText       string  `json:"answerText"`
	AnswerVerdict    string  `json:"answerVerdict"`
	VerdictReason    string  `json:"verdictReason"`
	FactCount        int     `json:"factCount"`
	PassageCount     int     `json:"passageCount"`
	Cost             float64 `json:"cost"`
	Currency         string  `json:"currency"`
	AnswerDurationMS int     `json:"answerDurationMS"`
}

AgentAnswerEvaluation is one question of a memory evaluation, answered and graded.

func EvaluateAgentAnswer added in v0.60.0

func EvaluateAgentAnswer(ctx context.Context, connection *Client, question, expectedAnswer, outdatedAnswer, answerFrom string, plan *AgentRetrievalPlan) (*AgentAnswerEvaluation, error)

EvaluateAgentAnswer answers a question from memory, sources or both, and grades the answer against the expected one.

type AgentAttachment

type AgentAttachment struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	ContentType string `json:"contentType"`
	Size        int64  `json:"size"`
}

AgentAttachment is a file handed to the agent with a turn.

func UploadAgentAttachment

func UploadAgentAttachment(ctx context.Context, connection *Client, filename string, content []byte) (*AgentAttachment, error)

UploadAgentAttachment hands the agent a file for the next turn and returns its record; AskAgentWith names it by id.

func UploadTaxDocument added in v0.155.0

func UploadTaxDocument(ctx context.Context, connection *Client, filename string, content []byte) (*AgentAttachment, error)

UploadTaxDocument hands the agent a paystub's or a tax form's file, whose text, which holds the person's taxpayer number, the server never keeps; ReadTaxDocument then names it by id.

type AgentBackgroundCommand added in v0.57.0

type AgentBackgroundCommand struct {
	Computer       string     `json:"computer"`
	ID             string     `json:"id"`
	Command        string     `json:"command"`
	Directory      string     `json:"directory"`
	ConversationID string     `json:"conversationId"`
	StartedAt      time.Time  `json:"startedAt"`
	EndedAt        *time.Time `json:"endedAt"`
	IsRunning      bool       `json:"isRunning"`
	ExitCode       int        `json:"exitCode"`
	// StopReason is "stopped" or "lifetime" when it did not end by itself,
	// and empty otherwise.
	StopReason string `json:"stopReason"`

	Stdout            string `json:"stdout,omitempty"`
	Stderr            string `json:"stderr,omitempty"`
	IsStdoutTruncated bool   `json:"isStdoutTruncated,omitempty"`
	IsStderrTruncated bool   `json:"isStderrTruncated,omitempty"`
	StdoutByteCount   int    `json:"stdoutByteCount,omitempty"`
	StderrByteCount   int    `json:"stderrByteCount,omitempty"`
}

AgentBackgroundCommand is one background command, with its output when it was read.

func ListAgentBackgroundCommands added in v0.57.0

func ListAgentBackgroundCommands(ctx context.Context, connection *Client, conversationId string) ([]*AgentBackgroundCommand, error)

ListAgentBackgroundCommands is what runs, or ended lately, in the background on the caller's computers, newest first; only what one conversation started when conversationId is given.

func ReadAgentBackgroundCommand added in v0.57.0

func ReadAgentBackgroundCommand(ctx context.Context, connection *Client, computer, id string, tailBytes int) (*AgentBackgroundCommand, error)

ReadAgentBackgroundCommand is one background command with the last tailBytes of each of its streams; zero leaves the amount to the server.

func StopAgentBackgroundCommand added in v0.57.0

func StopAgentBackgroundCommand(ctx context.Context, connection *Client, computer, id string) (*AgentBackgroundCommand, error)

StopAgentBackgroundCommand stops one background command.

type AgentBackgroundWork added in v0.81.0

type AgentBackgroundWork struct {
	ID string `json:"id"`
	// WorkKind is survey or subagent, and WorkStatus queued, running,
	// done, failed or stopped.
	WorkKind       string     `json:"workKind"`
	WorkStatus     string     `json:"workStatus"`
	Title          string     `json:"title"`
	ConversationID string     `json:"conversationId"`
	Question       string     `json:"question,omitempty"`
	ScopePath      string     `json:"scopePath,omitempty"`
	Prompt         string     `json:"prompt,omitempty"`
	ResultText     string     `json:"resultText,omitempty"`
	RunIDs         []string   `json:"runIds,omitempty"`
	ErrorMessage   string     `json:"errorMessage,omitempty"`
	CreatedAt      time.Time  `json:"createdAt"`
	StartedAt      *time.Time `json:"startedAt"`
	FinishedAt     *time.Time `json:"finishedAt"`
	WokenAt        *time.Time `json:"wokenAt"`
}

AgentBackgroundWork is one piece of background work, with its result when it was read one at a time.

func GetAgentBackgroundWork added in v0.81.0

func GetAgentBackgroundWork(ctx context.Context, connection *Client, id string) (*AgentBackgroundWork, error)

GetAgentBackgroundWork is one piece of background work with its result.

func ListAgentBackgroundWork added in v0.81.0

func ListAgentBackgroundWork(ctx context.Context, connection *Client, first int) ([]*AgentBackgroundWork, error)

ListAgentBackgroundWork is the agent's background work, newest first, without results; first zero leaves how many to the server.

func StartAgentSurvey added in v0.81.0

func StartAgentSurvey(ctx context.Context, connection *Client, question, scopePath string) (*AgentBackgroundWork, error)

StartAgentSurvey starts a survey of a whole area of the graph, a page's path or everything when scopePath is empty, and returns at once; its report is read with GetAgentBackgroundWork once it is done.

func StopAgentBackgroundWork added in v0.81.0

func StopAgentBackgroundWork(ctx context.Context, connection *Client, id string) (*AgentBackgroundWork, error)

StopAgentBackgroundWork stops one that is queued or running.

func (*AgentBackgroundWork) IsFinished added in v0.81.0

func (self *AgentBackgroundWork) IsFinished() bool

IsFinished says whether it will not run again.

type AgentBilledPrice added in v0.165.0

type AgentBilledPrice struct {
	Model                string  `json:"model"`
	TokenKind            string  `json:"tokenKind"`
	ConfiguredPerMillion float64 `json:"configuredPerMillion"`
	BilledPerMillion     float64 `json:"billedPerMillion"`
	DayCount             int     `json:"dayCount"`
	IsPattern            bool    `json:"isPattern"`
}

AgentBilledPrice is one price the check set beside the bill.

type AgentBillingCheck added in v0.165.0

type AgentBillingCheck struct {
	ProviderName string              `json:"providerName"`
	CheckedAt    time.Time           `json:"checkedAt"`
	ErrorMessage string              `json:"errorMessage"`
	Compared     []*AgentBilledPrice `json:"compared"`
	Changed      []*AgentPriceChange `json:"changed"`
}

AgentBillingCheck is the last check of one provider.

func AgentBillingChecks added in v0.165.0

func AgentBillingChecks(ctx context.Context, connection *Client) ([]*AgentBillingCheck, error)

AgentBillingChecks is what the last check of each provider with a billing key did.

func CheckAgentProviderPrices added in v0.165.0

func CheckAgentProviderPrices(ctx context.Context, connection *Client) ([]*AgentBillingCheck, error)

CheckAgentProviderPrices checks the prices against the bill now.

type AgentBudget

type AgentBudget struct {
	Used      int64     `json:"used"`
	Limit     int64     `json:"limit"`
	ResetsAt  time.Time `json:"resetsAt"`
	Cost      float64   `json:"cost"`
	CostLimit float64   `json:"costLimit"`
	Currency  string    `json:"currency"`
}

AgentBudget is today's spend.

type AgentChannel

type AgentChannel struct {
	Kind       string     `json:"kind"`
	HasToken   bool       `json:"hasToken"`
	BotName    string     `json:"botName,omitempty"`
	Linked     bool       `json:"linked"`
	LinkedName string     `json:"linkedName,omitempty"`
	LinkCode   string     `json:"linkCode,omitempty"`
	Enabled    bool       `json:"enabled"`
	Running    bool       `json:"running"`
	LastError  string     `json:"lastError,omitempty"`
	LastSeenAt *time.Time `json:"lastSeenAt,omitempty"`
}

AgentChannel is one chat app of the caller's, as the API shows it.

func ListAgentChannels

func ListAgentChannels(ctx context.Context, connection *Client) ([]*AgentChannel, error)

ListAgentChannels is the caller's chat apps.

func SetAgentChannel

func SetAgentChannel(ctx context.Context, connection *Client, kind, token string, enabled *bool) (*AgentChannel, error)

SetAgentChannel sets a chat app's bot token, or whether it runs.

func UnlinkAgentChannel

func UnlinkAgentChannel(ctx context.Context, connection *Client, kind string) (*AgentChannel, error)

UnlinkAgentChannel drops the linked chat and draws a new code.

type AgentCodingContext added in v0.124.0

type AgentCodingContext struct {
	ProjectPath       string               `json:"projectPath"`
	CheckoutDirectory string               `json:"checkoutDirectory"`
	ReadFrom          string               `json:"readFrom"`
	Pages             []*AgentRecalledPage `json:"pages"`
	Lessons           []string             `json:"lessons"`
	ShownPaths        []string             `json:"shownPaths"`
	Text              string               `json:"text"`
	LastSession       *AgentCodingSession  `json:"lastSession"`
}

AgentCodingContext is what a coding session is shown.

func ReadAgentCodingContext added in v0.124.0

func ReadAgentCodingContext(ctx context.Context, connection *Client, place *AgentCodingPlace) (*AgentCodingContext, error)

ReadAgentCodingContext is what a session starting in a directory is shown. It changes nothing.

func RecallAgentCodingMemory added in v0.124.0

func RecallAgentCodingMemory(ctx context.Context, connection *Client, place *AgentCodingPlace, prompt string, shownPaths []string, isEverywhere bool) (*AgentCodingContext, error)

RecallAgentCodingMemory is what a prompt typed in a coding session recalls, less the pages in shownPaths. It changes nothing.

type AgentCodingPlace added in v0.124.0

type AgentCodingPlace struct {
	Directory     string
	ComputerName  string
	HomeDirectory string
	SessionID     string

	// RemoteURLs, Head and CheckoutRoot are what git says about the
	// checkout the directory is in, where it is one.
	RemoteURLs   []string
	Head         string
	CheckoutRoot string
}

AgentCodingPlace is where a coding session runs.

type AgentCodingSession added in v0.124.0

type AgentCodingSession struct {
	Title        string    `json:"title"`
	Assistant    string    `json:"assistant"`
	LastActiveAt time.Time `json:"lastActiveAt"`
	Requests     []string  `json:"requests"`
	LastAnswer   string    `json:"lastAnswer"`
}

AgentCodingSession is the previous session in a directory.

type AgentCollection

type AgentCollection struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Kind    string `json:"kind"`
	Granted bool   `json:"granted"`
	Items   int    `json:"items"`
}

AgentCollection is one calendar or address book as a source: a switch, and how much is in it.

type AgentComputerView

type AgentComputerView struct {
	Name        string    `json:"name"`
	System      string    `json:"system,omitempty"`
	Description string    `json:"description,omitempty"`
	Since       time.Time `json:"since"`
}

AgentComputerView is one attached computer.

type AgentComputersView

type AgentComputersView struct {
	Allowed   bool                `json:"allowed"`
	Computers []AgentComputerView `json:"computers"`
}

AgentComputersView is which computers the caller has attached.

func ReadAgentComputers

func ReadAgentComputers(ctx context.Context, connection *Client) (*AgentComputersView, error)

ReadAgentComputers says which computers the server sees for the caller.

type AgentConversation

type AgentConversation struct {
	ID               string     `json:"id"`
	Kind             string     `json:"kind"`
	Title            string     `json:"title"`
	Summary          string     `json:"summary"`
	JobKind          string     `json:"jobKind"`
	SubjectID        string     `json:"subjectId"`
	Surface          string     `json:"surface"`
	LastAt           time.Time  `json:"lastAt"`
	ArchivedAt       *time.Time `json:"archivedAt"`
	CompactedThrough string     `json:"compactedThrough"`

	// On a goal's own conversation, the goal: its description, where it
	// stands (working, waiting, met, dropped), its status line, and when
	// it takes its next turn.
	Goal       string     `json:"goal"`
	GoalState  string     `json:"goalState"`
	GoalNote   string     `json:"goalNote"`
	GoalNextAt *time.Time `json:"goalNextAt"`
	GoalSetAt  *time.Time `json:"goalSetAt"`
}

AgentConversation is a conversation with the agent.

func ListAgentConversations

func ListAgentConversations(ctx context.Context, connection *Client, archived bool) ([]*AgentConversation, error)

ListAgentConversations is the main conversation and the named ones.

func SearchAgentConversations

func SearchAgentConversations(ctx context.Context, connection *Client, archived bool, query string) ([]*AgentConversation, error)

SearchAgentConversations lists conversations, or finds them by words in the title or in what was said.

func SetAgentMainConversation

func SetAgentMainConversation(ctx context.Context, connection *Client, conversationId string) (*AgentConversation, error)

SetAgentMainConversation makes a named conversation the main one, or starts a fresh main one when none is named; the old main is kept as a named conversation.

func StartAgentConversation

func StartAgentConversation(ctx context.Context, connection *Client, title string) (*AgentConversation, error)

StartAgentConversation begins a named conversation, with a goal on it when one is given.

func UpdateAgentConversation

func UpdateAgentConversation(ctx context.Context, connection *Client, conversationId, title string, archived *bool) (*AgentConversation, error)

UpdateAgentConversation renames a conversation, archives it, or sets the goal it works toward; a goal of "" clears the goal, and a nil goal leaves it alone.

type AgentConversationView

type AgentConversationView struct {
	Conversation *AgentConversation `json:"conversation"`
	Messages     []*AgentMessage    `json:"messages"`
	Total        int                `json:"total"`
	Todos        []*AgentTodo       `json:"todos"`
}

AgentConversationView is a conversation, a page of its messages, and the task list the agent is keeping in it.

func ReadAgentConversation

func ReadAgentConversation(ctx context.Context, connection *Client, conversationId string, first, offset int) (*AgentConversationView, error)

ReadAgentConversation is a conversation and its newest messages.

type AgentDefinition

type AgentDefinition struct {
	Symbol     string `json:"symbol"`
	Kind       string `json:"kind"`
	Line       int    `json:"line"`
	DocumentID string `json:"documentId"`
	ExternalID string `json:"externalId"`
	Title      string `json:"title"`
}

AgentDefinition is one place an identifier in the words is defined.

type AgentDirectoryHits added in v0.124.0

type AgentDirectoryHits struct {
	Directory    string `json:"directory"`
	SourceID     string `json:"sourceId"`
	Source       string `json:"source"`
	PassageCount int    `json:"passageCount"`
}

AgentDirectoryHits is a directory a search's passages are in.

type AgentDocumentExtract

type AgentDocumentExtract struct {
	DocumentID string     `json:"documentId"`
	ExternalID string     `json:"externalId"`
	Title      string     `json:"title"`
	URL        string     `json:"url"`
	Kind       string     `json:"kind"`
	Author     string     `json:"author"`
	SourceID   string     `json:"sourceId"`
	Source     string     `json:"source"`
	HappenedAt *time.Time `json:"happenedAt"`
	Private    bool       `json:"private"`
	From       int        `json:"from"`
	Text       string     `json:"text"`
	Total      int        `json:"total"`
	Next       int        `json:"next"`
}

AgentDocumentExtract is a document and a slice of its text. Next is where the read that carries on from this one starts, and zero at the end of the document.

func ReadAgentDocument

func ReadAgentDocument(ctx context.Context, connection *Client, documentId string, from, first int) (*AgentDocumentExtract, error)

ReadAgentDocument reads one indexed document from an offset.

type AgentDocumentQuery added in v0.124.0

type AgentDocumentQuery struct {
	Words         string
	First, Offset int
	SourceID      string

	// Directory narrows to what a source of files read under it, on
	// ComputerName where several have the path.
	Directory    string
	ComputerName string
}

AgentDocumentQuery is what to search for, and where.

type AgentDocumentSearch

type AgentDocumentSearch struct {
	Passages    []*AgentPassage    `json:"passages"`
	Definitions []*AgentDefinition `json:"definitions"`
	Meaningful  bool               `json:"meaningful"`

	// Directories are where the passages ranked fall in a tree of files,
	// the most first; a search with Directory looks inside one.
	Directories []*AgentDirectoryHits `json:"directories"`

	// MoreCount is how many more passages the search found past these, at
	// least that many where IsMoreCountLowerBound says so, and NextOffset
	// the offset that reads them; zero is the last page.
	MoreCount             int  `json:"moreCount"`
	IsMoreCountLowerBound bool `json:"isMoreCountLowerBound"`
	NextOffset            int  `json:"nextOffset"`
}

AgentDocumentSearch is what a search of what was indexed found. Meaningful is false where the deployment can only search by words.

func SearchAgentDocuments

func SearchAgentDocuments(ctx context.Context, connection *Client, query *AgentDocumentQuery) (*AgentDocumentSearch, error)

SearchAgentDocuments finds passages in what the sources indexed: the same search the agent's own knowledge tool runs, past the first offset passages of its ranking.

type AgentDraft

type AgentDraft struct {
	Text  string `json:"text"`
	Model string `json:"model"`
	RunID string `json:"runId"`
}

AgentDraft is a reply the agent wrote, for the person to read and send.

func DraftReply

func DraftReply(ctx context.Context, connection *Client, itemId, instructions string) (*AgentDraft, error)

DraftReply has the agent write a reply to the message an item holds.

type AgentDream

type AgentDream struct {
	ID         string     `json:"id"`
	JobID      string     `json:"jobId"`
	StartedAt  time.Time  `json:"startedAt"`
	FinishedAt *time.Time `json:"finishedAt"`
	Digested   int        `json:"digested"`
	Filed      int        `json:"filed"`
	Merged     int        `json:"merged"`
	Rewritten  int        `json:"rewritten"`
	Moved      int        `json:"moved"`
	Dormant    int        `json:"dormant"`
	Embedded   int        `json:"embedded"`
	Backlog    int        `json:"backlog"`
	Coarse     bool       `json:"coarse"`

	Revised      int `json:"revised"`
	Strengthened int `json:"strengthened"`
	Associated   int `json:"associated"`
	Rehearsed    int `json:"rehearsed"`
	Gaps         int `json:"gaps"`
	Unknown      int `json:"unknown"`

	OverviewsWritten   int `json:"overviewsWritten"`
	ThemesMade         int `json:"themesMade"`
	ThemesUpdated      int `json:"themesUpdated"`
	ReflectionsWritten int `json:"reflectionsWritten"`

	Tokens    int64  `json:"tokens"`
	LastError string `json:"lastError"`

	// Cost is what its model calls cost, in Currency.
	Cost      float64 `json:"cost"`
	Currency  string  `json:"currency"`
	Proposals []struct {
		Kind   string `json:"kind"`
		Path   string `json:"path"`
		To     string `json:"to"`
		Reason string `json:"reason"`
	} `json:"proposals"`
}

AgentDream is what the nightly run did.

func ListAgentDreams

func ListAgentDreams(ctx context.Context, connection *Client, first int) ([]*AgentDream, error)

ListAgentDreams is what the nightly run did, newest first.

type AgentEdge

type AgentEdge struct {
	Relation string `json:"relation"`
	Status   string `json:"status"`
	FromPath string `json:"fromPath"`
	ToPath   string `json:"toPath"`
}

AgentEdge joins two pages. Status is "stated" or "proposed": a link the nightly walk guessed is read as a guess and not as a fact.

type AgentEvaluationQuestion added in v0.61.0

type AgentEvaluationQuestion struct {
	ID                 string     `json:"id"`
	CreatedAt          time.Time  `json:"createdAt"`
	QuestionKind       string     `json:"questionKind"`
	QuestionText       string     `json:"questionText"`
	ExpectedAnswer     string     `json:"expectedAnswer"`
	OutdatedAnswer     string     `json:"outdatedAnswer,omitempty"`
	QuestionState      string     `json:"questionState"`
	IsAnswerFiledAfter bool       `json:"isAnswerFiledAfter"`
	AnsweredAt         *time.Time `json:"answeredAt,omitempty"`
}

AgentEvaluationQuestion is a memory check question as the API gives it.

func ListAgentEvaluationQuestions added in v0.61.0

func ListAgentEvaluationQuestions(ctx context.Context, connection *Client, questionStates []string) ([]*AgentEvaluationQuestion, error)

ListAgentEvaluationQuestions is the memory check's questions, newest first, in the states given or in all of them.

type AgentEvaluationRun added in v0.61.0

type AgentEvaluationRun struct {
	ID            string                   `json:"id"`
	StartedAt     time.Time                `json:"startedAt"`
	FinishedAt    *time.Time               `json:"finishedAt,omitempty"`
	QuestionCount int                      `json:"questionCount"`
	Cost          float64                  `json:"cost"`
	SourceScores  []*EvaluationSourceScore `json:"sourceScores"`
}

AgentEvaluationRun is a run of the memory check as the API gives it.

func EvaluateAgentMemoryNow added in v0.61.0

func EvaluateAgentMemoryNow(ctx context.Context, connection *Client) (*AgentEvaluationRun, error)

EvaluateAgentMemoryNow starts a run of the memory check now, or returns the one under way.

func ListAgentEvaluationRuns added in v0.61.0

func ListAgentEvaluationRuns(ctx context.Context, connection *Client, first int) ([]*AgentEvaluationRun, error)

ListAgentEvaluationRuns is the memory check's runs, newest first.

type AgentEvent

type AgentEvent struct {
	Kind      string    `json:"kind"`
	RunID     string    `json:"runId"`
	Sequence  int       `json:"sequence"`
	Text      string    `json:"text"`
	Tool      string    `json:"tool"`
	CallID    string    `json:"callId"`
	Arguments string    `json:"arguments"`
	Risk      string    `json:"risk"`
	Note      string    `json:"note"`
	Error     string    `json:"error"`
	At        time.Time `json:"at"`
}

AgentEvent is one thing that happened in a run.

type AgentEvidence

type AgentEvidence struct {
	Kind  string `json:"kind"`
	ID    string `json:"id"`
	Quote string `json:"quote"`

	// For a passage of a recording, the transcript and the range in
	// milliseconds the fact was read from.
	TranscriptRunID string `json:"transcriptRunId"`
	StartMS         int64  `json:"startMS"`
	EndMS           int64  `json:"endMS"`
}

AgentEvidence is where a fact came from.

type AgentFact

type AgentFact struct {
	ID         string          `json:"id"`
	Number     int             `json:"number"`
	Kind       string          `json:"kind"`
	Text       string          `json:"text"`
	HappenedAt *time.Time      `json:"happenedAt"`
	Confidence float32         `json:"confidence"`
	Inferred   bool            `json:"inferred"`
	Evidence   []AgentEvidence `json:"evidence"`
	Audiences  []string        `json:"audiences"`
	Dormant    bool            `json:"dormant"`
	CreatedAt  time.Time       `json:"createdAt"`
}

AgentFact is one sentence on a page.

func MoveAgentFact

func MoveAgentFact(ctx context.Context, connection *Client, path string, number int, to string) (*AgentFact, error)

MoveAgentFact puts one fact on another page, where it takes a new number.

func SaveAgentFact

func SaveAgentFact(ctx context.Context, connection *Client, fields map[string]any) (*AgentFact, error)

SaveAgentFact puts a fact on a page, or changes one.

type AgentFeedback

type AgentFeedback struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	Kind      string    `json:"kind"`
	MailID    string    `json:"mailId"`
	Said      string    `json:"said"`
}

AgentFeedback is a correction recorded from the person's own action.

func ListAgentCorrections

func ListAgentCorrections(ctx context.Context, connection *Client, first int) ([]*AgentFeedback, error)

ListAgentCorrections is what the person corrected, newest first.

type AgentGoal added in v0.111.0

type AgentGoal struct {
	ConversationID  string `json:"conversationId"`
	GoalTitle       string `json:"goalTitle"`
	GoalDescription string `json:"goalDescription"`

	// GoalState is working, waiting, met or dropped, and GoalStatus the
	// agent's one line on where it stands.
	GoalState  string `json:"goalState"`
	GoalStatus string `json:"goalStatus"`

	GoalSetAt      *time.Time `json:"goalSetAt"`
	GoalNextAt     *time.Time `json:"goalNextAt"`
	GoalSurfacedAt *time.Time `json:"goalSurfacedAt"`
	LastAt         time.Time  `json:"lastAt"`

	Activity       []*AgentGoalActivity   `json:"activity,omitempty"`
	Schedules      []*AgentGoalSchedule   `json:"schedules,omitempty"`
	BackgroundWork []*AgentBackgroundWork `json:"backgroundWork,omitempty"`
	Artifacts      []*AgentGoalArtifact   `json:"artifacts,omitempty"`
}

AgentGoal is one goal; its activity and what it made are filled only when it was read one at a time.

func GetAgentGoal added in v0.111.0

func GetAgentGoal(ctx context.Context, connection *Client, conversationId string) (*AgentGoal, error)

GetAgentGoal is one goal with its activity and what it made.

func ListAgentGoals added in v0.76.0

func ListAgentGoals(ctx context.Context, connection *Client, goalStates []string) ([]*AgentGoal, error)

ListAgentGoals is the person's goals in the states given, every state when none is.

func SetAgentGoalState added in v0.111.0

func SetAgentGoalState(ctx context.Context, connection *Client, conversationId, goalState string) (*AgentGoal, error)

SetAgentGoalState marks a goal met or dropped, or takes it up again.

func StartAgentGoal added in v0.111.0

func StartAgentGoal(ctx context.Context, connection *Client, goalTitle, goalDescription string) (*AgentGoal, error)

StartAgentGoal starts a goal in the background.

func TellAgentGoal added in v0.111.0

func TellAgentGoal(ctx context.Context, connection *Client, conversationId, text string) (*AgentGoal, error)

TellAgentGoal passes the person's words to a goal.

type AgentGoalActivity added in v0.111.0

type AgentGoalActivity struct {
	ID               string    `json:"id"`
	CreatedAt        time.Time `json:"createdAt"`
	GoalActivityKind string    `json:"goalActivityKind"`
	ActivityHeadline string    `json:"activityHeadline"`
	ActivityDetail   string    `json:"activityDetail,omitempty"`
}

AgentGoalActivity is one row of a goal's log.

type AgentGoalArtifact added in v0.111.0

type AgentGoalArtifact struct {
	ID                string    `json:"id"`
	CreatedAt         time.Time `json:"createdAt"`
	GoalArtifactKind  string    `json:"goalArtifactKind"`
	ArtifactReference string    `json:"artifactReference"`
	ArtifactTitle     string    `json:"artifactTitle"`
}

AgentGoalArtifact is a mail rule, a reminder or an alert mute a goal made.

type AgentGoalSchedule added in v0.111.0

type AgentGoalSchedule struct {
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	Cron      string     `json:"cron"`
	IsEnabled bool       `json:"enabled"`
	NextRunAt *time.Time `json:"nextRunAt"`
}

AgentGoalSchedule is a schedule a goal made.

func MoveAgentScheduleToGoal added in v0.111.0

func MoveAgentScheduleToGoal(ctx context.Context, connection *Client, scheduleId, conversationId string) (*AgentGoalSchedule, error)

MoveAgentScheduleToGoal makes a schedule one of a goal's.

type AgentGraphPage

type AgentGraphPage struct {
	Node     *AgentNode   `json:"node"`
	Facts    []*AgentFact `json:"facts"`
	Edges    []*AgentEdge `json:"edges"`
	Children []*AgentNode `json:"children"`
	Contact  *Contact     `json:"contact"`

	// LinkCount is how many links the page has, and NextLinkOffset where
	// the next part of them starts, zero when Edges reaches the last.
	LinkCount      int `json:"linkCount"`
	NextLinkOffset int `json:"nextLinkOffset"`

	// RecordLinkCount is how many links the page has to the person's own
	// records; ListAgentRecordLinks reads them.
	RecordLinkCount int `json:"recordLinkCount"`
}

AgentGraphPage is a page and everything a reader of it wants.

func AgentGraphPageOf

func AgentGraphPageOf(ctx context.Context, connection *Client, path string) (*AgentGraphPage, error)

AgentGraphPageOf is one page with its facts and every link.

func AgentGraphPageWithLinks(ctx context.Context, connection *Client, path string, linkOffset, linkLimit int) (*AgentGraphPage, error)

AgentGraphPageWithLinks is one page with its facts and linkLimit of its links past linkOffset, or every link past it when linkLimit is zero.

type AgentGraphSearch

type AgentGraphSearch struct {
	Nodes []*AgentNode        `json:"nodes"`
	Facts []*AgentLearnedFact `json:"facts"`

	// MoreNodeCount and MoreFactCount are how many more the search found
	// past these, at least that many where the flag says so, and
	// NextOffset the offset that reads them; zero is the last page.
	MoreNodeCount             int  `json:"moreNodeCount"`
	IsMoreNodeCountLowerBound bool `json:"isMoreNodeCountLowerBound"`
	MoreFactCount             int  `json:"moreFactCount"`
	IsMoreFactCountLowerBound bool `json:"isMoreFactCountLowerBound"`
	NextOffset                int  `json:"nextOffset"`
}

AgentGraphSearch is what words found.

func SearchAgentGraph

func SearchAgentGraph(ctx context.Context, connection *Client, query string, first, offset int) (*AgentGraphSearch, error)

SearchAgentGraph finds pages and facts by words, past the first offset of each.

type AgentHerdrAnswer added in v0.120.0

type AgentHerdrAnswer struct {
	HerdrSession     *AgentHerdrSession `json:"herdrSession"`
	IsAnswerAccepted bool               `json:"isAnswerAccepted"`
	AnsweredWith     string             `json:"answeredWith"`
}

AgentHerdrAnswer says whether the question took its answer.

func AnswerAgentHerdrQuestion added in v0.120.0

func AnswerAgentHerdrQuestion(ctx context.Context, connection *Client, computer, paneId, questionFingerprint string, optionNumbers []int, optionLabels []string, freeText string) (*AgentHerdrAnswer, error)

AnswerAgentHerdrQuestion answers the question with this fingerprint; optionLabels, when given, must be the labels of the options chosen.

type AgentHerdrList added in v0.120.0

type AgentHerdrList struct {
	ComputerNames       []string             `json:"computerNames"`
	FailedComputerNames []string             `json:"failedComputerNames"`
	Sessions            []*AgentHerdrSession `json:"sessions"`
}

AgentHerdrList is every session, and the computers that were asked.

func ListAgentHerdrSessions added in v0.120.0

func ListAgentHerdrSessions(ctx context.Context, connection *Client, computer string) (*AgentHerdrList, error)

ListAgentHerdrSessions is the coding sessions on the caller's computers, or on the one named.

type AgentHerdrQuestion added in v0.120.0

type AgentHerdrQuestion struct {
	QuestionFingerprint string                      `json:"questionFingerprint"`
	HerdrQuestionKind   string                      `json:"herdrQuestionKind"`
	QuestionText        string                      `json:"questionText"`
	IsMultipleChoice    bool                        `json:"isMultipleChoice"`
	IsFromTranscript    bool                        `json:"isFromTranscript"`
	Options             []*AgentHerdrQuestionOption `json:"options"`
}

AgentHerdrQuestion is the question a session waits on.

type AgentHerdrQuestionOption added in v0.120.0

type AgentHerdrQuestionOption struct {
	OptionNumber      int    `json:"optionNumber"`
	OptionLabel       string `json:"optionLabel"`
	OptionDescription string `json:"optionDescription"`
	HerdrOptionKind   string `json:"herdrOptionKind"`
}

AgentHerdrQuestionOption is one option of a question.

type AgentHerdrRead added in v0.120.0

type AgentHerdrRead struct {
	HerdrSession *AgentHerdrSession `json:"herdrSession"`
	Turns        []*AgentHerdrTurn  `json:"turns"`
	IsTruncated  bool               `json:"isTruncated"`
}

AgentHerdrRead is a session's last turns.

func ReadAgentHerdrSession added in v0.120.0

func ReadAgentHerdrSession(ctx context.Context, connection *Client, computer, paneId string, turnCount int) (*AgentHerdrRead, error)

ReadAgentHerdrSession is a session's last turnCount turns; zero leaves the count to the server.

type AgentHerdrScreen added in v0.120.0

type AgentHerdrScreen struct {
	HerdrSession *AgentHerdrSession `json:"herdrSession"`
	ScreenText   string             `json:"screenText"`
}

AgentHerdrScreen is a session's screen.

func ReadAgentHerdrScreen added in v0.120.0

func ReadAgentHerdrScreen(ctx context.Context, connection *Client, computer, paneId string, lineCount int) (*AgentHerdrScreen, error)

ReadAgentHerdrScreen is a session's screen, or its last lineCount lines.

type AgentHerdrSession added in v0.120.0

type AgentHerdrSession struct {
	Computer          string              `json:"computer"`
	PaneID            string              `json:"paneId"`
	PaneName          string              `json:"paneName"`
	CodingAgentKind   string              `json:"codingAgentKind"`
	CodingSessionID   string              `json:"codingSessionId"`
	HerdrSessionState string              `json:"herdrSessionState"`
	HerdrAgentStatus  string              `json:"herdrAgentStatus"`
	PaneTitle         string              `json:"paneTitle"`
	WorkingDirectory  string              `json:"workingDirectory"`
	TranscriptPath    string              `json:"transcriptPath"`
	IsWatched         bool                `json:"isWatched"`
	Question          *AgentHerdrQuestion `json:"question"`
}

AgentHerdrSession is one coding session in one pane of one computer.

func CloseAgentHerdrSession added in v0.120.0

func CloseAgentHerdrSession(ctx context.Context, connection *Client, computer, paneId string) (*AgentHerdrSession, error)

CloseAgentHerdrSession ends a session's coding agent and closes its pane.

func OpenAgentHerdrSession added in v0.120.0

func OpenAgentHerdrSession(ctx context.Context, connection *Client, computer, directory, codingAgentKind, agentName string, shouldSkipPermissions bool) (*AgentHerdrSession, error)

OpenAgentHerdrSession starts a coding agent, "claude" or "codex", in a new herdr pane in a directory; agentName may be empty. shouldSkipPermissions starts it without asking before it acts.

func SendAgentHerdrSession added in v0.120.0

func SendAgentHerdrSession(ctx context.Context, connection *Client, computer, paneId, text string, attachmentIds []string) (*AgentHerdrSession, error)

SendAgentHerdrSession types text into a session and presses enter; a session at work takes it as a message in its turn. The agent's files named by attachmentIds are written on the computer and their paths typed after the text.

func WatchAgentHerdrSession added in v0.120.0

func WatchAgentHerdrSession(ctx context.Context, connection *Client, computer, paneId, conversationId string) (*AgentHerdrSession, error)

WatchAgentHerdrSession has a conversation woken when a session next finishes: the one named, or the main conversation when none is.

type AgentHerdrSetup added in v0.120.0

type AgentHerdrSetup struct {
	Computer       string   `json:"computer"`
	IsInstalled    bool     `json:"isInstalled"`
	SettingsPath   string   `json:"settingsPath"`
	ScriptPath     string   `json:"scriptPath"`
	BackupPath     string   `json:"backupPath"`
	HookEventNames []string `json:"hookEventNames"`
}

AgentHerdrSetup says what setting the hooks up did.

func SetUpAgentHerdrHooks added in v0.120.0

func SetUpAgentHerdrHooks(ctx context.Context, connection *Client, computer string, isRemoval bool) (*AgentHerdrSetup, error)

SetUpAgentHerdrHooks puts TeaNode's reporting hooks in on a computer, or takes them out.

type AgentHerdrTurn added in v0.120.0

type AgentHerdrTurn struct {
	HerdrTurnRole string     `json:"herdrTurnRole"`
	TurnText      string     `json:"turnText"`
	TurnAt        *time.Time `json:"turnAt"`
}

AgentHerdrTurn is one thing said or done in a session.

type AgentHerdrWait added in v0.120.0

type AgentHerdrWait struct {
	HerdrSession *AgentHerdrSession `json:"herdrSession"`
	IsTimedOut   bool               `json:"isTimedOut"`
}

AgentHerdrWait is a session after a wait.

func WaitAgentHerdrSession added in v0.120.0

func WaitAgentHerdrSession(ctx context.Context, connection *Client, computer, paneId string, waitSeconds int) (*AgentHerdrWait, error)

WaitAgentHerdrSession waits for a session to stop working.

type AgentIdea added in v0.76.0

type AgentIdea struct {
	ID                    string              `json:"id"`
	IdeaKey               string              `json:"ideaKey"`
	IdeaKind              string              `json:"ideaKind"`
	IdeaCategory          string              `json:"ideaCategory"`
	Emoji                 string              `json:"emoji"`
	Headline              string              `json:"headline"`
	Body                  string              `json:"body"`
	OpeningRequest        string              `json:"openingRequest"`
	NeededToolNames       []string            `json:"neededToolNames"`
	Evidence              []AgentIdeaEvidence `json:"evidence"`
	SuggestionReason      string              `json:"suggestionReason"`
	IdeaStatus            string              `json:"ideaStatus"`
	ExpiredReason         string              `json:"expiredReason"`
	StartedConversationID string              `json:"startedConversationId"`
	CreatedAt             time.Time           `json:"createdAt"`
	ShownAt               *time.Time          `json:"shownAt"`
	StartedAt             *time.Time          `json:"startedAt"`
	ClosedAt              *time.Time          `json:"closedAt"`
	ExpiresAt             *time.Time          `json:"expiresAt"`
}

AgentIdea is one idea.

func ProposeAgentIdea added in v0.76.0

func ProposeAgentIdea(ctx context.Context, connection *Client, proposal *AgentIdeaProposal) (*AgentIdea, error)

ProposeAgentIdea keeps an idea, once it passes the check every idea passes.

func SetAgentIdeaStatus added in v0.76.0

func SetAgentIdeaStatus(ctx context.Context, connection *Client, ideaId, status string) (*AgentIdea, error)

SetAgentIdeaStatus says what became of an idea: done, dismissed, or open.

type AgentIdeaEvidence added in v0.76.0

type AgentIdeaEvidence struct {
	EvidenceKind    string `json:"evidenceKind"`
	EvidenceID      string `json:"evidenceId"`
	EvidenceSummary string `json:"evidenceSummary"`
}

AgentIdeaEvidence is one thing that prompted a personal idea.

type AgentIdeaListing added in v0.120.3

type AgentIdeaListing struct {
	Statuses []string
	Kinds    []string
	IdeaIDs  []string
	Limit    int
	Offset   int
}

AgentIdeaListing narrows a listing of ideas: the statuses, kinds and ideas given, or all; Limit of them from Offset, or every one when Limit is zero.

type AgentIdeaPage added in v0.120.3

type AgentIdeaPage struct {
	Ideas      []*AgentIdea `json:"ideas"`
	TotalCount int          `json:"totalCount"`
	NextOffset int          `json:"nextOffset"`
}

AgentIdeaPage is a page of ideas, how many match on every page, and the offset of the next page, zero on the last.

func ListAgentIdeas added in v0.76.0

func ListAgentIdeas(ctx context.Context, connection *Client, listing AgentIdeaListing) (*AgentIdeaPage, error)

ListAgentIdeas is a page of the ideas the listing asks for.

type AgentIdeaProposal added in v0.76.0

type AgentIdeaProposal struct {
	IdeaCategory     string              `json:"ideaCategory"`
	Emoji            string              `json:"emoji"`
	Headline         string              `json:"headline"`
	Body             string              `json:"body"`
	OpeningRequest   string              `json:"openingRequest"`
	NeededToolNames  []string            `json:"neededToolNames"`
	Evidence         []AgentIdeaEvidence `json:"evidence"`
	SuggestionReason string              `json:"suggestionReason"`
	ExpiresOn        string              `json:"expiresOn"`
}

AgentIdeaProposal is an idea to keep.

type AgentJob

type AgentJob struct {
	ID         string     `json:"id"`
	CreatedAt  time.Time  `json:"createdAt"`
	AgentID    string     `json:"agentId"`
	MailboxID  string     `json:"mailboxId"`
	Kind       string     `json:"kind"`
	SubjectID  string     `json:"subjectId"`
	Status     string     `json:"status"`
	Attempts   int        `json:"attempts"`
	Error      string     `json:"error"`
	FinishedAt *time.Time `json:"finishedAt"`
}

AgentJob is one job of the worker.

func ListAgentDeadLetters

func ListAgentDeadLetters(ctx context.Context, connection *Client) ([]*AgentJob, error)

ListAgentDeadLetters is the jobs the worker gave up on.

func RetryAgentJob

func RetryAgentJob(ctx context.Context, connection *Client, jobId string) (*AgentJob, error)

RetryAgentJob puts a dead job back.

type AgentJudgedPlan added in v0.93.0

type AgentJudgedPlan struct {
	Depth           string   `json:"depth"`
	DepthReason     string   `json:"depthReason"`
	PlannedSearches []string `json:"plannedSearches"`
	IsBroad         bool     `json:"isBroad"`
	Cost            float64  `json:"cost"`
	Currency        string   `json:"currency"`
}

AgentJudgedPlan is what the depth judgement said of a question on its own, and what the judgement cost.

func JudgeAgentRetrievalPlan added in v0.93.0

func JudgeAgentRetrievalPlan(ctx context.Context, connection *Client, question string) (*AgentJudgedPlan, error)

JudgeAgentRetrievalPlan asks the depth judgement what plan a live turn would follow for a question: one call to the fast model.

type AgentKnowledgeSource

type AgentKnowledgeSource struct {
	ID             string                      `json:"id"`
	Kind           string                      `json:"kind"`
	Name           string                      `json:"name"`
	Specification  AgentKnowledgeSpecification `json:"specification"`
	RootPath       string                      `json:"rootPath"`
	Enabled        bool                        `json:"enabled"`
	Cron           string                      `json:"cron"`
	LastRunAt      *time.Time                  `json:"lastRunAt"`
	NextRunAt      *time.Time                  `json:"nextRunAt"`
	LastError      string                      `json:"lastError"`
	DocumentCount  int                         `json:"documentCount"`
	ChunkCount     int                         `json:"chunkCount"`
	RefusedCount   int                         `json:"refusedCount"`
	More           bool                        `json:"more"`
	UnknownAuthors []string                    `json:"unknownAuthors"`

	// CheckoutsKeptToProfile is how many checkouts under this source were
	// kept to what git says about them, and FilesKeptToProfile how many
	// files that was.
	CheckoutsKeptToProfile int `json:"checkoutsKeptToProfile"`
	FilesKeptToProfile     int `json:"filesKeptToProfile"`
}

AgentKnowledgeSource is a place the agent reads.

func ListAgentKnowledgeSources

func ListAgentKnowledgeSources(ctx context.Context, connection *Client) ([]*AgentKnowledgeSource, error)

ListAgentKnowledgeSources is what the agent reads.

func SaveAgentKnowledgeSource

func SaveAgentKnowledgeSource(ctx context.Context, connection *Client, fields map[string]any) (*AgentKnowledgeSource, error)

SaveAgentKnowledgeSource adds one, or changes one.

type AgentKnowledgeSpecification

type AgentKnowledgeSpecification struct {
	// Type is the source type this source is one of, and Settings what
	// was filled in for it.
	Type     string          `json:"type"`
	Settings json.RawMessage `json:"settings"`

	Computer  string   `json:"computer"`
	Path      string   `json:"path"`
	Format    string   `json:"format"`
	Include   []string `json:"include"`
	Exclude   []string `json:"exclude"`
	Tool      string   `json:"tool"`
	Start     string   `json:"start"`
	Depth     int      `json:"depth"`
	MailboxID string   `json:"mailboxId"`

	// ReadEveryCheckout reads the files of every checkout under this
	// source, the person's own and the ones they cloned alike.
	ReadEveryCheckout bool `json:"readEveryCheckout"`

	// CommitsPerPass is how many commits one pass over this source's
	// tree carries; zero is the pace the program on the machine reads
	// at.
	CommitsPerPass int `json:"commitsPerPass"`

	// OwnCommitsAtLeast is the fewest commits of the person's own a
	// checkout under this source must hold before its files are read;
	// zero is the floor the program on the machine reads at.
	OwnCommitsAtLeast int `json:"ownCommitsAtLeast"`
}

AgentKnowledgeSpecification says what a source reads.

type AgentLearnedFact

type AgentLearnedFact struct {
	Fact *AgentFact `json:"fact"`
	Path string     `json:"path"`
	Name string     `json:"name"`
}

AgentLearnedFact is a fact with the page it sits on.

func ListAgentLearned

func ListAgentLearned(ctx context.Context, connection *Client, days, first int) ([]*AgentLearnedFact, error)

ListAgentLearned is what has been filed lately.

type AgentMemory

type AgentMemory struct {
	ID         string     `json:"id"`
	CreatedAt  time.Time  `json:"createdAt"`
	ModifiedAt time.Time  `json:"modifiedAt"`
	Title      string     `json:"title"`
	Content    string     `json:"content"`
	Tags       []string   `json:"tags"`
	AppliesTo  []string   `json:"appliesTo"`
	Pinned     bool       `json:"pinned"`
	UsedAt     *time.Time `json:"usedAt"`
}

AgentMemory is a durable fact the agent keeps about the person.

func ListAgentMemories

func ListAgentMemories(ctx context.Context, connection *Client, audience, query string, first int) ([]*AgentMemory, error)

ListAgentMemories is what the agent remembers, pinned first; searched when words are given.

func SaveAgentMemory

func SaveAgentMemory(ctx context.Context, connection *Client, memoryId string, fields map[string]any) (*AgentMemory, error)

SaveAgentMemory adds a memory, or changes one when memoryId is given.

type AgentMessage

type AgentMessage struct {
	ID          string            `json:"id"`
	CreatedAt   time.Time         `json:"createdAt"`
	Role        string            `json:"role"`
	Content     string            `json:"content"`
	Name        string            `json:"name"`
	ToolCallID  string            `json:"toolCallId"`
	ToolCalls   []AgentToolCall   `json:"toolCalls"`
	Usage       *AgentUsageNote   `json:"usage"`
	Attachments []AgentAttachment `json:"attachments"`
	References  []AgentReference  `json:"references"`
	// Reactions are the emoji you and the agent put on the message.
	Reactions []AgentMessageReaction `json:"reactions"`
}

AgentMessage is one turn, tool call or result of a conversation.

type AgentMessageReaction added in v0.134.0

type AgentMessageReaction struct {
	Emoji       string    `json:"emoji"`
	ReactorKind string    `json:"reactorKind"`
	ReactedAt   time.Time `json:"reactedAt"`
}

AgentMessageReaction is an emoji on a message, and who put it there: person or agent.

type AgentNode

type AgentNode struct {
	ID         string     `json:"id"`
	Path       string     `json:"path"`
	Kind       string     `json:"kind"`
	Name       string     `json:"name"`
	Aliases    []string   `json:"aliases"`
	Summary    string     `json:"summary"`
	ContactID  string     `json:"contactId"`
	Pinned     bool       `json:"pinned"`
	Importance float32    `json:"importance"`
	Dormant    bool       `json:"dormant"`
	UsedAt     *time.Time `json:"usedAt"`
	ModifiedAt time.Time  `json:"modifiedAt"`

	// Overview is how the thing works, in markdown sections the night
	// writes; asked for only when one page is read.
	Overview          string     `json:"overview"`
	OverviewWrittenAt *time.Time `json:"overviewWrittenAt"`
}

AgentNode is one page of the graph.

func AgentGraphIndex

func AgentGraphIndex(ctx context.Context, connection *Client, under string, first int) ([]*AgentNode, error)

AgentGraphIndex is the pages, under a path or the whole graph.

func MergeAgentNodes

func MergeAgentNodes(ctx context.Context, connection *Client, path, into string) (*AgentNode, error)

MergeAgentNodes folds one page into another.

func MoveAgentNode

func MoveAgentNode(ctx context.Context, connection *Client, path, under string) (*AgentNode, error)

MoveAgentNode files a page under another.

func SaveAgentNode

func SaveAgentNode(ctx context.Context, connection *Client, fields map[string]any) (*AgentNode, error)

SaveAgentNode writes a page.

type AgentOverviewState added in v0.89.0

type AgentOverviewState struct {
	Path                       string     `json:"path"`
	OverviewWrittenAt          *time.Time `json:"overviewWrittenAt"`
	IsOverviewStale            bool       `json:"isOverviewStale"`
	ChildCount                 int        `json:"childCount"`
	ChildShownCount            int        `json:"childShownCount"`
	ChildWithoutOverviewCount  int        `json:"childWithoutOverviewCount"`
	MemberCount                int        `json:"memberCount"`
	MemberShownCount           int        `json:"memberShownCount"`
	MemberWithoutOverviewCount int        `json:"memberWithoutOverviewCount"`
	LinkCount                  int        `json:"linkCount"`
	LinkShownCount             int        `json:"linkShownCount"`
}

AgentOverviewState is how a page's overview stands: how much of what it could be written from its prompt shows, and whether that has changed since it was written.

func GetAgentOverviewState added in v0.89.0

func GetAgentOverviewState(ctx context.Context, connection *Client, path string) (*AgentOverviewState, error)

GetAgentOverviewState reads how a page's overview stands.

type AgentPageRevision

type AgentPageRevision struct {
	Revision  int       `json:"revision"`
	Kind      string    `json:"kind"`
	Actor     string    `json:"actor"`
	Summary   string    `json:"summary"`
	Change    string    `json:"change"`
	Before    string    `json:"before"`
	After     string    `json:"after"`
	Path      string    `json:"path"`
	Reason    string    `json:"reason"`
	CreatedAt time.Time `json:"createdAt"`
}

AgentPageRevision is one change to a page.

func ListAgentPageHistory

func ListAgentPageHistory(ctx context.Context, connection *Client, path string, first int) ([]*AgentPageRevision, error)

ListAgentPageHistory is what has happened to one page, newest first.

type AgentPassage

type AgentPassage struct {
	DocumentID string     `json:"documentId"`
	ExternalID string     `json:"externalId"`
	Title      string     `json:"title"`
	URL        string     `json:"url"`
	Kind       string     `json:"kind"`
	Author     string     `json:"author"`
	SourceID   string     `json:"sourceId"`
	Source     string     `json:"source"`
	HappenedAt *time.Time `json:"happenedAt"`
	Private    bool       `json:"private"`
	Number     int        `json:"number"`
	Text       string     `json:"text"`
	Score      float64    `json:"score"`
}

AgentPassage is one passage a search of what was indexed found, with enough of the document it came from to cite it.

type AgentPhone added in v0.128.0

type AgentPhone struct {
	ID                string     `json:"id"`
	PhoneName         string     `json:"phoneName"`
	PhoneModel        string     `json:"phoneModel"`
	PhoneModelName    string     `json:"phoneModelName"`
	NotificationKinds []string   `json:"notificationKinds"`
	CanBeNotified     bool       `json:"canBeNotified"`
	CreatedAt         time.Time  `json:"createdAt"`
	LastSeenAt        *time.Time `json:"lastSeenAt"`
	LastDeliveredAt   *time.Time `json:"lastDeliveredAt"`
	LastDeliveryError string     `json:"lastDeliveryError"`
}

AgentPhone is one phone a person talks to their agent from.

func TestAgentPhone added in v0.128.0

func TestAgentPhone(ctx context.Context, connection *Client, phoneId string) (*AgentPhone, error)

TestAgentPhone sends a phone a notification that says it can be reached.

func UpdateAgentPhone added in v0.128.0

func UpdateAgentPhone(ctx context.Context, connection *Client, phoneId string, phoneName *string, notificationKinds *[]string) (*AgentPhone, error)

UpdateAgentPhone renames a phone or chooses its notifications; nil leaves either as it is.

type AgentPhoneList added in v0.128.0

type AgentPhoneList struct {
	Phones            []*AgentPhone `json:"phones"`
	IsPushEnabled     bool          `json:"isPushEnabled"`
	NotificationKinds []string      `json:"notificationKinds"`
}

AgentPhoneList is a person's phones and whether notifications go out.

func ListAgentPhones added in v0.128.0

func ListAgentPhones(ctx context.Context, connection *Client) (*AgentPhoneList, error)

ListAgentPhones lists the caller's phones.

type AgentPriceChange added in v0.165.0

type AgentPriceChange struct {
	Model            string  `json:"model"`
	TokenKind        string  `json:"tokenKind"`
	BeforePerMillion float64 `json:"beforePerMillion"`
	AfterPerMillion  float64 `json:"afterPerMillion"`
}

AgentPriceChange is one price the check changed.

type AgentReadingProgress

type AgentReadingProgress struct {
	Waiting       int64   `json:"waiting"`
	Read          int64   `json:"read"`
	PerHour       float64 `json:"perHour"`
	HoursLeft     float64 `json:"hoursLeft"`
	Bootstrapping bool    `json:"bootstrapping"`
}

AgentReadingProgress is how far the night has got through what was indexed, and how long the rest takes at the pace of the last dreams.

func ReadAgentReadingProgress

func ReadAgentReadingProgress(ctx context.Context, connection *Client) (*AgentReadingProgress, error)

ReadAgentReadingProgress asks how far the reading has got.

type AgentRecall

type AgentRecall struct {
	// RetrievalMode is basic, or planned when a plan was followed.
	RetrievalMode string               `json:"retrievalMode"`
	Pages         []*AgentRecalledPage `json:"pages"`

	// Explanation is why, when it was asked for.
	Explanation *AgentRecallExplanation `json:"explanation,omitempty"`
}

AgentRecall is what a turn asking a question would have been carried from the graph: the pages, each with the facts recall would have put in front of the model.

func ExplainAgentRecall added in v0.89.0

func ExplainAgentRecall(ctx context.Context, connection *Client, question string, plan *AgentRetrievalPlan) (*AgentRecall, error)

ExplainAgentRecall is RecallAgentMemory and why: what each search found, and why each page and fact was carried or left out.

func RecallAgentMemory

func RecallAgentMemory(ctx context.Context, connection *Client, question string, plan *AgentRetrievalPlan) (*AgentRecall, error)

RecallAgentMemory is what a turn asking this question would have been carried from the graph. It asks nothing of a model and changes nothing.

type AgentRecallExplanation added in v0.89.0

type AgentRecallExplanation struct {
	RetrievalMode      string               `json:"retrievalMode"`
	Plan               *AgentRetrievalPlan  `json:"plan"`
	Queries            []*AgentRecallQuery  `json:"queries"`
	Searches           []*AgentRecallSearch `json:"searches"`
	Pages              []*AgentRecallPage   `json:"pages"`
	Facts              []*AgentRecallFact   `json:"facts"`
	IsBroadNoteCarried bool                 `json:"isBroadNoteCarried"`

	TokenBudget int `json:"tokenBudget"`
	TokensSpent int `json:"tokensSpent"`
}

AgentRecallExplanation is how one question's recall went: each query, what each of its lists found, and why each page and fact was carried or left out.

type AgentRecallFact added in v0.89.0

type AgentRecallFact struct {
	Reference      string             `json:"reference"`
	FusedRank      int                `json:"fusedRank"`
	Ranks          []*AgentRecallRank `json:"ranks"`
	RecallDecision string             `json:"recallDecision"`
}

AgentRecallFact is one fact the searches found and what became of it.

type AgentRecallPage added in v0.89.0

type AgentRecallPage struct {
	Path                   string             `json:"path"`
	FusedRank              int                `json:"fusedRank"`
	Ranks                  []*AgentRecallRank `json:"ranks"`
	HitFactCount           int                `json:"hitFactCount"`
	RecallDecision         string             `json:"recallDecision"`
	OverviewSectionHeading string             `json:"overviewSectionHeading"`
	SectionChoice          string             `json:"sectionChoice"`
	CarriedFactCount       int                `json:"carriedFactCount"`
	TokenCount             int                `json:"tokenCount"`
}

AgentRecallPage is one page the searches found and what became of it.

type AgentRecallQuery added in v0.93.0

type AgentRecallQuery struct {
	QueryID   string `json:"queryId"`
	QueryKind string `json:"queryKind"`
	QueryText string `json:"queryText"`
}

AgentRecallQuery is one query a retrieval ran.

type AgentRecallRank added in v0.93.0

type AgentRecallRank struct {
	QueryID    string `json:"queryId"`
	SearchName string `json:"searchName"`
	Rank       int    `json:"rank"`
}

AgentRecallRank is where a page or fact stood in one list.

type AgentRecallSearch added in v0.89.0

type AgentRecallSearch struct {
	QueryID    string `json:"queryId"`
	SearchName string `json:"searchName"`
	FoundCount int    `json:"foundCount"`
}

AgentRecallSearch is one list a query produced, and how much it found.

type AgentRecalledFact

type AgentRecalledFact struct {
	Number int    `json:"number"`
	Text   string `json:"text"`
}

AgentRecalledFact is a fact as the page cites it.

type AgentRecalledPage

type AgentRecalledPage struct {
	Path string `json:"path"`

	// Summary and Overview are the page's opening and the section of its
	// overview as recall carried them; empty where it carried none.
	Summary  string               `json:"summary"`
	Overview string               `json:"overview"`
	Facts    []*AgentRecalledFact `json:"facts"`
}

AgentRecalledPage is one of those pages.

type AgentRecordLink struct {
	ID       string `json:"id"`
	NodePath string `json:"nodePath"`
	NodeName string `json:"nodeName"`
	NodeKind string `json:"nodeKind"`

	RecordKind     string `json:"recordKind"`
	RecordID       string `json:"recordId"`
	RecordRelation string `json:"recordRelation"`

	// LinkStatus is stated, or proposed where the agent only guessed.
	LinkStatus string `json:"linkStatus"`

	PassageStartMS  int64  `json:"passageStartMS"`
	PassageEndMS    int64  `json:"passageEndMS"`
	TranscriptRunID string `json:"transcriptRunId"`

	// PassageCount is how many passage links of a recording the row stands
	// for, the range above being the first; zero for any other kind.
	PassageCount int `json:"passageCount"`

	Note       string     `json:"note"`
	HappenedAt *time.Time `json:"happenedAt"`
	CreatedAt  time.Time  `json:"createdAt"`

	RecordTitle      string     `json:"recordTitle"`
	RecordHappenedAt *time.Time `json:"recordHappenedAt"`
	DashboardPath    string     `json:"dashboardPath"`
	IsUnavailable    bool       `json:"isUnavailable"`
}

AgentRecordLink is a link from a page to one of the person's own records, with the record found again by the server: its title and date, and the dashboard path that opens it.

func LinkAgentRecord added in v0.154.0

func LinkAgentRecord(ctx context.Context, connection *Client, path, recordKind, recordId, recordRelation string, startMS, endMS int64, transcriptRunId, note string) (*AgentRecordLink, error)

LinkAgentRecord joins a page to a record of the person's own, stated.

func ReadRecordMemoryLinks(ctx context.Context, connection *Client, recordKind, recordId string, startMS, endMS int64) ([]*AgentRecordLink, error)

ReadRecordMemoryLinks is the pages that link to one record; for a passage of a recording, the range narrows it to the passages that overlap.

type AgentRecordLinks struct {
	RecordLinks     []*AgentRecordLink `json:"recordLinks"`
	RecordLinkCount int                `json:"recordLinkCount"`
	NextOffset      int                `json:"nextOffset"`
}

AgentRecordLinks is a part of a page's record links.

func ListAgentRecordLinks(ctx context.Context, connection *Client, path string, first, offset int) (*AgentRecordLinks, error)

ListAgentRecordLinks is first of a page's record links past offset; zero first is as many as the server gives at once.

type AgentReference

type AgentReference struct {
	ItemID   string `json:"itemId,omitempty"`
	ThreadID string `json:"threadId,omitempty"`
	Subject  string `json:"subject,omitempty"`
	From     string `json:"from,omitempty"`

	// RecordingID is a recording the person asks about; the server reads
	// its title into RecordingTitle, and refuses one that is not theirs.
	RecordingID    string `json:"recordingId,omitempty"`
	RecordingTitle string `json:"recordingTitle,omitempty"`

	// AgentMessageID is the message replied to; the server reads its words
	// into QuotedRole and QuotedText.
	AgentMessageID string `json:"agentMessageId,omitempty"`
	QuotedRole     string `json:"quotedRole,omitempty"`
	QuotedText     string `json:"quotedText,omitempty"`
}

AgentReference is what the person pointed at with a turn: a thread, a recording, or a message of the conversation they are replying to.

type AgentReply

type AgentReply struct {
	ID          string     `json:"id"`
	CreatedAt   time.Time  `json:"createdAt"`
	ModifiedAt  time.Time  `json:"modifiedAt"`
	AgentID     string     `json:"agentId"`
	MailboxID   string     `json:"mailboxId"`
	MailID      string     `json:"mailId"`
	ThreadID    string     `json:"threadId"`
	DraftItemID string     `json:"draftItemId"`
	RunID       string     `json:"runId"`
	Status      string     `json:"status"`
	Reason      string     `json:"reason"`
	Subject     string     `json:"subject"`
	From        string     `json:"from"`
	To          string     `json:"to"`
	Text        string     `json:"text"`
	SendAfter   *time.Time `json:"sendAfter"`
	SentMailID  string     `json:"sentMailId"`
	SentAt      *time.Time `json:"sentAt"`
}

AgentReply is a reply the agent wrote on the person's behalf.

func CancelAgentReply

func CancelAgentReply(ctx context.Context, connection *Client, replyId string) (*AgentReply, error)

CancelAgentReply cancels a reply the agent is holding.

type AgentReplyPage

type AgentReplyPage struct {
	Replies []*AgentReply `json:"replies"`
	Total   int64         `json:"total"`
}

AgentReplyPage is a page of replies.

func ListAgentReplies

func ListAgentReplies(ctx context.Context, connection *Client, mailboxId, status string, first, offset int) (*AgentReplyPage, error)

ListAgentReplies is the replies the agent wrote, newest first.

type AgentRetrievalPlan added in v0.93.0

type AgentRetrievalPlan struct {
	Searches []string `json:"searches"`
	IsBroad  bool     `json:"isBroad"`
}

AgentRetrievalPlan is a retrieval plan to follow: at most two focused searches, and whether the question is about a whole area.

type AgentRun

type AgentRun struct {
	RunID  string        `json:"runId"`
	Events []*AgentEvent `json:"events"`
	Done   bool          `json:"done"`
}

AgentRun is what happened in a run from a point on.

func ReadAgentRun

func ReadAgentRun(ctx context.Context, connection *Client, runId string, after, wait int) (*AgentRun, error)

ReadAgentRun is the events of a run from a sequence number on, waiting up to wait seconds for more.

type AgentRunFilter

type AgentRunFilter struct {
	JobID string
	Kinds []string
	Query string
}

AgentRunFilter narrows a listing of runs: to the runs one job made, to some kinds of run, or to the titles carrying some words.

type AgentRunSummary

type AgentRunSummary struct {
	ID        string    `json:"id"`
	AgentID   string    `json:"agentId"`
	Title     string    `json:"title"`
	JobID     string    `json:"jobId"`
	JobKind   string    `json:"jobKind"`
	SubjectID string    `json:"subjectId"`
	LastAt    time.Time `json:"lastAt"`
	Usage     struct {
		PromptTokens     int     `json:"promptTokens"`
		CacheReadTokens  int     `json:"cacheReadTokens"`
		CompletionTokens int     `json:"completionTokens"`
		Cost             float64 `json:"cost"`
	} `json:"usage"`
}

AgentRunSummary is one run as a list shows it, with what it cost.

func ListAgentRuns

func ListAgentRuns(ctx context.Context, connection *Client, first, offset int, jobId string) ([]*AgentRunSummary, int64, error)

ListAgentRuns is a page of the transcripts of runs, newest first, and how many there are in all.

func ListAllAgentRuns

func ListAllAgentRuns(ctx context.Context, connection *Client, first, offset int, agentId string) ([]*AgentRunSummary, int64, error)

ListAllAgentRuns is every person's runs, for an operator with agent:act; an agent narrows it to one person's.

func SearchAgentRuns

func SearchAgentRuns(ctx context.Context, connection *Client, first, offset int, filter *AgentRunFilter) ([]*AgentRunSummary, int64, error)

SearchAgentRuns is ListAgentRuns narrowed by a filter.

func SearchAllAgentRuns

func SearchAllAgentRuns(ctx context.Context, connection *Client, first, offset int, agentId string, filter *AgentRunFilter) ([]*AgentRunSummary, int64, error)

SearchAllAgentRuns is ListAllAgentRuns narrowed by a filter.

type AgentSchedule

type AgentSchedule struct {
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	Cron      string     `json:"cron"`
	Prompt    string     `json:"prompt"`
	Deliver   string     `json:"deliver"`
	Enabled   bool       `json:"enabled"`
	LastRunAt *time.Time `json:"lastRunAt"`
	NextRunAt *time.Time `json:"nextRunAt"`
}

AgentSchedule is a prompt the agent runs at set times.

func ListAgentSchedules

func ListAgentSchedules(ctx context.Context, connection *Client) ([]*AgentSchedule, error)

ListAgentSchedules is the person's schedules.

func RunAgentBriefNow

func RunAgentBriefNow(ctx context.Context, connection *Client) (*AgentSchedule, error)

RunAgentBriefNow sends one immediately.

func SaveAgentSchedule

func SaveAgentSchedule(ctx context.Context, connection *Client, scheduleId string, fields map[string]any) (*AgentSchedule, error)

SaveAgentSchedule adds a schedule, or changes one when scheduleId is given.

func SetAgentBrief

func SetAgentBrief(ctx context.Context, connection *Client, enabled bool, at string, days []int) (*AgentSchedule, error)

SetAgentBrief turns the daily brief on or off and says when it comes.

type AgentServer

type AgentServer struct {
	Name            string     `json:"name"`
	Transport       string     `json:"transport"`
	Location        string     `json:"location"`
	Auth            string     `json:"auth"`
	Headless        bool       `json:"headless"`
	Enabled         bool       `json:"enabled"`
	Status          string     `json:"status"`
	LastError       string     `json:"lastError"`
	LastConnectedAt *time.Time `json:"lastConnectedAt"`
	Tools           int        `json:"tools"`
}

AgentServer is a declared server as the person sees it.

func ConnectAgentServer

func ConnectAgentServer(ctx context.Context, connection *Client, server, credential string) (*AgentServer, error)

ConnectAgentServer connects a server with the person's credential.

func DisconnectAgentServer

func DisconnectAgentServer(ctx context.Context, connection *Client, server string) (*AgentServer, error)

DisconnectAgentServer forgets the person's credential for a server.

func FinishAgentServerOAuth

func FinishAgentServerOAuth(ctx context.Context, connection *Client, server, code, state string) (*AgentServer, error)

FinishAgentServerOAuth hands back what the authorization came back with.

func ListAgentServers

func ListAgentServers(ctx context.Context, connection *Client) ([]*AgentServer, error)

ListAgentServers is the declared servers and where the person stands.

type AgentSkill

type AgentSkill struct {
	Name            string            `json:"name"`
	Description     string            `json:"description"`
	Version         string            `json:"version"`
	Publisher       string            `json:"publisher"`
	Enabled         bool              `json:"enabled"`
	Readable        bool              `json:"readable"`
	Problem         string            `json:"problem,omitempty"`
	Secrets         []string          `json:"secrets"`
	PersonalSecrets []string          `json:"personalSecrets"`
	Scope           string            `json:"scope"`
	Tools           []*AgentSkillTool `json:"tools"`
}

AgentSkill is an installed skill.

func InstallAgentSkill

func InstallAgentSkill(ctx context.Context, connection *Client, name string) (*AgentSkill, error)

InstallAgentSkill installs one, or replaces it with a newer version.

func ListAgentSkills

func ListAgentSkills(ctx context.Context, connection *Client) ([]*AgentSkill, error)

ListAgentSkills is what is installed here.

func SetAgentSkillEnabled

func SetAgentSkillEnabled(ctx context.Context, connection *Client, name string, enabled bool) (*AgentSkill, error)

SetAgentSkillEnabled offers a skill's tools or stops offering them.

func SetAgentSkillScope

func SetAgentSkillScope(ctx context.Context, connection *Client, name, scope string) (*AgentSkill, error)

SetAgentSkillScope settles who fills a skill's secrets in: "operator", "person", or empty to leave it to what the skill declares.

type AgentSkillOffer

type AgentSkillOffer struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Version     string   `json:"version"`
	Tags        []string `json:"tags"`
	Installed   string   `json:"installed,omitempty"`
	Newer       bool     `json:"newer"`
}

AgentSkillOffer is one skill the registry publishes.

func SearchAgentSkills

func SearchAgentSkills(ctx context.Context, connection *Client, query string) ([]*AgentSkillOffer, error)

SearchAgentSkills is what the registry offers.

type AgentSkillSecret

type AgentSkillSecret struct {
	Skill       string `json:"skill"`
	Key         string `json:"key"`
	Description string `json:"description"`
	Set         bool   `json:"set"`
}

AgentSkillSecret is one value an installed skill asks a person for.

func ListAgentSkillSecrets

func ListAgentSkillSecrets(ctx context.Context, connection *Client) ([]*AgentSkillSecret, error)

ListAgentSkillSecrets is what the installed skills ask this person for.

func SetAgentSkillSecret

func SetAgentSkillSecret(ctx context.Context, connection *Client, skill, key, value string) (*AgentSkillSecret, error)

SetAgentSkillSecret keeps one of this person's values.

type AgentSkillTool

type AgentSkillTool struct {
	Name          string `json:"name"`
	Description   string `json:"description"`
	Kind          string `json:"kind"`
	NeedsComputer bool   `json:"needsComputer"`
}

AgentSkillTool is one tool a skill declares.

type AgentSource

type AgentSource struct {
	MailboxID string          `json:"mailboxId"`
	Name      string          `json:"name"`
	Addresses []string        `json:"addresses"`
	Policy    json.RawMessage `json:"policy"`
}

AgentSource is one mailbox as a source.

type AgentSourceSecret added in v0.55.0

type AgentSourceSecret struct {
	Key         string `json:"key"`
	Description string `json:"description"`
	IsOptional  bool   `json:"isOptional"`
	IsSet       bool   `json:"isSet"`
}

AgentSourceSecret is one secret a source's type asks for.

func ListAgentKnowledgeSourceSecrets added in v0.55.0

func ListAgentKnowledgeSourceSecrets(ctx context.Context, connection *Client, sourceId string) ([]*AgentSourceSecret, error)

ListAgentKnowledgeSourceSecrets is what a source's type asks for, and whether each is filled in.

func SetAgentKnowledgeSourceSecret added in v0.55.0

func SetAgentKnowledgeSourceSecret(ctx context.Context, connection *Client, sourceId, key, value string) (*AgentSourceSecret, error)

SetAgentKnowledgeSourceSecret keeps one value for a source.

type AgentSourceType added in v0.54.0

type AgentSourceType struct {
	Name        string                    `json:"name"`
	Description string                    `json:"description"`
	Version     string                    `json:"version"`
	Publisher   string                    `json:"publisher"`
	IsLocal     bool                      `json:"isLocal"`
	Reader      string                    `json:"reader"`
	Runs        []string                  `json:"runs"`
	Requires    []string                  `json:"requires"`
	Settings    []*AgentSourceTypeSetting `json:"settings"`
	Secrets     []*AgentSourceSecret      `json:"secrets"`
	Guide       string                    `json:"guide"`
	Readable    bool                      `json:"readable"`
	Problem     string                    `json:"problem,omitempty"`
}

AgentSourceType is an installed source type.

func AddLocalAgentSourceType added in v0.54.0

func AddLocalAgentSourceType(ctx context.Context, connection *Client, content string) (*AgentSourceType, error)

AddLocalAgentSourceType adds the operator's own file as a local type.

func InstallAgentSourceType added in v0.54.0

func InstallAgentSourceType(ctx context.Context, connection *Client, name string) (*AgentSourceType, error)

InstallAgentSourceType installs one, or replaces it with a newer version.

func ListAgentSourceTypes added in v0.54.0

func ListAgentSourceTypes(ctx context.Context, connection *Client) ([]*AgentSourceType, error)

ListAgentSourceTypes is what is installed here.

type AgentSourceTypeOffer added in v0.54.0

type AgentSourceTypeOffer struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Version     string   `json:"version"`
	Tags        []string `json:"tags"`
	Installed   string   `json:"installed,omitempty"`
	Newer       bool     `json:"newer"`
}

AgentSourceTypeOffer is one type the registry publishes.

func SearchAgentSourceTypes added in v0.54.0

func SearchAgentSourceTypes(ctx context.Context, connection *Client, query string) ([]*AgentSourceTypeOffer, error)

SearchAgentSourceTypes is what the registry offers.

type AgentSourceTypeSetting added in v0.54.0

type AgentSourceTypeSetting struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	SettingType string          `json:"settingType"`
	Pattern     string          `json:"pattern"`
	ItemPattern string          `json:"itemPattern"`
	Default     json.RawMessage `json:"default"`
	IsRequired  bool            `json:"isRequired"`
	Minimum     *int            `json:"minimum"`
	Maximum     *int            `json:"maximum"`
}

AgentSourceTypeSetting is one setting a type asks for.

type AgentSummary

type AgentSummary struct {
	AgentID            string         `json:"agentId"`
	UserID             string         `json:"userId"`
	Username           string         `json:"username"`
	Name               string         `json:"name"`
	Enabled            bool           `json:"enabled"`
	OperatorDisabledAt *time.Time     `json:"operatorDisabledAt"`
	DailyTokens        int64          `json:"dailyTokens"`
	DailyCost          float64        `json:"dailyCost"`
	Sources            []*AgentSource `json:"sources"`
	Today              *AgentBudget   `json:"today"`
	LastRunAt          *time.Time     `json:"lastRunAt"`
	Dead               int64          `json:"dead"`
	Queued             int64          `json:"queued"`
}

AgentSummary is one person's agent as an operator sees it.

func ListAgents

func ListAgents(ctx context.Context, connection *Client) ([]*AgentSummary, error)

ListAgents is every person's agent, for an operator.

func SetAgentDisabled

func SetAgentDisabled(ctx context.Context, connection *Client, agentId string, disabled bool) (*AgentSummary, error)

SetAgentDisabled switches a person's agent off or on.

func SetAgentLimit

func SetAgentLimit(ctx context.Context, connection *Client, agentId string, dailyTokens *int64, dailyCost *float64) (*AgentSummary, error)

SetAgentLimit sets one person's daily budget. SetAgentLimit changes a person's daily budget. A nil budget is left as it is, so one can be set without clearing the other.

type AgentTodo

type AgentTodo struct {
	ID             string     `json:"id"`
	ConversationID string     `json:"conversationId"`
	Text           string     `json:"text"`
	CreatedAt      time.Time  `json:"createdAt"`
	DoneAt         *time.Time `json:"doneAt"`
}

AgentTodo is one item of a conversation's task list.

type AgentTool

type AgentTool struct {
	Name        string `json:"name"`
	Family      string `json:"family"`
	Risk        string `json:"risk"`
	Description string `json:"description"`
	Confirms    bool   `json:"confirms"`
	Core        bool   `json:"core"`
}

AgentTool is one tool as the caller sees it.

func ListAgentTools

func ListAgentTools(ctx context.Context, connection *Client) ([]*AgentTool, error)

ListAgentTools is the catalog as the caller sees it.

type AgentToolCall

type AgentToolCall struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

AgentToolCall is a tool the model asked for.

type AgentTurn

type AgentTurn struct {
	RunID          string `json:"runId"`
	ConversationID string `json:"conversationId"`
}

AgentTurn is the run a turn started.

func AskAgent

func AskAgent(ctx context.Context, connection *Client, conversationId, message, surface string) (*AgentTurn, error)

AskAgent says something to the agent and returns the run to follow. A read-only client asks with every changing tool left out, which is why it may send this one mutation.

func AskAgentWith

func AskAgentWith(ctx context.Context, connection *Client, request *AskAgentRequest) (*AgentTurn, error)

AskAgentWith is AskAgent with files and references.

type AgentUsageNote

type AgentUsageNote struct {
	Model            string `json:"model"`
	Kind             string `json:"kind"`
	PromptTokens     int    `json:"promptTokens"`
	CompletionTokens int    `json:"completionTokens"`
}

AgentUsageNote is what one model call cost.

type AgentUsageRow

type AgentUsageRow struct {
	Key      string  `json:"key"`
	Cost     float64 `json:"cost"`
	Currency string  `json:"currency"`

	// BilledAmount is what the provider billed, in BilledCurrencyCode;
	// nil when no bill was read for the period. Only the server's usage has it.
	BilledAmount       *float64 `json:"billedAmount"`
	BilledCurrencyCode string   `json:"billedCurrencyCode"`
	Totals             struct {
		PromptTokens     int64 `json:"promptTokens"`
		CompletionTokens int64 `json:"completionTokens"`
		CacheReadTokens  int64 `json:"cacheReadTokens"`
		CacheWriteTokens int64 `json:"cacheWriteTokens"`
		AudioInputTokens int64 `json:"audioInputTokens"`
		Calls            int64 `json:"calls"`
	} `json:"totals"`
}

AgentUsageRow is totals under one key.

func AgentServerUsage

func AgentServerUsage(ctx context.Context, connection *Client, since *time.Time, by string) ([]*AgentUsageRow, error)

AgentServerUsage is token use across the server, for an operator.

func AgentUsage

func AgentUsage(ctx context.Context, connection *Client, since *time.Time, by string) ([]*AgentUsageRow, error)

AgentUsage is the caller's own token use.

type AgentView

type AgentView struct {
	Agent       json.RawMessage    `json:"agent"`
	Sources     []*AgentSource     `json:"sources"`
	Collections []*AgentCollection `json:"collections"`
	Allowed     map[string]bool    `json:"allowed"`
	Budget      *AgentBudget       `json:"budget"`
	Choices     []string           `json:"choices"`
	Timezone    string             `json:"timezone"`
	Language    string             `json:"language"`
	// KnowledgeLanguage is what the agent's notes are written in.
	KnowledgeLanguage string   `json:"knowledgeLanguage"`
	Categories        []string `json:"categories"`
}

AgentView is what ReadAgent returns.

func GrantAgentMailbox

func GrantAgentMailbox(ctx context.Context, connection *Client, mailboxId string, policy any) (*AgentView, error)

GrantAgentMailbox lets the agent reach a mailbox, with a policy or the stored one.

func GrantAgentSource

func GrantAgentSource(ctx context.Context, connection *Client, kind, id string, granted bool) (*AgentView, error)

GrantAgentSource gives the agent a calendar or an address book, or takes it back.

func ReadAgent

func ReadAgent(ctx context.Context, connection *Client) (*AgentView, error)

ReadAgent returns the caller's agent and sources.

func RevokeAgentMailbox

func RevokeAgentMailbox(ctx context.Context, connection *Client, mailboxId string) (*AgentView, error)

RevokeAgentMailbox stops the agent reaching a mailbox.

func UpdateAgent

func UpdateAgent(ctx context.Context, connection *Client, variables map[string]any) (*AgentView, error)

UpdateAgent changes the caller's agent; variables are the mutation's arguments by name.

type AgentWaiting added in v0.130.0

type AgentWaiting struct {
	WaitingCount int                        `json:"waitingCount"`
	Interactions []*AgentWaitingInteraction `json:"interactions"`
}

AgentWaiting is what waits for the person across every conversation.

func ReadAgentWaiting added in v0.130.0

func ReadAgentWaiting(ctx context.Context, connection *Client, first int) (*AgentWaiting, error)

ReadAgentWaiting is how many questions and approvals wait for the person, and the newest `first` of them.

type AgentWaitingInteraction added in v0.130.0

type AgentWaitingInteraction struct {
	ID                 string    `json:"id"`
	ConversationID     string    `json:"conversationId"`
	RunID              string    `json:"runId"`
	CallID             string    `json:"callId"`
	InteractionKind    string    `json:"interactionKind"`
	ToolName           string    `json:"toolName"`
	InteractionText    string    `json:"interactionText"`
	InteractionChoices []string  `json:"interactionChoices"`
	CreatedAt          time.Time `json:"createdAt"`
}

AgentWaitingInteraction is a question or an approval the agent put to the person and is still waiting on.

type Alias

type Alias struct {
	ID         string      `json:"id"`
	Pattern    string      `json:"pattern"`
	Comment    string      `json:"comment"`
	Kind       string      `json:"kind"`
	Email      string      `json:"email"`
	Webhook    string      `json:"webhook"`
	MailServer *MailServer `json:"mailServer"`
	MailboxID  string      `json:"mailboxId"`
	Disabled   bool        `json:"disabled"`
}

Alias matches recipient addresses and says where the mail goes.

func CreateAlias

func CreateAlias(ctx context.Context, connection *Client, domainId string, parameters *AliasParameters) (*Alias, error)

CreateAlias adds an alias to a domain.

func ListAliases

func ListAliases(ctx context.Context, connection *Client, domainId string) ([]*Alias, error)

ListAliases returns a domain's aliases in the order they are evaluated.

func MatchAliases

func MatchAliases(ctx context.Context, connection *Client, domainId, address string) ([]*Alias, error)

MatchAliases returns the aliases an address would match.

func UpdateAlias

func UpdateAlias(ctx context.Context, connection *Client, aliasId string, parameters *AliasParameters) (*Alias, error)

UpdateAlias changes an alias.

func (*Alias) Destination

func (self *Alias) Destination() string

Destination is where an alias sends mail, as one string for a table.

type AliasParameters

type AliasParameters struct {
	Pattern    string                `json:"pattern"`
	Comment    *string               `json:"comment,omitempty"`
	Kind       string                `json:"kind"`
	Email      *string               `json:"email,omitempty"`
	Webhook    *string               `json:"webhook,omitempty"`
	MailServer *MailServerParameters `json:"mailServer,omitempty"`
	MailboxID  *string               `json:"mailboxId,omitempty"`
	Disabled   *bool                 `json:"disabled,omitempty"`
}

AliasParameters are the settings of an alias an operator can set. Pattern and Kind left empty keep what is stored; the pointers left nil do too.

type App added in v0.53.0

type App struct {
	ClientID       string     `json:"clientId"`
	Name           string     `json:"name"`
	RegisteredName string     `json:"registeredName"`
	RedirectHosts  []string   `json:"redirectHosts"`
	Registered     *time.Time `json:"registered"`
	LastUsed       *time.Time `json:"lastUsed"`
	LastUsedIP     string     `json:"lastUsedIp"`
	Expires        *time.Time `json:"expires"`
	RenewableUntil *time.Time `json:"renewableUntil"`
	TokenCount     int        `json:"tokenCount"`
}

App is a program somebody authorized, holding a token of theirs that it renews by itself.

func ListApps added in v0.53.0

func ListApps(ctx context.Context, connection *Client, username string) ([]*App, error)

ListApps returns the apps holding a token of the account this client is authenticated as, or of username on the console.

type Argument

type Argument struct {
	Name        string
	Description string
	Type        *TypeReference
}

Argument is one argument of an operation or input object field.

type AskAgentRequest

type AskAgentRequest struct {
	ConversationID string
	Message        string
	Surface        string
	AttachmentIDs  []string
	References     []AgentReference

	// Effort is how hard the model thinks: low, medium or high; empty
	// leaves it to the agent.
	Effort string
}

AskAgentRequest is one turn with everything that may come with it.

type Asset added in v0.87.0

type Asset struct {
	ID                  string           `json:"id"`
	AssetName           string           `json:"assetName"`
	AssetKind           string           `json:"assetKind"`
	IsLiability         bool             `json:"isLiability"`
	CurrencyCode        string           `json:"currencyCode"`
	FinanceAccountID    string           `json:"financeAccountId,omitempty"`
	FinanceSecurityID   string           `json:"financeSecurityId,omitempty"`
	FinanceSecurity     *FinanceSecurity `json:"financeSecurity,omitempty"`
	ValuationSource     string           `json:"valuationSource"`
	EstimateDescription string           `json:"estimateDescription,omitempty"`
	IsEstimateAllowed   bool             `json:"isEstimateAllowed"`
	ClosedOn            string           `json:"closedOn,omitempty"`
	LatestValuation     *AssetValuation  `json:"latestValuation,omitempty"`
}

Asset is anything that counts toward net worth, what is owed included.

type AssetHistory added in v0.87.0

type AssetHistory struct {
	Asset           *Asset            `json:"asset"`
	AssetValuations []*AssetValuation `json:"assetValuations"`
}

AssetHistory is one asset and its valuations, newest day first.

type AssetValuation added in v0.87.0

type AssetValuation struct {
	ID              string   `json:"id"`
	AssetID         string   `json:"assetId"`
	ValuedOn        string   `json:"valuedOn"`
	Value           string   `json:"value"`
	CurrencyCode    string   `json:"currencyCode"`
	ValuationSource string   `json:"valuationSource"`
	EstimateLow     string   `json:"estimateLow,omitempty"`
	EstimateHigh    string   `json:"estimateHigh,omitempty"`
	ValuationNote   string   `json:"valuationNote,omitempty"`
	EvidenceURLs    []string `json:"evidenceUrls"`
	HeldQuantity    string   `json:"heldQuantity,omitempty"`
	UnitPrice       string   `json:"unitPrice,omitempty"`
	CostBasis       string   `json:"costBasis,omitempty"`
}

AssetValuation is one value of one asset on one day. ValuationNote and EvidenceURLs may come from web pages the agent read.

type AssistantSetup added in v0.167.0

type AssistantSetup struct {
	Provider       string `json:"provider"`
	DefaultModel   string `json:"defaultModel"`
	EmbeddingModel string `json:"embeddingModel"`
	IsAgentOn      bool   `json:"isAgentOn"`
	NeedsRestart   bool   `json:"needsRestart"`
}

AssistantSetup is what setting up the assistant in one step did.

type Attachment

type Attachment struct {
	Index       int    `json:"index"`
	Filename    string `json:"filename"`
	ContentType string `json:"contentType"`
	Size        int    `json:"size"`
	Inline      bool   `json:"inline"`
}

Attachment is a file attached to a message.

type AttachmentParameters

type AttachmentParameters struct {
	Filename    string `json:"filename"`
	ContentType string `json:"contentType,omitempty"`
	Content     []byte `json:"content"`
}

AttachmentParameters is a file to attach to a message being sent.

type AuditEvent

type AuditEvent struct {
	ID          string    `json:"id"`
	CreatedAt   time.Time `json:"createdAt"`
	ActorKind   string    `json:"actorKind"`
	ActorUserID string    `json:"actorUserId"`
	ActorLabel  string    `json:"actorLabel"`
	TokenID     string    `json:"tokenId"`

	// ImpersonatorLabel is the operator who was signed in as the actor,
	// when one was.
	ImpersonatorLabel string          `json:"impersonatorLabel"`
	SourceIP          string          `json:"sourceIp"`
	ResourceType      string          `json:"resourceType"`
	ResourceID        string          `json:"resourceId"`
	Action            string          `json:"action"`
	Before            json.RawMessage `json:"before"`
	After             json.RawMessage `json:"after"`
}

AuditEvent is one administrative change: who made it, to what, and the row before and after.

type AuditEventPage

type AuditEventPage struct {
	Events []*AuditEvent `json:"events"`
	Total  int           `json:"total"`
}

AuditEventPage is a page of the audit log, and how many there are in all.

func ListAuditEvents

func ListAuditEvents(ctx context.Context, connection *Client, filter *AuditFilter) (*AuditEventPage, error)

ListAuditEvents returns a page of the audit log, newest first.

type AuditFilter

type AuditFilter struct {
	ResourceType string
	ResourceID   string
	ActorUserID  string
	Since        *time.Time
	Until        *time.Time
	First        int
	Offset       int
}

AuditFilter narrows the audit log.

type Budget added in v0.87.0

type Budget struct {
	ID                 string `json:"id"`
	SpendingCategoryID string `json:"spendingCategoryId"`
	MonthlyAmount      string `json:"monthlyAmount"`
	CurrencyCode       string `json:"currencyCode"`
	EffectiveFrom      string `json:"effectiveFrom"`
}

Budget is an amount for one spending category for each month from a month on.

type BudgetStatus added in v0.87.0

type BudgetStatus struct {
	Month              string                          `json:"month"`
	AsOf               string                          `json:"asOf"`
	DayOfMonth         int                             `json:"dayOfMonth"`
	DaysInMonth        int                             `json:"daysInMonth"`
	Year               string                          `json:"year"`
	MonthsElapsedCount int                             `json:"monthsElapsedCount"`
	DayOfYear          int                             `json:"dayOfYear"`
	DaysInYear         int                             `json:"daysInYear"`
	SpendingCategories []*SpendingCategoryBudgetStatus `json:"spendingCategories"`
	IncomeCategories   []*IncomeCategoryBudgetStatus   `json:"incomeCategories"`
}

BudgetStatus is every spending category with a budget in a month, or in any month of a year: the spending budgets, and the income budgets apart.

type Calendar

type Calendar struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Colour      string `json:"colour,omitempty"`
	Timezone    string `json:"timezone,omitempty"`
	WeekStart   string `json:"weekStart,omitempty"`
	Events      int    `json:"events"`

	// CalendarKind is what it holds: events, or reminders.
	CalendarKind string `json:"calendarKind"`

	// AgentGranted says the person has given their agent this one.
	AgentGranted bool `json:"agentGranted"`
}

Calendar is one calendar and how much is in it.

func ListCalendars

func ListCalendars(ctx context.Context, connection *Client) ([]*Calendar, error)

ListCalendars are the caller's. An account that has never had one is given one by the server when it first looks.

func SaveCalendar

func SaveCalendar(ctx context.Context, connection *Client, id, name, description, colour, timezone, weekStart string) (*Calendar, error)

SaveCalendar renames one, or changes how it is shown.

type CalendarAttendee

type CalendarAttendee struct {
	Address       string `json:"address"`
	Name          string `json:"name,omitempty"`
	Participation string `json:"participation,omitempty"`
	Role          string `json:"role,omitempty"`
}

CalendarAttendee is one person asked to an event.

type CalendarEvent

type CalendarEvent struct {
	ID         string `json:"id"`
	CalendarID string `json:"calendarId"`
	UID        string `json:"uid"`
	ETag       string `json:"etag,omitempty"`

	Summary     string `json:"summary,omitempty"`
	Location    string `json:"location,omitempty"`
	Description string `json:"description,omitempty"`

	StartsAt string `json:"startsAt"`
	EndsAt   string `json:"endsAt"`
	AllDay   bool   `json:"allDay"`

	Recurring  bool   `json:"recurring"`
	Recurrence string `json:"recurrence,omitempty"`
	Occurrence bool   `json:"occurrence"`

	Status   string `json:"status,omitempty"`
	Timezone string `json:"timezone,omitempty"`

	Organizer string              `json:"organizer,omitempty"`
	Attendees []*CalendarAttendee `json:"attendees,omitempty"`

	File string `json:"file,omitempty"`
}

CalendarEvent is one entry. In a listing it is one time something happens, so an event that repeats weekly appears once for each week in the window; StartsAt and EndsAt are that occurrence rather than the event's own first time. File is the whole of it and comes back only when one is asked for.

func GetCalendarEvent

func GetCalendarEvent(ctx context.Context, connection *Client, calendarId, id string) (*CalendarEvent, error)

GetCalendarEvent is one event, with the file as it is stored.

func ListCalendarEvents

func ListCalendarEvents(ctx context.Context, connection *Client, calendarId, from, until string) ([]*CalendarEvent, error)

ListCalendarEvents is what is on between two moments, written as RFC 3339.

func SaveCalendarEvent

func SaveCalendarEvent(ctx context.Context, connection *Client, fields *SaveCalendarEventFields) (*CalendarEvent, error)

SaveCalendarEvent keeps one, or changes one that is kept.

type CalendarRequest added in v0.48.0

type CalendarRequest struct {
	RequestID   string    `json:"requestId"`
	CalendarID  string    `json:"calendarId"`
	ObjectID    string    `json:"objectId"`
	Operation   string    `json:"operation"`
	CompletedAt time.Time `json:"completedAt"`
	IsMissing   bool      `json:"isMissing"`
}

CalendarRequest identifies a committed change even when its event was deleted.

func CancelCalendarRequest added in v0.48.0

func CancelCalendarRequest(ctx context.Context, connection *Client, requestId string) (*CalendarRequest, error)

CancelCalendarRequest stops future execution or returns an already completed change. It never undoes the event or mail belonging to a completed request.

func GetCalendarRequest added in v0.48.0

func GetCalendarRequest(ctx context.Context, connection *Client, requestId string) (*CalendarRequest, error)

GetCalendarRequest looks up completion without repeating the original mutation. A nil receipt does not prove that an in-flight request will never commit.

type CashFlow added in v0.87.0

type CashFlow struct {
	FromMonth                string           `json:"fromMonth"`
	ToMonth                  string           `json:"toMonth"`
	CurrencyCashFlowMonths   []*CashFlowMonth `json:"currencyCashFlowMonths"`
	ReportingCurrencyCode    string           `json:"reportingCurrencyCode,omitempty"`
	CashFlowMonths           []*CashFlowMonth `json:"cashFlowMonths"`
	UnconvertedCurrencyCodes []string         `json:"unconvertedCurrencyCodes"`
}

CashFlow is income and spending per month, per currency and converted.

type CashFlowMonth added in v0.87.0

type CashFlowMonth struct {
	CashFlowMonth  string `json:"cashFlowMonth"`
	CurrencyCode   string `json:"currencyCode,omitempty"`
	IncomeAmount   string `json:"incomeAmount"`
	SpendingAmount string `json:"spendingAmount"`
	NetAmount      string `json:"netAmount"`
}

CashFlowMonth is one month's income, spending and difference, in one currency (CurrencyCode empty when it is the reporting currency's).

type CategorizedTransaction added in v0.87.0

type CategorizedTransaction struct {
	FinanceTransaction *FinanceTransaction `json:"financeTransaction"`
	SpendingRule       *SpendingRule       `json:"spendingRule,omitempty"`
}

CategorizedTransaction is a finance transaction as categorized, and the spending rule made for its merchant, when one was asked for.

type CategorizedTransactions added in v0.103.0

type CategorizedTransactions struct {
	FinanceTransactions []*FinanceTransaction `json:"financeTransactions"`
	SpendingRules       []*SpendingRule       `json:"spendingRules"`
}

CategorizedTransactions are finance transactions categorized together, and the spending rules saved for them, when they were asked for.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a connection to one server's API.

func Local

func Local(configuration *config.Configuration, readOnly bool) (*Client, error)

Local builds a Client for the server described by a configuration file, connecting over the loopback interface and authenticating with a token minted from the server secret.

This is what "teanode credential add" uses when it is run on the server, and the reason no token has to be set up before the tool is usable there. readOnly refuses mutations, as it does for a client over the network.

func New

func New(options Options) (*Client, error)

New builds a Client.

func (*Client) CaptureRecording added in v0.154.0

func (self *Client) CaptureRecording(ctx context.Context, pcm io.Reader, options RecordingCaptureOptions) (*models.Recording, error)

CaptureRecording records audio read from pcm (mono 16-bit little-endian at RecordingCaptureSampleRate) as a new capture, the way the dashboard and the iPhone do: cut into pieces by RecordingCutPolicy, each uploaded and verified while the capture goes on, then stopped when pcm ends or ctx is done. The pieces are uploaded under their own context, so stopping never drops one.

func (*Client) CompleteRecordingUpload added in v0.142.0

func (self *Client) CompleteRecordingUpload(ctx context.Context, expected *models.RecordingMedia) (*models.RecordingMedia, error)

CompleteRecordingUpload verifies the whole-file receipt before a caller may release its local source. A missing or mismatched receipt is never success.

func (*Client) CreateDeviceSetupProfile added in v0.148.0

func (self *Client) CreateDeviceSetupProfile(ctx context.Context, selectedServices map[string]any) (*CreatedDeviceSetupProfile, error)

func (*Client) DeviceSetupCapabilities added in v0.148.0

func (self *Client) DeviceSetupCapabilities(ctx context.Context) (*DeviceSetupCapabilities, error)

func (*Client) Download

func (self *Client) Download(ctx context.Context, path string) (*http.Response, error)

Download fetches something that is a file rather than a GraphQL reply — the raw source of a stored message — with the same credentials. The caller closes the body. A reply that is not a success is returned as an error, so that a "not found" page is never saved as though it were the file.

func (*Client) DownloadRecordingMedia added in v0.143.0

func (self *Client) DownloadRecordingMedia(ctx context.Context, media *models.RecordingMedia, destination io.Writer) error

DownloadRecordingMedia verifies unchanged bytes against an owned manifest. A caller must discard its destination on error rather than publish a partial file.

func (*Client) DownloadRecordingPlayback added in v0.150.0

func (self *Client) DownloadRecordingPlayback(ctx context.Context, playback *RecordingPlayback, destination io.Writer) error

DownloadRecordingPlayback verifies ready preview bytes using bounded memory. Discard the destination on failure, as with DownloadRecordingMedia.

func (*Client) Execute

func (self *Client) Execute(ctx context.Context, query string, variables map[string]any, result any) error

Execute runs a query or mutation and decodes the data into result, which should be a pointer to a struct with the field names the query selects.

func (*Client) ImportRecordingFile added in v0.143.0

func (self *Client) ImportRecordingFile(ctx context.Context, source io.ReadSeeker, filename, contentType, recordingTitle, clientRecordingId string) (*RecordingView, error)

ImportRecordingFile preserves a seekable original with bounded transport memory. The caller retains the file on every outcome. Stable IDs make retries resume the same source, including a server receipt lost during a disconnected upload.

func (*Client) PostJSON

func (self *Client) PostJSON(ctx context.Context, path string, body []byte) (*http.Response, error)

PostJSON sends a JSON body to a path beside the GraphQL endpoint and hands back what came of it, with the same credentials and the same verification of the server's certificate.

For an endpoint that is not GraphQL and is not a file: the Model Context Protocol, whose messages are JSON-RPC and whose answers are the same. The caller closes the body and reads whatever status came back, because this protocol says things in the body that HTTP would say with a code.

func (*Client) PutRecordingPart added in v0.142.0

func (self *Client) PutRecordingPart(ctx context.Context, mediaId string, partIndex int, content []byte) (*models.RecordingMediaPart, error)

PutRecordingPart sends bounded unchanged bytes and validates the durable receipt.

func (*Client) ReadOnly

func (self *Client) ReadOnly() bool

ReadOnly says whether this client refuses mutations.

func (*Client) ResumeRecordingFile added in v0.143.0

func (self *Client) ResumeRecordingFile(ctx context.Context, source io.ReadSeeker, expected *models.RecordingMedia) (*RecordingView, error)

ResumeRecordingFile uploads only the exact retained original of an existing recording.

func (*Client) ServiceCapabilities added in v0.139.0

func (self *Client) ServiceCapabilities(ctx context.Context) (*ServiceCapabilities, error)

func (*Client) SetTimeout added in v0.66.0

func (self *Client) SetTimeout(timeout time.Duration)

SetTimeout changes how long a single request may take, for the few that run a whole agent turn before they answer.

func (*Client) SetUpAssistant added in v0.167.0

func (self *Client) SetUpAssistant(ctx context.Context, variables map[string]any) (*AssistantSetup, error)

func (*Client) Token

func (self *Client) Token() string

Token is what this client signs in with, for a connection made beside it, such as a websocket.

func (*Client) URL

func (self *Client) URL() string

URL returns the server this client talks to.

func (*Client) UpdateServices added in v0.139.0

func (self *Client) UpdateServices(ctx context.Context, selectedServices map[string]any) (*ServiceCapabilities, error)

func (*Client) Upload

func (self *Client) Upload(ctx context.Context, path, field, filename string, content []byte) (*http.Response, error)

Upload sends a file to an endpoint that takes one, as a multipart form with the file under the given field. The counterpart of Download, and the only way to reach the parts of the API that take a file rather than arguments: a logo is bytes, and bytes are not a GraphQL argument.

The reply is returned as it came, since callers read a small JSON object out of it — the address to publish, or the reason the file was refused.

type ConfirmedSpendingRule added in v0.103.0

type ConfirmedSpendingRule struct {
	MatchText             string `json:"matchText"`
	SpendingCategoryID    string `json:"spendingCategoryId"`
	AheadOfSpendingRuleID string `json:"aheadOfSpendingRuleId,omitempty"`
}

ConfirmedSpendingRule is a proposed spending rule as it is sent back to CategorizeTransactions to be saved.

type ConnectionError

type ConnectionError struct {
	URL   string
	Cause error
}

ConnectionError means the server could not be reached at all, which is a different question from what it answered.

func (*ConnectionError) Error

func (self *ConnectionError) Error() string

func (*ConnectionError) Unwrap

func (self *ConnectionError) Unwrap() error

type Contact

type Contact struct {
	ID           string     `json:"id"`
	UID          string     `json:"uid"`
	ETag         string     `json:"etag"`
	Name         string     `json:"name,omitempty"`
	Organization string     `json:"organization,omitempty"`
	Emails       []string   `json:"emails"`
	Phones       []string   `json:"phones"`
	Addresses    []*Address `json:"addresses,omitempty"`
	Note         string     `json:"note,omitempty"`
	HasPhoto     bool       `json:"hasPhoto"`
	Card         string     `json:"card,omitempty"`
}

Contact is one person kept in an address book. Card is the whole of it and comes back only when one contact is asked for by name.

func GetContact

func GetContact(ctx context.Context, connection *Client, id string) (*Contact, error)

GetContact is one contact, with its card.

func ListContacts

func ListContacts(ctx context.Context, connection *Client, addressBookId, query string, first int) ([]*Contact, error)

ListContacts are the contacts in one book, narrowed by a query when there is one.

func SaveContact

func SaveContact(ctx context.Context, connection *Client, fields *SaveContactFields) (*Contact, error)

SaveContact keeps one, or changes one that is kept.

type CreatedAppPassword

type CreatedAppPassword struct {
	AppPassword *MailboxAppPassword `json:"appPassword"`
	Password    string              `json:"password"`
	Username    string              `json:"username"`
}

CreatedAppPassword is an app password at the one moment its secret is known: the server keeps only a hash of it.

func CreateMailboxAppPassword

func CreateMailboxAppPassword(ctx context.Context, connection *Client, mailboxId, name string) (*CreatedAppPassword, error)

CreateMailboxAppPassword makes an app password for a device. The password is in the reply and nowhere else, ever.

type CreatedCredential

type CreatedCredential struct {
	Credential *Credential `json:"credential"`
	Host       string      `json:"host"`
	Port       string      `json:"port"`
	Username   string      `json:"username"`
	Password   string      `json:"password"`
}

CreatedCredential is a new credential with the settings to enter into a mail client.

func CreateCredential

func CreateCredential(ctx context.Context, connection *Client, domainId string, parameters *CredentialParameters) (*CreatedCredential, error)

CreateCredential issues a credential for a domain.

type CreatedDeviceSetupProfile added in v0.148.0

type CreatedDeviceSetupProfile struct {
	DownloadPath       string                 `json:"downloadPath"`
	DownloadLink       string                 `json:"downloadLink"`
	QRCodeSVG          string                 `json:"qrCodeSvg"`
	ExpiresAt          time.Time              `json:"expiresAt"`
	MailboxAppPassword *MailboxAppPassword    `json:"mailboxAppPassword"`
	SyncCredential     *models.SyncCredential `json:"syncCredential"`
}

CreatedDeviceSetupProfile holds the one-use download and separate revocation metadata.

type CreatedSetupProfile added in v0.129.0

type CreatedSetupProfile struct {
	DownloadPath            string              `json:"downloadPath"`
	DownloadLink            string              `json:"downloadLink"`
	ExpiresAt               time.Time           `json:"expiresAt"`
	AppPassword             *MailboxAppPassword `json:"appPassword"`
	HasCalendarsAndContacts bool                `json:"hasCalendarsAndContacts"`
}

CreatedSetupProfile says where a setup profile for a device downloads from, once, before it expires.

func CreateMailboxSetupProfile added in v0.129.0

func CreateMailboxSetupProfile(ctx context.Context, connection *Client, mailboxId, deviceName string, isDownloadOnly bool) (*CreatedSetupProfile, error)

CreateMailboxSetupProfile makes an app password for a device and a setup profile holding it, and says where the profile downloads from, once. isDownloadOnly says the caller downloads it itself rather than showing the link, which lets a server with no name of its own make one.

type Credential

type Credential struct {
	ID       string `json:"id"`
	Comment  string `json:"comment"`
	Alias    string `json:"alias"`
	Disabled bool   `json:"disabled"`
}

Credential may send mail as a domain.

func ListCredentials

func ListCredentials(ctx context.Context, connection *Client, domainId string) ([]*Credential, error)

ListCredentials returns the credentials of one domain.

func UpdateCredential

func UpdateCredential(ctx context.Context, connection *Client, credentialId string, parameters *CredentialParameters) (*Credential, error)

UpdateCredential changes a credential's comment, alias restriction or whether it is refused.

type CredentialParameters

type CredentialParameters struct {
	Comment  *string `json:"comment,omitempty"`
	Alias    *string `json:"alias,omitempty"`
	Disabled *bool   `json:"disabled,omitempty"`
}

CredentialParameters are the settings of a credential an operator can set.

type CredentialSettings

type CredentialSettings struct {
	Host     string `json:"host"`
	Port     string `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
}

CredentialSettings is what to enter into a mail client.

func GetCredentialSettings

func GetCredentialSettings(ctx context.Context, connection *Client, domainId, credentialId string) (*CredentialSettings, error)

GetCredentialSettings returns the SMTP settings for an existing credential, including its password.

type CreditCardUsage added in v0.101.0

type CreditCardUsage struct {
	FinanceAccountID           string     `json:"financeAccountId"`
	AccountName                string     `json:"accountName"`
	AccountMask                string     `json:"accountMask,omitempty"`
	InstitutionName            string     `json:"institutionName,omitempty"`
	CurrencyCode               string     `json:"currencyCode"`
	OwedAmount                 string     `json:"owedAmount,omitempty"`
	CreditLimitAmount          string     `json:"creditLimitAmount,omitempty"`
	CreditLimitSource          string     `json:"creditLimitSource"`
	UsageShare                 *float64   `json:"usageShare,omitempty"`
	ConvertedOwedAmount        string     `json:"convertedOwedAmount,omitempty"`
	ConvertedCreditLimitAmount string     `json:"convertedCreditLimitAmount,omitempty"`
	BalanceAt                  *time.Time `json:"balanceAt,omitempty"`
}

CreditCardUsage is one credit card's owed amount against its credit limit, and where the limit comes from (provider, derived or unknown).

type CreditUsage added in v0.101.0

type CreditUsage struct {
	ReportingCurrencyCode    string             `json:"reportingCurrencyCode,omitempty"`
	UnconvertedCurrencyCodes []string           `json:"unconvertedCurrencyCodes"`
	TotalOwedAmount          string             `json:"totalOwedAmount"`
	TotalCreditLimitAmount   string             `json:"totalCreditLimitAmount"`
	UsageShare               *float64           `json:"usageShare,omitempty"`
	LeftOutCardCount         int                `json:"leftOutCardCount"`
	LeftOutOwedAmount        string             `json:"leftOutOwedAmount"`
	CreditCards              []*CreditCardUsage `json:"creditCards"`
}

CreditUsage is what is owed on the credit cards against their credit limits, overall in the reporting currency and per card.

type CurrencyAmount added in v0.87.0

type CurrencyAmount struct {
	CurrencyCode string `json:"currencyCode"`
	Amount       string `json:"amount"`
}

CurrencyAmount is an amount in one currency.

type CurrencyConversion added in v0.87.0

type CurrencyConversion struct {
	Amount           string `json:"amount"`
	FromCurrencyCode string `json:"fromCurrencyCode"`
	ConvertedAmount  string `json:"convertedAmount"`
	ToCurrencyCode   string `json:"toCurrencyCode"`
	Rate             string `json:"rate"`
	RateOn           string `json:"rateOn"`
	RateSource       string `json:"rateSource"`
}

CurrencyConversion is an amount converted, with its rate and day.

type CurrencyPairRate added in v0.87.0

type CurrencyPairRate struct {
	FromCurrencyCode string `json:"fromCurrencyCode"`
	ToCurrencyCode   string `json:"toCurrencyCode"`
	Rate             string `json:"rate"`
	RateOn           string `json:"rateOn"`
	RateSource       string `json:"rateSource"`
}

CurrencyPairRate is what one unit of one currency bought in another on a published day.

type Delivery

type Delivery struct {
	ID          string     `json:"id"`
	CreatedAt   time.Time  `json:"createdAt"`
	MailID      string     `json:"mailId"`
	DomainID    string     `json:"domainId"`
	AliasID     string     `json:"aliasId"`
	Recipient   string     `json:"recipient"`
	Kind        string     `json:"kind"`
	Status      string     `json:"status"`
	Size        uint64     `json:"size"`
	AttemptedAt *time.Time `json:"attemptedAt"`
	DeliveredAt *time.Time `json:"deliveredAt"`
	DroppedAt   *time.Time `json:"droppedAt"`
	RetryAt     *time.Time `json:"retryAt"`
	Attempts    uint64     `json:"attempts"`
	Error       string     `json:"error"`
}

Delivery is one attempt to pass a message on: to an address, a webhook or another server.

func GetDelivery

func GetDelivery(ctx context.Context, connection *Client, deliveryId string) (*Delivery, error)

GetDelivery returns one delivery.

func ListDeliveries

func ListDeliveries(ctx context.Context, connection *Client, domainId string, first int) ([]*Delivery, error)

ListDeliveries returns a domain's deliveries, newest first.

func ListDeliveriesByMail

func ListDeliveriesByMail(ctx context.Context, connection *Client, mailId string) ([]*Delivery, error)

ListDeliveriesByMail returns every delivery made for one message.

func ListPendingDeliveries

func ListPendingDeliveries(ctx context.Context, connection *Client, domainId string, first int) ([]*Delivery, error)

ListPendingDeliveries returns what has not been delivered yet, for every domain when domainId is empty.

func RetryDelivery

func RetryDelivery(ctx context.Context, connection *Client, deliveryId string) (*Delivery, error)

RetryDelivery asks for a failed or delayed delivery to be tried again now.

type DeviceSetupCapabilities added in v0.148.0

type DeviceSetupCapabilities struct {
	CanSetUpMail      bool       `json:"canSetUpMail"`
	CanSetUpCalendar  bool       `json:"canSetUpCalendar"`
	CanSetUpReminders bool       `json:"canSetUpReminders"`
	CanSetUpContacts  bool       `json:"canSetUpContacts"`
	Mailboxes         []*Mailbox `json:"mailboxes"`
}

DeviceSetupCapabilities lists the account's available services and mailboxes.

type Domain

type Domain struct {
	ID                       string        `json:"id"`
	Domain                   string        `json:"domain"`
	Subdomain                string        `json:"subdomain"`
	Comment                  string        `json:"comment"`
	SpamFilterScoreThreshold float64       `json:"spamFilterScoreThreshold"`
	MailServers              []string      `json:"mailServers"`
	MailHosts                []string      `json:"mailHosts"`
	LinkHost                 string        `json:"linkHost"`
	LinkHostname             string        `json:"linkHostname"`
	DKIMSelector             string        `json:"dkimSelector"`
	HasDKIMKey               bool          `json:"hasDkimKey"`
	Aliases                  []*Alias      `json:"aliases"`
	Credentials              []*Credential `json:"credentials"`
	Records                  *RecordSet    `json:"records"`
}

Domain is a mail domain the server accepts mail for, as the dashboard sees it: the configured settings plus the live state of its DNS records.

func CheckDomain

func CheckDomain(ctx context.Context, connection *Client, domainId string) (*Domain, error)

CheckDomain checks a domain's DNS records now.

func CreateDomain

func CreateDomain(ctx context.Context, connection *Client, parameters *DomainParameters) (*Domain, error)

CreateDomain adds a domain, which the server gives a signing key.

func FindDomain

func FindDomain(ctx context.Context, connection *Client, name string) (*Domain, error)

FindDomain returns the configured domain with this name, matched case insensitively, or nil.

func ListDomains

func ListDomains(ctx context.Context, connection *Client) ([]*Domain, error)

ListDomains returns the configured domains.

func RegenerateDomainKey

func RegenerateDomainKey(ctx context.Context, connection *Client, domainId string) (*Domain, error)

RegenerateDomainKey replaces a domain's signing key.

func UpdateDomain

func UpdateDomain(ctx context.Context, connection *Client, domainId string, parameters *DomainParameters) (*Domain, error)

UpdateDomain changes a domain.

type DomainLogo struct {
	Filename   string    `json:"filename"`
	Title      string    `json:"title"`
	URL        string    `json:"url"`
	PublicURL  string    `json:"publicUrl"`
	UploadedAt time.Time `json:"uploadedAt"`
}

DomainLogo is the mark this server publishes for a domain, when one has been uploaded.

func UploadDomainLogo(ctx context.Context, connection *Client, domainId, filename string, content []byte) (*DomainLogo, error)

UploadDomainLogo publishes a mark for a domain.

Not a schema operation: it sends a file, and the server checks the file against the profile a mark has to satisfy before storing it. A refusal carries the rule that refused it, which is the whole value of checking here rather than leaving a receiver to refuse it silently.

type DomainParameters

type DomainParameters struct {
	Domain                   *string   `json:"domain,omitempty"`
	Subdomain                *string   `json:"subdomain,omitempty"`
	Comment                  *string   `json:"comment,omitempty"`
	SpamFilterScoreThreshold *float64  `json:"spamFilterScoreThreshold,omitempty"`
	MailServers              *[]string `json:"mailServers,omitempty"`
	LinkHost                 *string   `json:"linkHost,omitempty"`
	DKIMSelector             *string   `json:"dkimSelector,omitempty"`
}

DomainParameters are the settings of a domain an operator can change. A nil field is left alone, so an update carries only what it changes.

type DomainSubmission added in v0.48.0

type DomainSubmission struct {
	SubmissionID string    `json:"submissionId"`
	MailID       string    `json:"mailId"`
	AcceptedAt   time.Time `json:"acceptedAt"`
}

DomainSubmission identifies locally accepted mail after the stored copy expires.

func GetDomainSubmission added in v0.48.0

func GetDomainSubmission(ctx context.Context, connection *Client, domainId, submissionId string) (*DomainSubmission, error)

GetDomainSubmission checks this account's send without reading or sending content. A nil result does not prevent an in-flight send from committing later.

type Error

type Error struct {
	Message   string `json:"message"`
	Path      []any  `json:"path,omitempty"`
	Locations []struct {
		Line   int `json:"line"`
		Column int `json:"column"`
	} `json:"locations,omitempty"`
}

Error is a message the server returned for a query.

func (*Error) Error

func (self *Error) Error() string

type Errors

type Errors []*Error

Errors is every error one query returned.

func (Errors) Error

func (self Errors) Error() string

type EvaluationSourceScore added in v0.61.0

type EvaluationSourceScore struct {
	AnswerFrom                    string         `json:"answerFrom"`
	AnsweredCount                 int            `json:"answeredCount"`
	ScorePercent                  float64        `json:"scorePercent"`
	ScorePercentWithoutFiledAfter float64        `json:"scorePercentWithoutFiledAfter"`
	FiledAfterCount               int            `json:"filedAfterCount"`
	VerdictCounts                 map[string]int `json:"verdictCounts"`
}

EvaluationSourceScore is how the answers from one source scored.

type Executor added in v0.87.0

type Executor interface {
	Execute(ctx context.Context, query string, variables map[string]any, result any) error
}

Executor runs a document: a Client, or the agent's operations as the person.

type ExpectedRepeatCharge added in v0.98.1

type ExpectedRepeatCharge struct {
	MerchantName   string `json:"merchantName"`
	ExpectedAmount string `json:"expectedAmount"`
	CurrencyCode   string `json:"currencyCode"`
}

ExpectedRepeatCharge is a merchant that charged a spending category in each of the last three full months, expected to charge it again this month and not seen yet.

type ExternalAddresses

type ExternalAddresses struct {
	IPv4  string `json:"ipv4"`
	IPv6  string `json:"ipv6"`
	Error string `json:"error"`
}

ExternalAddresses is how the outside world reaches this server.

func GetServerAddresses

func GetServerAddresses(ctx context.Context, connection *Client) (*ExternalAddresses, error)

GetServerAddresses returns the addresses the DNS records have to point at.

type Facet

type Facet struct {
	Value string `json:"value"`
	Count int    `json:"count"`
}

Facet is one value a column takes, and how many messages carry it.

func CountMailsBy

func CountMailsBy(ctx context.Context, connection *Client, domainId, field string, filters []Filter) ([]*Facet, error)

CountMailsBy counts messages by the values of one field.

type Field

type Field struct {
	Name        string
	Description string
	Arguments   []*Argument
	Type        *TypeReference
}

Field is one field of an object type.

type Filter

type Filter struct {
	Field string
	Value string

	// Contains matches a substring rather than the whole value, for subjects.
	Contains bool
}

Filter is one equality or substring test on a mail column, for ListMails.

type FinanceAccount added in v0.87.0

type FinanceAccount struct {
	ID                      string     `json:"id"`
	SourceID                string     `json:"sourceId"`
	InstitutionName         string     `json:"institutionName,omitempty"`
	ProviderKind            string     `json:"providerKind"`
	AccountName             string     `json:"accountName"`
	AccountMask             string     `json:"accountMask,omitempty"`
	AccountKind             string     `json:"accountKind"`
	CurrencyCode            string     `json:"currencyCode"`
	CurrentBalance          string     `json:"currentBalance,omitempty"`
	AvailableBalance        string     `json:"availableBalance,omitempty"`
	BalanceAt               *time.Time `json:"balanceAt,omitempty"`
	IsSignInRequired        bool       `json:"isSignInRequired"`
	CreditLimitAmount       string     `json:"creditLimitAmount,omitempty"`
	ReportingCurrencyCode   string     `json:"reportingCurrencyCode,omitempty"`
	ConvertedCurrentBalance string     `json:"convertedCurrentBalance,omitempty"`
	CreatedAt               time.Time  `json:"createdAt"`
	ModifiedAt              time.Time  `json:"modifiedAt"`
}

FinanceAccount is one finance account and its balance.

type FinanceConvertedSummaryRow added in v0.87.0

type FinanceConvertedSummaryRow struct {
	GroupKey   string `json:"groupKey"`
	GroupLabel string `json:"groupLabel"`
	MoneyOut   string `json:"moneyOut"`
	MoneyIn    string `json:"moneyIn"`
}

FinanceConvertedSummaryRow is one group in the reporting currency.

type FinanceCurrencyTotal added in v0.87.0

type FinanceCurrencyTotal struct {
	CurrencyCode            string `json:"currencyCode"`
	MoneyOut                string `json:"moneyOut"`
	MoneyIn                 string `json:"moneyIn"`
	FinanceTransactionCount int    `json:"financeTransactionCount"`
}

FinanceCurrencyTotal is money out and money in in one currency.

type FinanceLinkToken added in v0.87.0

type FinanceLinkToken struct {
	LinkToken string `json:"linkToken"`
	SourceID  string `json:"sourceId,omitempty"`
}

FinanceLinkToken is what the linking page opens Plaid Link with.

type FinanceProvider added in v0.87.0

type FinanceProvider struct {
	ProviderKind      string `json:"providerKind"`
	IsBrowserRequired bool   `json:"isBrowserRequired"`
}

FinanceProvider is one provider people may link through.

type FinanceReceipt added in v0.118.0

type FinanceReceipt struct {
	ID                    string                 `json:"id"`
	ReceiptSourceKind     string                 `json:"receiptSourceKind"`
	MailID                string                 `json:"mailId,omitempty"`
	MailboxItemID         string                 `json:"mailboxItemId,omitempty"`
	GmailMessageID        string                 `json:"gmailMessageId,omitempty"`
	AgentAttachmentID     string                 `json:"agentAttachmentId,omitempty"`
	MerchantName          string                 `json:"merchantName"`
	MerchantReceiptNumber string                 `json:"merchantReceiptNumber,omitempty"`
	PurchasedOn           string                 `json:"purchasedOn,omitempty"`
	PurchasedAt           *time.Time             `json:"purchasedAt,omitempty"`
	CurrencyCode          string                 `json:"currencyCode"`
	SubtotalAmount        string                 `json:"subtotalAmount,omitempty"`
	TotalAmount           string                 `json:"totalAmount"`
	PaymentAccountMask    string                 `json:"paymentAccountMask,omitempty"`
	ReceiptCheckState     string                 `json:"receiptCheckState"`
	CheckDifferenceAmount string                 `json:"checkDifferenceAmount"`
	IsFeeAfterSubtotal    bool                   `json:"isFeeAfterSubtotal"`
	ReceiptLines          []*FinanceReceiptLine  `json:"receiptLines"`
	ReceiptMatches        []*FinanceReceiptMatch `json:"receiptMatches"`
	CreatedAt             time.Time              `json:"createdAt"`
	ModifiedAt            time.Time              `json:"modifiedAt"`
}

FinanceReceipt is one merchant's record of one purchase, stored line by line as printed, checked against its totals and matched to the charges it explains. MailboxItemID is where its message is now, for opening it.

type FinanceReceiptLine added in v0.118.0

type FinanceReceiptLine struct {
	ID                   string `json:"id"`
	LineNumber           int    `json:"lineNumber"`
	ReceiptLineKind      string `json:"receiptLineKind"`
	Description          string `json:"description"`
	Quantity             string `json:"quantity,omitempty"`
	QuantityUnit         string `json:"quantityUnit,omitempty"`
	UnitPriceAmount      string `json:"unitPriceAmount,omitempty"`
	LineAmount           string `json:"lineAmount"`
	TaxClassCode         string `json:"taxClassCode,omitempty"`
	DiscountedLineNumber int    `json:"discountedLineNumber,omitempty"`
	DiscountedLineID     string `json:"discountedLineId,omitempty"`
}

FinanceReceiptLine is one printed line of a receipt, its amount signed as printed.

type FinanceReceiptMatch added in v0.118.0

type FinanceReceiptMatch struct {
	ReceiptID            string    `json:"receiptId"`
	FinanceTransactionID string    `json:"financeTransactionId"`
	MatchedAmount        string    `json:"matchedAmount"`
	ReceiptMatchSource   string    `json:"receiptMatchSource"`
	MatchConfidence      string    `json:"matchConfidence,omitempty"`
	CreatedAt            time.Time `json:"createdAt"`
}

FinanceReceiptMatch is how much of a finance transaction a receipt explains, and what matched them (receipt_matcher or person).

type FinanceReceiptPage added in v0.118.0

type FinanceReceiptPage struct {
	FinanceReceipts []*FinanceReceipt `json:"financeReceipts"`
	NextCursor      string            `json:"nextCursor,omitempty"`
	TotalCount      int               `json:"totalCount"`
}

FinanceReceiptPage is one page of receipts, the cursor for the next, empty on the last, and how many match on every page.

type FinanceSecurity added in v0.88.0

type FinanceSecurity struct {
	ID           string `json:"id"`
	TickerSymbol string `json:"tickerSymbol,omitempty"`
	SecurityName string `json:"securityName"`
	SecurityKind string `json:"securityKind"`
	CurrencyCode string `json:"currencyCode,omitempty"`
	ClosePrice   string `json:"closePrice,omitempty"`
	ClosePriceOn string `json:"closePriceOn,omitempty"`
}

FinanceSecurity is something an investment account can hold, as the provider that reported it describes it.

type FinanceSource added in v0.87.0

type FinanceSource struct {
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	ProviderKind     string            `json:"providerKind"`
	InstitutionID    string            `json:"institutionId,omitempty"`
	InstitutionName  string            `json:"institutionName,omitempty"`
	IsEnabled        bool              `json:"isEnabled"`
	Cron             string            `json:"cron,omitempty"`
	LastRunAt        *time.Time        `json:"lastRunAt,omitempty"`
	NextRunAt        *time.Time        `json:"nextRunAt,omitempty"`
	LastError        string            `json:"lastError,omitempty"`
	IsSignInRequired bool              `json:"isSignInRequired"`
	FinanceAccounts  []*FinanceAccount `json:"financeAccounts"`
	CreatedAt        time.Time         `json:"createdAt"`
}

FinanceSource is one login at one institution through one provider.

type FinanceSpendingSummary added in v0.87.0

type FinanceSpendingSummary struct {
	GroupBy                      string                        `json:"groupBy"`
	SpendingSummaryRows          []*FinanceSpendingSummaryRow  `json:"spendingSummaryRows"`
	CurrencyTotals               []*FinanceCurrencyTotal       `json:"currencyTotals"`
	ReportingCurrencyCode        string                        `json:"reportingCurrencyCode,omitempty"`
	ConvertedSpendingSummaryRows []*FinanceConvertedSummaryRow `json:"convertedSpendingSummaryRows"`
	ConvertedMoneyOut            string                        `json:"convertedMoneyOut,omitempty"`
	ConvertedMoneyIn             string                        `json:"convertedMoneyIn,omitempty"`
	UnconvertedCurrencyCodes     []string                      `json:"unconvertedCurrencyCodes"`
}

FinanceSpendingSummary is a spending summary per currency and converted.

type FinanceSpendingSummaryRow added in v0.87.0

type FinanceSpendingSummaryRow struct {
	GroupKey                string `json:"groupKey"`
	GroupLabel              string `json:"groupLabel"`
	CurrencyCode            string `json:"currencyCode"`
	MoneyOut                string `json:"moneyOut"`
	MoneyIn                 string `json:"moneyIn"`
	FinanceTransactionCount int    `json:"financeTransactionCount"`
}

FinanceSpendingSummaryRow is one group's money out and money in, in one currency.

type FinanceStatementImport added in v0.100.0

type FinanceStatementImport struct {
	ImportedAt                   time.Time `json:"importedAt"`
	StatementImportOrigin        string    `json:"statementImportOrigin"`
	StatementFileNames           []string  `json:"statementFileNames"`
	AddedTransactionCount        int       `json:"addedTransactionCount"`
	UpdatedTransactionCount      int       `json:"updatedTransactionCount"`
	UnchangedTransactionCount    int       `json:"unchangedTransactionCount"`
	SkippedTransactionCount      int       `json:"skippedTransactionCount"`
	TransactionWithoutFITIDCount int       `json:"transactionWithoutFitIdCount"`
	FinanceAccountIDs            []string  `json:"financeAccountIds"`
	FinanceAccountNames          []string  `json:"financeAccountNames"`
	ImportErrorMessage           string    `json:"importErrorMessage,omitempty"`
}

FinanceStatementImport is what one import of statement files did.

type FinanceTrade added in v0.88.0

type FinanceTrade struct {
	ID                string           `json:"id"`
	FinanceAccountID  string           `json:"financeAccountId"`
	FinanceSecurityID string           `json:"financeSecurityId,omitempty"`
	FinanceSecurity   *FinanceSecurity `json:"financeSecurity,omitempty"`
	ProviderTradeID   string           `json:"providerTradeId"`
	TradedOn          string           `json:"tradedOn"`
	TradeKind         string           `json:"tradeKind"`
	TradeSubkind      string           `json:"tradeSubkind,omitempty"`
	TradedQuantity    string           `json:"tradedQuantity,omitempty"`
	UnitPrice         string           `json:"unitPrice,omitempty"`
	TradeAmount       string           `json:"tradeAmount"`
	FeeAmount         string           `json:"feeAmount,omitempty"`
	CurrencyCode      string           `json:"currencyCode"`
	Description       string           `json:"description"`
}

FinanceTrade is one trade in an investment account: a buy, a sell, a cancelled trade or a security moved in or out. Description is written by the institution.

type FinanceTradePage added in v0.88.0

type FinanceTradePage struct {
	FinanceTrades []*FinanceTrade `json:"financeTrades"`
	NextCursor    string          `json:"nextCursor,omitempty"`
	TotalCount    int             `json:"totalCount"`
}

FinanceTradePage is one page of trades and the cursor for the next, empty on the last.

type FinanceTransaction added in v0.87.0

type FinanceTransaction struct {
	ID                       string     `json:"id"`
	FinanceAccountID         string     `json:"financeAccountId"`
	PostedOn                 string     `json:"postedOn"`
	TransactedAt             *time.Time `json:"transactedAt,omitempty"`
	Amount                   string     `json:"amount"`
	CurrencyCode             string     `json:"currencyCode"`
	Description              string     `json:"description"`
	MerchantName             string     `json:"merchantName,omitempty"`
	ProviderCategoryPrimary  string     `json:"providerCategoryPrimary,omitempty"`
	ProviderCategoryDetailed string     `json:"providerCategoryDetailed,omitempty"`
	IsPending                bool       `json:"isPending"`
	SpendingCategoryID       string     `json:"spendingCategoryId,omitempty"`
	CategorizedBy            string     `json:"categorizedBy,omitempty"`
	CategorizationConfidence string     `json:"categorizationConfidence,omitempty"`
	DuplicateOfTransactionID string     `json:"duplicateOfTransactionId,omitempty"`
	DuplicateDecidedBy       string     `json:"duplicateDecidedBy,omitempty"`
	Annotation               string     `json:"annotation,omitempty"`
	AnnotatedBy              string     `json:"annotatedBy,omitempty"`
	ReceiptCount             int        `json:"receiptCount"`
}

FinanceTransaction is one transaction on a finance account. Description and MerchantName are written by whoever charged the account. DuplicateOfTransactionID names the counted copy when it is a mirrored copy, left out of every total, and DuplicateDecidedBy what decided (mirror_detection, or person when the person counted it).

type FinanceTransactionPage added in v0.87.0

type FinanceTransactionPage struct {
	FinanceTransactions   []*FinanceTransaction `json:"financeTransactions"`
	NextCursor            string                `json:"nextCursor,omitempty"`
	TotalCount            int                   `json:"totalCount"`
	LeftOutDuplicateCount int                   `json:"leftOutDuplicateCount"`
}

FinanceTransactionPage is one page of finance transactions, the cursor for the next, empty on the last, how many match on every page, and how many mirrored copies were left out because they were not asked for.

type Group

type Group struct {
	ID          string    `json:"id"`
	CreatedAt   time.Time `json:"createdAt"`
	ModifiedAt  time.Time `json:"modifiedAt"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	IDPGroup    string    `json:"idpGroup"`
	UserIDs     []string  `json:"userIds"`
	RoleIDs     []string  `json:"roleIds"`
	DomainIDs   []string  `json:"domainIds"`
}

Group is a set of people, what they may do, and where. Permissions come from the group's roles; the domain-kind ones apply to the group's domains.

func CreateGroup

func CreateGroup(ctx context.Context, connection *Client, name string, parameters *GroupParameters) (*Group, error)

CreateGroup adds a group.

func ListGroups

func ListGroups(ctx context.Context, connection *Client) ([]*Group, error)

ListGroups returns the groups on this server.

func UpdateGroup

func UpdateGroup(ctx context.Context, connection *Client, groupId string, parameters *GroupParameters) (*Group, error)

UpdateGroup changes a group.

type GroupParameters

type GroupParameters struct {
	Name        *string
	Description *string
	IDPGroup    *string
	UserIDs     *[]string
	RoleIDs     *[]string
	DomainIDs   *[]string
}

GroupParameters is what a group is made or changed with. A nil field is left alone; a list replaces the one stored.

type Header struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Header is one decoded header line.

type ImportedEvaluationQuestion added in v0.61.0

type ImportedEvaluationQuestion struct {
	QuestionKind   string `json:"questionKind,omitempty"`
	QuestionText   string `json:"questionText"`
	ExpectedAnswer string `json:"expectedAnswer"`
	OutdatedAnswer string `json:"outdatedAnswer,omitempty"`
}

ImportedEvaluationQuestion is one question to import.

type IncomeCategoryBudgetStatus added in v0.98.0

type IncomeCategoryBudgetStatus struct {
	SpendingCategoryID             string            `json:"spendingCategoryId"`
	SpendingCategoryName           string            `json:"spendingCategoryName"`
	BudgetAmount                   string            `json:"budgetAmount"`
	CurrencyCode                   string            `json:"currencyCode"`
	BudgetedMonthCount             int               `json:"budgetedMonthCount"`
	FirstBudgetedMonth             string            `json:"firstBudgetedMonth"`
	LastBudgetedMonth              string            `json:"lastBudgetedMonth"`
	IncomeAmount                   string            `json:"incomeAmount"`
	IncomeBySameDayLastMonthAmount string            `json:"incomeBySameDayLastMonthAmount"`
	ExpectedByTodayAmount          string            `json:"expectedByTodayAmount"`
	ProjectedAmount                string            `json:"projectedAmount"`
	IncomePace                     string            `json:"incomePace"`
	UnconvertedIncome              []*CurrencyAmount `json:"unconvertedIncome"`
}

IncomeCategoryBudgetStatus is one income spending category against the income expected of it, in the budget's currency.

type Layout

type Layout struct {
	ID           string               `json:"id"`
	CreatedAt    time.Time            `json:"createdAt"`
	ModifiedAt   time.Time            `json:"modifiedAt"`
	DomainID     string               `json:"domainId"`
	Comment      string               `json:"comment"`
	Locale       string               `json:"locale"`
	HTMLContent  string               `json:"htmlContent"`
	TextContent  string               `json:"textContent"`
	Translations []*LayoutTranslation `json:"translations"`
}

Layout is what goes around a template: the frame the message is rendered into.

func CreateLayout

func CreateLayout(ctx context.Context, connection *Client, domainId string, parameters *LayoutParameters) (*Layout, error)

CreateLayout adds a layout to a domain.

func GetLayout

func GetLayout(ctx context.Context, connection *Client, layoutId string) (*Layout, error)

GetLayout returns one layout.

func ListLayouts

func ListLayouts(ctx context.Context, connection *Client, domainId string) ([]*Layout, error)

ListLayouts returns a domain's layouts.

func ModifyLayout

func ModifyLayout(ctx context.Context, connection *Client, layoutId string, parameters *LayoutParameters) (*Layout, error)

ModifyLayout replaces a layout's settings.

func (*Layout) Parameters

func (self *Layout) Parameters() *LayoutParameters

Parameters returns a layout's settings, so that a change can start from what is stored.

type LayoutParameters

type LayoutParameters struct {
	Comment      string               `json:"comment"`
	Locale       string               `json:"locale,omitempty"`
	HTMLContent  string               `json:"htmlContent"`
	TextContent  string               `json:"textContent"`
	Translations []*LayoutTranslation `json:"translations,omitempty"`
}

LayoutParameters is everything that can be set on a layout. The server replaces the whole layout with them.

type LayoutTranslation

type LayoutTranslation struct {
	Locale      string `json:"locale"`
	HTMLContent string `json:"htmlContent"`
	TextContent string `json:"textContent"`
}

LayoutTranslation is a layout's content in one locale.

type Mail

type Mail struct {
	ID                    string          `json:"id"`
	CreatedAt             time.Time       `json:"createdAt"`
	ReceivedAt            time.Time       `json:"receivedAt"`
	DomainID              string          `json:"domainId"`
	CredentialID          string          `json:"credentialId"`
	EnvelopeID            string          `json:"envelopeId"`
	Kind                  string          `json:"kind"`
	Status                string          `json:"status"`
	Sender                string          `json:"sender"`
	Recipients            []string        `json:"recipients"`
	From                  string          `json:"from"`
	Subject               string          `json:"subject"`
	MessageID             string          `json:"messageId"`
	Size                  uint64          `json:"size"`
	IP                    string          `json:"ip"`
	RDNS                  string          `json:"rdns"`
	Hello                 string          `json:"hello"`
	TLSVersion            string          `json:"tlsVersion"`
	AuthenticationResults json.RawMessage `json:"authenticationResults"`
	Deliveries            []*Delivery     `json:"deliveries"`
}

Mail is a message the server has handled, as the list shows it.

func GetMail

func GetMail(ctx context.Context, connection *Client, mailId string) (*Mail, error)

GetMail returns one message.

func ListMails

func ListMails(ctx context.Context, connection *Client, domainId string, filters []Filter, first int) ([]*Mail, error)

ListMails returns handled mail, newest first, for one domain or every domain when domainId is empty.

func SendMail

func SendMail(ctx context.Context, connection *Client, domainId string, message *MessageParameters) (*Mail, error)

SendMail sends a fresh message using the legacy wire shape. Use SendMailWithSubmission when the caller retains an identifier for retries.

type MailContent

type MailContent struct {
	MailID           string        `json:"mailId"`
	Available        bool          `json:"available"`
	Text             string        `json:"text"`
	HTML             string        `json:"html"`
	HasRemoteContent bool          `json:"hasRemoteContent"`
	Attachments      []*Attachment `json:"attachments"`
	Headers          []*Header     `json:"headers"`
	RawHeaders       string        `json:"rawHeaders"`
	Size             int           `json:"size"`
}

MailContent is a stored message taken apart for display.

func GetMailContent

func GetMailContent(ctx context.Context, connection *Client, mailId string) (*MailContent, error)

GetMailContent returns a stored message decoded: its text, its HTML with scripts removed, its headers and its attachments.

type MailOpens

type MailOpens struct {
	MailID       string     `json:"mailId"`
	Trackable    bool       `json:"trackable"`
	Opened       bool       `json:"opened"`
	OpenedAt     *time.Time `json:"openedAt"`
	LastOpenedAt *time.Time `json:"lastOpenedAt"`
	OpenCount    int64      `json:"openCount"`
	IP           string     `json:"ip"`
	UserAgent    string     `json:"userAgent"`
}

MailOpens is whether a sent message has been looked at, as far as a fetched picture can say.

func GetMailOpens

func GetMailOpens(ctx context.Context, connection *Client, mailId string) (*MailOpens, error)

GetMailOpens returns whether a sent message was opened.

type MailProgramSettings

type MailProgramSettings struct {
	IMAPHost       string `json:"imapHost"`
	IMAPPort       int    `json:"imapPort"`
	IMAPSPort      int    `json:"imapsPort"`
	SubmissionHost string `json:"submissionHost"`
	SubmissionPort int    `json:"submissionPort"`
}

MailProgramSettings is where a mail program connects.

func GetMailProgramSettings

func GetMailProgramSettings(ctx context.Context, connection *Client) (*MailProgramSettings, error)

GetMailProgramSettings returns the hosts and ports a mail program needs.

type MailServer

type MailServer struct {
	Host     string `json:"host"`
	Port     uint16 `json:"port"`
	Username string `json:"username"`
}

MailServer is a downstream server an alias relays to. The password is never returned.

type MailServerParameters

type MailServerParameters struct {
	Host     string  `json:"host"`
	Port     uint16  `json:"port"`
	Username *string `json:"username,omitempty"`
	Password *string `json:"password,omitempty"`
}

MailServerParameters describes a downstream server to relay to.

type MailSubmission added in v0.48.0

type MailSubmission struct {
	SubmissionID string `json:"submissionId"`
	MailID       string `json:"mailId"`
	Mail         *Mail  `json:"mail"`
}

MailSubmission names durable acceptance even when the stored mail has expired.

func SendMailWithSubmission added in v0.48.0

func SendMailWithSubmission(ctx context.Context, connection *Client, domainId, submissionId string, message *MessageParameters) (*MailSubmission, error)

SendMailWithSubmission reuses one identifier and unchanged parameters on retry.

type Mailbox

type Mailbox struct {
	ID            string            `json:"id"`
	UserID        string            `json:"userId"`
	Name          string            `json:"name"`
	SignatureText string            `json:"signatureText"`
	SignatureHTML string            `json:"signatureHtml"`
	Addresses     []*MailboxAddress `json:"addresses"`
	Rules         []MailboxRule     `json:"rules"`
	AutoReply     *MailboxAutoReply `json:"autoReply"`
}

Mailbox is where a person's mail lives.

type MailboxAddress

type MailboxAddress struct {
	AliasID   string `json:"aliasId"`
	DomainID  string `json:"domainId"`
	Domain    string `json:"domain"`
	LocalPart string `json:"localPart"`
	Address   string `json:"address"`
}

MailboxAddress is an address that delivers into a mailbox: an alias of kind mailbox, read back from its pattern.

type MailboxAppPassword

type MailboxAppPassword struct {
	ID         string     `json:"id"`
	MailboxID  string     `json:"mailboxId"`
	Name       string     `json:"name"`
	CreatedAt  time.Time  `json:"createdAt"`
	LastUsedAt *time.Time `json:"lastUsedAt"`
}

MailboxAppPassword is what one mail program signs in with.

func ListMailboxAppPasswords

func ListMailboxAppPasswords(ctx context.Context, connection *Client, mailboxId string) ([]*MailboxAppPassword, error)

ListMailboxAppPasswords returns the app passwords of a mailbox, one per device. The passwords themselves are never returned.

type MailboxAutoReply

type MailboxAutoReply struct {
	Enabled bool       `json:"enabled"`
	From    *time.Time `json:"from,omitempty"`
	Until   *time.Time `json:"until,omitempty"`
	Subject string     `json:"subject"`
	Text    string     `json:"text"`
	HTML    string     `json:"html,omitempty"`

	// SameDomainOnly answers only senders at the mailbox's own domains.
	SameDomainOnly bool `json:"sameDomainOnly,omitempty"`
}

MailboxAutoReply is the out-of-office setting.

type MailboxFolder

type MailboxFolder struct {
	ID        string     `json:"id"`
	MailboxID string     `json:"mailboxId"`
	ParentID  string     `json:"parentId"`
	Name      string     `json:"name"`
	Kind      string     `json:"kind"`
	PinnedAt  *time.Time `json:"pinnedAt"`
	Unread    int        `json:"unread"`
	Total     int        `json:"total"`
}

MailboxFolder is one folder of a mailbox. The kind is empty for a folder somebody made; the rest are the ones every mailbox has.

func CreateMailboxFolder

func CreateMailboxFolder(ctx context.Context, connection *Client, mailboxId, name, parentId string) (*MailboxFolder, error)

CreateMailboxFolder adds a folder, at the top level or under another.

func SetMailboxFolderPinned

func SetMailboxFolderPinned(ctx context.Context, connection *Client, folderId string, pinned bool) (*MailboxFolder, error)

SetMailboxFolderPinned pins a folder to the top of the rail, or takes it down. The Inbox is always there and cannot be pinned.

func UpdateMailboxFolder

func UpdateMailboxFolder(ctx context.Context, connection *Client, folderId string, name, parentId *string) (*MailboxFolder, error)

UpdateMailboxFolder renames a folder, moves it under another, or moves it to the top level with an empty parent. Only what is given changes.

type MailboxItem

type MailboxItem struct {
	ID       string       `json:"id"`
	FolderID string       `json:"folderId"`
	Seen     bool         `json:"seen"`
	Flagged  bool         `json:"flagged"`
	Mail     *MailboxMail `json:"mail"`
}

MailboxItem is one message in one folder.

type MailboxMail

type MailboxMail struct {
	ID         string     `json:"id"`
	From       string     `json:"from"`
	FromName   string     `json:"fromName"`
	Subject    string     `json:"subject"`
	ReceivedAt *time.Time `json:"receivedAt"`
}

MailboxMail is the little of a message a list needs.

type MailboxParameters

type MailboxParameters struct {
	Name           *string
	SignatureText  *string
	SignatureHTML  *string
	Rules          *[]MailboxRule
	AutoReply      *MailboxAutoReply
	ClearAutoReply bool
}

MailboxParameters is what UpdateMailbox may change. A nil field is left alone; the rules and the out-of-office setting replace what is stored.

type MailboxRule

type MailboxRule struct {
	Name       string                 `json:"name"`
	Enabled    bool                   `json:"enabled"`
	Conditions []MailboxRuleCondition `json:"conditions"`
	Actions    []MailboxRuleAction    `json:"actions"`
	Stop       bool                   `json:"stop"`
}

MailboxRule files arriving mail: every condition must match, then every action runs, in order.

type MailboxRuleAction

type MailboxRuleAction struct {
	Kind     string `json:"kind"`
	FolderID string `json:"folderId,omitempty"`
	Address  string `json:"address,omitempty"`
}

MailboxRuleAction is one thing to do with a message a rule matched.

type MailboxRuleApplication

type MailboxRuleApplication struct {
	Considered int `json:"considered"`
	Matched    int `json:"matched"`
	Moved      int `json:"moved"`
	Marked     int `json:"marked"`
	Flagged    int `json:"flagged"`
	Deleted    int `json:"deleted"`
	Skipped    int `json:"skipped"`
	Failed     int `json:"failed"`
}

MailboxRuleApplication is what applying the rules to stored mail did.

func ApplyMailboxRules

func ApplyMailboxRules(ctx context.Context, connection *Client, mailboxId, folderId string, first int) (*MailboxRuleApplication, error)

ApplyMailboxRules runs the stored rules over the mail already in a folder.

type MailboxRuleCondition

type MailboxRuleCondition struct {
	Field    string `json:"field"`
	Header   string `json:"header,omitempty"`
	Operator string `json:"operator"`
	Value    string `json:"value,omitempty"`
}

MailboxRuleCondition is one test: a field, how to compare it, and what to.

type MailboxRuleTest

type MailboxRuleTest struct {
	Item    *MailboxItem `json:"item"`
	Matched []int        `json:"matched"`
}

MailboxRuleTest is one message the rules were tried against, and which of them matched, by position in the list given.

func TestMailboxRules

func TestMailboxRules(ctx context.Context, connection *Client, mailboxId, folderId string, first int, rules []MailboxRule) ([]*MailboxRuleTest, error)

TestMailboxRules says which of the given rules would match the mail already in a folder, without changing anything.

type MailboxSubscription

type MailboxSubscription struct {
	Key         string     `json:"key"`
	Name        string     `json:"name"`
	From        string     `json:"from"`
	Count       int        `json:"count"`
	Unread      int        `json:"unread"`
	LastAt      time.Time  `json:"lastAt"`
	LastItemID  string     `json:"lastItemId"`
	OneClick    bool       `json:"oneClick"`
	Unsubscribe []string   `json:"unsubscribe"`
	RequestedAt *time.Time `json:"requestedAt"`
	Method      string     `json:"method"`
	Failed      bool       `json:"failed"`
	Error       string     `json:"error"`
}

MailboxSubscription is one mailing list a mailbox receives: who sends it, how much of it there is, and whether leaving has been asked for.

func GetMailboxSubscription

func GetMailboxSubscription(ctx context.Context, connection *Client, mailboxId, key string) (*MailboxSubscription, error)

GetMailboxSubscription is one of them, by the key that identifies the list.

func UnsubscribeMailboxSubscription

func UnsubscribeMailboxSubscription(ctx context.Context, connection *Client, mailboxId, key string) (*MailboxSubscription, error)

UnsubscribeMailboxSubscription asks to leave a list, by whichever way the sender offered: a one-click request, a message to the address it named, or a page handed back for a person to open.

type MailboxSubscriptionPage

type MailboxSubscriptionPage struct {
	Subscriptions []*MailboxSubscription `json:"subscriptions"`
	Total         int64                  `json:"total"`
}

MailboxSubscriptionPage is a page of them, with how many there are in all.

func ListMailboxSubscriptions

func ListMailboxSubscriptions(ctx context.Context, connection *Client, mailboxId string, first, offset int) (*MailboxSubscriptionPage, error)

ListMailboxSubscriptions is every mailing list a mailbox receives.

type MailboxSummary

type MailboxSummary struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	UserID   string `json:"userId"`
	Username string `json:"username"`
	UserName string `json:"userName"`
}

MailboxSummary is a mailbox with its owner, for pointing an alias at one.

func ListAllMailboxes

func ListAllMailboxes(ctx context.Context, connection *Client) ([]*MailboxSummary, error)

ListAllMailboxes returns every mailbox on the server with its owner. It needs the permission to manage domains or users; an ordinary account is told the operation does not exist.

type MailboxThreadItem

type MailboxThreadItem struct {
	Item       *MailboxItem `json:"item"`
	FolderID   string       `json:"folderId"`
	FolderName string       `json:"folderName"`
	FolderKind string       `json:"folderKind"`
}

MailboxThreadItem is one message in that view, with the folder it sits in.

type MailboxThreadView

type MailboxThreadView struct {
	ThreadID  string               `json:"threadId"`
	Subject   string               `json:"subject"`
	Items     []*MailboxThreadItem `json:"items"`
	Truncated bool                 `json:"truncated"`
}

MailboxThreadView is the mail of one subscription, read as a conversation is: the messages it sent, newest first.

func ReadMailboxSubscription

func ReadMailboxSubscription(ctx context.Context, connection *Client, mailboxId, key string) (*MailboxThreadView, error)

ReadMailboxSubscription is its mail, grouped the way a conversation is.

type MailboxView

type MailboxView struct {
	Mailbox        *Mailbox         `json:"mailbox"`
	Folders        []*MailboxFolder `json:"folders"`
	Unread         int              `json:"unread"`
	MaxMessageSize uint64           `json:"maxMessageSize"`
}

MailboxView is a mailbox with its folders, as the server returns it.

func ListMailboxes

func ListMailboxes(ctx context.Context, connection *Client) ([]*MailboxView, error)

ListMailboxes returns the caller's own mailboxes with their folders.

func UpdateMailbox

func UpdateMailbox(ctx context.Context, connection *Client, mailboxId string, parameters *MailboxParameters) (*MailboxView, error)

UpdateMailbox changes a mailbox's name, signature, rules or out-of-office setting.

type MessageParameters

type MessageParameters struct {
	From        string                  `json:"from"`
	FromName    string                  `json:"fromName,omitempty"`
	To          []string                `json:"to"`
	Cc          []string                `json:"cc,omitempty"`
	Bcc         []string                `json:"bcc,omitempty"`
	Subject     string                  `json:"subject,omitempty"`
	TemplateID  string                  `json:"templateId,omitempty"`
	Locale      string                  `json:"locale,omitempty"`
	Variables   map[string]any          `json:"variables,omitempty"`
	HTMLContent string                  `json:"htmlContent,omitempty"`
	TextContent string                  `json:"textContent,omitempty"`
	Attachments []*AttachmentParameters `json:"attachments,omitempty"`
}

MessageParameters is a message to send: who it is from and to, and either a template with its variables or a subject and body written by hand.

type NetWorth added in v0.87.0

type NetWorth struct {
	From                     string           `json:"from"`
	To                       string           `json:"to"`
	NetWorthPoints           []*NetWorthPoint `json:"netWorthPoints"`
	ReportingCurrencyCode    string           `json:"reportingCurrencyCode,omitempty"`
	ConvertedNetWorthPoints  []*NetWorthPoint `json:"convertedNetWorthPoints"`
	UnconvertedCurrencyCodes []string         `json:"unconvertedCurrencyCodes"`
}

NetWorth is net worth per day, per currency and converted.

type NetWorthPoint added in v0.87.0

type NetWorthPoint struct {
	NetWorthOn     string `json:"netWorthOn"`
	CurrencyCode   string `json:"currencyCode,omitempty"`
	NetWorthAmount string `json:"netWorthAmount"`
}

NetWorthPoint is one day's net worth in one currency.

type Note added in v0.78.0

type Note struct {
	ID         string    `json:"id"`
	MailboxID  string    `json:"mailboxId"`
	FolderID   string    `json:"folderId"`
	Title      string    `json:"title"`
	Preview    string    `json:"preview"`
	HTML       string    `json:"html"`
	Text       string    `json:"text"`
	IsEditable bool      `json:"isEditable"`
	CreatedAt  time.Time `json:"createdAt"`
	ModifiedAt time.Time `json:"modifiedAt"`
}

Note is one note. HTML and Text are empty in a list.

func GetNote added in v0.78.0

func GetNote(ctx context.Context, connection *Client, mailboxId, noteId string) (*Note, error)

GetNote is one note, with its text.

func ListNotes added in v0.78.0

func ListNotes(ctx context.Context, connection *Client, mailboxId string) ([]*Note, error)

ListNotes is the notes of a mailbox, the most recently changed first.

func SaveNote added in v0.78.0

func SaveNote(ctx context.Context, connection *Client, mailboxId, noteId, text string) (*Note, error)

SaveNote writes text as a note: a new one when noteId is empty, or a new version of that one, whatever version it is at: the last writer wins.

type OAuthConnectCode added in v0.127.0

type OAuthConnectCode struct {
	ConnectLink string    `json:"connectLink"`
	QRCodeSVG   string    `json:"qrCodeSvg"`
	ExpiresAt   time.Time `json:"expiresAt"`
}

OAuthConnectCode is a one-time code that connects the TeaNode phone app to the server as you: a link, and the same link as a QR code.

func CreateOAuthConnectCode added in v0.127.0

func CreateOAuthConnectCode(ctx context.Context, connection *Client) (*OAuthConnectCode, error)

CreateOAuthConnectCode makes a code for a phone to scan.

type Operation

type Operation struct {
	Name        string
	Kind        string // "query" or "mutation"
	Description string
	Arguments   []*Argument
	Type        *TypeReference
}

Operation is one query or mutation.

func (*Operation) FindArgument

func (self *Operation) FindArgument(name string) *Argument

FindArgument resolves one of an operation's arguments, case insensitively.

type Options

type Options struct {
	// URL of the server, for example https://mail.example.com. The API path
	// is appended.
	URL string

	// Token sent as "Authorization: Bearer". Empty is allowed, and works
	// against a server that has no accounts yet.
	Token string

	// HTTPClient overrides the transport, which is how the local connection
	// pins the server's own certificate.
	HTTPClient *http.Client

	// Insecure skips verifying the server's certificate, for a development
	// server with a self-signed one. Ignored when HTTPClient is given.
	Insecure bool

	// Timeout for a single request. Zero means one minute.
	Timeout time.Duration

	// ReadOnly refuses every mutation before it is sent, so that a profile
	// handed to a script or an agent can look but not change. Queries,
	// introspection and downloads go through as they would otherwise.
	ReadOnly bool
}

Options configure a Client.

type OutgoingIdentity

type OutgoingIdentity struct {
	Address          string   `json:"address"`
	Via              string   `json:"via"`
	ReverseName      string   `json:"reverseName"`
	ForwardAddresses []string `json:"forwardAddresses"`
	Confirmed        bool     `json:"confirmed"`
	HelloName        string   `json:"helloName"`
	HelloAddresses   []string `json:"helloAddresses"`
	HelloMatches     bool     `json:"helloMatches"`
}

OutgoingIdentity is how outgoing mail identifies itself, and whether the receivers that check will believe it.

func GetOutgoingIdentity

func GetOutgoingIdentity(ctx context.Context, connection *Client) (*OutgoingIdentity, error)

GetOutgoingIdentity returns how this server's outgoing mail identifies itself.

type Passkey

type Passkey struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	CreatedAt      time.Time `json:"createdAt"`
	UsedAt         time.Time `json:"usedAt"`
	IP             string    `json:"ip"`
	Transports     []string  `json:"transports"`
	BackupEligible bool      `json:"backupEligible"`
	BackupState    bool      `json:"backupState"`
}

Passkey is an authenticator registered to an account.

func ListPasskeys

func ListPasskeys(ctx context.Context, connection *Client) ([]*Passkey, error)

ListPasskeys returns the passkeys of the account this client acts as.

func RenamePasskey

func RenamePasskey(ctx context.Context, connection *Client, passkeyId, name string) (*Passkey, error)

RenamePasskey changes what an authenticator is called.

type PasskeyPolicy

type PasskeyPolicy struct {
	Enabled        bool `json:"enabled"`
	MaximumPerUser int  `json:"maximumPerUser"`
}

PasskeyPolicy is whether this server offers passkeys, and how many an account may have.

func GetPasskeyPolicy

func GetPasskeyPolicy(ctx context.Context, connection *Client) (*PasskeyPolicy, error)

GetPasskeyPolicy returns whether passkeys are offered at all.

type PaystubPage added in v0.155.0

type PaystubPage struct {
	FinancePaystubs []*models.FinancePaystub `json:"financePaystubs"`
	HasMore         bool                     `json:"hasMore"`
	TotalCount      int                      `json:"totalCount"`
}

PaystubPage is one page of paystubs.

type PermissionDescription

type PermissionDescription struct {
	Key    string `json:"key"`
	Kind   string `json:"kind"`
	Widens string `json:"widens"`
}

PermissionDescription is one permission a role may hold: its key, whether it applies to the server or to a group's domains, and, for one that covers every domain, the domain permission it stands in for.

func ListPermissions

func ListPermissions(ctx context.Context, connection *Client) ([]*PermissionDescription, error)

ListPermissions returns every permission a role may hold.

type ReadOnlyError

type ReadOnlyError struct {
	URL string
}

ReadOnlyError is a mutation refused by a read-only client before it was sent, so nothing on the server has changed.

func (*ReadOnlyError) Error

func (self *ReadOnlyError) Error() string

type ReceiptMatchCandidate added in v0.118.0

type ReceiptMatchCandidate struct {
	FinanceTransactionID string              `json:"financeTransactionId"`
	FinanceTransaction   *FinanceTransaction `json:"financeTransaction,omitempty"`
	MatchedAmount        string              `json:"matchedAmount"`
	IsExactAmount        bool                `json:"isExactAmount"`
	IsSameAccount        bool                `json:"isSameAccount"`
	IsMerchantNameShared bool                `json:"isMerchantNameShared"`
	DayDistanceCount     int                 `json:"dayDistanceCount"`
	IsAutomatic          bool                `json:"isAutomatic"`
	MatchConfidence      string              `json:"matchConfidence,omitempty"`
}

ReceiptMatchCandidate is a charge a receipt could explain, with the finance transaction itself.

type ReceiptPreview added in v0.118.0

type ReceiptPreview struct {
	ReceiptCheckState      string                   `json:"receiptCheckState"`
	CheckDifferenceAmount  string                   `json:"checkDifferenceAmount"`
	ReceiptCheckSummary    string                   `json:"receiptCheckSummary"`
	ReceiptMatchCandidates []*ReceiptMatchCandidate `json:"receiptMatchCandidates"`
	IsReplacing            bool                     `json:"isReplacing"`
}

ReceiptPreview is what recording a receipt would do.

type ReceiptReading added in v0.118.0

type ReceiptReading struct {
	AgentJobID string `json:"agentJobId"`
}

ReceiptReading is the receipt job queued to read a receipt.

type Record

type Record struct {
	Type     string   `json:"type"`
	Name     string   `json:"name"`
	Expected string   `json:"expected"`
	Found    []string `json:"found"`
	Verified bool     `json:"verified"`
	Priority uint16   `json:"priority"`
	Optional bool     `json:"optional"`
	Purpose  string   `json:"purpose"`

	// Blocked says why publishing this record would not have the effect it
	// promises — a BIMI record with no logo behind it, or with a DMARC policy
	// no receiver acts on. Empty when nothing is in the way.
	Blocked string `json:"blocked"`
}

Record is one DNS record a domain needs.

type RecordSet

type RecordSet struct {
	Domain    string    `json:"domain"`
	Records   []*Record `json:"records"`
	CheckedAt time.Time `json:"checkedAt"`
	Error     string    `json:"error"`
}

RecordSet is the DNS a domain needs, and what is published now.

func (*RecordSet) FindRecord

func (self *RecordSet) FindRecord(recordType, name string) *Record

FindRecord returns the record of a type whose name matches, or nil.

The trailing dot is ignored on both sides: the server reports fully qualified names, and a caller building one from a domain and a selector will not have written it.

func (*RecordSet) Published

func (self *RecordSet) Published() (verified, required int)

Published counts the records that are verified, and the ones that are required, so a list can say "3 of 5".

type RecordedReceipt added in v0.118.0

type RecordedReceipt struct {
	FinanceReceipt         *FinanceReceipt          `json:"financeReceipt"`
	ReceiptCheckSummary    string                   `json:"receiptCheckSummary"`
	ReceiptMatchCandidates []*ReceiptMatchCandidate `json:"receiptMatchCandidates"`
	IsReplaced             bool                     `json:"isReplaced"`

	// DroppedReceiptMatchReasons say which of the person's matches were
	// taken off, since the receipt as read now cannot explain them.
	DroppedReceiptMatchReasons []string `json:"droppedReceiptMatchReasons"`
}

RecordedReceipt is what recording a receipt did.

type RecordingActionArguments added in v0.145.0

type RecordingActionArguments struct {
	Operation                           string  `json:"operation"`
	RecordingID                         string  `json:"recording_id"`
	RecordingMediaID                    string  `json:"media_id"`
	RecordingTranscriptRunID            string  `json:"transcript_run_id"`
	RecordingTranscriptionAttemptID     string  `json:"attempt_id"`
	RecordingTranscriptSegmentID        string  `json:"segment_id"`
	SpeakerIdentityID                   string  `json:"speaker_identity_id"`
	RecordingSpeakerCorrectionID        string  `json:"speaker_correction_id"`
	RecordingVoiceReferenceID           string  `json:"voice_reference_id"`
	RecordingTranscriptTextCorrectionID string  `json:"text_correction_id"`
	AgentAttachmentID                   string  `json:"attachment_id"`
	ClientRecordingID                   string  `json:"client_recording_id"`
	ClientRunID                         string  `json:"client_run_id"`
	ClientCorrectionID                  string  `json:"client_correction_id"`
	ConfirmedName                       string  `json:"confirmed_name"`
	IsAccountOwner                      bool    `json:"is_account_owner"`
	LocalSpeakerID                      string  `json:"local_speaker_id"`
	SpeakerLabel                        string  `json:"speaker_label"`
	CorrectedTranscriptText             string  `json:"corrected_transcript_text"`
	RecordingTitle                      *string `json:"recording_title"`
	RecordedAt                          *string `json:"recorded_at"`
	KnowledgeSourceID                   string  `json:"knowledge_source_id"`
	SourceCron                          *string `json:"source_cron"`
	ExpectedSourceGeneration            *int64  `json:"expected_source_generation"`
	PassageStartMS                      *int64  `json:"passage_start_ms"`
	PassageEndMS                        *int64  `json:"passage_end_ms"`
	SegmentOffset                       int     `json:"segment_offset"`
	PageSize                            int     `json:"page_size"`
	// SearchText narrows a list of recordings, or the names offered for a
	// speaker, to those containing it.
	SearchText string `json:"search_text"`
	// IsUnnamedOnly narrows the timeline to the passages whose speaker
	// nobody has named yet.
	IsUnnamedOnly bool `json:"is_unnamed_only"`
}

RecordingActionArguments are explicit user edits or account-owned evidence IDs. A stable client key must be reused after an uncertain write response.

type RecordingCaptureOptions added in v0.154.0

type RecordingCaptureOptions struct {
	// IsLiveTranscriptionWanted streams the audio for words as they are
	// spoken; a refused or broken stream never stops the capture.
	IsLiveTranscriptionWanted bool
	// OnUtterance is told each utterance the live transcription finished.
	OnUtterance func(transcriptText string, utteranceStartMS, utteranceEndMS int64)
	// OnPieceUploaded is told each piece the server has verified.
	OnPieceUploaded func(pieceIndex int, timelineStartMS, durationMS int64)
	// OnProblem is told what went wrong without stopping the capture.
	OnProblem func(problemText string)
}

RecordingCaptureOptions say what a capture tells its caller as it goes.

type RecordingCutPolicy added in v0.154.0

type RecordingCutPolicy struct {
	// contains filtered or unexported fields
}

RecordingCutPolicy decides where the piece being recorded ends.

func (*RecordingCutPolicy) ObserveFrame added in v0.154.0

func (self *RecordingCutPolicy) ObserveFrame(frameEndMS int64, levelDecibels float64, isLiveConnected bool) bool

ObserveFrame is told of each frame of audio: where it ended on the timeline and how loud it was. It says whether to cut at the frame's end.

func (*RecordingCutPolicy) ObserveUtteranceEnd added in v0.154.0

func (self *RecordingCutPolicy) ObserveUtteranceEnd(utteranceEndMS, bufferedEndMS int64) bool

ObserveUtteranceEnd is told where the live transcription says an utterance ended and how much audio is held. It says whether to cut there: an end before the piece is long enough, or past the audio held, is not used.

func (*RecordingCutPolicy) StartPiece added in v0.154.0

func (self *RecordingCutPolicy) StartPiece(pieceStartMS int64)

StartPiece begins a piece at pieceStartMS on the recording's timeline.

type RecordingLimits added in v0.142.0

type RecordingLimits struct {
	MaximumMediaBytes   int64 `json:"maximumMediaBytes"`
	MaximumAccountBytes int64 `json:"maximumAccountBytes"`
	UploadPartBytes     int64 `json:"uploadPartBytes"`
}

RecordingLimits names the dedicated upload and account-storage bounds.

type RecordingPlayback added in v0.150.0

type RecordingPlayback = models.RecordingPlayback

RecordingPlayback describes a retained compatible audio preview, not an original.

func PrepareRecordingPlayback added in v0.150.0

func PrepareRecordingPlayback(ctx context.Context, executor Executor, mediaId string) (*RecordingPlayback, error)

PrepareRecordingPlayback explicitly creates local compatible audio. It writes owned storage and must not be called during a read-only metadata refresh.

func ReadRecordingPlayback added in v0.150.0

func ReadRecordingPlayback(ctx context.Context, executor Executor, mediaId string) (*RecordingPlayback, error)

ReadRecordingPlayback inspects an existing preview without creating one.

type RecordingView added in v0.142.0

type RecordingView struct {
	Recording   *models.Recording            `json:"recording"`
	MediaFiles  []*models.RecordingMedia     `json:"mediaFiles"`
	UploadParts []*models.RecordingMediaPart `json:"uploadParts"`
}

RecordingView includes the original manifests and durable transport receipts.

type Reminder added in v0.77.0

type Reminder struct {
	ID          string     `json:"id"`
	Title       string     `json:"title"`
	Notes       string     `json:"notes"`
	DueAt       *time.Time `json:"dueAt"`
	IsDueDate   bool       `json:"isDueDate"`
	IsDone      bool       `json:"isDone"`
	DoneAt      *time.Time `json:"doneAt"`
	Priority    int        `json:"priority"`
	IsRepeating bool       `json:"isRepeating"`
	CreatedAt   time.Time  `json:"createdAt"`
	ModifiedAt  time.Time  `json:"modifiedAt"`
}

Reminder is one reminder.

func ListReminders added in v0.77.0

func ListReminders(ctx context.Context, connection *Client, isDone *bool) ([]*Reminder, error)

ListReminders is the reminders, done or not when isDone says, or all.

func SaveReminder added in v0.77.0

func SaveReminder(ctx context.Context, connection *Client, reminderId string, change *ReminderChange) (*Reminder, error)

SaveReminder makes a reminder, when reminderId is empty, or changes one.

func SetReminderDone added in v0.77.0

func SetReminderDone(ctx context.Context, connection *Client, reminderId string, isDone bool) (*Reminder, error)

SetReminderDone says a reminder is done, or not.

type ReminderChange added in v0.77.0

type ReminderChange struct {
	Title        *string `json:"title,omitempty"`
	Notes        *string `json:"notes,omitempty"`
	DueAt        *string `json:"dueAt,omitempty"`
	DueOn        *string `json:"dueOn,omitempty"`
	IsDueCleared bool    `json:"isDueCleared,omitempty"`
	Priority     *int    `json:"priority,omitempty"`
}

ReminderChange is what to write into a reminder; what is nil is kept.

type Rendered

type Rendered struct {
	Subject     string   `json:"subject"`
	HTMLContent string   `json:"htmlContent"`
	TextContent string   `json:"textContent"`
	Locale      string   `json:"locale"`
	Variables   []string `json:"variables"`
}

Rendered is a template or layout with its variables filled in.

func RenderLayout

func RenderLayout(ctx context.Context, connection *Client, domainId string, parameters *LayoutParameters, locale string, variables map[string]any) (*Rendered, error)

RenderLayout renders a layout by itself, its blocks showing their default content, for a preview.

func RenderTemplate

func RenderTemplate(ctx context.Context, connection *Client, domainId, templateId, locale string, variables map[string]any) (*Rendered, error)

RenderTemplate renders a stored template as a message would be, without sending it.

type Report

type Report struct {
	ID           string          `json:"id"`
	CreatedAt    time.Time       `json:"createdAt"`
	MailID       string          `json:"mailId"`
	DomainID     string          `json:"domainId"`
	BeginAt      time.Time       `json:"beginAt"`
	EndAt        time.Time       `json:"endAt"`
	Count        uint64          `json:"count"`
	IP           string          `json:"ip"`
	RDNS         string          `json:"rdns"`
	FromDomain   string          `json:"fromDomain"`
	SenderDomain string          `json:"senderDomain"`
	Disposition  string          `json:"disposition"`
	DKIMAligned  bool            `json:"dkimAligned"`
	SPFAligned   bool            `json:"spfAligned"`
	Feedback     json.RawMessage `json:"feedback"`
}

Report is a DMARC aggregate report somebody sent about mail claiming to be from one of this server's domains.

func GetReport

func GetReport(ctx context.Context, connection *Client, reportId string) (*Report, error)

GetReport returns one report with the original feedback it was parsed from, which is what "report get --json" prints in full.

func ListReports

func ListReports(ctx context.Context, connection *Client, domainId string, first int) ([]*Report, error)

ListReports returns the reports for one domain, or every domain when domainId is empty.

type ReportingCurrency added in v0.87.0

type ReportingCurrency struct {
	ReportingCurrencyCode string `json:"reportingCurrencyCode"`
	IsChosen              bool   `json:"isChosen"`
}

ReportingCurrency is the currency totals are shown in, and whether the person chose it or it falls back to their first finance account's.

type RestartResult

type RestartResult struct {
	Started     bool   `json:"started"`
	Instance    string `json:"instance"`
	Supervision string `json:"supervision"`
}

RestartResult is what the server says when asked to restart.

func RestartServer

func RestartServer(ctx context.Context, connection *Client) (*RestartResult, error)

RestartServer asks the instance to exit so its supervisor starts a new one.

type Role

type Role struct {
	ID          string    `json:"id"`
	CreatedAt   time.Time `json:"createdAt"`
	ModifiedAt  time.Time `json:"modifiedAt"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Permissions []string  `json:"permissions"`
}

Role is a named set of permissions.

func CreateRole

func CreateRole(ctx context.Context, connection *Client, name string, permissions []string, description *string) (*Role, error)

CreateRole adds a role.

func ListRoles

func ListRoles(ctx context.Context, connection *Client) ([]*Role, error)

ListRoles returns the roles on this server.

func UpdateRole

func UpdateRole(ctx context.Context, connection *Client, roleId string, parameters *RoleParameters) (*Role, error)

UpdateRole changes a role.

type RoleParameters

type RoleParameters struct {
	Name        *string
	Description *string
	Permissions *[]string
}

RoleParameters is what a role is made or changed with.

type SaveCalendarEventFields

type SaveCalendarEventFields struct {
	RequestID  string
	CalendarID string
	ID         string
	File       string

	Summary     *string
	Location    *string
	Description *string
	StartsAt    *string
	EndsAt      *string
	AllDay      *bool
	Timezone    string
	Recurrence  *string
	Status      *string
	Attendees   *[]string
}

SaveCalendarEventFields keeps an event from filled-in fields. A nil field is left as it was; a pointer to an empty value clears it.

type SaveContactFields

type SaveContactFields struct {
	AddressBookID string
	ID            string
	Card          string
	Name          *string
	Organization  *string
	Title         *string
	Emails        *[]string
	Phones        *[]string
	Note          *string
}

SaveContactFields keeps a contact from filled-in fields. A nil field is left as it was; a pointer to an empty value clears it.

type SavingSummary added in v0.98.0

type SavingSummary struct {
	Month                      string   `json:"month"`
	AsOf                       string   `json:"asOf"`
	DayOfMonth                 int      `json:"dayOfMonth"`
	DaysInMonth                int      `json:"daysInMonth"`
	Year                       string   `json:"year"`
	MonthsElapsedCount         int      `json:"monthsElapsedCount"`
	DayOfYear                  int      `json:"dayOfYear"`
	DaysInYear                 int      `json:"daysInYear"`
	BudgetedMonths             []string `json:"budgetedMonths"`
	BudgetedMonthCount         int      `json:"budgetedMonthCount"`
	BudgetedMonthsElapsedCount int      `json:"budgetedMonthsElapsedCount"`
	ReportingCurrencyCode      string   `json:"reportingCurrencyCode"`
	IncomeBudgetCount          int      `json:"incomeBudgetCount"`
	SpendingBudgetCount        int      `json:"spendingBudgetCount"`
	ExpectedIncomeAmount       string   `json:"expectedIncomeAmount"`
	ExpectedSpendingAmount     string   `json:"expectedSpendingAmount"`
	ExpectedSavingAmount       string   `json:"expectedSavingAmount"`
	IncomeAmount               string   `json:"incomeAmount"`
	SpendingAmount             string   `json:"spendingAmount"`
	SavingAmount               string   `json:"savingAmount"`
	ProjectedIncomeAmount      string   `json:"projectedIncomeAmount"`
	ProjectedSpendingAmount    string   `json:"projectedSpendingAmount"`
	ProjectedSavingAmount      string   `json:"projectedSavingAmount"`
	SavingDifferenceAmount     string   `json:"savingDifferenceAmount"`
	SavingPace                 string   `json:"savingPace"`
	UnconvertedCurrencyCodes   []string `json:"unconvertedCurrencyCodes"`
}

SavingSummary is a month's or a year's saving in the reporting currency: what its budgets expect, what it is so far, and where it is heading.

type SavingsTarget added in v0.87.0

type SavingsTarget struct {
	ID                string   `json:"id"`
	SavingsTargetName string   `json:"savingsTargetName"`
	TargetAmount      string   `json:"targetAmount"`
	CurrencyCode      string   `json:"currencyCode"`
	TargetOn          string   `json:"targetOn"`
	TargetMeasure     string   `json:"targetMeasure"`
	StartingAmount    string   `json:"startingAmount,omitempty"`
	StartedOn         string   `json:"startedOn"`
	ClosedOn          string   `json:"closedOn,omitempty"`
	AssetIDs          []string `json:"assetIds"`
	FinanceAccountIDs []string `json:"financeAccountIds"`
}

SavingsTarget is an amount to save by a day.

type SavingsTargetProgress added in v0.87.0

type SavingsTargetProgress struct {
	SavedAmount              string   `json:"savedAmount"`
	RemainingAmount          string   `json:"remainingAmount"`
	MonthsLeftCount          int      `json:"monthsLeftCount"`
	RequiredMonthlyAmount    string   `json:"requiredMonthlyAmount"`
	IsBehind                 bool     `json:"isBehind"`
	UnconvertedCurrencyCodes []string `json:"unconvertedCurrencyCodes"`
}

SavingsTargetProgress is how a savings target stands, in its currency.

type SavingsTargetStanding added in v0.87.0

type SavingsTargetStanding struct {
	SavingsTarget         *SavingsTarget         `json:"savingsTarget"`
	SavingsTargetProgress *SavingsTargetProgress `json:"savingsTargetProgress"`
}

SavingsTargetStanding is a savings target and its progress.

type Schema

type Schema struct {
	QueryType    string
	MutationType string
	Operations   map[string]*Operation
	Types        map[string]*Type
}

Schema is as much of the server's GraphQL schema as is needed to call an operation without knowing it in advance.

It exists so the command line tool covers the whole API without a hand written command per operation. Hand written ones drift: an operation added to the schema is reachable the moment the server supports it, with no second place to remember to update.

func Introspect

func Introspect(ctx context.Context, connection *Client) (*Schema, error)

Introspect reads the schema from the server.

func (*Schema) BuildQuery

func (self *Schema) BuildQuery(operation *Operation, arguments map[string]any, depth int) (string, error)

BuildQuery assembles a query for an operation and its arguments, declaring a variable for each so that input objects and lists work without having to write GraphQL literal syntax.

func (*Schema) FindOperation

func (self *Schema) FindOperation(name string) *Operation

FindOperation resolves an operation name, matching case insensitively so that a name typed from memory still works.

func (*Schema) OperationNames

func (self *Schema) OperationNames() []string

OperationNames returns every operation, sorted, so that a listing and an error message can both suggest what there is.

func (*Schema) Selection

func (self *Schema) Selection(reference *TypeReference, depth int) string

Selection builds the selection set for an operation's return type: every field that can be asked for without arguments, to a bounded depth.

Bounded because the schema is cyclic — a Domain has Credentials, and a Delivery has a Mail that has a Domain — so an unbounded walk does not terminate. Three levels is enough for everything the API returns to be legible without asking for the whole graph.

type ServerStatus

type ServerStatus struct {
	Instance       string    `json:"instance"`
	Version        string    `json:"version"`
	Commit         string    `json:"commit"`
	StartedAt      time.Time `json:"startedAt"`
	UptimeSeconds  int64     `json:"uptimeSeconds"`
	PendingRestart []string  `json:"pendingRestart"`
	Supervision    string    `json:"supervision"`
	Restarting     bool      `json:"restarting"`
}

ServerStatus describes the running instance rather than the configuration.

func GetServerStatus

func GetServerStatus(ctx context.Context, connection *Client) (*ServerStatus, error)

GetServerStatus returns what the instance is and how it is running.

type ServiceCapabilities added in v0.139.0

type ServiceCapabilities struct {
	IsMailRoutingEnabled     bool `json:"isMailRoutingEnabled"`
	IsMailboxEnabled         bool `json:"isMailboxEnabled"`
	IsCalendarEnabled        bool `json:"isCalendarEnabled"`
	IsRemindersEnabled       bool `json:"isRemindersEnabled"`
	IsContactsEnabled        bool `json:"isContactsEnabled"`
	IsAssistantEnabled       bool `json:"isAssistantEnabled"`
	HasPendingServiceRestart bool `json:"hasPendingServiceRestart"`
	HasCompletedSetup        bool `json:"hasCompletedSetup"`
}

ServiceCapabilities describes hosted features running on the server.

type Session

type Session struct {
	ID        string     `json:"id"`
	Current   bool       `json:"current"`
	Created   time.Time  `json:"created"`
	Expires   *time.Time `json:"expires"`
	LastUsed  *time.Time `json:"lastUsed"`
	IP        string     `json:"ip"`
	UserAgent string     `json:"userAgent"`
	Revoked   *time.Time `json:"revoked"`

	// ImpersonatorUsername is the operator who signed in as the account
	// with this session, when it was one.
	ImpersonatorUsername string `json:"impersonatorUsername"`
}

Session is one signed-in browser.

func ListSessions

func ListSessions(ctx context.Context, connection *Client, username string, includeRevoked bool) ([]*Session, error)

ListSessions returns an account's signed-in browsers, newest first. The console, which is not an account, names whose with username.

type Settings

type Settings map[string]json.RawMessage

Settings are the optional integrations, as the server describes them. Kept as raw JSON per section rather than as typed structs: the command line prints whatever fields the server reports, so a setting added to the API shows up without a change here.

func GetSettings

func GetSettings(ctx context.Context, connection *Client) (Settings, error)

GetSettings returns the optional integrations. Secrets are never returned; a field that is set reads back as whether it is set.

func UpdateSettings

func UpdateSettings(ctx context.Context, connection *Client, sections map[string]any) (Settings, error)

UpdateSettings changes one or more sections. Each value is the parameters object for that section, as the schema's <Section>ParametersInput declares it; a field left out keeps its stored value.

type SpendingByDay added in v0.87.0

type SpendingByDay struct {
	Month                    string         `json:"month"`
	CompareMonth             string         `json:"compareMonth"`
	ReportingCurrencyCode    string         `json:"reportingCurrencyCode,omitempty"`
	MonthDays                []*SpendingDay `json:"monthDays"`
	CompareMonthDays         []*SpendingDay `json:"compareMonthDays"`
	UnconvertedCurrencyCodes []string       `json:"unconvertedCurrencyCodes"`
}

SpendingByDay is cumulative spending per day of two months.

type SpendingCategory added in v0.87.0

type SpendingCategory struct {
	ID                       string `json:"id"`
	SpendingCategoryName     string `json:"spendingCategoryName"`
	ParentSpendingCategoryID string `json:"parentSpendingCategoryId,omitempty"`
	IsIncome                 bool   `json:"isIncome"`
	IsHidden                 bool   `json:"isHidden"`
	IsTransfer               bool   `json:"isTransfer"`
	IsOther                  bool   `json:"isOther"`
}

SpendingCategory is a label in the person's own list. IsTransfer marks the built-in transfer category: what is in it is neither spending nor income. IsOther marks the built-in other category: what fits no other spending category.

type SpendingCategoryBudgetStatus added in v0.87.0

type SpendingCategoryBudgetStatus struct {
	SpendingCategoryID               string                  `json:"spendingCategoryId"`
	SpendingCategoryName             string                  `json:"spendingCategoryName"`
	BudgetAmount                     string                  `json:"budgetAmount"`
	CurrencyCode                     string                  `json:"currencyCode"`
	BudgetToDateAmount               string                  `json:"budgetToDateAmount"`
	BudgetedMonthCount               int                     `json:"budgetedMonthCount"`
	FirstBudgetedMonth               string                  `json:"firstBudgetedMonth"`
	LastBudgetedMonth                string                  `json:"lastBudgetedMonth"`
	SpendingAmount                   string                  `json:"spendingAmount"`
	SpendingBySameDayLastMonthAmount string                  `json:"spendingBySameDayLastMonthAmount"`
	FixedChargesDueAmount            string                  `json:"fixedChargesDueAmount"`
	ExpectedRepeatCharges            []*ExpectedRepeatCharge `json:"expectedRepeatCharges"`
	ProjectedAmount                  string                  `json:"projectedAmount"`
	BudgetPace                       string                  `json:"budgetPace"`
	UnconvertedSpending              []*CurrencyAmount       `json:"unconvertedSpending"`
}

SpendingCategoryBudgetStatus is one spending category against its budget, in the budget's currency.

type SpendingDay added in v0.87.0

type SpendingDay struct {
	SpentOn                  string `json:"spentOn"`
	SpendingAmount           string `json:"spendingAmount"`
	CumulativeSpendingAmount string `json:"cumulativeSpendingAmount"`
}

SpendingDay is one day's spending and the month's up to it.

type SpendingRule added in v0.87.0

type SpendingRule struct {
	ID                 string `json:"id"`
	MatchText          string `json:"matchText"`
	FinanceAccountID   string `json:"financeAccountId,omitempty"`
	MinimumAmount      string `json:"minimumAmount,omitempty"`
	MaximumAmount      string `json:"maximumAmount,omitempty"`
	SpendingCategoryID string `json:"spendingCategoryId"`
	RulePriority       int    `json:"rulePriority"`
}

SpendingRule assigns a spending category to the finance transactions that match it; the transfer category marks them transfers.

type SpendingRuleProposal added in v0.103.0

type SpendingRuleProposal struct {
	MatchText               string        `json:"matchText"`
	SpendingCategoryID      string        `json:"spendingCategoryId"`
	FinanceTransactionCount int           `json:"financeTransactionCount"`
	ChangedTransactionCount int           `json:"changedTransactionCount"`
	AheadOfSpendingRule     *SpendingRule `json:"aheadOfSpendingRule,omitempty"`
}

SpendingRuleProposal is a spending rule CategorizeTransactions would save once confirmed: what it matches and assigns, how many of the finance transactions named it matches, how many others it would recategorize, and the spending rule it goes ahead of, if any.

type SpendingRuleProposals added in v0.103.0

type SpendingRuleProposals struct {
	SpendingRuleProposals        []*SpendingRuleProposal `json:"spendingRuleProposals"`
	TooGenericMatchTextCount     int                     `json:"tooGenericMatchTextCount"`
	ChangingNumberMatchTextCount int                     `json:"changingNumberMatchTextCount"`
	OverLimitMatchTextCount      int                     `json:"overLimitMatchTextCount"`
}

SpendingRuleProposals is what ProposeSpendingRules offers: the spending rules, and how many distinct match texts it left out and why.

func (*SpendingRuleProposals) Confirmed added in v0.103.0

func (self *SpendingRuleProposals) Confirmed() []ConfirmedSpendingRule

Confirmed is the spending rules proposed, as CategorizeTransactions takes them to save exactly those.

func (*SpendingRuleProposals) LeftOutReasons added in v0.103.0

func (self *SpendingRuleProposals) LeftOutReasons() []string

LeftOutReasons says, a phrase each, how many match texts the proposal left out and why; none when it left out nothing.

type StartedAgentIdea added in v0.76.0

type StartedAgentIdea struct {
	Idea           *AgentIdea         `json:"idea"`
	Conversation   *AgentConversation `json:"conversation"`
	OpeningRequest string             `json:"openingRequest"`
}

StartedAgentIdea is an idea started, the conversation carrying it out, and what to say in it first.

func StartAgentIdea added in v0.76.0

func StartAgentIdea(ctx context.Context, connection *Client, ideaId, conversationId string) (*StartedAgentIdea, error)

StartAgentIdea starts an idea: in the conversation given, or in one of its own when none is.

type StatementAccountDeleted added in v0.108.0

type StatementAccountDeleted struct {
	FinanceAccountID        string `json:"financeAccountId"`
	DeletedTransactionCount int    `json:"deletedTransactionCount"`
	DeletedAssetCount       int    `json:"deletedAssetCount"`
}

StatementAccountDeleted is what deleting an account of imported statements removed.

type StatementImport added in v0.100.0

type StatementImport struct {
	SourceID              string                  `json:"sourceId"`
	ImportAddress         string                  `json:"importAddress,omitempty"`
	IsEnabled             bool                    `json:"isEnabled"`
	MaximumStatementBytes int                     `json:"maximumStatementBytes"`
	LastStatementImport   *FinanceStatementImport `json:"lastStatementImport,omitempty"`
}

StatementImport is the address to mail statements to, whether importing is on, and what the last import did.

type StatusError added in v0.81.0

type StatusError struct {
	URL        string
	StatusCode int
	Cause      error
}

StatusError is a reply that was not a GraphQL answer with HTTP 200: what a proxy in front of the server says while the server restarts, or a server that failed. Cause is why the body could not be read, when it could not.

func (*StatusError) Error added in v0.81.0

func (self *StatusError) Error() string

func (*StatusError) Unwrap added in v0.81.0

func (self *StatusError) Unwrap() error

type TaxDocumentAddress added in v0.155.0

type TaxDocumentAddress struct {
	TaxDocumentAddress string `json:"taxDocumentAddress"`
	CanReadPDFs        bool   `json:"canReadPdfs"`
}

TaxDocumentAddress is the address to mail paystubs and W-2s to, empty without a mailbox address, and whether the server reads PDFs.

type TaxDocumentReading added in v0.155.0

type TaxDocumentReading struct {
	AgentAttachmentIDs []string `json:"agentAttachmentIds"`
	AgentJobIDs        []string `json:"agentJobIds"`
}

TaxDocumentReading is the uploads queued to be read as paystubs or tax forms, and the job reading each.

type TaxFormPage added in v0.155.0

type TaxFormPage struct {
	TaxForms   []*TaxFormView `json:"taxForms"`
	HasMore    bool           `json:"hasMore"`
	TotalCount int            `json:"totalCount"`
}

TaxFormPage is one page of tax forms.

type TaxFormView added in v0.155.0

type TaxFormView struct {
	FinanceTaxForm  *models.FinanceTaxForm   `json:"financeTaxForm"`
	TaxFormFindings []finance.TaxFormFinding `json:"taxFormFindings"`
}

TaxFormView is a tax form with what it says about itself.

type Template

type Template struct {
	ID           string                 `json:"id"`
	CreatedAt    time.Time              `json:"createdAt"`
	ModifiedAt   time.Time              `json:"modifiedAt"`
	DomainID     string                 `json:"domainId"`
	LayoutID     string                 `json:"layoutId"`
	Name         string                 `json:"name"`
	Comment      string                 `json:"comment"`
	Locale       string                 `json:"locale"`
	Subject      string                 `json:"subject"`
	HTMLContent  string                 `json:"htmlContent"`
	TextContent  string                 `json:"textContent"`
	Translations []*TemplateTranslation `json:"translations"`
	Variables    []string               `json:"variables"`
}

Template is a message to be sent with variables filled in.

func CreateTemplate

func CreateTemplate(ctx context.Context, connection *Client, domainId string, parameters *TemplateParameters) (*Template, error)

CreateTemplate adds a template to a domain.

func GetTemplateByName

func GetTemplateByName(ctx context.Context, connection *Client, domainId, name string) (*Template, error)

GetTemplateByName returns a domain's template with this name, or nil.

func ListTemplates

func ListTemplates(ctx context.Context, connection *Client, domainId string) ([]*Template, error)

ListTemplates returns a domain's templates.

func ModifyTemplate

func ModifyTemplate(ctx context.Context, connection *Client, templateId string, parameters *TemplateParameters) (*Template, error)

ModifyTemplate replaces a template's settings.

func (*Template) Parameters

func (self *Template) Parameters() *TemplateParameters

Parameters returns a template's settings, so that a change can start from what is stored.

type TemplateParameters

type TemplateParameters struct {
	LayoutID     string                 `json:"layoutId"`
	Name         string                 `json:"name"`
	Comment      string                 `json:"comment"`
	Locale       string                 `json:"locale,omitempty"`
	Subject      string                 `json:"subject"`
	HTMLContent  string                 `json:"htmlContent"`
	TextContent  string                 `json:"textContent"`
	Translations []*TemplateTranslation `json:"translations,omitempty"`
}

TemplateParameters is everything that can be set on a template. The server replaces the whole template with them, so an update sends every field.

type TemplateTranslation

type TemplateTranslation struct {
	Locale      string `json:"locale"`
	Subject     string `json:"subject"`
	HTMLContent string `json:"htmlContent"`
	TextContent string `json:"textContent"`
}

TemplateTranslation is a template's subject and content in one locale.

type Token

type Token struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Username   string     `json:"username"`
	Created    time.Time  `json:"created"`
	Expires    *time.Time `json:"expires"`
	LastUsed   *time.Time `json:"lastUsed"`
	LastUsedIP string     `json:"lastUsedIp"`
	Revoked    *time.Time `json:"revoked"`
}

Token is an issued API token, without its secret.

func CreateToken

func CreateToken(ctx context.Context, connection *Client, name, username, lifetime string) (*Token, string, error)

CreateToken issues a token and returns it. The secret is not recoverable afterwards.

func ListTokens

func ListTokens(ctx context.Context, connection *Client, username string, includeRevoked bool) ([]*Token, error)

ListTokens returns the tokens belonging to the account this client is authenticated as.

There is no listing somebody else's: a token acts as the person it belongs to, so a list of theirs is a list of ways to become them. The console, which is not an account, names whose with username.

func UpdateToken added in v0.52.0

func UpdateToken(ctx context.Context, connection *Client, id, username, name, lifetime string) (*Token, error)

UpdateToken renames a token or gives it a new lifetime counted from now, "never" for one that does not expire. An empty name or lifetime leaves that as it is.

type TransactionRowPreview added in v0.108.0

type TransactionRowPreview struct {
	RowNumber                  int    `json:"rowNumber"`
	PostedOn                   string `json:"postedOn"`
	Description                string `json:"description"`
	Amount                     string `json:"amount"`
	HasNearbyStoredTransaction bool   `json:"hasNearbyStoredTransaction"`
}

TransactionRowPreview is one row of a preview, by its number among the rows as sent.

type TransactionRowsPreview added in v0.108.0

type TransactionRowsPreview struct {
	FinanceAccountID       string                   `json:"financeAccountId,omitempty"`
	AccountName            string                   `json:"accountName"`
	IsNewAccount           bool                     `json:"isNewAccount"`
	AccountMatch           string                   `json:"accountMatch"`
	CurrencyCode           string                   `json:"currencyCode"`
	NewTransactionRows     []*TransactionRowPreview `json:"newTransactionRows"`
	PresentTransactionRows []*TransactionRowPreview `json:"presentTransactionRows"`
	FirstPostedOn          string                   `json:"firstPostedOn,omitempty"`
	LastPostedOn           string                   `json:"lastPostedOn,omitempty"`
	MoneyInAmount          string                   `json:"moneyInAmount"`
	MoneyOutAmount         string                   `json:"moneyOutAmount"`
	VerificationSummary    string                   `json:"verificationSummary"`
	LedgerBalanceAmount    string                   `json:"ledgerBalanceAmount,omitempty"`
	LedgerBalanceOn        string                   `json:"ledgerBalanceOn,omitempty"`
	LedgerBalanceTimeZone  string                   `json:"ledgerBalanceTimeZone,omitempty"`
}

TransactionRowsPreview is what an import of transaction rows would do: the account (FinanceAccountID empty for a new one), the rows it would add and the rows it holds already, the days and money of the new rows, and what was checked.

type Type

type Type struct {
	Name        string
	Kind        string
	Description string
	Fields      []*Field
	InputFields []*Argument
	EnumValues  []string
}

Type is a named type in the schema.

type TypeReference

type TypeReference struct {
	Kind   string
	Name   string
	OfType *TypeReference
}

TypeReference is a type as used, which may wrap a named type in non-null and list markers.

func (*TypeReference) Named

func (self *TypeReference) Named() string

Named returns the underlying named type, unwrapping non-null and list.

func (*TypeReference) Required

func (self *TypeReference) Required() bool

Required reports whether a value has to be given.

func (*TypeReference) String

func (self *TypeReference) String() string

String renders the type the way it is written in a query, for example "[Domain!]!".

type Upgrade

type Upgrade struct {
	Current     string     `json:"current"`
	Latest      string     `json:"latest"`
	Available   bool       `json:"available"`
	Notes       string     `json:"notes"`
	URL         string     `json:"url"`
	CheckedAt   *time.Time `json:"checkedAt"`
	AttemptedAt *time.Time `json:"attemptedAt"`
	Checking    bool       `json:"checking"`
	Error       string     `json:"error"`
	Applicable  bool       `json:"applicable"`
	Reason      string     `json:"reason"`
	Automatic   bool       `json:"automatic"`
	Upgrading   bool       `json:"upgrading"`
	Enabled     bool       `json:"enabled"`
	Window      string     `json:"window"`
	CheckError  string     `json:"checkError"`
}

Upgrade is what version is running, what has been released since, and whether anything can be done about the difference from here.

func ApplyUpgrade

func ApplyUpgrade(ctx context.Context, connection *Client, version string) (*Upgrade, error)

ApplyUpgrade installs a release: the newest, or the version named. It answers as soon as the upgrade has started.

func GetUpgrade

func GetUpgrade(ctx context.Context, connection *Client, check bool) (*Upgrade, error)

GetUpgrade returns the upgrade state, asking the release list again first when check is set.

type User

type User struct {
	// ID is what other rows hold a user by: a group's membership, an audit
	// event's actor.
	ID       string `json:"id"`
	Username string `json:"username"`
	Name     string `json:"name"`
	Email    string `json:"email"`
}

User is an account that may administer a server.

func CreateUser

func CreateUser(ctx context.Context, connection *Client, username, password, email string) (*User, error)

CreateUser adds an account.

func GetCurrentUser

func GetCurrentUser(ctx context.Context, connection *Client) (*User, error)

GetCurrentUser returns the account this connection authenticates as, or nil when it authenticates as something that is not an account — which is what a locally minted token does.

func ListUsers

func ListUsers(ctx context.Context, connection *Client) ([]*User, error)

ListUsers returns the accounts configured on the server.

func SetUserPassword

func SetUserPassword(ctx context.Context, connection *Client, username, password string) (*User, error)

SetUserPassword replaces an account's password.

func UpdateUser

func UpdateUser(ctx context.Context, connection *Client, username string, parameters *UserParameters) (*User, error)

UpdateUser changes an account's name, address or username.

type UserParameters

type UserParameters struct {
	Name        *string
	Email       *string
	NewUsername *string
}

UserParameters are what UpdateUser can change. A nil field is left alone.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL