client

package
v0.251.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 38 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, $feedDestination: String,
		$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, feedDestination: $feedDestination, 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 + `
	}`

	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 = `` /* 742-byte string literal not displayed */

	DocumentReadAgentRun = `` /* 213-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, $kind: String) { ListAgentConversations(archived: $archived, query: $query, kind: $kind) ` + 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, $since: String, $until: String, $isRunningOnly: Boolean) { ListAllAgentRuns(first: $first, offset: $offset, agentId: $agentId, kinds: $kinds, query: $query, since: $since, until: $until, isRunningOnly: $isRunningOnly) { total totalCount runs ` + oversightRunFields + ` } }`
	DocumentListFailedAgentTurns    = `query ($first: Int, $offset: Int, $since: String, $agentId: String) { ListFailedAgentTurns(first: $first, offset: $offset, since: $since, agentId: $agentId) { totalCount failedTurns ` + failedTurnFields + ` } }`
	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 intention } usage { model kind promptTokens completionTokens } attachments { id name contentType size audioDurationMS audioWaveform } references { itemId threadId subject from recordingId recordingTitle agentMessageId quotedRole quotedText } reactions { emoji reactorKind reactedAt reactorUserId reactorName } authorKind authorUserId authorName authorOwnerName authorAgentId isMine isAgentWork editedAt isDeleted isVoiceMessage transcriptText transcriptState }
			total
			actingAs
			isObserved
			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, $stream: String, $offset: Int, $lengthBytes: Int) {
		ReadAgentBackgroundCommand(computer: $computer, id: $id, tailBytes: $tailBytes, stream: $stream, offset: $offset, lengthBytes: $lengthBytes) {
			` + backgroundCommandFields + `
			stdout stderr isStdoutTruncated isStderrTruncated stdoutByteCount stderrByteCount stream streamOffset streamNextOffset
		}
	}`
	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 (
	DocumentOpenDirectChat              = `mutation ($userId: String!) { OpenDirectChat(userId: $userId) ` + conversationFields + ` }`
	DocumentCreateGroupChat             = `mutation ($title: String, $userIds: [String!]!) { CreateGroupChat(title: $title, userIds: $userIds) ` + conversationFields + ` }`
	DocumentRenameChat                  = `mutation ($conversationId: String!, $title: String!) { RenameChat(conversationId: $conversationId, title: $title) ` + conversationFields + ` }`
	DocumentAddChatMembers              = `mutation ($conversationId: String!, $userIds: [String!]!) { AddChatMembers(conversationId: $conversationId, userIds: $userIds) ` + conversationFields + ` }`
	DocumentRemoveChatMember            = `mutation ($conversationId: String!, $userId: String!) { RemoveChatMember(conversationId: $conversationId, userId: $userId) ` + conversationFields + ` }`
	DocumentLeaveChat                   = `mutation ($conversationId: String!) { LeaveChat(conversationId: $conversationId) }`
	DocumentEditChatMessage             = `` /* 156-byte string literal not displayed */
	DocumentDeleteChatMessage           = `mutation ($messageId: String!) { DeleteChatMessage(messageId: $messageId) }`
	DocumentTranscribeChatVoiceMessage  = `mutation ($messageId: String!) { TranscribeChatVoiceMessage(messageId: $messageId) { id transcriptState transcriptText } }`
	DocumentMarkChatRead                = `` /* 150-byte string literal not displayed */
	DocumentSetChatNotificationLevel    = `mutation ($conversationId: String!, $notificationLevel: String!) { SetChatNotificationLevel(conversationId: $conversationId, notificationLevel: $notificationLevel) ` + conversationFields + ` }`
	DocumentSetChatTyping               = `mutation ($conversationId: String!) { SetChatTyping(conversationId: $conversationId) }`
	DocumentSetChatAgentReading         = `mutation ($conversationId: String!, $isAgentReading: Boolean!) { SetChatAgentReading(conversationId: $conversationId, isAgentReading: $isAgentReading) ` + conversationFields + ` }`
	DocumentSetChatAgentAskableByOthers = `mutation ($conversationId: String!, $isAgentAskableByOthers: Boolean!) { SetChatAgentAskableByOthers(conversationId: $conversationId, isAgentAskableByOthers: $isAgentAskableByOthers) ` + conversationFields + ` }`
	DocumentSayInChat                   = `` /* 220-byte string literal not displayed */
	DocumentSayInChatAsAgent            = `` /* 163-byte string literal not displayed */
)

The documents.

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 (
	DocumentListAgentFeed = `query ($first: Int, $after: String, $includeDismissed: Boolean, $isDismissedOnly: Boolean, $isUnreadOnly: Boolean) {
		ListAgentFeed(first: $first, after: $after, includeDismissed: $includeDismissed, isDismissedOnly: $isDismissedOnly, isUnreadOnly: $isUnreadOnly) {
			feedItems { ` + feedItemFields + ` } nextCursor unreadCount
		}
	}`
	DocumentListAgentFeedStack = `query ($feedStackKey: String!, $first: Int, $after: String) {
		ListAgentFeedStack(feedStackKey: $feedStackKey, first: $first, after: $after) {
			feedItems { ` + feedItemFields + ` } nextCursor unreadCount
		}
	}`
	DocumentGetAgentFeedItem = `query ($feedItemId: String!) {
		GetAgentFeedItem(feedItemId: $feedItemId) { ` + feedItemFields + ` }
	}`
	DocumentChooseAgentFeedItem = `mutation ($feedItemId: String!, $choiceKey: String!, $runConversationId: String) {
		ChooseAgentFeedItem(feedItemId: $feedItemId, choiceKey: $choiceKey, runConversationId: $runConversationId) { ` + feedItemFields + ` }
	}`
	DocumentLikeAgentFeedItem = `mutation ($feedItemId: String!, $isLiked: Boolean!) {
		LikeAgentFeedItem(feedItemId: $feedItemId, isLiked: $isLiked) { ` + feedItemFields + ` }
	}`
	DocumentShowLessLikeAgentFeedItem = `mutation ($feedItemId: String!) {
		ShowLessLikeAgentFeedItem(feedItemId: $feedItemId) { ` + feedItemFields + ` }
	}`
	DocumentDismissAgentFeedItems = `` /* 204-byte string literal not displayed */

	DocumentRestoreAgentFeedItems = `mutation ($feedItemIds: [String!]!) {
		RestoreAgentFeedItems(feedItemIds: $feedItemIds)
	}`
	DocumentWithdrawAgentFeedItem = `mutation ($feedItemId: String!) {
		WithdrawAgentFeedItem(feedItemId: $feedItemId)
	}`
	DocumentResolveAgentFeedItem = `mutation ($feedItemId: String!, $resolutionNote: String, $runConversationId: String) {
		ResolveAgentFeedItem(feedItemId: $feedItemId, resolutionNote: $resolutionNote, runConversationId: $runConversationId) { ` + feedItemFields + ` }
	}`
	DocumentUnresolveAgentFeedItem = `mutation ($feedItemId: String!, $runConversationId: String) {
		UnresolveAgentFeedItem(feedItemId: $feedItemId, runConversationId: $runConversationId) { ` + feedItemFields + ` }
	}`
	DocumentMarkAgentFeedRead = `mutation ($feedItemIds: [String!]!) {
		MarkAgentFeedRead(feedItemIds: $feedItemIds)
	}`
	DocumentDiscussAgentFeedItem = `mutation ($feedItemId: String!) {
		DiscussAgentFeedItem(feedItemId: $feedItemId)
	}`
	DocumentPostAgentFeedItem = `mutation (` + postFields + `) {
		PostAgentFeedItem(` + postArguments + `) { ` + feedItemFields + ` }
	}`
)

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

View Source
const (
	DocumentListAgentFollowUps = `query ($isOpenOnly: Boolean) { ListAgentFollowUps(isOpenOnly: $isOpenOnly) ` + agentFollowUpFields + ` }`

	DocumentStopAgentFollowUp = `mutation ($followUpId: String!) { StopAgentFollowUp(followUpId: $followUpId) ` + agentFollowUpFields + ` }`

	DocumentBackfillAgentFollowUps = `mutation { BackfillAgentFollowUps { queuedMessageCount } }`

	DocumentAddAgentFollowUp = `mutation ($followUpKind: String!, $followUpTitle: String!, $dueOn: String, $payee: String, $amount: String, $currencyCode: String, $carrier: String, $trackingNumber: String, $place: String) {
  AddAgentFollowUp(followUpKind: $followUpKind, followUpTitle: $followUpTitle, dueOn: $dueOn, payee: $payee, amount: $amount, currencyCode: $currencyCode, carrier: $carrier, trackingNumber: $trackingNumber, place: $place) ` + agentFollowUpFields + `
}`
)
View Source
const (
	DocumentListAgentGoals = `query ($goalStates: [String!]) {
		ListAgentGoals(goalStates: $goalStates) { ` + goalFields + ` }
	}`
	DocumentGetAgentGoal = `query ($conversationId: String!) {
		GetAgentGoal(conversationId: $conversationId) {
			` + goalFields + `
			cardEngagement { ` + goalCardEngagementFields + ` }
			recentCardEngagement { ` + goalCardEngagementFields + ` }
			activity { id createdAt goalActivityKind activityHeadline activityDetail }
			backgroundWork { ` + backgroundWorkFields + ` }
			artifacts { id createdAt goalArtifactKind artifactReference artifactTitle }
		}
	}`
	DocumentStartAgentGoal = `mutation ($goalTitle: String!, $goalDescription: String!, $goalEmoji: String, $originConversationId: String, $goalTimes: [String!], $goalMailConditions: [MailboxRuleConditionInput!], $isGoalNotifiedWhenPosted: Boolean) {
		StartAgentGoal(goalTitle: $goalTitle, goalDescription: $goalDescription, goalEmoji: $goalEmoji, originConversationId: $originConversationId, goalTimes: $goalTimes, goalMailConditions: $goalMailConditions, isGoalNotifiedWhenPosted: $isGoalNotifiedWhenPosted) { ` + goalFields + ` }
	}`
	DocumentUpdateAgentGoal = `mutation ($conversationId: String!, $goalTitle: String, $goalDescription: String, $goalEmoji: String, $goalTimes: [String!], $goalMailConditions: [MailboxRuleConditionInput!], $isGoalNotifiedWhenPosted: Boolean) {
		UpdateAgentGoal(conversationId: $conversationId, goalTitle: $goalTitle, goalDescription: $goalDescription, goalEmoji: $goalEmoji, goalTimes: $goalTimes, goalMailConditions: $goalMailConditions, isGoalNotifiedWhenPosted: $isGoalNotifiedWhenPosted) { ` + goalFields + ` }
	}`
	DocumentRunAgentGoal = `mutation ($conversationId: String!) {
		RunAgentGoal(conversationId: $conversationId) { ` + goalFields + ` }
	}`
	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, $offset: Int, $shouldIncludeToolDetail: Boolean) {
		ReadAgentHerdrSession(computer: $computer, paneId: $paneId, turnCount: $turnCount, offset: $offset, shouldIncludeToolDetail: $shouldIncludeToolDetail) {
			herdrSession { ` + HerdrSessionFields + ` } turns { herdrTurnRole turnText turnAt toolInputText toolResultText isQueued turnFiles { herdrFileReference fileName fileContentType fileByteCount filePath } } isTruncated nextOffset
		}
	}`
	DocumentReadAgentHerdrSubagents = `query ($computer: String, $paneId: String!, $offset: Int) {
		ReadAgentHerdrSubagents(computer: $computer, paneId: $paneId, offset: $offset) {
			herdrSession { ` + HerdrSessionFields + ` } sessionModelName requestStartedAt isTruncated leftCount nextOffset
			subagents { subagentId parentSubagentId subagentType subagentName taskText modelName subagentState spawnDepth startedAt endedAt toolNames toolCallCount }
		}
	}`
	DocumentReadAgentHerdrFile = `` /* 294-byte string literal not displayed */

	DocumentReadAgentHerdrScreen = `query ($computer: String, $paneId: String!, $lineCount: Int, $shouldKeepColor: Boolean) {
		ReadAgentHerdrScreen(computer: $computer, paneId: $paneId, lineCount: $lineCount, shouldKeepColor: $shouldKeepColor) {
			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, $paneId: String) {
		OpenAgentHerdrSession(computer: $computer, directory: $directory, codingAgentKind: $codingAgentKind, agentName: $agentName, shouldSkipPermissions: $shouldSkipPermissions, paneId: $paneId) { ` + HerdrSessionFields + ` }
	}`
	DocumentFocusAgentHerdrSession = `mutation ($computer: String, $paneId: String!) {
		FocusAgentHerdrSession(computer: $computer, paneId: $paneId) { ` + 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 } }`
	DocumentAnswerAgentQuestion  = `` /* 135-byte string literal not displayed */
)

The documents.

View Source
const (
	DocumentAgentProviderModels = `query { GetSettings { agent { providers { name models { ` + agentModelEntryFields + ` } } } } }`

	DocumentSaveAgentModelEntry = `mutation ($providerName: String!, $entry: AgentModelEntryInput!) {
		SaveAgentModelEntry(providerName: $providerName, entry: $entry) { ` + agentModelEntryFields + ` }
	}`

	DocumentDeleteAgentModelEntry = `mutation ($providerName: String!, $model: String!) { DeleteAgentModelEntry(providerName: $providerName, model: $model) }`
)
View Source
const (

	// DocumentListAgentPageShares lists the shares the caller made.
	DocumentListAgentPageShares = `query { ListAgentPageShares { ` + agentPageShareFields + ` } }`

	// DocumentShareAgentPage shares a page with a person or a circle.
	DocumentShareAgentPage = `mutation ($path: String!, $granteeUserId: String, $granteeCircleId: String, $isQuoteShared: Boolean) {
  ShareAgentPage(path: $path, granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, isQuoteShared: $isQuoteShared) {
    ` + agentPageShareFields + `
  }
}`

	// DocumentUnshareAgentPage takes a share back.
	DocumentUnshareAgentPage = `mutation ($shareId: String!) { UnshareAgentPage(shareId: $shareId) }`

	// DocumentPreviewAgentPageShare is what a share would show.
	DocumentPreviewAgentPageShare = `query ($path: String!, $granteeUserId: String, $granteeCircleId: String, $isQuoteShared: Boolean) {
  PreviewAgentPageShare(path: $path, granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, isQuoteShared: $isQuoteShared) {
    page { ` + sharedAgentPageFields + ` }
    reachedPageCount isReachedPageCountCut reachedPagePaths withheldFactCount
  }
}`

	// DocumentListSharedAgentPages lists what other people shared with the
	// caller.
	DocumentListSharedAgentPages = `` /* 150-byte string literal not displayed */

	// DocumentSearchSharedAgentPages finds, by words, pages and facts in what
	// other people shared with the caller.
	DocumentSearchSharedAgentPages = `` /* 190-byte string literal not displayed */

	// DocumentReadSharedAgentPage reads one page another person shared.
	DocumentReadSharedAgentPage = `query ($ownerUserId: String!, $path: String!) {
  ReadSharedAgentPage(ownerUserId: $ownerUserId, path: $path) { ` + sharedAgentPageFields + ` }
}`
)
View Source
const (

	// DocumentListSkillShares lists the shares the caller made and was given.
	DocumentListSkillShares = `query { ListSkillShares { ` + skillShareFields + ` } }`

	// DocumentShareSkill shares tools of a skill with a person.
	DocumentShareSkill = `mutation ($skillName: String!, $toolNames: [String!]!, $granteeUserId: String!, $paymentLimitMinor: Int64, $monthlyLimitMinor: Int64, $currencyCode: String, $isApprovalRequired: Boolean) {
  ShareSkill(skillName: $skillName, toolNames: $toolNames, granteeUserId: $granteeUserId, paymentLimitMinor: $paymentLimitMinor, monthlyLimitMinor: $monthlyLimitMinor, currencyCode: $currencyCode, isApprovalRequired: $isApprovalRequired) {
    ` + skillShareFields + `
  }
}`

	// DocumentUnshareSkill takes a share back.
	DocumentUnshareSkill = `mutation ($shareId: String!) { UnshareSkill(shareId: $shareId) }`

	// DocumentListSkillShareCalls lists the calls made through a share.
	DocumentListSkillShareCalls = `query ($shareId: String!, $callState: String, $limit: Int) {
  ListSkillShareCalls(shareId: $shareId, callState: $callState, limit: $limit) { ` + skillShareCallFields + ` }
}`

	// DocumentListEndedSkillShareCalls lists the calls of shares that ended.
	DocumentListEndedSkillShareCalls = `query ($callState: String, $limit: Int) {
  ListSkillShareCalls(isShareEnded: true, callState: $callState, limit: $limit) { ` + skillShareCallFields + ` }
}`

	// DocumentAnswerSkillShareCall approves or declines a call that waits.
	DocumentAnswerSkillShareCall = `mutation ($callId: String!, $isApproved: Boolean!, $answerNote: String) {
  AnswerSkillShareCall(callId: $callId, isApproved: $isApproved, answerNote: $answerNote) { ` + skillShareCallFields + ` }
}`
)
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 = `` /* 205-byte string literal not displayed */

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

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

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

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

	DocumentListCalendarShares = `` /* 199-byte string literal not displayed */

	DocumentShareCalendar = `` /* 360-byte string literal not displayed */

	DocumentUnshareCalendar = `mutation ($shareId: String!) { UnshareCalendar(shareId: $shareId) }`

	DocumentCreateCircleCalendar = `` /* 184-byte string literal not displayed */

	DocumentDeleteCircleCalendar = `mutation ($circleId: String!) { DeleteCircleCalendar(circleId: $circleId) }`

	DocumentListCalendarFreeBusy = `` /* 214-byte string literal not displayed */

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

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

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

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

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

)
View Source
const (
	DocumentListChatCalls = `query ($conversationId: String!, $first: Int) { ListChatCalls(conversationId: $conversationId, first: $first) ` + chatCallFields + ` }`
	DocumentReadChatCall  = `query ($callId: String!) { ReadChatCall(callId: $callId) { call ` + chatCallFields + ` transcript { speakerName startMs text } recordingId isRecordingOwned } }`
)
View Source
const (
	DocumentListAddressBooks = `query { ListAddressBooks { id name description contacts } }`

	// DocumentListReachableAddressBooks is the caller's own books and then
	// their circles', with whose each is.
	DocumentListReachableAddressBooks = `query { ListReachableAddressBooks ` + addressBookSelection + ` }`

	DocumentCreateCircleAddressBook = `mutation ($circleId: String!, $name: String) {
  CreateCircleAddressBook(circleId: $circleId, name: $name) ` + addressBookSelection + `
}`

	DocumentSaveAddressBook = `mutation ($id: String!, $name: String, $description: String) {
  SaveAddressBook(id: $id, name: $name, description: $description) ` + addressBookSelection + `
}`

	DocumentDeleteCircleAddressBook = `mutation ($addressBookId: String!) { DeleteCircleAddressBook(addressBookId: $addressBookId) }`

	DocumentListContacts = `query ($addressBookId: String!, $query: String, $first: Int) {
  ListContacts(addressBookId: $addressBookId, query: $query, first: $first) {
    id uid name organization emails phones hasPhoto addresses { written }
    accountUserId account ` + contactAccountSelection + `
  }
}`

	DocumentGetContact = `query ($id: String!, $addressBookId: String) {
  GetContact(id: $id, addressBookId: $addressBookId) {
    id uid etag name organization emails phones note hasPhoto card
    addresses { label street locality region postalCode country written }
    accountUserId account ` + contactAccountSelection + `
  }
}`

	DocumentSetContactAccount = `mutation ($addressBookId: String!, $contactId: String!, $accountUserId: String) {
  SetContactAccount(addressBookId: $addressBookId, contactId: $contactId, accountUserId: $accountUserId) {
    id uid name emails phones accountUserId account ` + contactAccountSelection + `
  }
}`

	DocumentListContactAccountSuggestions = `query {
  ListContactAccountSuggestions {
    addressBookId
    contact { id uid name organization emails phones }
    account ` + contactAccountSelection + `
  }
}`

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

	DocumentDeleteContact = `mutation ($id: String!, $addressBookId: String) { DeleteContact(id: $id, addressBookId: $addressBookId) }`

	DocumentRemoveContactPicture = `` /* 153-byte string literal not displayed */

)
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 + ` }`

	DocumentReadStatement = `` /* 128-byte string literal not displayed */

	DocumentFinanceImports = `` /* 429-byte string literal not displayed */

	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 (
	DocumentListFinanceAccountShares = `query ($financeAccountId: String) {
  ListFinanceAccountShares(financeAccountId: $financeAccountId) { ` + financeShareFields + ` }
}`
	DocumentShareFinanceAccount = `mutation ($financeAccountId: String!, $granteeUserId: String, $granteeCircleId: String, $financeShareLevel: String!) {
  ShareFinanceAccount(financeAccountId: $financeAccountId, granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, financeShareLevel: $financeShareLevel) { ` + financeShareFields + ` }
}`
	DocumentUnshareFinanceAccount     = `mutation ($shareId: String!) { UnshareFinanceAccount(shareId: $shareId) }`
	DocumentListSharedFinanceAccounts = `` /* 320-byte string literal not displayed */

	DocumentListSharedFinanceSpending = `` /* 300-byte string literal not displayed */

	DocumentListSharedFinanceTransactions = `` /* 417-byte string literal not displayed */

	DocumentListFinanceShares = `query { ListFinanceShares { ` + financeShareAllFields + ` } }`
	DocumentShareFinance      = `mutation ($granteeUserId: String, $granteeCircleId: String, $financeShareLevel: String!) {
  ShareFinance(granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, financeShareLevel: $financeShareLevel) { ` + financeShareAllFields + ` }
}`
	DocumentUnshareFinance    = `mutation ($financeShareId: String!) { UnshareFinance(financeShareId: $financeShareId) }`
	DocumentListSharedFinance = `` /* 135-byte string literal not displayed */
)
View Source
const (
	DocumentListHealthTypes = `query ($ownerUserId: String) {
  ListHealthTypes(ownerUserId: $ownerUserId) {
    healthType healthCategory typeName valueKind quantityUnit summaryKind firstDay lastDay sampleCount
    latestDaySummary { ` + healthDayFields + ` }
  }
}`

	DocumentReadHealthSummary = `` /* 410-byte string literal not displayed */

	DocumentListHealthSamples = `query ($healthType: String!, $from: DateTime!, $to: DateTime!, $limitCount: Int, $offset: Int) {
  ListHealthSamples(healthType: $healthType, from: $from, to: $to, limitCount: $limitCount, offset: $offset) {
    totalCount isTotalCountCapped nextOffset
    samples { ` + healthSampleFields + ` }
  }
}`

	DocumentReadHealthRoute = `query ($healthSampleId: String!) {
  ReadHealthRoute(healthSampleId: $healthSampleId) { healthSampleId routePoints }
}`

	DocumentReadHealthSettings = `query { ReadHealthSettings { ` + healthSettingsFields + ` } }`

	// DocumentReadHealthAgentSwitch asks only whether the agent may read
	// Health, which the server answers from one row of the account.
	DocumentReadHealthAgentSwitch = `query { ReadHealthSettings { canAgentReadHealth } }`

	DocumentUpdateHealthSettings = `mutation ($canAgentReadHealth: Boolean!) {
  UpdateHealthSettings(canAgentReadHealth: $canAgentReadHealth) { ` + healthSettingsFields + ` }
}`

	DocumentEraseHealthData = `mutation ($healthType: String) {
  EraseHealthData(healthType: $healthType) { erasedSampleCount }
}`

	DocumentListHealthShares = `query { ListHealthShares { ` + healthShareFields + ` } }`

	DocumentSetHealthShare = `mutation ($granteeUserId: String, $granteeCircleId: String, $healthCategories: [String!]!) {
  SetHealthShare(granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, healthCategories: $healthCategories) { ` + healthShareFields + ` }
}`
)
View Source
const (
	DocumentListJournalDays = `query ($fromDay: String, $untilDay: String, $first: Int, $offset: Int) {
  ListJournalDays(fromDay: $fromDay, untilDay: $untilDay, first: $first, offset: $offset) {
    totalCount today firstDay days { ` + journalDaySummaryFields + ` }
  }
}`

	DocumentReadJournalDay = `query ($day: String!) { ReadJournalDay(day: $day) { ` + journalDayFields + ` } }`

	DocumentReadJournalPeriod = `query ($periodKind: String!, $day: String!) {
  ReadJournalPeriod(periodKind: $periodKind, day: $day) { ` + journalPeriodFields + ` }
}`

	DocumentSearchJournal = `` /* 173-byte string literal not displayed */

	DocumentReadJournalSettings = `query { ReadJournalSettings { ` + journalSettingsFields + ` } }`

	DocumentSetJournalWords = `mutation ($day: String!, $words: String!, $baseModifiedAt: DateTime) {
  SetJournalWords(day: $day, words: $words, baseModifiedAt: $baseModifiedAt) { day words { ` + journalWordsFields + ` } mood { ` + journalMoodFields + ` } }
}`

	DocumentSetJournalMood = `mutation ($day: String!, $moodLevel: Int, $moodWords: String) {
  SetJournalMood(day: $day, moodLevel: $moodLevel, moodWords: $moodWords) { day mood { ` + journalMoodFields + ` } }
}`

	DocumentSetJournalLookingBack = `mutation ($periodKind: String!, $day: String!, $lookingBack: String!, $baseModifiedAt: DateTime) {
  SetJournalLookingBack(periodKind: $periodKind, day: $day, lookingBack: $lookingBack, baseModifiedAt: $baseModifiedAt) {
    periodKind periodStart periodEnd lookingBack { ` + journalWordsFields + ` }
  }
}`

	DocumentTouchUpJournalWords = `mutation ($day: String!, $periodKind: String, $how: String) {
  TouchUpJournalWords(day: $day, periodKind: $periodKind, how: $how) { day periodKind words { ` + journalWordsFields + ` } }
}`

	DocumentStopJournalTouchUp = `mutation ($day: String!, $periodKind: String) {
  StopJournalTouchUp(day: $day, periodKind: $periodKind) { day periodKind words { ` + journalWordsFields + ` } }
}`

	DocumentCorrectJournalNarrative = `mutation ($day: String!, $periodKind: String, $correctionText: String!) {
  CorrectJournalNarrative(day: $day, periodKind: $periodKind, correctionText: $correctionText) { ` + journalNarrativeFields + ` isCorrectionAlreadyKept }
}`

	DocumentRemoveJournalCorrection = `mutation ($day: String!, $periodKind: String, $correctionIndex: Int!) {
  RemoveJournalCorrection(day: $day, periodKind: $periodKind, correctionIndex: $correctionIndex) { ` + journalNarrativeFields + ` }
}`

	DocumentWriteJournalNarrative = `mutation ($day: String!, $periodKind: String) {
  WriteJournalNarrative(day: $day, periodKind: $periodKind) { ` + journalNarrativeFields + ` }
}`

	DocumentDeleteJournalNarrative = `mutation ($day: String!, $periodKind: String) {
  DeleteJournalNarrative(day: $day, periodKind: $periodKind) { ` + journalNarrativeFields + ` }
}`

	DocumentPinJournalRecord = `mutation ($day: String!, $recordKind: String!, $recordId: String!, $linkReason: String) {
  PinJournalRecord(day: $day, recordKind: $recordKind, recordId: $recordId, linkReason: $linkReason) { ` + journalLinkFields + ` }
}`

	DocumentRemoveJournalLink = `mutation ($linkId: String!) { RemoveJournalLink(linkId: $linkId) }`

	DocumentUpdateJournalSettings = `mutation ($isWeatherOn: Boolean, $isEveningQuestionOn: Boolean, $eveningQuestionTime: String) {
  UpdateJournalSettings(isWeatherOn: $isWeatherOn, isEveningQuestionOn: $isEveningQuestionOn, eveningQuestionTime: $eveningQuestionTime) { ` + journalSettingsFields + ` }
}`

	DocumentEraseJournal = `mutation { EraseJournal { dayCount periodCount linkCount } }`
)
View Source
const (
	DocumentGetLocation = `query ($userId: String) {
  GetLocation(userId: $userId) {
    userId username name shareLevel
    latestPoint { ` + locationPointFields + ` }
    openVisit { ` + placeVisitFields + ` }
    pause { ` + locationPauseFields + ` }
    notificationMute { ` + locationNotificationMuteFields + ` }
  }
}`

	DocumentListLocationVisits = `query ($userId: String, $from: DateTime, $until: DateTime, $placeId: String, $placeLabel: String, $offset: Int, $limitCount: Int) {
  ListLocationVisits(userId: $userId, from: $from, until: $until, placeId: $placeId, placeLabel: $placeLabel, offset: $offset, limitCount: $limitCount) {
    nextOffset
    placeVisits { ` + listedVisitFields + ` }
  }
}`

	DocumentListPlaces = `query ($userId: String, $placeLabel: String, $query: String, $offset: Int, $limitCount: Int) {
  ListPlaces(userId: $userId, placeLabel: $placeLabel, query: $query, offset: $offset, limitCount: $limitCount) {
    nextOffset
    places { ` + placeFields + ` }
  }
}`

	DocumentReadPlace = `query ($placeId: String!, $userId: String) {
  ReadPlace(placeId: $placeId, userId: $userId) { ` + placeFields + ` }
}`

	DocumentListNearbyPlaces = `query ($latitudeDegrees: Float!, $longitudeDegrees: Float!, $radiusMeters: Float) {
  ListNearbyPlaces(latitudeDegrees: $latitudeDegrees, longitudeDegrees: $longitudeDegrees, radiusMeters: $radiusMeters) {
    ` + foundPlaceFields + `
  }
}`

	DocumentSearchPlaces = `query ($query: String!, $latitudeDegrees: Float, $longitudeDegrees: Float, $placeId: String, $radiusMeters: Float, $offset: Int, $limitCount: Int) {
  SearchPlaces(query: $query, latitudeDegrees: $latitudeDegrees, longitudeDegrees: $longitudeDegrees, placeId: $placeId, radiusMeters: $radiusMeters, offset: $offset, limitCount: $limitCount) {
    nextOffset
    foundPlaces { ` + foundPlaceFields + ` }
  }
}`

	DocumentSearchAddresses = `query ($query: String!, $latitudeDegrees: Float, $longitudeDegrees: Float, $placeId: String, $limitCount: Int) {
  SearchAddresses(query: $query, latitudeDegrees: $latitudeDegrees, longitudeDegrees: $longitudeDegrees, placeId: $placeId, limitCount: $limitCount) {
    ` + foundPlaceFields + `
  }
}`

	DocumentListLocationPauses = `query ($userId: String, $from: DateTime!, $until: DateTime!) {
  ListLocationPauses(userId: $userId, from: $from, until: $until) { ` + locationPauseFields + ` }
}`

	DocumentPauseLocation = `mutation ($endedAt: DateTime) {
  PauseLocation(endedAt: $endedAt) { ` + locationPauseFields + ` }
}`

	DocumentResumeLocation = `mutation { ResumeLocation }`

	DocumentMuteLocationNotifications = `mutation ($userId: String!, $mutedUntil: DateTime) {
  MuteLocationNotifications(userId: $userId, mutedUntil: $mutedUntil) { ` + locationNotificationMuteFields + ` }
}`

	DocumentUnmuteLocationNotifications = `mutation ($userId: String!) { UnmuteLocationNotifications(userId: $userId) }`

	DocumentListLocationPoints = `query ($userId: String, $from: DateTime!, $until: DateTime!) {
  ListLocationPoints(userId: $userId, from: $from, until: $until) { ` + locationPointFields + ` }
}`

	DocumentSavePlace = `mutation ($placeId: String, $placeName: String, $placeLabel: String, $latitudeDegrees: Float, $longitudeDegrees: Float, $radiusMeters: Float, $addressText: String) {
  SavePlace(placeId: $placeId, placeName: $placeName, placeLabel: $placeLabel, latitudeDegrees: $latitudeDegrees, longitudeDegrees: $longitudeDegrees, radiusMeters: $radiusMeters, addressText: $addressText) {
    ` + placeFields + `
  }
}`

	DocumentForgetPlace      = `mutation ($placeId: String!) { ForgetPlace(placeId: $placeId) }`
	DocumentForgetPlaceVisit = `mutation ($placeVisitId: String!) { ForgetPlaceVisit(placeVisitId: $placeVisitId) }`

	DocumentCheckIn = `mutation ($placeId: String, $latitudeDegrees: Float, $longitudeDegrees: Float, $placeName: String, $osmType: String, $osmId: Int64, $osmCategory: String, $addressText: String, $accuracyMeters: Float) {
  CheckIn(placeId: $placeId, latitudeDegrees: $latitudeDegrees, longitudeDegrees: $longitudeDegrees, placeName: $placeName, osmType: $osmType, osmId: $osmId, osmCategory: $osmCategory, addressText: $addressText, accuracyMeters: $accuracyMeters) {
    ` + placeVisitFields + `
  }
}`

	DocumentEraseLocationHistory = `` /* 136-byte string literal not displayed */

)
View Source
const (
	DocumentListSharedLocations = `query {
  ListSharedLocations {
    userId username name shareLevel grantedShareLevel
    latestPoint { ` + locationPointFields + ` }
    openVisit { ` + placeVisitFields + ` }
    pause { ` + locationPauseFields + ` }
    notificationMute { ` + locationNotificationMuteFields + ` }
  }
}`

	DocumentListLocationShares = `query { ListLocationShares { ` + locationShareFields + ` } }`

	DocumentShareLocation = `mutation ($granteeUserId: String, $granteeCircleId: String, $shareLevel: String!) {
  ShareLocation(granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, shareLevel: $shareLevel) { ` + locationShareFields + ` }
}`

	DocumentUnshareLocation = `mutation ($shareId: String!) { UnshareLocation(shareId: $shareId) }`
)
View Source
const (
	DocumentListTrips = `query ($userId: String, $from: DateTime!, $until: DateTime!, $offset: Int, $limitCount: Int) {
  ListTrips(userId: $userId, from: $from, until: $until, offset: $offset, limitCount: $limitCount) {
    nextOffset
    trips {
      id startedAt endedAt durationSeconds distanceMeters
      fromPlace { ` + placeFields + ` }
      toPlace { ` + placeFields + ` }
      legs { ` + tripLegFields + ` }
    }
  }
}`

	DocumentSetTripLegTravelMode = `mutation ($tripLegId: String!, $travelMode: String) {
  SetTripLegTravelMode(tripLegId: $tripLegId, travelMode: $travelMode) { ` + tripLegFields + ` }
}`

	DocumentListTravelTotals = `` /* 239-byte string literal not displayed */

)
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 = `` /* 266-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 (

	// DocumentListMailboxItems 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.
	DocumentListMailboxItems = `query ($folderId: String, $mailboxId: String, $from: String, $to: String, $subject: String, $search: String,
		$since: DateTime, $before: DateTime, $hasAttachment: Boolean, $unread: Boolean, $flagged: Boolean, $first: Int, $offset: Int, $after: String) {
		ListMailboxItems(folderId: $folderId, mailboxId: $mailboxId, from: $from, to: $to, subject: $subject, search: $search,
			since: $since, before: $before, hasAttachment: $hasAttachment, unread: $unread, flagged: $flagged, first: $first, offset: $offset, after: $after) {
			total
			items ` + mailboxItemFields + `
		}
	}`
	DocumentGetMailboxItem   = `query ($itemId: String!) { GetMailboxItem(itemId: $itemId) ` + mailboxItemFields + ` }`
	DocumentGetMailboxThread = `query ($itemId: String!) {
		GetMailboxThread(itemId: $itemId) {
			threadId subject truncated
			items { folderId folderName folderKind item ` + mailboxItemFields + ` }
		}
	}`
	DocumentMoveMailboxItems = `mutation ($itemIds: [String!]!, $folderId: String!) {
		MoveMailboxItems(itemIds: $itemIds, folderId: $folderId) ` + mailboxItemFields + `
	}`
	DocumentSetMailboxItemFlags = `` /* 144-byte string literal not displayed */

	DocumentReportMailboxJunk = `mutation ($itemIds: [String!]!, $notJunk: Boolean) {
		ReportMailboxJunk(itemIds: $itemIds, notJunk: $notJunk)
	}`
	DocumentSendMailboxMessage = `mutation ($mailboxId: String!, $submissionId: String, $message: MailboxMessageParametersInput!) {
		SendMailboxMessage(mailboxId: $mailboxId, submissionId: $submissionId, message: $message) {
			mail { id from fromName recipients subject receivedAt }
			item ` + mailboxItemFields + `
		}
	}`
	DocumentSaveMailboxDraft = `mutation ($mailboxId: String!, $message: MailboxMessageParametersInput!) {
		SaveMailboxDraft(mailboxId: $mailboxId, message: $message) ` + mailboxItemFields + `
	}`
	DocumentGetMailInvitation    = `query ($itemId: String!) { GetMailInvitation(itemId: $itemId) ` + invitationFields + ` }`
	DocumentAnswerMailInvitation = `mutation ($requestId: String, $itemId: String!, $answer: String!) {
		AnswerMailInvitation(requestId: $requestId, itemId: $itemId, answer: $answer) ` + invitationFields + `
	}`
)
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 (
	DocumentReadPasswordsSetup = `query { ReadPasswordsSetup { ` + passwordsSetupFields + ` } }`

	DocumentSetUpPasswords = `mutation ($input: PasswordsSetupInput!) {
  SetUpPasswords(input: $input) { ` + passwordsSetupFields + ` }
}`

	DocumentUnlockPasswords = `` /* 174-byte string literal not displayed */

	DocumentChangePasswordsPassphrase = `mutation ($input: PasswordsPassphraseChangeInput!) {
  ChangePasswordsPassphrase(input: $input) { ` + passwordsSetupFields + ` }
}`

	DocumentReplacePasswordsRecoveryKey = `mutation ($input: PasswordsRecoveryKeyReplacementInput!) {
  ReplacePasswordsRecoveryKey(input: $input) { ` + passwordsSetupFields + ` }
}`

	DocumentUpdatePasswordsSettings = `mutation ($lockAfterMinutes: Int!) {
  UpdatePasswordsSettings(lockAfterMinutes: $lockAfterMinutes) { ` + passwordsSetupFields + ` }
}`

	DocumentErasePasswords = `mutation { ErasePasswords }`

	DocumentListPasswordItems = `query ($sinceRevision: Int64) {
  ListPasswordItems(sinceRevision: $sinceRevision) {
    itemIds revision
    items { ` + passwordItemFields + ` }
  }
}`

	DocumentListPasswordRecipients = `query ($granteeUserId: String, $granteeCircleId: String) {
  ListPasswordRecipients(granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId) { ` + passwordRecipientFields + ` }
}`

	DocumentListWaitingPasswordShares = `query {
  ListWaitingPasswordShares { itemId hasMoreWaiting recipient { ` + passwordRecipientFields + ` } }
}`

	DocumentReadPasswordsAgentKey = `query { ReadPasswordsAgentKey }`

	DocumentListPasswordItemVersions = `` /* 143-byte string literal not displayed */

	DocumentSavePasswordItem = `mutation ($input: PasswordItemInput!) {
  SavePasswordItem(input: $input) { ` + passwordItemFields + ` }
}`

	DocumentDeletePasswordItem = `mutation ($id: String!) {
  DeletePasswordItem(id: $id) { ` + passwordItemFields + ` }
}`

	DocumentRestorePasswordItem = `mutation ($id: String!) {
  RestorePasswordItem(id: $id) { ` + passwordItemFields + ` }
}`

	DocumentRestorePasswordItemVersion = `mutation ($itemId: String!, $versionId: String!, $baseRevision: Int64!) {
  RestorePasswordItemVersion(itemId: $itemId, versionId: $versionId, baseRevision: $baseRevision) { ` + passwordItemFields + ` }
}`

	DocumentPurgePasswordItem = `mutation ($id: String!) {
  PurgePasswordItem(id: $id)
}`

	DocumentSetPasswordItemShares = `mutation ($input: PasswordItemSharesInput!) {
  SetPasswordItemShares(input: $input) { ` + passwordItemFields + ` }
}`

	DocumentAddPasswordShareKeys = `mutation ($keys: [PasswordItemShareKeyInput!]!) {
  AddPasswordShareKeys(keys: $keys)
}`

	DocumentRekeyPasswordItem = `mutation ($input: PasswordItemRekeyInput!) {
  RekeyPasswordItem(input: $input) { ` + passwordItemFields + ` }
}`

	DocumentSetPasswordItemUsableByAgent = `mutation ($input: PasswordItemAgentUseInput!) {
  SetPasswordItemUsableByAgent(input: $input) { ` + passwordItemFields + ` }
}`
)
View Source
const (
	DocumentListPhotos = `query (` + photoFilterDeclarations + `) { ListPhotos(` + photoFilterArguments + `) ` + photoSelection + ` }`

	DocumentCountPhotos = `query (` + photoFilterDeclarations + `) { CountPhotos(` + photoFilterArguments + `) }`

	DocumentCountUndescribedPhotos = `query (` + photoFilterDeclarations + `) { CountUndescribedPhotos(` + photoFilterArguments + `) }`

	DocumentReadPhoto = `query ($photoId: String!) {
  ReadPhoto(photoId: $photoId) {
    photo ` + photoSelection + `
    photoFiles { photoId photoFileRole blobSha256 contentType fileSizeBytes originalFilename createdAt fileUrl }
    photoPreviews { photoId photoPreviewSize contentType previewSizeBytes widthPixels heightPixels createdAt previewUrl }
    albums { id albumTitle }
    faces { ` + photoFaceSelection + ` }
  }
}`

	DocumentReadPhotoPlace = `query ($photoId: String!) { ReadPhotoPlace(photoId: $photoId) { locationPlace { ` + placeFields + ` } addressText } }`

	DocumentReadPhotoLibrary = `` /* 338-byte string literal not displayed */

	DocumentFindPhotos = `query ($clientPhotoIds: [String!]!) { FindPhotos(clientPhotoIds: $clientPhotoIds) ` + photoSelection + ` }`

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

	DocumentUpdatePhoto = `mutation ($photoId: String!, $isFavorite: Boolean, $takenAt: DateTime) { UpdatePhoto(photoId: $photoId, isFavorite: $isFavorite, takenAt: $takenAt) ` + photoSelection + ` }`

	DocumentSearchPhotoPlaces = `` /* 260-byte string literal not displayed */

	DocumentSetPhotoLocation = `` /* 157-byte string literal not displayed */

	DocumentRemovePhotoLocation = `mutation ($photoIds: [String!]!) { RemovePhotoLocation(photoIds: $photoIds) }`

	DocumentTrashPhotos = `mutation ($photoIds: [String!]!) { TrashPhotos(photoIds: $photoIds) }`

	DocumentRestorePhotos = `mutation ($photoIds: [String!]!) { RestorePhotos(photoIds: $photoIds) }`

	DocumentDeletePhotos = `mutation ($photoIds: [String!]!) { DeletePhotos(photoIds: $photoIds) }`

	DocumentEmptyPhotoTrash = `mutation { EmptyPhotoTrash }`

	DocumentRetryPhotoProcessing = `mutation ($photoIds: [String!]!) { RetryPhotoProcessing(photoIds: $photoIds) }`

	DocumentDescribePhoto = `mutation ($photoId: String!, $isRedescribed: Boolean) { DescribePhoto(photoId: $photoId, isRedescribed: $isRedescribed) ` + photoSelection + ` }`

	DocumentSavePhotoFromAttachment = `mutation ($agentAttachmentId: String!) { SavePhotoFromAttachment(agentAttachmentId: $agentAttachmentId) ` + photoSelection + ` }`

	DocumentSavePhotoToLibrary = `mutation ($photoId: String!) { SavePhotoToLibrary(photoId: $photoId) ` + photoSelection + ` }`
)
View Source
const (
	DocumentListPhotoAlbums = `query ($circleId: String) { ListPhotoAlbums(circleId: $circleId) ` + photoAlbumSelection + ` }`

	DocumentReadPhotoAlbum = `query ($photoAlbumId: String!) { ReadPhotoAlbum(photoAlbumId: $photoAlbumId) ` + photoAlbumSelection + ` }`

	DocumentSuggestPhotoAlbums = `query ($takenAfter: DateTime, $takenBefore: DateTime) { SuggestPhotoAlbums(takenAfter: $takenAfter, takenBefore: $takenBefore) ` + photoAlbumSuggestionSelection + ` }`

	DocumentCreatePhotoAlbum = `mutation ($albumTitle: String!, $photoIds: [String!], $circleId: String) { CreatePhotoAlbum(albumTitle: $albumTitle, photoIds: $photoIds, circleId: $circleId) ` + photoAlbumSelection + ` }`

	DocumentRenamePhotoAlbum = `mutation ($photoAlbumId: String!, $albumTitle: String!) { RenamePhotoAlbum(photoAlbumId: $photoAlbumId, albumTitle: $albumTitle) ` + photoAlbumSelection + ` }`

	DocumentDeletePhotoAlbum = `mutation ($photoAlbumId: String!) { DeletePhotoAlbum(photoAlbumId: $photoAlbumId) }`

	DocumentAddPhotosToAlbum = `` /* 127-byte string literal not displayed */

	DocumentRemovePhotosFromAlbum = `` /* 132-byte string literal not displayed */

	DocumentListPhotoAlbumShares = `query ($photoAlbumId: String!) { ListPhotoAlbumShares(photoAlbumId: $photoAlbumId) ` + photoAlbumShareSelection + ` }`

	DocumentSharePhotoAlbum = `mutation ($photoAlbumId: String!, $granteeUserId: String, $granteeCircleId: String, $shareLevel: String!, $isLocationIncluded: Boolean, $isFaceNamesIncluded: Boolean) { SharePhotoAlbum(photoAlbumId: $photoAlbumId, granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId, shareLevel: $shareLevel, isLocationIncluded: $isLocationIncluded, isFaceNamesIncluded: $isFaceNamesIncluded) ` + photoAlbumShareSelection + ` }`

	DocumentUpdatePhotoAlbumShare = `mutation ($photoAlbumShareId: String!, $shareLevel: String!, $isLocationIncluded: Boolean, $isFaceNamesIncluded: Boolean) { UpdatePhotoAlbumShare(photoAlbumShareId: $photoAlbumShareId, shareLevel: $shareLevel, isLocationIncluded: $isLocationIncluded, isFaceNamesIncluded: $isFaceNamesIncluded) ` + photoAlbumShareSelection + ` }`

	DocumentRemovePhotoAlbumShare = `mutation ($photoAlbumShareId: String!) { RemovePhotoAlbumShare(photoAlbumShareId: $photoAlbumShareId) }`

	DocumentSetPhotoAlbumCover = `mutation ($photoAlbumId: String!, $photoId: String!) { SetPhotoAlbumCover(photoAlbumId: $photoAlbumId, photoId: $photoId) ` + photoAlbumSelection + ` }`
)
View Source
const (
	DocumentListPhotoFaceGroups = `query ($isHiddenIncluded: Boolean) { ListPhotoFaceGroups(isHiddenIncluded: $isHiddenIncluded) ` + photoFaceGroupSelection + ` }`

	DocumentReadPhotoFaceGroup = `query ($photoFaceGroupId: String!) { ReadPhotoFaceGroup(photoFaceGroupId: $photoFaceGroupId) ` + photoFaceGroupSelection + ` }`

	DocumentNamePhotoFaceGroup = `mutation ($photoFaceGroupId: String!, $contactId: String!) { NamePhotoFaceGroup(photoFaceGroupId: $photoFaceGroupId, contactId: $contactId) { photoFaceGroup ` + photoFaceGroupSelection + ` mergedPhotoFaceGroupId isContactPictureSet } }`

	DocumentUnnamePhotoFaceGroup = `mutation ($photoFaceGroupId: String!) { UnnamePhotoFaceGroup(photoFaceGroupId: $photoFaceGroupId) ` + photoFaceGroupSelection + ` }`

	DocumentMergePhotoFaceGroups = `mutation ($photoFaceGroupIds: [String!]!) { MergePhotoFaceGroups(photoFaceGroupIds: $photoFaceGroupIds) ` + photoFaceGroupSelection + ` }`

	DocumentRemovePhotoFaceFromGroup = `mutation ($photoFaceId: String!) { RemovePhotoFaceFromGroup(photoFaceId: $photoFaceId) ` + photoFaceGroupSelection + ` }`

	DocumentHidePhotoFaceGroup = `mutation ($photoFaceGroupId: String!, $isHidden: Boolean!) { HidePhotoFaceGroup(photoFaceGroupId: $photoFaceGroupId, isHidden: $isHidden) ` + photoFaceGroupSelection + ` }`

	DocumentSetPhotoFaceRecognition = `mutation ($isEnabled: Boolean!) { SetPhotoFaceRecognition(isEnabled: $isEnabled) }`
)
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 (

	// DocumentListSharing is the query behind "teanode sharing" and the
	// agent's circle tool.
	DocumentListSharing = `query { ListSharing {
  ` + sharesMadeFields + `
  ` + sharesReceivedFields + `
} }`

	// DocumentListSharingMade is DocumentListSharing without what others
	// shared with the account, for the agent in a chat, where everybody in
	// the room would read it.
	DocumentListSharingMade = `query { ListSharing {
  ` + sharesMadeFields + `
} }`

	// DocumentDeclineShare ends a share made to the account by name.
	DocumentDeclineShare = `mutation ($shareKind: String!, $shareId: String!) { DeclineShare(shareKind: $shareKind, shareId: $shareId) }`
)
View Source
const (
	DocumentListShoppingLists = `query { ListShoppingLists ` + shoppingListSelection + ` }`

	DocumentGetShoppingList = `query ($shoppingListId: String!, $shoppingItemStates: [String!], $searchText: String, $offset: Int, $pageSize: Int) { GetShoppingList(shoppingListId: $shoppingListId, shoppingItemStates: $shoppingItemStates, searchText: $searchText, offset: $offset, pageSize: $pageSize) { totalCount shoppingList ` + shoppingListSelection + ` shoppingItems ` + shoppingItemSelection + ` shoppingTrips ` + shoppingTripSelection + ` } }`

	DocumentGetShoppingItem = `query ($shoppingItemId: String!) { GetShoppingItem(shoppingItemId: $shoppingItemId) ` + shoppingItemSelection + ` }`

	DocumentListShoppingListShares = `query ($shoppingListId: String!) { ListShoppingListShares(shoppingListId: $shoppingListId) ` + shoppingShareSelection + ` }`

	DocumentListShoppingStores = `query { ListShoppingStores ` + shoppingStoreSelection + ` }`

	DocumentListShoppingStoreItems = `query ($storeName: String!, $shoppingListIds: [String!], $isAnyStoreIncluded: Boolean) { ListShoppingStoreItems(storeName: $storeName, shoppingListIds: $shoppingListIds, isAnyStoreIncluded: $isAnyStoreIncluded) { storeName isReminded shoppingItems ` + shoppingItemSelection + ` shoppingLists { shoppingListId listName neededCount isIncluded } shoppingTrips ` + shoppingTripSelection + ` } }`

	DocumentListOpenShoppingTrips = `query { ListOpenShoppingTrips ` + shoppingTripSelection + ` }`

	DocumentGetResumableShoppingTrip = `query { GetResumableShoppingTrip ` + shoppingTripSelection + ` }`

	DocumentListWatchedStores = `` /* 279-byte string literal not displayed */

	DocumentListSimilarShoppingItems = `query ($shoppingListId: String!, $itemDescription: String!) { ListSimilarShoppingItems(shoppingListId: $shoppingListId, itemDescription: $itemDescription) ` + shoppingItemSelection + ` }`
	DocumentListShoppingItemPrices   = `query ($shoppingItemId: String!) { ListShoppingItemPrices(shoppingItemId: $shoppingItemId) ` + shoppingPriceSelection + ` }`

	DocumentListShoppingReceiptMatches = `query ($financeReceiptId: String!) { ListShoppingReceiptMatches(financeReceiptId: $financeReceiptId) { financeReceiptId merchantName purchasedOn totalAmount currencyCode shoppingReceiptLines { financeReceiptLineId lineNumber description quantity lineAmount shoppingReceiptMatches { shoppingReceiptMatch ` + shoppingReceiptMatchSelection + ` shoppingItem ` + shoppingItemSelection + ` } } stillNeededItems ` + shoppingItemSelection + ` } }`

	DocumentPreviewShoppingImport = `query ($shoppingListId: String, $importText: String, $agentAttachmentIds: [String!]) { PreviewShoppingImport(shoppingListId: $shoppingListId, importText: $importText, agentAttachmentIds: $agentAttachmentIds) { shoppingItems ` + shoppingImportItemSelection + ` } }`

	DocumentCreateShoppingList = `mutation ($listName: String!) { CreateShoppingList(listName: $listName) ` + shoppingListSelection + ` }`

	DocumentRenameShoppingList = `mutation ($shoppingListId: String!, $listName: String!) { RenameShoppingList(shoppingListId: $shoppingListId, listName: $listName) ` + shoppingListSelection + ` }`

	DocumentDeleteShoppingList = `mutation ($shoppingListId: String!) { DeleteShoppingList(shoppingListId: $shoppingListId) }`

	DocumentShareShoppingList = `mutation ($shoppingListId: String!, $granteeUserId: String, $granteeCircleId: String) { ShareShoppingList(shoppingListId: $shoppingListId, granteeUserId: $granteeUserId, granteeCircleId: $granteeCircleId) ` + shoppingShareSelection + ` }`

	DocumentUnshareShoppingList = `mutation ($shoppingListShareId: String!) { UnshareShoppingList(shoppingListShareId: $shoppingListShareId) }`

	DocumentSetShoppingListReminder = `` /* 144-byte string literal not displayed */

	DocumentSetShoppingStoreReminder = `` /* 130-byte string literal not displayed */

	DocumentAddShoppingItems = `mutation ($shoppingListId: String!, $shoppingItems: [ShoppingItemEntryInput!]!) { AddShoppingItems(shoppingListId: $shoppingListId, shoppingItems: $shoppingItems) { isMerged shoppingItem ` + shoppingItemSelection + ` } }`

	DocumentUpdateShoppingItem = `mutation ($shoppingItemId: String!, $itemDescription: String, $itemDetails: String, $storeName: String, $isStoreBrand: Boolean, $aisleName: String, $neededQuantity: String, $quantityUnit: String) { UpdateShoppingItem(shoppingItemId: $shoppingItemId, itemDescription: $itemDescription, itemDetails: $itemDetails, storeName: $storeName, isStoreBrand: $isStoreBrand, aisleName: $aisleName, neededQuantity: $neededQuantity, quantityUnit: $quantityUnit) ` + shoppingItemSelection + ` }`

	DocumentRemoveShoppingItems = `mutation ($shoppingItemIds: [String!]!) { RemoveShoppingItems(shoppingItemIds: $shoppingItemIds) }`

	DocumentCheckShoppingItem = `mutation ($shoppingItemId: String!, $isChecked: Boolean!, $storeName: String) { CheckShoppingItem(shoppingItemId: $shoppingItemId, isChecked: $isChecked, storeName: $storeName) ` + shoppingItemSelection + ` }`

	DocumentSetShoppingItemNeed = `mutation ($shoppingItemId: String!, $isNeeded: Boolean!, $neededQuantity: String) { SetShoppingItemNeed(shoppingItemId: $shoppingItemId, isNeeded: $isNeeded, neededQuantity: $neededQuantity) ` + shoppingItemSelection + ` }`

	DocumentSetShoppingItemOutOfStock = `mutation ($shoppingItemId: String!, $isOutOfStock: Boolean!, $storeName: String) { SetShoppingItemOutOfStock(shoppingItemId: $shoppingItemId, isOutOfStock: $isOutOfStock, storeName: $storeName) ` + shoppingItemSelection + ` }`

	DocumentRecordShoppingItemPrice = `mutation ($shoppingItemId: String!, $unitPriceAmount: String!, $storeName: String, $observedOn: String, $currencyCode: String) { RecordShoppingItemPrice(shoppingItemId: $shoppingItemId, unitPriceAmount: $unitPriceAmount, storeName: $storeName, observedOn: $observedOn, currencyCode: $currencyCode) ` + shoppingPriceSelection + ` }`

	DocumentFindShoppingItemPicture = `mutation ($shoppingItemId: String!) { FindShoppingItemPicture(shoppingItemId: $shoppingItemId) }`

	DocumentSetShoppingItemPicture = `mutation ($shoppingItemId: String!, $agentAttachmentId: String) { SetShoppingItemPicture(shoppingItemId: $shoppingItemId, agentAttachmentId: $agentAttachmentId) ` + shoppingItemSelection + ` }`

	DocumentStartShopping = `mutation ($storeName: String, $shoppingListIds: [String!]!) { StartShopping(storeName: $storeName, shoppingListIds: $shoppingListIds) ` + shoppingTripSelection + ` }`

	DocumentFinishShopping = `mutation ($shoppingTripId: String) { FinishShopping(shoppingTripId: $shoppingTripId) ` + shoppingTripSelection + ` }`

	DocumentResumeShopping = `mutation ($shoppingTripId: String!) { ResumeShopping(shoppingTripId: $shoppingTripId) ` + shoppingTripSelection + ` }`

	DocumentCheckOffShoppingItem = `mutation ($shoppingItemId: String!, $isCheckedOff: Boolean!) { CheckOffShoppingItem(shoppingItemId: $shoppingItemId, isCheckedOff: $isCheckedOff) ` + shoppingItemSelection + ` }`

	DocumentMatchShoppingReceipt = `mutation ($financeReceiptId: String!) { MatchShoppingReceipt(financeReceiptId: $financeReceiptId) }`

	DocumentDecideShoppingReceiptMatch = `mutation ($shoppingReceiptMatchId: String!, $isApplied: Boolean!) { DecideShoppingReceiptMatch(shoppingReceiptMatchId: $shoppingReceiptMatchId, isApplied: $isApplied) ` + shoppingReceiptMatchSelection + ` }`

	DocumentMatchShoppingReceiptLine = `mutation ($shoppingItemId: String!, $financeReceiptLineId: String!) { MatchShoppingReceiptLine(shoppingItemId: $shoppingItemId, financeReceiptLineId: $financeReceiptLineId) ` + shoppingReceiptMatchSelection + ` }`

	DocumentUndoShoppingReceipt = `mutation ($financeReceiptId: String!) { UndoShoppingReceipt(financeReceiptId: $financeReceiptId) }`

	DocumentAddShoppingItemFromReceiptLine = `mutation ($financeReceiptLineId: String!, $shoppingListId: String!) { AddShoppingItemFromReceiptLine(financeReceiptLineId: $financeReceiptLineId, shoppingListId: $shoppingListId) ` + shoppingItemSelection + ` }`
)
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 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 DocumentHandBackAgentTab = `mutation ($note: String, $runId: String, $callId: String) {
	HandBackAgentTab(note: $note, runId: $runId, callId: $callId)
}`
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 DocumentReadAgentTab = `query {
	ReadAgentTab { connected attached title url allowed tabs { tab title url isOwn isCurrent } isTakenOver }
}`
View Source
const DocumentReadAgentWaiting = `` /* 196-byte string literal not displayed */
View Source
const DocumentReadLinkPreviews = `` /* 240-byte string literal not displayed */
View Source
const DocumentReadLocationSharingLimit = `query { ReadLocationSharingLimit { shareLevelLimit sharingLimitReason phonePermission isRecordingOn reportedAt } }`
View Source
const DocumentReadPersonCard = `query ($userId: String, $addressBookId: String, $contactId: String, $itemLimit: Int) {
  ReadPersonCard(userId: $userId, addressBookId: $addressBookId, contactId: $contactId, itemLimit: $itemLimit) {
    person ` + circleMemberFields + `
    contact {
      id uid name organization emails phones note hasPhoto
      addresses { label street locality region postalCode country written }
    }
    sharedCircles { circleId circleName circleKind }
    canMessage
    location {
      sectionState hasMoreTodayVisits
      location {
        userId username name shareLevel
        latestPoint { ` + locationPointFields + ` }
        openVisit { ` + placeVisitFields + ` }
        pause { id startedAt endedAt }
      }
      todayVisits { ` + placeVisitFields + ` }
    }
    health {
      sectionState hasMore
      healthTypes {
        healthType healthCategory typeName valueKind quantityUnit summaryKind firstDay lastDay sampleCount
        latestDaySummary { ` + healthDayFields + ` }
      }
    }
    finance {
      sectionState hasMore allFinanceShareLevel
      financeAccounts {
        financeAccountId ownerUserId ownerUsername ownerName financeShareLevel accountName accountMask accountKind currencyCode currentBalance balanceAt
        creditUsage { owedAmount creditLimitAmount creditLimitSource usageShare }
      }
    }
    photos {
      photosState hasMorePhotos albumsState hasMoreAlbums
      photos ` + photoSelection + `
      albums ` + photoAlbumSelection + `
    }
    mail {
      sectionState hasMore
      mails { mailboxItemId mailboxId folderPath subject fromAddress fromName isFromPerson isUnread receivedAt snippet }
    }
    recordings {
      sectionState hasMore
      recordings { recordingId title recordedAt durationMS spokenPassageCount }
    }
    memory {
      sectionState hasMore
      pages { nodePath nodeName nodeKind summary updatedAt isMatchedByName }
    }
  }
}`
View Source
const DocumentSearchEverything = `` /* 280-byte string literal not displayed */
View Source
const DocumentSendAgentFileToFeed = `` /* 191-byte string literal not displayed */

DocumentSendAgentFileToFeed names a file to send to the person's feed, as a card that shows it, and answers where its bytes go.

View Source
const DocumentSendAgentFileToMainChat = `` /* 195-byte string literal not displayed */

DocumentSendAgentFileToMainChat names a file to send to the person's main chat and answers where its bytes go.

View Source
const DocumentServiceCapabilities = `` /* 222-byte string literal not displayed */
View Source
const DocumentSetPhotoReading = `mutation ($isEnabled: Boolean!) { SetPhotoReading(isEnabled: $isEnabled) }`

DocumentSetPhotoReading switches the reading of the person's new photos.

View Source
const DocumentSetUpAssistant = `` /* 233-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 DocumentStorageUsage = `` /* 699-byte string literal not displayed */

DocumentStorageUsage is what the database and the files hold, for an operator.

View Source
const DocumentUpdateServices = `` /* 629-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 = `` /* 394-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 MaximumMergedPhotoFaceGroups = 50

MaximumMergedPhotoFaceGroups is how many groups one merge may name.

View Source
const MaximumPhotoIDs = 500

MaximumPhotoIDs is how many photos one call to the operations that take a list of them may name.

View Source
const MaximumSpendingRuleProposalCount = 50

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

View Source
const MostLinkPreviewURLs = 10

MostLinkPreviewURLs is how many links one question may be about.

View Source
const (
	RecordingCaptureSampleRate = 16000
)

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

View Source
const SkillSharingPagePath = "/settings/agent/connections"

SkillSharingPagePath is the dashboard page where the skills a person shared and the calls waiting for them are, and where they are approved (the agent page's Connections tab). The command line prints it, because approving is done there and in the iPhone app, not from a command line.

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 ErrNoPlaceMatches = errors.New("no city matches")

ErrNoPlaceMatches is words no city in the server's table matches.

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,
	"ReadStatement": DocumentReadStatement, "FinanceImports": DocumentFinanceImports,
	"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 FinanceShareDocuments = map[string]string{
	"ListFinanceAccountShares": DocumentListFinanceAccountShares, "ShareFinanceAccount": DocumentShareFinanceAccount,
	"UnshareFinanceAccount": DocumentUnshareFinanceAccount, "ListSharedFinanceAccounts": DocumentListSharedFinanceAccounts,
	"ListSharedFinanceSpending": DocumentListSharedFinanceSpending, "ListSharedFinanceTransactions": DocumentListSharedFinanceTransactions,
	"ListFinanceShares": DocumentListFinanceShares, "ShareFinance": DocumentShareFinance, "UnshareFinance": DocumentUnshareFinance,
	"ListSharedFinance": DocumentListSharedFinance,
}

FinanceShareDocuments is every document here 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 AddPasswordShareKeys added in v0.193.0

func AddPasswordShareKeys(ctx context.Context, connection *Client, keys []*PasswordItemShareKeyInput) (int, error)

AddPasswordShareKeys seals items for recipients that a share already reaches but who had no key yet, and says how many keys it stored.

func AddPhotosToAlbum added in v0.171.0

func AddPhotosToAlbum(ctx context.Context, executor Executor, photoAlbumId string, photoIds []string) (int, error)

AddPhotosToAlbum puts photos in an album and says how many it added: those already in it are not counted.

func AddShoppingItemFromReceiptLine added in v0.201.0

func AddShoppingItemFromReceiptLine(ctx context.Context, executor Executor, financeReceiptLineId, shoppingListId string) (*models.ShoppingItem, error)

AddShoppingItemFromReceiptLine puts a receipt line on a list as an item.

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 BackfillAgentFollowUps added in v0.169.0

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

BackfillAgentFollowUps has the agent look back over the last 45 days of mail for bills, parcels and notices, and answers how many messages it queued to be read.

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 CheckOffShoppingItem added in v0.231.0

func CheckOffShoppingItem(ctx context.Context, executor Executor, shoppingItemId string, isCheckedOff bool) (*models.ShoppingItem, error)

CheckOffShoppingItem is the check on a list for somebody not shopping: the item is bought now, with no trip and nobody told. Unchecked, it is needed again, and a purchase only hours old is taken back.

func CheckPasswordsSetUpAllowed added in v0.193.0

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

CheckPasswordsSetUpAllowed asks whether this connection may set Passwords up, before a person types a passphrase for it. The server checks that the caller is a person's own tap before it looks at what is sent, so an empty setup is refused for want of a tap when the caller is no tap (the error then satisfies IsTapRequired), and refused as invalid when it is, which this answers with nil. Nothing is ever set up by it: an empty setup is not a valid one.

func CheckShoppingItem added in v0.201.0

func CheckShoppingItem(ctx context.Context, executor Executor, shoppingItemId string, isChecked bool, storeName string) (*models.ShoppingItem, error)

CheckShoppingItem puts an item in the cart, or back to needed. Putting one in the cart starts the caller's trip when none is open, at storeName (the item's store when empty).

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 CountPhotos added in v0.171.0

func CountPhotos(ctx context.Context, executor Executor, filter *PhotoFilter) (int, error)

CountPhotos is how many photos the filter keeps, whatever page it asks for.

func CountUndescribedPhotos added in v0.171.0

func CountUndescribedPhotos(ctx context.Context, executor Executor, filter *PhotoFilter) (int, error)

CountUndescribedPhotos is how many photos the filter keeps that no model has described yet. The filter's search words are not used: it counts the range, which is how much of it a search by what is in the pictures cannot see into.

func CreateCirclePhotoAlbum added in v0.171.0

func CreateCirclePhotoAlbum(ctx context.Context, executor Executor, circleId, albumTitle string, photoIds []string) (*models.PhotoAlbum, error)

CreateCirclePhotoAlbum makes an album that belongs to a circle the caller is in, holding the photos named, which are the caller's own and stay theirs. An empty circle makes the caller's own album.

func CreatePhotoAlbum added in v0.171.0

func CreatePhotoAlbum(ctx context.Context, executor Executor, albumTitle string, photoIds []string) (*models.PhotoAlbum, error)

CreatePhotoAlbum makes an album holding the photos named, which may be none.

func CreateShoppingList added in v0.201.0

func CreateShoppingList(ctx context.Context, executor Executor, listName string) (*models.ShoppingList, error)

CreateShoppingList makes a list owned by the caller.

func DecideShoppingReceiptMatch added in v0.201.0

func DecideShoppingReceiptMatch(ctx context.Context, executor Executor, shoppingReceiptMatchId string, isApplied bool) (*models.ShoppingReceiptMatch, error)

DecideShoppingReceiptMatch applies a proposed match, or dismisses one, undoing it when it was applied.

func DeclineShare added in v0.194.0

func DeclineShare(ctx context.Context, connection Executor, shareKind, shareId string) error

DeclineShare ends a share that was made to the signed-in account by name.

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 DeleteAgentModelEntry added in v0.240.1

func DeleteAgentModelEntry(ctx context.Context, connection *Client, providerName, model string) error

DeleteAgentModelEntry removes a model from a provider; the server refuses while a role uses it, and names the role.

func DeleteAgentNode

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

DeleteAgentNode removes a page and what is under it.

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 DeleteChatMessage added in v0.170.0

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

DeleteChatMessage takes a message back.

func DeleteCircle added in v0.170.0

func DeleteCircle(ctx context.Context, connection *Client, circleId string) error

DeleteCircle removes a circle.

func DeleteCircleAddressBook added in v0.194.0

func DeleteCircleAddressBook(ctx context.Context, executor Executor, addressBookId string) error

DeleteCircleAddressBook deletes a circle's address book with every card in it.

func DeleteCircleCalendar added in v0.194.0

func DeleteCircleCalendar(ctx context.Context, connection *Client, circleId string) error

DeleteCircleCalendar takes away the calendar a circle keeps for itself, with every event in it.

func DeleteContact

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

DeleteContact forgets one, in the address book named as GetContact's is.

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 DeletePhotoAlbum added in v0.171.0

func DeletePhotoAlbum(ctx context.Context, executor Executor, photoAlbumId string) error

DeletePhotoAlbum deletes an album. Its photos stay in the library.

func DeletePhotos added in v0.171.0

func DeletePhotos(ctx context.Context, executor Executor, photoIds []string) (int, error)

DeletePhotos deletes forever the photos that are in the trash, and says how many there were.

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 DeleteShoppingList added in v0.201.0

func DeleteShoppingList(ctx context.Context, executor Executor, shoppingListId string) error

DeleteShoppingList deletes one of the caller's own lists with its items and prices. It cannot be undone.

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 DescribePhoto added in v0.171.0

func DescribePhoto(ctx context.Context, executor Executor, photoId string, isRedescribed bool) (*models.Photo, error)

DescribePhoto asks the assistant to look at a photo and write what is in it. It answers at once with the photo as it is: the description arrives some seconds later, and isDescriptionRequested says it is on its way. A photo that has a description is left alone unless isRedescribed is true.

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 DiscussAgentFeedItem added in v0.230.0

func DiscussAgentFeedItem(ctx context.Context, connection *Client, feedItemId string) (string, error)

DiscussAgentFeedItem is the main conversation's id, to talk about a card in.

func DismissAgentFeedItems added in v0.235.0

func DismissAgentFeedItems(ctx context.Context, connection *Client, feedItemIds []string, feedStackKey string, isEveryReadCard bool) ([]string, error)

DismissAgentFeedItems closes cards, named by id, by stack or all the read ones (give exactly one), and answers the ids it closed.

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 EmptyPhotoTrash added in v0.171.0

func EmptyPhotoTrash(ctx context.Context, executor Executor) (int, error)

EmptyPhotoTrash deletes forever everything in the trash and says how many photos that was.

func ErasePasswords added in v0.193.0

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

ErasePasswords deletes the caller's setup, items, shares and keys. It cannot be undone. Needs the person's tap.

func FindCirclePersonID added in v0.188.0

func FindCirclePersonID(ctx context.Context, connection Executor, usernameOrID string) (string, error)

FindCirclePersonID turns what the command line speaks in, a username or an account's identifier, into the identifier the schema takes, from everybody the signed-in account shares a circle with.

func FindPhotos added in v0.171.0

func FindPhotos(ctx context.Context, executor Executor, clientPhotoIds []string) ([]*models.Photo, error)

FindPhotos is the photos the library already has under the uploader's own names for them, which is how an uploader decides what to skip. At most MaximumPhotoIDs names are asked at once.

func FindShoppingItemPicture added in v0.201.0

func FindShoppingItemPicture(ctx context.Context, executor Executor, shoppingItemId string) error

FindShoppingItemPicture queues the search for another picture of an item.

func FinishShopping added in v0.201.0

func FinishShopping(ctx context.Context, executor Executor, shoppingTripId string) (*models.ShoppingTrip, error)

FinishShopping ends a trip; what the caller put in the cart is bought. An empty trip id ends the caller's own open trip, or buys their cart without one.

func ForgetPlace added in v0.175.0

func ForgetPlace(ctx context.Context, connection *Client, placeId string) error

ForgetPlace deletes a place and every visit to it.

func ForgetPlaceVisit added in v0.206.0

func ForgetPlaceVisit(ctx context.Context, connection *Client, placeVisitId string) error

ForgetPlaceVisit deletes one of the caller's visits, one that did not happen; the place stays.

func GetResumableShoppingTrip added in v0.231.0

func GetResumableShoppingTrip(ctx context.Context, executor Executor) (*models.ShoppingTrip, error)

GetResumableShoppingTrip is the caller's latest trip when it finished in the last few hours and resuming it would put something back in the cart; nil when there is none or they are shopping now.

func GetShoppingItem added in v0.201.0

func GetShoppingItem(ctx context.Context, executor Executor, shoppingItemId string) (*models.ShoppingItem, error)

GetShoppingItem is one item on a list the caller reaches.

func HandBackAgentTab added in v0.189.0

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

HandBackAgentTab gives the agent back the tab the person took over, with a note for it, and answers its request to take the tab over: the one of this run and call, or, with both empty, the newest. It says whether there was anything to hand back.

func HealthDurationWords added in v0.183.0

func HealthDurationWords(seconds float64) string

HealthDurationWords writes a time covered in hours and minutes: 7 h 12 min, 35 min, 45 s.

func HealthNumberWords added in v0.183.0

func HealthNumberWords(quantityValue float64) string

HealthNumberWords writes a reading the way a person says it: thousands separated, and only as many decimals as the size of the number is worth (8,412, 72.4, 0.35).

func HealthPerDayNoun added in v0.183.0

func HealthPerDayNoun(healthType string) string

HealthPerDayNoun is the word for one of the days a sum or a time is averaged over: a night for sleep, a day for anything else.

func HealthPeriodWords added in v0.183.0

func HealthPeriodWords(period *HealthPeriodView, healthType, quantityUnit string) string

HealthPeriodWords tells one period of one type in a line of figures, the same in the command line and the agent's tool. What adds up (steps, energy) is the total and, for a week or a month, the average per day over the days that have a summary; what is a level (heart rate, weight) is the average with the lowest and highest; a time (sleep, workouts) is the time, for a week or a month the average per night or day with the total, and for sleep its stages. The figures are in the words of internal/health, so that a value reads the same here as on the dashboard.

func HealthShownValue added in v0.183.0

func HealthShownValue(quantityValue float64, quantityUnit string) float64

HealthShownValue is a value as a person reads it. HealthKit keeps a percentage as a fraction (0.97 for 97%), and so does the server.

func HealthValueWords added in v0.183.0

func HealthValueWords(healthType string, quantityValue float64, quantityUnit string) string

HealthValueWords is a reading of this type with its unit, in the words the table in internal/health gives: 8,412 steps, 74 bpm, 97%, 36.6°C, 5.2 km.

func HidePhotoFaceGroup added in v0.171.0

func HidePhotoFaceGroup(ctx context.Context, executor Executor, photoFaceGroupId string, isHidden bool) (*models.PhotoFaceGroup, error)

HidePhotoFaceGroup hides a group from the people listing, or shows it again.

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 InviteToCircle added in v0.170.0

func InviteToCircle(ctx context.Context, connection *Client, circleId, username, memberRole string) error

InviteToCircle invites an account by username. The server answers the same whether or not the username is an account.

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 IsTapRequired added in v0.170.0

func IsTapRequired(err error) bool

IsTapRequired says the server refused a request because only a person's tap on the dashboard or in the iPhone app may make it.

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 LeaveChat added in v0.170.0

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

LeaveChat takes you out of a group chat.

func LeaveCircle added in v0.170.0

func LeaveCircle(ctx context.Context, connection *Client, circleId string) error

LeaveCircle takes the signed-in account out of a circle.

func LinkAgentNodes

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

LinkAgentNodes joins two pages.

func ListCirclePhotoAlbums added in v0.200.0

func ListCirclePhotoAlbums(ctx context.Context, executor Executor, circleId string) ([]*models.PhotoAlbum, error)

ListCirclePhotoAlbums is the albums of one circle the person is in, as its page shows them: the circle's own and those shared with the whole circle, the most recently changed first.

func ListOpenShoppingTrips added in v0.201.0

func ListOpenShoppingTrips(ctx context.Context, executor Executor) ([]*models.ShoppingTrip, error)

ListOpenShoppingTrips are the trips open now on the lists the caller reaches.

func ListPhotoAlbums added in v0.171.0

func ListPhotoAlbums(ctx context.Context, executor Executor) ([]*models.PhotoAlbum, error)

ListPhotoAlbums is the person's albums, the most recently changed first.

func ListPhotoFaceGroups added in v0.171.0

func ListPhotoFaceGroups(ctx context.Context, executor Executor, isHiddenIncluded bool) ([]*models.PhotoFaceGroup, error)

ListPhotoFaceGroups is the people worth showing: the groups a contact names first, by name, then the groups of at least three faces nobody has named, the largest first. Hidden groups are left out unless asked for.

func ListPhotos added in v0.171.0

func ListPhotos(ctx context.Context, executor Executor, filter *PhotoFilter) ([]*models.Photo, error)

ListPhotos is a page of the library, newest first.

func ListShoppingItemPrices added in v0.201.0

func ListShoppingItemPrices(ctx context.Context, executor Executor, shoppingItemId string) ([]*models.ShoppingItemPrice, error)

ListShoppingItemPrices are an item's prices, newest first.

func ListShoppingListShares added in v0.201.0

func ListShoppingListShares(ctx context.Context, executor Executor, shoppingListId string) ([]*models.ShoppingListShare, error)

ListShoppingListShares are the shares of one of the caller's own lists.

func ListShoppingLists added in v0.201.0

func ListShoppingLists(ctx context.Context, executor Executor) ([]*models.ShoppingList, error)

ListShoppingLists are the lists the caller reaches, their own first, each with its counts.

func ListShoppingStores added in v0.201.0

func ListShoppingStores(ctx context.Context, executor Executor) ([]*models.ShoppingStore, error)

ListShoppingStores are the stores the items of the caller's lists are for, with how many are needed at each.

func ListSimilarShoppingItems added in v0.219.0

func ListSimilarShoppingItems(ctx context.Context, executor Executor, shoppingListId, itemDescription string) ([]*models.ShoppingItem, error)

ListSimilarShoppingItems are the items that read like what is about to be added to a list, nearest first.

func LocalLanguage added in v0.202.0

func LocalLanguage() string

LocalLanguage is the language the shell speaks, from LANGUAGE, LC_ALL or LANG, reduced to a tag like "de" or "pt-BR". Empty when nothing says.

func MarkAgentFeedRead added in v0.230.0

func MarkAgentFeedRead(ctx context.Context, connection *Client, feedItemIds []string) (int, error)

MarkAgentFeedRead marks cards read and says how many were newly read.

func MarkChatRead added in v0.170.0

func MarkChatRead(ctx context.Context, connection *Client, conversationId, throughMessageId string) (bool, error)

MarkChatRead says you have read a chat through a message, and answers whether the mark moved: it never goes back.

func MatchShoppingReceipt added in v0.201.0

func MatchShoppingReceipt(ctx context.Context, executor Executor, financeReceiptId string) error

MatchShoppingReceipt queues matching one of the caller's receipts to their lists again.

func MatchShoppingReceiptLine added in v0.201.0

func MatchShoppingReceiptLine(ctx context.Context, executor Executor, shoppingItemId, financeReceiptLineId string) (*models.ShoppingReceiptMatch, error)

MatchShoppingReceiptLine ties a receipt line to an item by hand.

func MergePhotoFaceGroups added in v0.171.0

func MergePhotoFaceGroups(ctx context.Context, executor Executor, photoFaceGroupIds []string) (*models.PhotoFaceGroup, error)

MergePhotoFaceGroups moves the faces of the other groups into the first and deletes the others.

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 ParsePhotoTakenAt added in v0.171.0

func ParsePhotoTakenAt(text string) (time.Time, error)

ParsePhotoTakenAt reads the date a person gives for when a photo was taken: an RFC 3339 time with an offset (+09:00, or Z for a place on UTC). The offset is kept as the offset the photo is shown at, so a time without one is refused rather than read on a clock that is not where the photo was taken.

func PhotoByteSizeText added in v0.171.0

func PhotoByteSizeText(sizeBytes int64) string

PhotoByteSizeText writes a size the way the dashboard's Photos page does: 1.5 KB, 12.4 MB, 8 GB, with no decimal on a whole number.

func PhotoCountText added in v0.171.0

func PhotoCountText(library *PhotoLibrary) string

PhotoCountText is how many photos a library holds as the dashboard says it: a photo is any item, so the count is of pictures, Live Photos and videos together, and the videos among them are said beside it: "120 (4 videos)".

func PhotoOffsetText added in v0.171.0

func PhotoOffsetText(offsetMinutes int) string

PhotoOffsetText writes an offset in minutes east of UTC the way the dashboard's Photos page does: UTC+09:00, UTC-03:30, UTC+00:00.

func PhotoPlaybackAddress added in v0.171.0

func PhotoPlaybackAddress(ctx context.Context, executor Executor, photoId string, photoPreviewSize models.PhotoPreviewSize, photoFileRole models.PhotoFileRole) (string, error)

PhotoPlaybackAddress is an address, relative to the server, for one preview (photoPreviewSize) or one file (photoFileRole) of a photo that a player can fetch with ranges and without signing in, good for a few hours.

func PhotoTakenText added in v0.171.0

func PhotoTakenText(photo *models.Photo) string

PhotoTakenText is when a photo was taken as the dashboard's Photos page writes it, on the clock where it was taken: "2025-04-04 08:00". It is the photo's offset that says which clock, and the same one every place that shows a photo's date uses (models.Photo.TakenAtOnClock). Empty when the photo has no date.

func PhotosCountText added in v0.176.0

func PhotosCountText(count int) string

PhotosCountText is a number of photos in words, "1 photo" or "3 photos", for a line that says how many a call touched.

func PlacedName added in v0.179.0

func PlacedName(ctx context.Context, executor Executor, photoIds []string, latitude, longitude float64) (string, bool)

PlacedName is the place name the server gave photos set to a position, read from the first of them that moved there. It is the nearest city's, which can be a larger city than the one picked, and empty where no city is near. The second value says a photo was read at all: none was when the first few were skipped, or could not be read.

func PositionText added in v0.179.0

func PositionText(latitude, longitude float64) string

PositionText is a position as a person reads it, for a place with no name.

func PurgePasswordItem added in v0.193.0

func PurgePasswordItem(ctx context.Context, connection *Client, itemID string) error

PurgePasswordItem removes a deleted item at once, with its old versions, instead of after 30 days. Only the person's tap may do it (see IsTapRequired), and an item that is not deleted is refused.

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 ReadPasswordsAgentKey added in v0.193.0

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

ReadPasswordsAgentKey is the server's agent key, the public key an item key is sealed for when the person lets the agent use the item: base64 of 65 bytes.

func ReadPhotoAlbum added in v0.171.0

func ReadPhotoAlbum(ctx context.Context, executor Executor, photoAlbumId string) (*models.PhotoAlbum, error)

ReadPhotoAlbum is one album with its count, cover and dates.

func ReadPhotoFaceGroup added in v0.171.0

func ReadPhotoFaceGroup(ctx context.Context, executor Executor, photoFaceGroupId string) (*models.PhotoFaceGroup, error)

ReadPhotoFaceGroup is one group with its count and picture.

func RecordShoppingItemPrice added in v0.201.0

func RecordShoppingItemPrice(ctx context.Context, executor Executor, entry ShoppingPriceEntry) (*models.ShoppingItemPrice, error)

RecordShoppingItemPrice remembers a price somebody saw for an item.

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 RemoveJournalLink(ctx context.Context, connection *Client, linkId string) error

RemoveJournalLink takes a pin off a day, or hides one of the agent's choices.

func RemovePersonRelationship added in v0.178.0

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

RemovePersonRelationship takes away what the signed-in account and a person are to each other, whichever of them said it. It reports whether there was one.

func RemovePhotoAlbumShare added in v0.171.0

func RemovePhotoAlbumShare(ctx context.Context, executor Executor, photoAlbumShareId string) error

RemovePhotoAlbumShare takes one share back.

func RemovePhotoFaceFromGroup added in v0.171.0

func RemovePhotoFaceFromGroup(ctx context.Context, executor Executor, photoFaceId string) (*models.PhotoFaceGroup, error)

RemovePhotoFaceFromGroup takes a face out of its group, into a group of its own that the person has confirmed.

func RemovePhotoLocation added in v0.179.0

func RemovePhotoLocation(ctx context.Context, executor Executor, photoIds []string) (int, error)

RemovePhotoLocation removes the location from photos, for good: reading the file again does not bring it back. It says how many it changed.

func RemovePhotosFromAlbum added in v0.171.0

func RemovePhotosFromAlbum(ctx context.Context, executor Executor, photoAlbumId string, photoIds []string) (int, error)

RemovePhotosFromAlbum takes photos out of an album, which leaves them in the library, and says how many were in it.

func RemoveShoppingItems added in v0.201.0

func RemoveShoppingItems(ctx context.Context, executor Executor, shoppingItemIds []string) (int, error)

RemoveShoppingItems takes items off their lists for good and says how many it removed.

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 RenamePhotoAlbum added in v0.171.0

func RenamePhotoAlbum(ctx context.Context, executor Executor, photoAlbumId, albumTitle string) (*models.PhotoAlbum, error)

RenamePhotoAlbum gives an album another title.

func RenameShoppingList added in v0.201.0

func RenameShoppingList(ctx context.Context, executor Executor, shoppingListId, listName string) (*models.ShoppingList, error)

RenameShoppingList gives a list another name.

func ReportMailboxJunk added in v0.172.0

func ReportMailboxJunk(ctx context.Context, connection *Client, itemIds []string, isNotJunk bool) (int, error)

ReportMailboxJunk moves messages to Junk and tells the spam filter, or with isNotJunk back to the Inbox and tells it that it was wrong. It answers how many messages it moved.

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 RestoreAgentFeedItems added in v0.235.0

func RestoreAgentFeedItems(ctx context.Context, connection *Client, feedItemIds []string) ([]string, error)

RestoreAgentFeedItems brings dismissed cards back and answers the ids it restored.

func RestorePhotos added in v0.171.0

func RestorePhotos(ctx context.Context, executor Executor, photoIds []string) (int, error)

RestorePhotos takes photos out of the trash and says how many it took.

func ResumeLocation added in v0.195.0

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

ResumeLocation ends the pause in effect now, and says whether there was one.

func ResumeShopping added in v0.231.0

func ResumeShopping(ctx context.Context, executor Executor, shoppingTripId string) (*models.ShoppingTrip, error)

ResumeShopping opens again a trip the caller finished in the last few hours: what it bought goes back in their cart.

func RetryPhotoProcessing added in v0.171.0

func RetryPhotoProcessing(ctx context.Context, executor Executor, photoIds []string) (int, error)

RetryPhotoProcessing puts photos whose previews failed, or that are ready and should have their previews made again, back in line with a fresh count of attempts, and says how many it moved. Photos that are waiting already are left alone.

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 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 SavePhotoFromAttachment added in v0.171.0

func SavePhotoFromAttachment(ctx context.Context, executor Executor, agentAttachmentId string) (*models.Photo, error)

SavePhotoFromAttachment keeps a file of a conversation as a photo.

func SavePhotoToLibrary added in v0.171.0

func SavePhotoToLibrary(ctx context.Context, executor Executor, photoId string) (*models.Photo, error)

SavePhotoToLibrary makes a photo of the caller's own from a photo in an album that was shared with them or belongs to a circle they are in. Saving the same photo twice finds the copy that is there.

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 SetChatTyping added in v0.170.0

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

SetChatTyping tells the others in a chat you are writing.

func SetMailboxItemFlags added in v0.172.0

func SetMailboxItemFlags(ctx context.Context, connection *Client, itemIds []string, isSeen, isFlagged *bool) (int, error)

SetMailboxItemFlags marks messages read or unread, flagged or not. A flag left nil is not changed. It answers how many messages changed.

func SetMyContact

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

SetMyContact names the contact that is the caller.

func SetPhotoAlbumCover added in v0.171.0

func SetPhotoAlbumCover(ctx context.Context, executor Executor, photoAlbumId, photoId string) (*models.PhotoAlbum, error)

SetPhotoAlbumCover chooses which of an album's photos stands for it.

func SetPhotoFaceRecognition added in v0.171.0

func SetPhotoFaceRecognition(ctx context.Context, executor Executor, isEnabled bool) (bool, error)

SetPhotoFaceRecognition switches the finding of faces in the person's photos on or off, and answers the new state. Off deletes every face and group they have.

func SetPhotoFavorite added in v0.171.0

func SetPhotoFavorite(ctx context.Context, executor Executor, photoId string, isFavorite bool) (*models.Photo, error)

SetPhotoFavorite makes a photo a favorite or not.

func SetPhotoLocation added in v0.179.0

func SetPhotoLocation(ctx context.Context, executor Executor, photoIds []string, latitude, longitude float64) (int, error)

SetPhotoLocation says where photos were taken, and how many it changed. The server names the place after the nearest city.

func SetPhotoReading added in v0.209.0

func SetPhotoReading(ctx context.Context, executor Executor, isEnabled bool) (bool, error)

SetPhotoReading switches the reading of the person's new photos on or off, and answers the new state.

func SetPhotoTakenAt added in v0.171.0

func SetPhotoTakenAt(ctx context.Context, executor Executor, photoId string, takenAt time.Time) (*models.Photo, error)

SetPhotoTakenAt corrects the date a photo was taken. The offset of takenAt is the offset the photo is shown at from then on.

func SetShoppingItemNeed added in v0.201.0

func SetShoppingItemNeed(ctx context.Context, executor Executor, shoppingItemId string, isNeeded bool, neededQuantity string) (*models.ShoppingItem, error)

SetShoppingItemNeed makes an item needed again with a count (1 when neededQuantity is empty), or not needed (bought, if it was in the cart).

func SetShoppingItemOutOfStock added in v0.201.0

func SetShoppingItemOutOfStock(ctx context.Context, executor Executor, shoppingItemId string, isOutOfStock bool, storeName string) (*models.ShoppingItem, error)

SetShoppingItemOutOfStock marks an item out of stock at a store (the item's own when storeName is empty), or in stock again.

func SetShoppingItemPicture added in v0.201.0

func SetShoppingItemPicture(ctx context.Context, executor Executor, shoppingItemId, agentAttachmentId string) (*models.ShoppingItem, error)

SetShoppingItemPicture gives an item a picture uploaded as the caller's agent attachment, or takes its picture away when the attachment is empty.

func SetShoppingListReminder added in v0.201.0

func SetShoppingListReminder(ctx context.Context, executor Executor, shoppingListId string, isReminded bool) error

SetShoppingListReminder says whether the caller is reminded of a list on arriving at a store.

func SetShoppingStoreReminder added in v0.201.0

func SetShoppingStoreReminder(ctx context.Context, executor Executor, storeName string, isReminded bool) error

SetShoppingStoreReminder says whether the caller is reminded on arriving at a store.

func ShareShoppingList added in v0.201.0

func ShareShoppingList(ctx context.Context, executor Executor, shoppingListId, granteeUserId, granteeCircleId string) (*models.ShoppingListShare, error)

ShareShoppingList gives a person or a circle one of the caller's own lists. Give one of granteeUserId and granteeCircleId.

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 StartShopping added in v0.201.0

func StartShopping(ctx context.Context, executor Executor, storeName string, shoppingListIds []string) (*models.ShoppingTrip, error)

StartShopping starts the caller shopping a store (any, when storeName is empty) for some lists, and tells the others the lists reach.

func StopAgentRun

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

StopAgentRun stops a turn where it is.

func SuggestPhotoAlbums added in v0.171.0

func SuggestPhotoAlbums(ctx context.Context, executor Executor, takenAfter, takenBefore *time.Time) ([]*models.PhotoAlbumSuggestion, error)

SuggestPhotoAlbums offers the trips and events among the photos that are in no album, newest first. The dates narrow the photos considered; both are optional.

func SyncAgentKnowledgeSource

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

SyncAgentKnowledgeSource reads one again now.

func TrashPhotos added in v0.171.0

func TrashPhotos(ctx context.Context, executor Executor, photoIds []string) (int, error)

TrashPhotos moves photos to the trash and says how many it moved.

func UndoShoppingReceipt added in v0.201.0

func UndoShoppingReceipt(ctx context.Context, executor Executor, financeReceiptId string) error

UndoShoppingReceipt puts every item a receipt changed back as it was.

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.

func UnmuteLocationNotifications added in v0.198.0

func UnmuteLocationNotifications(ctx context.Context, connection *Client, userId string) (bool, error)

UnmuteLocationNotifications ends the mute of the person userId, and says whether there was one in effect.

func UnnamePhotoFaceGroup added in v0.171.0

func UnnamePhotoFaceGroup(ctx context.Context, executor Executor, photoFaceGroupId string) (*models.PhotoFaceGroup, error)

UnnamePhotoFaceGroup takes the contact off a group. The faces stay grouped.

func UnshareAgentPage added in v0.170.0

func UnshareAgentPage(ctx context.Context, connection *Client, shareId string) error

UnshareAgentPage takes a share back.

func UnshareCalendar added in v0.170.0

func UnshareCalendar(ctx context.Context, connection *Client, shareId string) error

UnshareCalendar takes a share back.

func UnshareFinance added in v0.210.0

func UnshareFinance(ctx context.Context, connection *Client, financeShareId string) error

UnshareFinance takes a share of all of the caller's finance back.

func UnshareFinanceAccount added in v0.194.0

func UnshareFinanceAccount(ctx context.Context, connection *Client, shareId string) error

UnshareFinanceAccount takes a share back.

func UnshareLocation added in v0.175.0

func UnshareLocation(ctx context.Context, connection *Client, shareId string) error

UnshareLocation takes a share back.

func UnshareShoppingList added in v0.201.0

func UnshareShoppingList(ctx context.Context, executor Executor, shoppingListShareId string) error

UnshareShoppingList takes one share of a list back.

func UnshareSkill added in v0.170.0

func UnshareSkill(ctx context.Context, connection *Client, shareId string) error

UnshareSkill takes a share back.

func UpdateShoppingItem added in v0.201.0

func UpdateShoppingItem(ctx context.Context, executor Executor, shoppingItemId string, change models.ShoppingItemChange) (*models.ShoppingItem, error)

UpdateShoppingItem changes the fields of an item that the change sets and leaves the others.

func WithdrawAgentFeedItem added in v0.238.0

func WithdrawAgentFeedItem(ctx context.Context, connection *Client, feedItemId string) error

WithdrawAgentFeedItem takes a card back for good.

func WithdrawCircleInvitation added in v0.170.0

func WithdrawCircleInvitation(ctx context.Context, connection *Client, invitationId string) error

WithdrawCircleInvitation takes back an invitation nobody has answered.

Types

type AIConsent added in v0.251.0

type AIConsent struct {
	IsConsentNeeded bool                 `json:"isConsentNeeded"`
	Providers       []*AIConsentProvider `json:"providers"`
}

AIConsent is what the phone apps ask about: whether the signed-in person is to be asked, and the AI services this server sends to. The server keeps no agreement; each app remembers it on its own device.

func ReadAIConsent added in v0.251.0

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

ReadAIConsent reads the AI services this server uses.

type AIConsentProvider added in v0.251.0

type AIConsentProvider struct {
	ProviderName string   `json:"providerName"`
	IsSelfHosted bool     `json:"isSelfHosted"`
	UsedFor      []string `json:"usedFor"`
	PrivacyURL   string   `json:"privacyUrl"`
	ProviderKeys []string `json:"providerKeys"`
}

AIConsentProvider is one AI service the server sends to.

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"`

	// CircleID, CircleName and IsCircleBook say whose a circle's book is; the
	// first is null for the account's own. CanManage is that the account may
	// rename it and, for a circle's, delete it.
	CircleID     *string `json:"circleId"`
	CircleName   string  `json:"circleName"`
	IsCircleBook bool    `json:"isCircleBook"`
	CanManage    bool    `json:"canManage"`
}

AddressBook is one address book and how much is in it: the signed-in account's own, or a circle's they are in.

func CreateCircleAddressBook added in v0.194.0

func CreateCircleAddressBook(ctx context.Context, executor Executor, circleId, name string) (*AddressBook, error)

CreateCircleAddressBook makes the address book a circle keeps for itself.

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.

func ListReachableAddressBooks added in v0.194.0

func ListReachableAddressBooks(ctx context.Context, executor Executor) ([]*AddressBook, error)

ListReachableAddressBooks are the caller's own address books and then the books of the circles they are in.

func SaveAddressBook added in v0.194.0

func SaveAddressBook(ctx context.Context, executor Executor, id, name, description string) (*AddressBook, error)

SaveAddressBook renames a book and changes what it says about itself; an empty name keeps the old one.

type AddressSearch added in v0.177.2

type AddressSearch struct {
	Query            string
	LatitudeDegrees  *float64
	LongitudeDegrees *float64
	PlaceID          string
	LimitCount       int
}

AddressSearch is a search for addresses by words. Near is a point, a place, or neither, which is where the caller last was.

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"`

	// AudioDurationMS is the length of a voice message's recording, zero on
	// any other file; AudioWaveform is its peaks, 48 levels of 0 to 255 in
	// base64.
	AudioDurationMS int64  `json:"audioDurationMS"`
	AudioWaveform   string `json:"audioWaveform"`
}

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.

func UploadVoiceMessage added in v0.211.0

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

UploadVoiceMessage hands the server the recording of a voice message, which it makes one mono AAC file and measures; AskAgentWith names the result by id in a chat. A recording the server refuses (too short, too long, with no sound) comes back as an error with the reason in words.

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"`

	// When one stream was read by offset: which, where the read began and
	// where the next begins.
	Stream           string `json:"stream,omitempty"`
	StreamOffset     int    `json:"streamOffset,omitempty"`
	StreamNextOffset int    `json:"streamNextOffset,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, stream string, offset, lengthBytes int) (*AgentBackgroundCommand, error)

ReadAgentBackgroundCommand is one background command with the last tailBytes of each of its streams; zero leaves the amount to the server. With stream (stdout or stderr), that stream's output is read instead from offset, lengthBytes of it.

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 AgentChat added in v0.170.0

type AgentChat struct {
	ChatID       string `json:"chatId"`
	ChatKind     string `json:"chatKind"`
	CircleID     string `json:"circleId"`
	Title        string `json:"title"`
	IsCircleChat bool   `json:"isCircleChat"`

	// Members are the people in it, then those who left.
	Members []*AgentChatMember `json:"members"`

	// UnreadCount is how many messages by others you have not read.
	UnreadCount int `json:"unreadCount"`

	// NotificationLevel is what your phone is told of in the chat: all,
	// mentions or off.
	NotificationLevel string `json:"notificationLevel"`

	// IsRemoved says you are no longer in it; you read it up to then.
	IsRemoved bool `json:"isRemoved"`
}

AgentChat is a chat as one member sees it.

type AgentChatMember added in v0.170.0

type AgentChatMember struct {
	UserID               string `json:"userId"`
	Username             string `json:"username"`
	Name                 string `json:"name"`
	MemberRole           string `json:"memberRole"`
	IsDeletedAccount     bool   `json:"isDeletedAccount"`
	IsRemoved            bool   `json:"isRemoved"`
	ReadThroughMessageID string `json:"readThroughMessageId"`
	IsAgentReading       bool   `json:"isAgentReading"`

	// IsAgentAskableByOthers says the others in the chat may ask their agent;
	// AgentName is what it is called and IsAgentActive whether it is on, told
	// for your own and for an agent its owner let the others ask.
	IsAgentAskableByOthers bool   `json:"isAgentAskableByOthers"`
	AgentID                string `json:"agentId"`
	AgentName              string `json:"agentName"`
	IsAgentActive          bool   `json:"isAgentActive"`
}

AgentChatMember is one person in a chat.

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"`
	// CalendarKind is, for a calendar, what it holds: events or reminders;
	// empty for an address book, and from a server that does not say.
	CalendarKind string `json:"calendarKind"`
	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"`

	// Chat is, on a chat, the people in it, how much you have not read and
	// whether you silenced it; null on every other conversation.
	Chat *AgentChat `json:"chat"`
}

AgentConversation is a conversation with the agent.

func AddChatMembers added in v0.170.0

func AddChatMembers(ctx context.Context, connection *Client, conversationId string, userIds []string) (*AgentConversation, error)

AddChatMembers puts people in a group chat.

func CreateGroupChat added in v0.170.0

func CreateGroupChat(ctx context.Context, connection *Client, title string, userIds []string) (*AgentConversation, error)

CreateGroupChat makes a group chat with you as its admin and the people given, by account id, as its members.

func ListAgentConversations

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

ListAgentConversations is the main conversation and the named ones.

func ListAgentConversationsOfKind added in v0.170.0

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

ListAgentConversationsOfKind is SearchAgentConversations narrowed to one kind of conversation: main, named or chat; empty is all of them.

func OpenDirectChat added in v0.170.0

func OpenDirectChat(ctx context.Context, connection *Client, userId string) (*AgentConversation, error)

OpenDirectChat is your direct chat with somebody you share a circle with, made when there is none, as your conversation.

func RemoveChatMember added in v0.170.0

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

RemoveChatMember takes a person out of a group chat.

func RenameChat added in v0.170.0

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

RenameChat changes a group chat's title.

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 SetChatAgentAskableByOthers added in v0.170.0

func SetChatAgentAskableByOthers(ctx context.Context, connection *Client, conversationId string, isAgentAskableByOthers bool) (*AgentConversation, error)

SetChatAgentAskableByOthers lets the others in a chat address your agent there, or stops them.

func SetChatAgentReading added in v0.170.0

func SetChatAgentReading(ctx context.Context, connection *Client, conversationId string, isAgentReading bool) (*AgentConversation, error)

SetChatAgentReading makes your agent remember a chat from now on, or stop.

func SetChatNotificationLevel added in v0.196.0

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

SetChatNotificationLevel chooses what your phone is told of in a chat: every message (all), only one that mentions you or everybody (mentions), or nothing (off).

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"`

	// ActingAs is whose conversation it is when it is not yours, and
	// IsObserved is true then: you are reading it, read-only.
	ActingAs   string `json:"actingAs"`
	IsObserved bool   `json:"isObserved"`
}

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"`

	JournalDaysWritten       int `json:"journalDaysWritten"`
	JournalPeriodsWritten    int `json:"journalPeriodsWritten"`
	JournalNarrativesRefused int `json:"journalNarrativesRefused"`

	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"`
	Intention string    `json:"intention"`
	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 AgentFailedTurn added in v0.237.0

type AgentFailedTurn struct {
	ConversationID    string    `json:"conversationId"`
	ConversationKind  string    `json:"conversationKind"`
	ConversationTitle string    `json:"conversationTitle"`
	OwnerUsername     string    `json:"ownerUsername"`
	OwnerName         string    `json:"ownerName"`
	FailedAt          time.Time `json:"failedAt"`
	ErrorText         string    `json:"errorText"`
	AgentID           string    `json:"agentId"`
}

AgentFailedTurn is a turn that ended in a failed note, in the operator's list of failed turns.

func ListFailedAgentTurns added in v0.237.0

func ListFailedAgentTurns(ctx context.Context, connection *Client, first, offset int, since *time.Time, agentId string) ([]*AgentFailedTurn, int64, error)

ListFailedAgentTurns is a page of the turns of every person's agent that ended in a failed note, newest first, and how many there are in all; for an operator with agent:observe or agent:act.

type AgentFeedChartBar added in v0.240.0

type AgentFeedChartBar struct {
	BarLabel string  `json:"barLabel"`
	BarValue float64 `json:"barValue"`
}

AgentFeedChartBar is one bar of a bar chart.

type AgentFeedChartBlock added in v0.240.0

type AgentFeedChartBlock struct {
	ChartKind  string                 `json:"chartKind"`
	ChartTitle string                 `json:"chartTitle"`
	Unit       string                 `json:"unit"`
	Provenance string                 `json:"provenance"`
	XLabels    []string               `json:"xLabels"`
	Series     []AgentFeedChartSeries `json:"series"`
	Markers    []AgentFeedChartMarker `json:"markers"`
	Bars       []AgentFeedChartBar    `json:"bars"`
}

AgentFeedChartBlock is a chart on a card, a series over time or bars, with the line saying where and when its numbers were read.

type AgentFeedChartMarker added in v0.240.0

type AgentFeedChartMarker struct {
	MarkerAt    string `json:"markerAt"`
	MarkerLabel string `json:"markerLabel"`
}

AgentFeedChartMarker is a labeled vertical rule at one of the axis labels.

type AgentFeedChartSeries added in v0.240.0

type AgentFeedChartSeries struct {
	SeriesName string     `json:"seriesName"`
	SeriesRole string     `json:"seriesRole"`
	Values     []*float64 `json:"values"`
}

AgentFeedChartSeries is one line of a series chart; a nil value is none.

type AgentFeedChoice added in v0.230.0

type AgentFeedChoice struct {
	ChoiceKey   string `json:"choiceKey"`
	ChoiceLabel string `json:"choiceLabel"`
	ChoiceRole  string `json:"choiceRole"`
}

AgentFeedChoice is a button of a card; ChoiceRole is action, dismiss, discuss or open.

type AgentFeedFactRow added in v0.230.0

type AgentFeedFactRow struct {
	FactLabel string `json:"factLabel"`
	FactValue string `json:"factValue"`
}

AgentFeedFactRow is one line of a card's short table.

type AgentFeedItem added in v0.230.0

type AgentFeedItem struct {
	FeedItemID        string                `json:"feedItemId"`
	FeedItemKind      string                `json:"feedItemKind"`
	FeedSourceKind    string                `json:"feedSourceKind"`
	FeedSourceID      string                `json:"feedSourceId"`
	FeedSourceTitle   string                `json:"feedSourceTitle"`
	RunConversationID string                `json:"runConversationId"`
	Title             string                `json:"title"`
	Body              string                `json:"body"`
	PictureSymbol     string                `json:"pictureSymbol"`
	FactRows          []AgentFeedFactRow    `json:"factRows"`
	SourceLinks       []AgentFeedSourceLink `json:"sourceLinks"`
	RecordReferences  []AgentFeedReference  `json:"recordReferences"`
	ChartBlocks       []AgentFeedChartBlock `json:"chartBlocks"`
	Choices           []AgentFeedChoice     `json:"choices"`
	IsResolved        bool                  `json:"isResolved"`
	ResolvedAt        *time.Time            `json:"resolvedAt"`
	ResolutionNote    string                `json:"resolutionNote"`
	ResolvedByKind    string                `json:"resolvedByKind"`
	PostNotes         []string              `json:"postNotes"`
	ChosenChoiceKey   string                `json:"chosenChoiceKey"`
	ChosenAt          *time.Time            `json:"chosenAt"`
	OutcomeText       string                `json:"outcomeText"`
	IsOutcomePending  bool                  `json:"isOutcomePending"`
	FeedUrgency       string                `json:"feedUrgency"`
	IsLiked           bool                  `json:"isLiked"`
	IsRead            bool                  `json:"isRead"`
	IsDismissed       bool                  `json:"isDismissed"`
	DismissedAt       *time.Time            `json:"dismissedAt"`
	FeedStackKey      string                `json:"feedStackKey"`
	StackItemCount    int                   `json:"stackItemCount"`
	StackUnreadCount  int                   `json:"stackUnreadCount"`
	FeedStackTitle    string                `json:"feedStackTitle"`
	StackPosition     *int                  `json:"stackPosition"`
	FeedCardLayout    string                `json:"feedCardLayout"`
	LayoutContent     string                `json:"layoutContent"`
	FeedMedia         []AgentFeedMedia      `json:"feedMedia"`
	PostedAt          time.Time             `json:"postedAt"`
	UpdatedAt         time.Time             `json:"updatedAt"`
}

AgentFeedItem is one card.

func ChooseAgentFeedItem added in v0.230.0

func ChooseAgentFeedItem(ctx context.Context, connection *Client, feedItemId, choiceKey string) (*AgentFeedItem, error)

ChooseAgentFeedItem presses a button of a card.

func GetAgentFeedItem added in v0.230.0

func GetAgentFeedItem(ctx context.Context, connection *Client, feedItemId string) (*AgentFeedItem, error)

GetAgentFeedItem is one card.

func LikeAgentFeedItem added in v0.230.0

func LikeAgentFeedItem(ctx context.Context, connection *Client, feedItemId string, isLiked bool) (*AgentFeedItem, error)

LikeAgentFeedItem likes a card or takes the like back.

func PostAgentFeedItem added in v0.230.0

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

PostAgentFeedItem posts a card; the variables are the mutation's.

func ResolveAgentFeedItem added in v0.240.0

func ResolveAgentFeedItem(ctx context.Context, connection *Client, feedItemId, resolutionNote string) (*AgentFeedItem, error)

ResolveAgentFeedItem marks a card resolved, with an optional one line saying what cleared.

func ShowLessLikeAgentFeedItem added in v0.230.0

func ShowLessLikeAgentFeedItem(ctx context.Context, connection *Client, feedItemId string) (*AgentFeedItem, error)

ShowLessLikeAgentFeedItem asks for fewer cards like this one and dismisses it.

func UnresolveAgentFeedItem added in v0.240.0

func UnresolveAgentFeedItem(ctx context.Context, connection *Client, feedItemId string) (*AgentFeedItem, error)

UnresolveAgentFeedItem takes the resolved mark off a card.

type AgentFeedMedia added in v0.230.0

type AgentFeedMedia struct {
	MediaKey      string `json:"mediaKey"`
	FeedMediaKind string `json:"feedMediaKind"`
	ImageURL      string `json:"imageUrl"`
	VideoURL      string `json:"videoUrl"`
	LinkURL       string `json:"linkUrl"`
	SiteName      string `json:"siteName"`
	MediaCaption  string `json:"mediaCaption"`
	WidthPixels   *int   `json:"widthPixels"`
	HeightPixels  *int   `json:"heightPixels"`
	ListRowIndex  *int   `json:"listRowIndex"`
	CameraName    string `json:"cameraName"`
	CapturedAt    string `json:"capturedAt"`
	StillReason   string `json:"stillReason"`
	PlaybackURL   string `json:"playbackUrl"`
	LiveURL       string `json:"liveUrl"`

	FileAttachmentID string `json:"fileAttachmentId"`
	FileName         string `json:"fileName"`
	FileContentType  string `json:"fileContentType"`
	FileSize         *int64 `json:"fileSize"`
	FileURL          string `json:"fileUrl"`
}

AgentFeedMedia is a picture or video on a card.

type AgentFeedPage added in v0.230.0

type AgentFeedPage struct {
	FeedItems   []*AgentFeedItem `json:"feedItems"`
	NextCursor  string           `json:"nextCursor"`
	UnreadCount int              `json:"unreadCount"`
}

AgentFeedPage is a page of the feed.

func ListAgentFeed added in v0.230.0

func ListAgentFeed(ctx context.Context, connection *Client, first int, after string, includeDismissed, isDismissedOnly, isUnreadOnly bool) (*AgentFeedPage, error)

ListAgentFeed is a page of the feed, newest first, or with isDismissedOnly a page of the dismissed cards, the most recently dismissed first, or with isUnreadOnly only the cards not yet read.

func ListAgentFeedStack added in v0.230.0

func ListAgentFeedStack(ctx context.Context, connection *Client, feedStackKey string, first int, after string) (*AgentFeedPage, error)

ListAgentFeedStack is the cards of one stack, newest first.

type AgentFeedReference added in v0.230.0

type AgentFeedReference struct {
	ItemID               string `json:"itemId,omitempty"`
	ThreadID             string `json:"threadId,omitempty"`
	Subject              string `json:"subject,omitempty"`
	From                 string `json:"from,omitempty"`
	Path                 string `json:"path,omitempty"`
	Name                 string `json:"name,omitempty"`
	FinanceTransactionID string `json:"financeTransactionId,omitempty"`
	RecordingID          string `json:"recordingId,omitempty"`
	RecordingTitle       string `json:"recordingTitle,omitempty"`
	PhotoID              string `json:"photoId,omitempty"`
	PhotoTitle           string `json:"photoTitle,omitempty"`
}

AgentFeedReference is a record a card points at.

type AgentFeedSourceLink struct {
	SourceTitle string `json:"sourceTitle"`
	SourceURL   string `json:"sourceUrl"`
}

AgentFeedSourceLink is a page a card is built from.

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 AgentFileUpload added in v0.210.0

type AgentFileUpload struct {
	AttachmentID string `json:"attachmentId"`
	Name         string `json:"name"`
	UploadURL    string `json:"uploadUrl"`
	MaxBytes     int64  `json:"maxBytes"`
}

AgentFileUpload is a file waiting for its bytes, and where to send them.

func SendAgentFileToFeed added in v0.250.0

func SendAgentFileToFeed(ctx context.Context, connection *Client, name, contentType, caption string, content []byte) (*AgentFileUpload, error)

SendAgentFileToFeed sends the person a file as a card of their feed, as SendAgentFileToMainChat sends it to the main chat.

func SendAgentFileToMainChat added in v0.210.0

func SendAgentFileToMainChat(ctx context.Context, connection *Client, name, contentType, caption string, content []byte) (*AgentFileUpload, error)

SendAgentFileToMainChat sends the person a file in their main chat, with a line to go with it: the file is named, then its bytes go to the address the server answered. It is posted when they arrive.

type AgentFollowUp added in v0.169.0

type AgentFollowUp struct {
	ID             string    `json:"id"`
	FollowUpKind   string    `json:"followUpKind"`
	FollowUpKey    string    `json:"followUpKey"`
	FollowUpTitle  string    `json:"followUpTitle"`
	Payee          string    `json:"payee"`
	Carrier        string    `json:"carrier"`
	Amount         string    `json:"amount"`
	CurrencyCode   string    `json:"currencyCode"`
	TrackingNumber string    `json:"trackingNumber"`
	DueOn          string    `json:"dueOn"`
	Place          string    `json:"place"`
	SourceURL      string    `json:"sourceUrl"`
	FollowUpState  string    `json:"followUpState"`
	ClosedReason   string    `json:"closedReason"`
	ToldState      string    `json:"toldState"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
}

AgentFollowUp is one follow-up. DueOn is a day written YYYY-MM-DD, and the fields a kind does not use are empty.

func AddAgentFollowUp added in v0.169.0

func AddAgentFollowUp(ctx context.Context, connection *Client, followUp NewAgentFollowUp) (*AgentFollowUp, error)

AddAgentFollowUp follows something the person names; what is left empty is not sent.

func ListAgentFollowUps added in v0.169.0

func ListAgentFollowUps(ctx context.Context, connection *Client, isOpenOnly bool) ([]*AgentFollowUp, error)

ListAgentFollowUps is what the agent is following: only what is still being watched, or, with isOpenOnly false, the newest of any state.

func StopAgentFollowUp added in v0.169.0

func StopAgentFollowUp(ctx context.Context, connection *Client, followUpId string) (*AgentFollowUp, error)

StopAgentFollowUp stops following one.

type AgentGoal added in v0.111.0

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

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

	// GoalTimes are when its turns are, in the person's zone, and
	// GoalMailConditions the mail it takes a turn for.
	GoalTimes                []string               `json:"goalTimes"`
	GoalMailConditions       []MailboxRuleCondition `json:"goalMailConditions"`
	GoalWrittenBy            string                 `json:"goalWrittenBy"`
	IsGoalNotifiedWhenPosted bool                   `json:"isGoalNotifiedWhenPosted"`

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

	// CardEngagement is how its cards landed, over all of them and over
	// the last 30 days; filled only when it was read one at a time.
	CardEngagement       *GoalCardEngagement `json:"cardEngagement,omitempty"`
	RecentCardEngagement *GoalCardEngagement `json:"recentCardEngagement,omitempty"`

	Activity       []*AgentGoalActivity   `json:"activity,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 RunAgentGoal added in v0.232.0

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

RunAgentGoal gives a working goal a turn now.

func SetAgentGoalState added in v0.111.0

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

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

func StartAgentGoal added in v0.111.0

func StartAgentGoal(ctx context.Context, connection *Client, change *AgentGoalChange) (*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.

func UpdateAgentGoal added in v0.232.0

func UpdateAgentGoal(ctx context.Context, connection *Client, conversationId string, change *AgentGoalChange) (*AgentGoal, error)

UpdateAgentGoal changes 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 AgentGoalChange added in v0.232.0

type AgentGoalChange struct {
	GoalTitle                *string
	GoalDescription          *string
	GoalEmoji                *string
	GoalTimes                []string
	GoalMailConditions       []MailboxRuleCondition
	IsGoalNotifiedWhenPosted *bool
}

AgentGoalChange is what a goal is started with or changed by: only what is not nil is sent, and an empty list of times or mail conditions takes them away.

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 AgentHerdrFile added in v0.251.0

type AgentHerdrFile struct {
	FileName          string `json:"fileName"`
	FileContentType   string `json:"fileContentType"`
	FileByteCount     int64  `json:"fileByteCount"`
	FileContentBase64 string `json:"fileContentBase64"`
}

AgentHerdrFile is one, bytes and all.

func ReadAgentHerdrFile added in v0.251.0

func ReadAgentHerdrFile(ctx context.Context, connection *Client, computer, paneId, herdrFileReference string, isThumbnail bool) (*AgentHerdrFile, error)

ReadAgentHerdrFile is a picture or a file of a session's turns by the reference a read gave, or its preview.

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"`
	NextOffset   int                `json:"nextOffset"`
}

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, offset int, shouldIncludeToolDetail bool) (*AgentHerdrRead, error)

ReadAgentHerdrSession is a session's last turnCount turns, ending offset turns before the newest; zero leaves the count to the server. shouldIncludeToolDetail gives each tool turn its whole input and what the tool answered.

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, shouldKeepColor bool) (*AgentHerdrScreen, error)

ReadAgentHerdrScreen is a session's screen, or its last lineCount lines, with its colors when shouldKeepColor says so.

type AgentHerdrSession added in v0.120.0

type AgentHerdrSession struct {
	Computer          string              `json:"computer"`
	PaneID            string              `json:"paneId"`
	PaneName          string              `json:"paneName"`
	WorkspaceID       string              `json:"workspaceId"`
	WorkspaceLabel    string              `json:"workspaceLabel"`
	WorkspaceNumber   int                 `json:"workspaceNumber"`
	TabID             string              `json:"tabId"`
	TabLabel          string              `json:"tabLabel"`
	TabNumber         int                 `json:"tabNumber"`
	IsTabFocused      bool                `json:"isTabFocused"`
	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 FocusAgentHerdrSession added in v0.174.0

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

FocusAgentHerdrSession brings a session's tab forward in herdr on its computer.

func OpenAgentHerdrSession added in v0.120.0

func OpenAgentHerdrSession(ctx context.Context, connection *Client, computer, directory, codingAgentKind, agentName string, shouldSkipPermissions bool, paneId string) (*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. Given paneId, it opens beside that pane, and directory and codingAgentKind may be empty: they default to that pane's.

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 before 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 AgentHerdrSubagent added in v0.186.0

type AgentHerdrSubagent struct {
	SubagentID       string     `json:"subagentId"`
	ParentSubagentID string     `json:"parentSubagentId"`
	SubagentType     string     `json:"subagentType"`
	SubagentName     string     `json:"subagentName"`
	TaskText         string     `json:"taskText"`
	ModelName        string     `json:"modelName"`
	SubagentState    string     `json:"subagentState"`
	SpawnDepth       int        `json:"spawnDepth"`
	StartedAt        *time.Time `json:"startedAt"`
	EndedAt          *time.Time `json:"endedAt"`
	ToolNames        []string   `json:"toolNames"`
	ToolCallCount    int        `json:"toolCallCount"`
}

AgentHerdrSubagent is one agent a session started, or one an agent started.

type AgentHerdrSubagents added in v0.186.0

type AgentHerdrSubagents struct {
	HerdrSession     *AgentHerdrSession    `json:"herdrSession"`
	SessionModelName string                `json:"sessionModelName"`
	RequestStartedAt *time.Time            `json:"requestStartedAt"`
	Subagents        []*AgentHerdrSubagent `json:"subagents"`
	IsTruncated      bool                  `json:"isTruncated"`
	LeftCount        int                   `json:"leftCount"`
	NextOffset       int                   `json:"nextOffset"`
}

AgentHerdrSubagents is the agents of a session's current request.

func ReadAgentHerdrSubagents added in v0.186.0

func ReadAgentHerdrSubagents(ctx context.Context, connection *Client, computer, paneId string, offset int) (*AgentHerdrSubagents, error)

ReadAgentHerdrSubagents is the agents a session started for its current request, each with the agent that started it named; offset skips that many of the newest.

type AgentHerdrTurn added in v0.120.0

type AgentHerdrTurn struct {
	HerdrTurnRole  string     `json:"herdrTurnRole"`
	TurnText       string     `json:"turnText"`
	TurnAt         *time.Time `json:"turnAt"`
	ToolInputText  string     `json:"toolInputText"`
	ToolResultText string     `json:"toolResultText"`
	// TurnFiles are the pictures the turn holds and the files it names.
	TurnFiles []*AgentHerdrTurnFile `json:"turnFiles"`
	// IsQueued says the session has not taken this prompt yet.
	IsQueued bool `json:"isQueued"`
}

AgentHerdrTurn is one thing said or done in a session.

type AgentHerdrTurnFile added in v0.251.0

type AgentHerdrTurnFile struct {
	HerdrFileReference string `json:"herdrFileReference"`
	FileName           string `json:"fileName"`
	FileContentType    string `json:"fileContentType"`
	FileByteCount      int64  `json:"fileByteCount"`
	FilePath           string `json:"filePath"`
}

AgentHerdrTurnFile is a picture a turn holds or a file it names, read with ReadAgentHerdrFile by its reference.

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; in a
	// chat, the emoji of each person who reacted.
	Reactions []AgentMessageReaction `json:"reactions"`

	// Who wrote it: a person or an agent, by name. IsMine says you or your
	// agent did. A deleted message has IsDeleted and no words.
	AuthorKind    string `json:"authorKind"`
	AuthorUserID  string `json:"authorUserId"`
	AuthorName    string `json:"authorName"`
	AuthorAgentID string `json:"authorAgentId"`
	// AuthorOwnerName is, on an agent's message, whose agent it is.
	AuthorOwnerName string `json:"authorOwnerName"`
	IsMine          bool   `json:"isMine"`

	// IsAgentWork says that, in a chat, the row is what your agent did to
	// answer, and not something said there.
	IsAgentWork bool       `json:"isAgentWork"`
	EditedAt    *time.Time `json:"editedAt"`
	IsDeleted   bool       `json:"isDeleted"`

	// A voice message in a chat is one recording, with no words of its own:
	// TranscriptText is what the server heard in it, and TranscriptState says
	// how that stands (waiting, done, failed, or off when there will be none).
	IsVoiceMessage  bool   `json:"isVoiceMessage"`
	TranscriptText  string `json:"transcriptText"`
	TranscriptState string `json:"transcriptState"`
}

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

func EditChatMessage added in v0.170.0

func EditChatMessage(ctx context.Context, connection *Client, messageId, message string) (*AgentMessage, error)

EditChatMessage changes what a message of yours says.

func SayInChat added in v0.215.0

func SayInChat(ctx context.Context, connection *Client, conversationId, message, replyToMessageId string) (*AgentMessage, error)

SayInChat says something in a chat as you, under your own name; an @ before a member's name mentions them, and replyToMessageId, when given, is the message it answers. It asks no agent.

func SayInChatAsAgent added in v0.170.0

func SayInChatAsAgent(ctx context.Context, connection *Client, conversationId, message string) (*AgentMessage, error)

SayInChatAsAgent says something in a chat as your agent, under its name.

func TranscribeChatVoiceMessage added in v0.213.0

func TranscribeChatVoiceMessage(ctx context.Context, connection *Client, messageId string) (*AgentMessage, error)

TranscribeChatVoiceMessage writes the words of a voice message that has none, paid by your agent; everybody in the chat sees them.

type AgentMessageReaction added in v0.134.0

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

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

type AgentModelEntry added in v0.240.1

type AgentModelEntry struct {
	// Model is the id the service knows it by.
	Model string `json:"model"`
	// Name is what people read; empty reads as the id.
	Name string `json:"name"`
	// ContextWindow is the override of the provider's window, zero for none.
	ContextWindow int `json:"contextWindow"`
	// ReportedContextWindow is the provider's own figure, zero when unknown.
	ReportedContextWindow int `json:"reportedContextWindow"`
	// Pricing is nil when the entry takes the provider's prices; a value,
	// even all zeros, is the model's own.
	Pricing   *AgentPricing `json:"pricing"`
	IsEnabled bool          `json:"isEnabled"`
	// UsedFor is the roles that point at it.
	UsedFor []string `json:"usedFor"`
}

AgentModelEntry is one model of a provider.

func SaveAgentModelEntry added in v0.240.1

func SaveAgentModelEntry(ctx context.Context, connection *Client, providerName string, entry *AgentModelEntry) (*AgentModelEntry, error)

SaveAgentModelEntry adds a model to a provider, or changes the one with the same id, and answers with it as it is now.

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 AgentPageShare added in v0.170.0

type AgentPageShare struct {
	ID       string `json:"id"`
	Path     string `json:"path"`
	PageName string `json:"pageName"`

	GranteeUserID           *string `json:"granteeUserId"`
	GranteeUsername         string  `json:"granteeUsername"`
	GranteeName             string  `json:"granteeName"`
	GranteeAvatarURL        *string `json:"granteeAvatarUrl"`
	GranteeAvatarColorIndex int     `json:"granteeAvatarColorIndex"`
	GranteeCircleID         *string `json:"granteeCircleId"`
	GranteeCircleName       string  `json:"granteeCircleName"`

	IsQuoteShared bool      `json:"isQuoteShared"`
	CreatedAt     time.Time `json:"createdAt"`
}

AgentPageShare is one share the signed-in account made of one of its own pages.

func ListAgentPageShares added in v0.170.0

func ListAgentPageShares(ctx context.Context, connection *Client) ([]*AgentPageShare, error)

ListAgentPageShares are the shares the signed-in account made.

func ShareAgentPage added in v0.170.0

func ShareAgentPage(ctx context.Context, connection *Client, path, granteeUserId, granteeCircleId string, isQuoteShared bool) (*AgentPageShare, error)

ShareAgentPage shares one of the signed-in account's pages, and everything under it, with a person or a circle, or changes whether the quotes are shared when it is shared with them already.

type AgentPageSharePreview added in v0.170.0

type AgentPageSharePreview struct {
	Page                  *SharedAgentPage `json:"page"`
	ReachedPageCount      int              `json:"reachedPageCount"`
	IsReachedPageCountCut bool             `json:"isReachedPageCountCut"`
	ReachedPagePaths      []string         `json:"reachedPagePaths"`
	WithheldFactCount     int              `json:"withheldFactCount"`
}

AgentPageSharePreview is what a share would show, and which pages it would reach: the first of their paths, by path, of ReachedPageCount in all, and how many facts on them are kept back for their evidence.

func PreviewAgentPageShare added in v0.170.0

func PreviewAgentPageShare(ctx context.Context, connection *Client, path, granteeUserId, granteeCircleId string, isQuoteShared bool) (*AgentPageSharePreview, error)

PreviewAgentPageShare is what the person or circle would be shown if the page were shared with them.

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"`
	PhonePlatform     string     `json:"phonePlatform"`
	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 AgentPricing added in v0.240.1

type AgentPricing struct {
	Input      float64 `json:"input"`
	Output     float64 `json:"output"`
	CacheRead  float64 `json:"cacheRead"`
	CacheWrite float64 `json:"cacheWrite"`
	AudioInput float64 `json:"audioInput"`
}

AgentPricing is what a model costs per million tokens.

type AgentProviderModels added in v0.240.1

type AgentProviderModels struct {
	ProviderName string             `json:"name"`
	Models       []*AgentModelEntry `json:"models"`
}

AgentProviderModels is one provider and its models, as the settings list them.

func AgentProviderModelList added in v0.240.1

func AgentProviderModelList(ctx context.Context, connection *Client) ([]*AgentProviderModels, error)

AgentProviderModelList is every provider with the models it offers.

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"`

	// PhotoID is a photo the person asks about; the server reads its place,
	// date or file name into PhotoTitle, and refuses one that is not theirs.
	PhotoID    string `json:"photoId,omitempty"`
	PhotoTitle string `json:"photoTitle,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, a photo, 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
	Since         *time.Time
	Until         *time.Time
	IsRunningOnly bool
}

AgentRunFilter narrows a listing of runs: to the runs one job made, to some kinds of run, or to the titles carrying some words. Since, Until and IsRunningOnly are for the operator's listing only, which also takes the kinds main and named.

type AgentRunSummary

type AgentRunSummary struct {
	ID        string    `json:"id"`
	AgentID   string    `json:"agentId"`
	Kind      string    `json:"kind"`
	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"`

	// OwnerUsername, OwnerName and IsRunning are told only in the operator's
	// listing: whose agent it is, and whether a turn is in flight in it.
	OwnerUsername string `json:"ownerUsername"`
	OwnerName     string `json:"ownerName"`
	IsRunning     bool   `json:"isRunning"`
}

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 conversations and runs, for an operator with agent:observe or 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 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"`

	// IsAmountDeclared says the skill says what a call costs, so that the tool
	// can be shared with limits; IsScoped that it works only on a request a
	// share made.
	IsAmountDeclared bool `json:"isAmountDeclared"`
	IsScoped         bool `json:"isScoped"`
}

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 AgentTab added in v0.189.0

type AgentTab struct {
	Connected   bool               `json:"connected"`
	Attached    bool               `json:"attached"`
	Title       string             `json:"title"`
	URL         string             `json:"url"`
	Allowed     bool               `json:"allowed"`
	Tabs        []*AgentTabListing `json:"tabs"`
	IsTakenOver bool               `json:"isTakenOver"`
}

AgentTab is the person's browser as the server knows it: whether it is connected through the extension, the tabs, and whether the person has taken the tab over from the dashboard.

func ReadAgentTab added in v0.189.0

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

ReadAgentTab is the person's browser and who holds its tab.

type AgentTabListing added in v0.189.0

type AgentTabListing struct {
	Tab       string `json:"tab"`
	Title     string `json:"title"`
	URL       string `json:"url"`
	IsOwn     bool   `json:"isOwn"`
	IsCurrent bool   `json:"isCurrent"`
}

AgentTabListing is one tab the agent may act in, as the person's browser last listed it: theirs, or one the agent opened.

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"`
	// Intention is the agent's words for what the call does; "" when it
	// gave none.
	Intention string `json:"intention"`
}

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 AppUpdate added in v0.223.0

type AppUpdate struct {
	UpdateChannel string `json:"updateChannel"`
	Version       string `json:"version"`
	BuildNumber   string `json:"buildNumber"`
	InstallURL    string `json:"installUrl"`
}

AppUpdate is the newest TeaNode app on a channel.

func GetAppUpdate added in v0.223.0

func GetAppUpdate(ctx context.Context, connection *Client, updateChannel string) (*AppUpdate, error)

GetAppUpdate is the newest TeaNode app on a channel, testflight, appstore or android, nil when there is none to offer.

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

	// In a chat, which agents the message is for: those by id, and your own
	// without knowing its id. A message that addresses none goes to the people
	// alone.
	AddressedAgentIDs     []string
	ShouldAddressOwnAgent bool

	// In a chat, the people the message mentions, by account, and whether
	// it mentions everybody. A member told only of mentions is told of it.
	// Mentioning a person does not ask their agent.
	MentionedUserIDs []string
	IsAllMentioned   bool

	// VoiceMessageAttachmentID is, in a chat, the recording to post as a
	// voice message, from UploadVoiceMessage. The message has no words.
	VoiceMessageAttachmentID 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"`
	FastModel      string `json:"fastModel"`
	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"`

	// ShareLevel is what the caller may do with it: owner for their own,
	// busy, titles, details or edit for one shared with them, edit for a
	// circle's.
	ShareLevel string `json:"shareLevel"`

	// Whose it is; empty for a circle's calendar, which belongs to the
	// circle.
	OwnerUserID   *string `json:"ownerUserId"`
	OwnerUsername string  `json:"ownerUsername"`
	OwnerName     string  `json:"ownerName"`

	CircleID         *string `json:"circleId"`
	CircleName       string  `json:"circleName"`
	IsCircleCalendar bool    `json:"isCircleCalendar"`
	ColorIndex       int     `json:"colorIndex"`
}

Calendar is one calendar and how much is in it.

func CreateCircleCalendar added in v0.170.0

func CreateCircleCalendar(ctx context.Context, connection *Client, circleId, name string) (*Calendar, error)

CreateCircleCalendar makes the calendar a circle keeps for itself.

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.

func (*Calendar) IsOwn added in v0.170.0

func (self *Calendar) IsOwn() bool

IsOwn says the calendar is the caller's own.

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 CalendarBusyPeriod added in v0.170.0

type CalendarBusyPeriod struct {
	StartsAt string `json:"startsAt"`
	EndsAt   string `json:"endsAt"`
}

CalendarBusyPeriod is a stretch of time somebody is busy, as RFC 3339 moments.

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"`

	// IsBusyOnly says this is all the caller is told of it: the owner is busy.
	IsBusyOnly bool `json:"isBusyOnly"`

	// IsPrivate says the owner marked it private, so everybody the calendar
	// is shared with sees only that the owner is busy.
	IsPrivate bool `json:"isPrivate"`

	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 CalendarFreeBusy added in v0.170.0

type CalendarFreeBusy struct {
	UserID     string                `json:"userId"`
	Username   string                `json:"username"`
	Name       string                `json:"name"`
	IsShared   bool                  `json:"isShared"`
	ShareLevel string                `json:"shareLevel"`
	Periods    []*CalendarBusyPeriod `json:"periods"`
}

CalendarFreeBusy is when one person is busy, for a caller they share their calendar with. IsShared is false for somebody who has shared nothing with the caller.

func ListCalendarFreeBusy added in v0.170.0

func ListCalendarFreeBusy(ctx context.Context, connection *Client, userIds []string, from, until string) ([]*CalendarFreeBusy, error)

ListCalendarFreeBusy asks when each of these people is busy between two moments written as RFC 3339.

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 CalendarShare added in v0.170.0

type CalendarShare struct {
	ID         string `json:"id"`
	CalendarID string `json:"calendarId"`

	GranteeUserID     *string `json:"granteeUserId"`
	GranteeUsername   string  `json:"granteeUsername"`
	GranteeName       string  `json:"granteeName"`
	GranteeCircleID   *string `json:"granteeCircleId"`
	GranteeCircleName string  `json:"granteeCircleName"`

	ShareLevel string    `json:"shareLevel"`
	CreatedAt  time.Time `json:"createdAt"`
}

CalendarShare gives one person or one circle a level of access to one calendar.

func ListCalendarShares added in v0.170.0

func ListCalendarShares(ctx context.Context, connection *Client, calendarId string) ([]*CalendarShare, error)

ListCalendarShares are who the caller's calendar is shared with.

func ShareCalendar added in v0.170.0

func ShareCalendar(ctx context.Context, connection *Client, calendarId, granteeUserId, granteeCircleId, shareLevel string) (*CalendarShare, error)

ShareCalendar shares the caller's calendar with a person or a circle, given by identifier (one of the two), or changes the level of a share already made.

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 ChangePasswordsPassphraseInput added in v0.193.0

type ChangePasswordsPassphraseInput struct {
	Proof                    string `json:"proof"`
	IsRecoveryKey            bool   `json:"isRecoveryKey"`
	AccountKeyByPassphrase   string `json:"accountKeyByPassphrase"`
	PassphraseSalt           string `json:"passphraseSalt"`
	PassphraseIterationCount int    `json:"passphraseIterationCount"`
	PassphraseProofHash      string `json:"passphraseProofHash"`
}

ChangePasswordsPassphraseInput is the account key sealed again by a new passphrase, with the proof of the old passphrase or of the recovery key.

type ChatCall added in v0.212.0

type ChatCall struct {
	ID              string            `json:"id"`
	ConversationID  string            `json:"conversationId"`
	ChatTitle       string            `json:"chatTitle"`
	StartedByName   string            `json:"startedByName"`
	StartedAt       time.Time         `json:"startedAt"`
	AnsweredAt      *time.Time        `json:"answeredAt"`
	EndedAt         *time.Time        `json:"endedAt"`
	EndReason       string            `json:"endReason"`
	IsGoing         bool              `json:"isGoing"`
	DurationMS      int64             `json:"durationMs"`
	TranscriptState string            `json:"transcriptState"`
	Members         []*ChatCallMember `json:"members"`
}

ChatCall is a call in a chat as the person asking sees it.

func ListChatCalls added in v0.212.0

func ListChatCalls(ctx context.Context, connection *Client, conversationId string, first int) ([]*ChatCall, error)

ListChatCalls is a chat's calls, newest first.

type ChatCallDetail added in v0.212.0

type ChatCallDetail struct {
	Call             *ChatCall                 `json:"call"`
	Transcript       []*ChatCallTranscriptLine `json:"transcript"`
	RecordingID      string                    `json:"recordingId"`
	IsRecordingOwned bool                      `json:"isRecordingOwned"`
}

ChatCallDetail is a call with its transcript, and the recording the call became when the caller may read it, theirs or shared with them.

func ReadChatCall added in v0.212.0

func ReadChatCall(ctx context.Context, connection *Client, callId string) (*ChatCallDetail, error)

ReadChatCall is one call with its transcript.

type ChatCallMember added in v0.212.0

type ChatCallMember struct {
	UserID    string `json:"userId"`
	Name      string `json:"name"`
	RingState string `json:"ringState"`
	IsOn      bool   `json:"isOn"`
}

ChatCallMember is one person's part in a call.

type ChatCallTranscriptLine added in v0.212.0

type ChatCallTranscriptLine struct {
	SpeakerName string `json:"speakerName"`
	StartMS     int64  `json:"startMs"`
	Text        string `json:"text"`
}

ChatCallTranscriptLine is one line of a transcribed call.

type CheckInAt added in v0.175.0

type CheckInAt struct {
	PlaceID          string
	LatitudeDegrees  *float64
	LongitudeDegrees *float64
	PlaceName        string
	OSMType          string
	OSMID            int64
	OSMCategory      string
	AddressText      string

	// AccuracyMeters is how far off the position may be, as the device said;
	// nil sends none.
	AccuracyMeters *float64
}

CheckInAt is where to check in: one of the caller's places, or a place that was found, with what OpenStreetMap called it.

type Circle added in v0.170.0

type Circle struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	CircleKind string    `json:"circleKind"`
	CreatedAt  time.Time `json:"createdAt"`

	// MemberRole is the signed-in account's own role in it.
	MemberRole string `json:"memberRole"`

	Members []*CircleMember `json:"members"`

	// PendingInvitations is empty unless the signed-in account is an admin.
	PendingInvitations []*CircleInvitation `json:"pendingInvitations"`
}

Circle is a named set of people on this server who know each other.

func AddCircleMember added in v0.170.0

func AddCircleMember(ctx context.Context, connection *Client, circleId, username, memberRole string) (*Circle, error)

AddCircleMember puts an account in a circle without an invitation. Needs user:manage.

func AnswerCircleInvitation added in v0.170.0

func AnswerCircleInvitation(ctx context.Context, connection *Client, invitationId string, isAccepted bool) (*Circle, error)

AnswerCircleInvitation accepts or declines an invitation. Accepting returns the circle joined; declining returns nil.

func CreateCircle added in v0.170.0

func CreateCircle(ctx context.Context, connection *Client, name, circleKind string) (*Circle, error)

CreateCircle makes a circle with the signed-in account as its admin.

func ListCircles added in v0.170.0

func ListCircles(ctx context.Context, connection Executor) ([]*Circle, error)

ListCircles returns the circles the signed-in account is in.

func ReadCircle added in v0.170.0

func ReadCircle(ctx context.Context, connection *Client, circleId string) (*Circle, error)

ReadCircle returns one circle the signed-in account is in.

func RemoveCircleMember added in v0.170.0

func RemoveCircleMember(ctx context.Context, connection *Client, circleId, username string) (*Circle, error)

RemoveCircleMember takes a member out of a circle. The circle it returns is nil when the caller took themselves out.

func RenameCircle added in v0.170.0

func RenameCircle(ctx context.Context, connection *Client, circleId, name string) (*Circle, error)

RenameCircle changes a circle's name.

func SetCircleMemberRole added in v0.170.0

func SetCircleMemberRole(ctx context.Context, connection *Client, circleId, username, memberRole string) (*Circle, error)

SetCircleMemberRole makes a member an admin, or an admin a member.

type CircleInvitation added in v0.170.0

type CircleInvitation struct {
	ID              string    `json:"id"`
	CircleID        string    `json:"circleId"`
	CircleName      string    `json:"circleName"`
	CircleKind      string    `json:"circleKind"`
	InvitedByName   string    `json:"invitedByName"`
	InvitedUsername string    `json:"invitedUsername"`
	MemberRole      string    `json:"memberRole"`
	CreatedAt       time.Time `json:"createdAt"`
	ExpiresAt       time.Time `json:"expiresAt"`
}

CircleInvitation asks one person to join one circle.

func ListCircleInvitations added in v0.170.0

func ListCircleInvitations(ctx context.Context, connection *Client) ([]*CircleInvitation, error)

ListCircleInvitations returns the invitations to the signed-in account that can still be answered.

type CircleMember added in v0.170.0

type CircleMember struct {
	UserID           string    `json:"userId"`
	Username         string    `json:"username"`
	Name             string    `json:"name"`
	AvatarURL        *string   `json:"avatarUrl"`
	AvatarColorIndex int       `json:"avatarColorIndex"`
	MemberRole       string    `json:"memberRole"`
	JoinedAt         time.Time `json:"joinedAt"`

	// RelationshipKind is what this person is to the signed-in account,
	// such as parent or spouse, empty when neither has said.
	// RelationshipTermGender (masculine, feminine or neutral) is the gender
	// of the word to show, and RelationshipWord that word in English, such
	// as father.
	RelationshipKind       string `json:"relationshipKind"`
	RelationshipTermGender string `json:"relationshipTermGender"`
	RelationshipWord       string `json:"relationshipWord"`

	// LinkedContactID is the signed-in account's own contact linked to this
	// person, empty when there is none. Private to the signed-in account.
	LinkedContactID string `json:"linkedContactId"`
}

CircleMember is one person in a circle.

func ListCirclePeople added in v0.170.0

func ListCirclePeople(ctx context.Context, connection Executor) ([]*CircleMember, error)

ListCirclePeople returns everybody the signed-in account shares a circle with, once each.

func SetPersonRelationship added in v0.178.0

func SetPersonRelationship(ctx context.Context, connection *Client, username, relationshipTerm string) (*CircleMember, error)

SetPersonRelationship says what somebody the signed-in account shares a circle with is to them, with one of the words ListRelationshipTerms gives, such as wife or father_in_law. The other person is told, and sees the opposite. It returns the person as the signed-in account now sees them.

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) DownloadPhotoFile added in v0.171.0

func (self *Client) DownloadPhotoFile(ctx context.Context, file *models.PhotoFile, destination io.Writer) error

DownloadPhotoFile streams one of a photo's files to destination and checks that all of it arrived: a file shorter than the server says it is, because the connection dropped, is an error and not a smaller photo.

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.

func (*Client) UploadPhoto added in v0.171.0

func (self *Client) UploadPhoto(ctx context.Context, upload *PhotoUpload) (string, error)

UploadPhoto sends a file over the resumable upload endpoint: the first part starts the upload, the others are appended at the offset the server has, and after a failure the server is asked where it got to (HEAD) and the upload goes on from there. It returns the new photo's identifier.

A part is tried three times. An upload the server lost, or that was cancelled, is started again from the beginning, which counts as a try. The caller sees the progress through OnProgress.

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"`

	// AccountUserID and Account say which person in the signed-in account's
	// circles the contact is linked to, when it is and they still share a
	// circle. Null otherwise.
	AccountUserID *string         `json:"accountUserId"`
	Account       *ContactAccount `json:"account"`
}

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, addressBookId, id string) (*Contact, error)

GetContact is one contact, with its card, in the address book named or, when addressBookId is empty, in the first of the caller's books that holds it.

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 RemoveContactPicture added in v0.176.0

func RemoveContactPicture(ctx context.Context, executor Executor, addressBookId, id string) (*Contact, error)

RemoveContactPicture takes the picture off a contact and leaves the rest of the card as it was, in the address book named as GetContact's is.

func SaveContact

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

SaveContact keeps one, or changes one that is kept.

func SetContactAccount added in v0.184.0

func SetContactAccount(ctx context.Context, executor Executor, addressBookId, contactId, accountUserId string) (*Contact, error)

SetContactAccount links a contact to the person in the signed-in account's circles it is, or takes the link away when accountUserId is empty.

type ContactAccount added in v0.184.0

type ContactAccount struct {
	UserID           string  `json:"userId"`
	Username         string  `json:"username"`
	Name             string  `json:"name"`
	AvatarURL        *string `json:"avatarUrl"`
	AvatarColorIndex int     `json:"avatarColorIndex"`
}

ContactAccount is the person a contact is linked to, as the circles show them.

type ContactAccountSuggestion added in v0.184.0

type ContactAccountSuggestion struct {
	// AddressBookID is the book the contact is in.
	AddressBookID string          `json:"addressBookId"`
	Contact       *Contact        `json:"contact"`
	Account       *ContactAccount `json:"account"`
}

ContactAccountSuggestion offers to link a contact to a person in the circles, because the contact carries one of that person's mailbox addresses. It never says which address.

func ListContactAccountSuggestions added in v0.184.0

func ListContactAccountSuggestions(ctx context.Context, executor Executor) ([]*ContactAccountSuggestion, error)

ListContactAccountSuggestions are the contacts that look like people in the circles, for the caller to confirm one by one.

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 EraseJournalView added in v0.202.0

type EraseJournalView struct {
	DayCount    int `json:"dayCount"`
	PeriodCount int `json:"periodCount"`
	LinkCount   int `json:"linkCount"`
}

EraseJournalView says what an erase removed.

func EraseJournal added in v0.202.0

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

EraseJournal erases the caller's whole journal. It cannot be undone.

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 FinanceImport added in v0.243.0

type FinanceImport struct {
	AgentJobID            string     `json:"agentJobId"`
	FinanceImportKind     string     `json:"financeImportKind"`
	FinanceImportSource   string     `json:"financeImportSource"`
	AgentJobStatus        string     `json:"agentJobStatus"`
	FileName              string     `json:"fileName"`
	AgentAttachmentID     string     `json:"agentAttachmentId"`
	AttachmentContentType string     `json:"attachmentContentType"`
	MailboxItemID         string     `json:"mailboxItemId"`
	QueuedAt              time.Time  `json:"queuedAt"`
	FinishedAt            *time.Time `json:"finishedAt"`
	OutcomeText           string     `json:"outcomeText"`
	RunConversationID     string     `json:"runConversationId"`
	ImportedRecordCount   int        `json:"importedRecordCount"`
	FinanceReceiptIDs     []string   `json:"financeReceiptIds"`
	FinanceTaxFormIDs     []string   `json:"financeTaxFormIds"`
	FinanceAccountIDs     []string   `json:"financeAccountIds"`
	TaxYear               int        `json:"taxYear"`
	IsNothingImported     bool       `json:"isNothingImported"`
	OutcomeReason         string     `json:"outcomeReason"`
}

FinanceImport is one file read into finance in the background.

type FinanceImportPage added in v0.243.0

type FinanceImportPage struct {
	FinanceImports []*FinanceImport `json:"financeImports"`
	HasMore        bool             `json:"hasMore"`
	TotalCount     int64            `json:"totalCount"`
}

FinanceImportPage is one page of imports.

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 FinanceShare added in v0.194.0

type FinanceShare struct {
	ID                string    `json:"id"`
	FinanceAccountID  string    `json:"financeAccountId"`
	AccountName       string    `json:"accountName"`
	AccountMask       string    `json:"accountMask"`
	GranteeUserID     *string   `json:"granteeUserId"`
	GranteeUsername   string    `json:"granteeUsername"`
	GranteeName       string    `json:"granteeName"`
	GranteeCircleID   *string   `json:"granteeCircleId"`
	GranteeCircleName string    `json:"granteeCircleName"`
	FinanceShareLevel string    `json:"financeShareLevel"`
	CreatedAt         time.Time `json:"createdAt"`
}

FinanceShare is one share of one of the caller's finance accounts.

func ListFinanceAccountShares added in v0.194.0

func ListFinanceAccountShares(ctx context.Context, connection *Client, financeAccountId string) ([]*FinanceShare, error)

ListFinanceAccountShares are the shares the caller has made, of one finance account when its identifier is given.

func ShareFinanceAccount added in v0.194.0

func ShareFinanceAccount(ctx context.Context, connection *Client, financeAccountId, granteeUserId, granteeCircleId, financeShareLevel string) (*FinanceShare, error)

ShareFinanceAccount shares one of the caller's finance accounts with a person or a circle, given by identifier (one of the two), or changes the level of a share already made.

type FinanceShareAll added in v0.210.0

type FinanceShareAll struct {
	ID                string    `json:"id"`
	GranteeUserID     *string   `json:"granteeUserId"`
	GranteeUsername   string    `json:"granteeUsername"`
	GranteeName       string    `json:"granteeName"`
	GranteeCircleID   *string   `json:"granteeCircleId"`
	GranteeCircleName string    `json:"granteeCircleName"`
	FinanceShareLevel string    `json:"financeShareLevel"`
	CreatedAt         time.Time `json:"createdAt"`
}

FinanceShareAll is one share of all of the caller's finance, which covers every account they hold now and later and names none.

func ListFinanceShares added in v0.210.0

func ListFinanceShares(ctx context.Context, connection *Client) ([]*FinanceShareAll, error)

ListFinanceShares are the shares of all of their finance that the caller has made.

func ShareFinance added in v0.210.0

func ShareFinance(ctx context.Context, connection *Client, granteeUserId, granteeCircleId, financeShareLevel string) (*FinanceShareAll, error)

ShareFinance shares all of the caller's finance with a person or a circle, given by identifier (one of the two), or changes the level of a share already made.

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 FoundPlace added in v0.175.0

type FoundPlace struct {
	PlaceName        string  `json:"placeName"`
	OSMType          string  `json:"osmType"`
	OSMID            int64   `json:"osmId"`
	OSMCategory      string  `json:"osmCategory"`
	AddressText      string  `json:"addressText"`
	LatitudeDegrees  float64 `json:"latitudeDegrees"`
	LongitudeDegrees float64 `json:"longitudeDegrees"`
	DistanceMeters   float64 `json:"distanceMeters"`
	PlaceID          *string `json:"placeId"`

	// PlaceLabel and IsNamedByPerson are filled when the row is the caller's
	// own place; PlaceName is then their name for it when they named it.
	PlaceLabel      string `json:"placeLabel"`
	IsNamedByPerson bool   `json:"isNamedByPerson"`
}

FoundPlace is a place on the map, found by OpenStreetMap or one of the caller's own that is near; PlaceID is the caller's own place there, if any.

func ListNearbyPlaces added in v0.175.0

func ListNearbyPlaces(ctx context.Context, connection *Client, latitudeDegrees, longitudeDegrees float64, radiusMeters *float64) ([]*FoundPlace, error)

ListNearbyPlaces is what is at and around a point; a nil radius is the server's default.

func SearchAddresses added in v0.175.0

func SearchAddresses(ctx context.Context, connection *Client, search AddressSearch) ([]*FoundPlace, error)

SearchAddresses is the addresses matching words, nearest first to the place, the point, or where the caller last was. A LimitCount of zero is the server's default.

type FoundPlacePage added in v0.175.0

type FoundPlacePage struct {
	FoundPlaces []*FoundPlace `json:"foundPlaces"`
	NextOffset  *int          `json:"nextOffset"`
}

FoundPlacePage is a page of found places; NextOffset is null on the last.

func SearchPlaces added in v0.175.0

func SearchPlaces(ctx context.Context, connection *Client, search PlaceSearch) (*FoundPlacePage, error)

SearchPlaces is a page of places matching words, nearest first.

type GoalCardEngagement added in v0.249.0

type GoalCardEngagement struct {
	PostedCardCount    int `json:"postedCardCount"`
	UsefulCardCount    int `json:"usefulCardCount"`
	LikedCardCount     int `json:"likedCardCount"`
	DiscussedCardCount int `json:"discussedCardCount"`
	ActedOnCardCount   int `json:"actedOnCardCount"`
	ExpectedCardCount  int `json:"expectedCardCount"`
	DismissedCardCount int `json:"dismissedCardCount"`
	ReadOnlyCardCount  int `json:"readOnlyCardCount"`
	NotReadCardCount   int `json:"notReadCardCount"`
}

GoalCardEngagement counts how the person responded to the cards a goal posted. The buckets overlap, except UsefulCardCount, which counts each card once.

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 HealthCategorySeconds added in v0.183.0

type HealthCategorySeconds map[string]float64

HealthCategorySeconds is the time a day or a period spent in each value of a category type, in seconds: for sleep, {"asleepCore": 12600, "awake": 600}. The server may send it as an object or as a string holding one, and an empty one is a type that has no such split.

func (HealthCategorySeconds) AsleepSeconds added in v0.183.0

func (self HealthCategorySeconds) AsleepSeconds() (float64, bool)

AsleepSeconds is the night's total time asleep, and whether the type has one.

func (*HealthCategorySeconds) UnmarshalJSON added in v0.183.0

func (self *HealthCategorySeconds) UnmarshalJSON(encoded []byte) error

UnmarshalJSON accepts an object or a string holding an object.

func (HealthCategorySeconds) Words added in v0.183.0

func (self HealthCategorySeconds) Words() string

Words lists what a day or a period spent in each value, as the dashboard words it: the stages of a night from the deepest up (Deep 1 h 5 min, Core 3 h, REM 1 h 30 min, Awake 20 min), then anything else a type keeps (a workout's energy and distance). The night's total (the key "asleep") is not a stage and is left out; AsleepSeconds is that.

func (HealthCategorySeconds) WordsPerDay added in v0.183.0

func (self HealthCategorySeconds) WordsPerDay(dayCount int) string

WordsPerDay is Words with every figure divided by this many days, which is how a week or a month is told as a night or a day. Fewer than one day is one.

type HealthCharacteristicView added in v0.183.0

type HealthCharacteristicView struct {
	HealthType          string `json:"healthType"`
	CharacteristicValue string `json:"characteristicValue"`
}

HealthCharacteristicView is a fact about the person that HealthKit keeps and that does not change by the day: date of birth, blood type.

type HealthDaySummaryView added in v0.183.0

type HealthDaySummaryView struct {
	SummaryDay      string                `json:"summaryDay"`
	SumValue        *float64              `json:"sumValue"`
	AverageValue    *float64              `json:"averageValue"`
	MinimumValue    *float64              `json:"minimumValue"`
	MaximumValue    *float64              `json:"maximumValue"`
	SampleCount     int                   `json:"sampleCount"`
	DurationSeconds *float64              `json:"durationSeconds"`
	CategorySeconds HealthCategorySeconds `json:"categorySeconds"`
}

HealthDaySummaryView is one type on one day, as the type list shows the latest day.

type HealthErasedView added in v0.183.0

type HealthErasedView struct {
	ErasedSampleCount int `json:"erasedSampleCount"`
}

HealthErasedView says what erasing deleted.

func EraseHealthData added in v0.183.0

func EraseHealthData(ctx context.Context, connection *Client, healthType string) (*HealthErasedView, error)

EraseHealthData erases one type of the caller's Health data, or all of it when the type is empty. It cannot be undone.

type HealthPeriodView added in v0.183.0

type HealthPeriodView struct {
	StartDay        string                `json:"startDay"`
	EndDay          string                `json:"endDay"`
	SumValue        *float64              `json:"sumValue"`
	AverageValue    *float64              `json:"averageValue"`
	MinimumValue    *float64              `json:"minimumValue"`
	MaximumValue    *float64              `json:"maximumValue"`
	SampleCount     int                   `json:"sampleCount"`
	DurationSeconds *float64              `json:"durationSeconds"`
	DayCount        int                   `json:"dayCount"`
	CategorySeconds HealthCategorySeconds `json:"categorySeconds"`
}

HealthPeriodView is one day, week (from Monday) or month of one type. DayCount is how many of its days have a summary, which a per-day average divides by; it is 0 from a server that does not say.

func (*HealthPeriodView) IsSeveralDays added in v0.183.0

func (self *HealthPeriodView) IsSeveralDays() bool

IsSeveralDays is whether the period is a week or a month (or any run of days with a summary), which is what is told as a total and a per-day average.

func (*HealthPeriodView) PerDay added in v0.183.0

func (self *HealthPeriodView) PerDay(quantityValue float64) (float64, bool)

PerDay is a figure of a period divided by the days that have a summary, and whether that could be worked out: a day, or a period from a server that does not say how many days it holds, has no average per day.

type HealthRouteView added in v0.183.0

type HealthRouteView struct {
	HealthSampleID string      `json:"healthSampleId"`
	RoutePoints    [][]float64 `json:"routePoints"`
}

HealthRouteView is a workout's path: [secondsFromStart, latitudeDegrees, longitudeDegrees, altitudeMeters] for each point.

func ReadHealthRoute added in v0.183.0

func ReadHealthRoute(ctx context.Context, connection *Client, healthSampleId string) (*HealthRouteView, error)

ReadHealthRoute is the path of one of the caller's workouts.

type HealthSamplePage added in v0.183.0

type HealthSamplePage struct {
	Samples            []*HealthSampleView `json:"samples"`
	TotalCount         int                 `json:"totalCount"`
	IsTotalCountCapped bool                `json:"isTotalCountCapped"`
	NextOffset         *int                `json:"nextOffset"`
}

HealthSamplePage is a page of samples: how many there are in all, and where the next page starts, null on the last.

func ListHealthSamples added in v0.183.0

func ListHealthSamples(ctx context.Context, connection *Client, query HealthSamplesQuery) (*HealthSamplePage, error)

ListHealthSamples is a page of the caller's own readings of one type, newest first.

type HealthSampleView added in v0.183.0

type HealthSampleView struct {
	HealthSampleID      string     `json:"healthSampleId"`
	HealthType          string     `json:"healthType"`
	StartedAt           time.Time  `json:"startedAt"`
	EndedAt             time.Time  `json:"endedAt"`
	QuantityValue       *float64   `json:"quantityValue"`
	QuantityUnit        string     `json:"quantityUnit"`
	CategoryValue       *int       `json:"categoryValue"`
	WorkoutActivityType string     `json:"workoutActivityType"`
	SourceName          string     `json:"sourceName"`
	SourceBundleID      string     `json:"sourceBundleId"`
	DeviceName          string     `json:"deviceName"`
	SampleMetadataJSON  string     `json:"sampleMetadataJson"`
	ReceivedAt          *time.Time `json:"receivedAt"`
	HasRoute            bool       `json:"hasRoute"`
}

HealthSampleView is one reading: a value over a time, a category value over a time, or a workout. SampleMetadataJSON is a JSON object as a string.

type HealthSamplesQuery added in v0.183.0

type HealthSamplesQuery struct {
	HealthType string
	From, To   time.Time
	Offset     int
	LimitCount int
}

HealthSamplesQuery pages the caller's readings of one type between two moments. A zero LimitCount is the server's default.

type HealthSettingsView added in v0.183.0

type HealthSettingsView struct {
	CanAgentReadHealth bool                        `json:"canAgentReadHealth"`
	HealthErasedAt     *time.Time                  `json:"healthErasedAt"`
	SampleCount        int                         `json:"sampleCount"`
	LastReceivedAt     *time.Time                  `json:"lastReceivedAt"`
	ModelProviderName  string                      `json:"modelProviderName"`
	Characteristics    []*HealthCharacteristicView `json:"characteristics"`
}

HealthSettingsView is the person's Health switches and what is kept.

func ReadHealthSettings added in v0.183.0

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

ReadHealthSettings are the caller's Health switches and what is kept.

func UpdateHealthSettings added in v0.183.0

func UpdateHealthSettings(ctx context.Context, connection *Client, canAgentReadHealth bool) (*HealthSettingsView, error)

UpdateHealthSettings lets the agent read the caller's Health data, or not.

type HealthShareView added in v0.183.0

type HealthShareView struct {
	ID                string     `json:"id"`
	OwnerUserID       string     `json:"ownerUserId"`
	OwnerUsername     string     `json:"ownerUsername"`
	OwnerName         string     `json:"ownerName"`
	GranteeUserID     *string    `json:"granteeUserId"`
	GranteeUsername   string     `json:"granteeUsername"`
	GranteeCircleID   *string    `json:"granteeCircleId"`
	GranteeCircleName string     `json:"granteeCircleName"`
	HealthCategories  []string   `json:"healthCategories"`
	CreatedAt         *time.Time `json:"createdAt"`
}

HealthShareView is one share of Health: the sharer, who it is shared with (a person or a circle) and which Health categories.

func ListHealthShares added in v0.183.0

func ListHealthShares(ctx context.Context, connection *Client) ([]*HealthShareView, error)

ListHealthShares are the caller's own shares of Health and the ones shared with them.

func SetHealthShare added in v0.183.0

func SetHealthShare(ctx context.Context, connection *Client, granteeUserId, granteeCircleId string, healthCategories []string) (*HealthShareView, error)

SetHealthShare shares the named Health categories with a person or a circle; an empty list takes the share away, and then nothing is returned.

type HealthSummaryQuery added in v0.183.0

type HealthSummaryQuery struct {
	HealthType  string
	FromDay     string
	ToDay       string
	Period      string
	OwnerUserID string
}

HealthSummaryQuery is one type over a range of days. Period is day, week or month; OwnerUserID is somebody who shares Health with the caller.

type HealthSummaryView added in v0.183.0

type HealthSummaryView struct {
	HealthType   string              `json:"healthType"`
	QuantityUnit string              `json:"quantityUnit"`
	SummaryKind  string              `json:"summaryKind"`
	Periods      []*HealthPeriodView `json:"periods"`
}

HealthSummaryView is one type over a range of days, by period.

func ReadHealthSummary added in v0.183.0

func ReadHealthSummary(ctx context.Context, connection *Client, query HealthSummaryQuery) (*HealthSummaryView, error)

ReadHealthSummary is one type over a range of days, by period.

type HealthTypeView added in v0.183.0

type HealthTypeView struct {
	HealthType       string                `json:"healthType"`
	HealthCategory   string                `json:"healthCategory"`
	TypeName         string                `json:"typeName"`
	ValueKind        string                `json:"valueKind"`
	QuantityUnit     string                `json:"quantityUnit"`
	SummaryKind      string                `json:"summaryKind"`
	FirstDay         string                `json:"firstDay"`
	LastDay          string                `json:"lastDay"`
	SampleCount      int                   `json:"sampleCount"`
	LatestDaySummary *HealthDaySummaryView `json:"latestDaySummary"`
}

HealthTypeView is one kind of data the person (or somebody who shares with them) has: its identifier, the Health category it belongs to, how its value is read and how its days add up.

func ListHealthTypes added in v0.183.0

func ListHealthTypes(ctx context.Context, connection *Client, ownerUserId string) ([]*HealthTypeView, error)

ListHealthTypes are the kinds of data the caller has, or, with an owner, the ones in the Health categories that person shares with them.

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 JournalChapterView added in v0.202.0

type JournalChapterView struct {
	FromDay  string `json:"fromDay"`
	UntilDay string `json:"untilDay"`
	Title    string `json:"title"`
	Detail   string `json:"detail"`
}

JournalChapterView is a stretch of a year that belongs together.

type JournalChatView added in v0.202.0

type JournalChatView struct {
	ChatID       string    `json:"chatId"`
	ChatName     string    `json:"chatName"`
	FirstAt      time.Time `json:"firstAt"`
	LastAt       time.Time `json:"lastAt"`
	MessageCount int       `json:"messageCount"`
}

JournalChatView is a circle or group chat that had messages that day.

type JournalCodingSessionView added in v0.202.0

type JournalCodingSessionView struct {
	DocumentID string     `json:"documentId"`
	Title      string     `json:"title"`
	Directory  string     `json:"directory"`
	Assistant  string     `json:"assistant"`
	StartedAt  time.Time  `json:"startedAt"`
	EndedAt    *time.Time `json:"endedAt"`

	// StretchCount is how many stretches of work the day had in it.
	StretchCount int `json:"stretchCount"`

	// LinkReason is the agent's one line about it, when it chose it.
	LinkReason string `json:"linkReason"`
}

JournalCodingSessionView is a stretch of work in Claude Code or Codex.

type JournalConversationView added in v0.202.0

type JournalConversationView struct {
	ConversationID string    `json:"conversationId"`
	Title          string    `json:"title"`
	IsMain         bool      `json:"isMain"`
	FirstAt        time.Time `json:"firstAt"`
	LastAt         time.Time `json:"lastAt"`
	MessageCount   int       `json:"messageCount"`
}

JournalConversationView is a conversation with the agent that had messages that day.

type JournalCorrectionView added in v0.202.0

type JournalCorrectionView struct {
	CorrectionText string    `json:"correctionText"`
	CreatedAt      time.Time `json:"createdAt"`
}

JournalCorrectionView is something the person said a narrative got wrong.

type JournalDayPageView added in v0.202.0

type JournalDayPageView struct {
	Days       []*JournalDaySummaryView `json:"days"`
	TotalCount int                      `json:"totalCount"`

	// Today is the caller's today, YYYY-MM-DD, in their zone.
	Today string `json:"today"`

	// FirstDay is the earliest day with anything in it, empty for none.
	FirstDay string `json:"firstDay"`
}

JournalDayPageView is a page of the timeline.

func ListJournalDays added in v0.202.0

func ListJournalDays(ctx context.Context, connection *Client, query JournalDaysQuery) (*JournalDayPageView, error)

ListJournalDays is the caller's days, newest first.

type JournalDaySummaryView added in v0.202.0

type JournalDaySummaryView struct {
	Day     string `json:"day"`
	IsToday bool   `json:"isToday"`

	Mood    *JournalMoodView    `json:"mood"`
	Weather *JournalWeatherView `json:"weather"`

	Headline string `json:"headline"`

	// WordsExcerpt is the start of the words as shown (the touched-up text
	// when touching up is on), at most 280 characters.
	WordsExcerpt string `json:"wordsExcerpt"`
	HasWords     bool   `json:"hasWords"`

	Facts *JournalFactsView `json:"facts"`

	// CoverPhotoID is the photo standing for the day, empty for none;
	// PhotoIDs up to four of the day's photos, the cover first.
	CoverPhotoID string   `json:"coverPhotoId"`
	PhotoIDs     []string `json:"photoIds"`

	HasNarrative bool `json:"hasNarrative"`
}

JournalDaySummaryView is a day as a timeline, a week or a month shows it.

type JournalDayView added in v0.202.0

type JournalDayView struct {
	Day      string `json:"day"`
	TimeZone string `json:"timeZone"`
	IsToday  bool   `json:"isToday"`

	// Weekday is monday to sunday; WeekStart, the first day of the week the
	// day is in, as the person's locale starts weeks.
	Weekday   string `json:"weekday"`
	WeekStart string `json:"weekStart"`

	Words     *JournalWordsView     `json:"words"`
	Mood      *JournalMoodView      `json:"mood"`
	Weather   *JournalWeatherView   `json:"weather"`
	Facts     *JournalFactsView     `json:"facts"`
	Narrative *JournalNarrativeView `json:"narrative"`

	// Choices are the agent's choices (hidden ones included, marked) and
	// Pins the person's, in the order the page shows them.
	Choices []*JournalLinkView `json:"choices"`
	Pins    []*JournalLinkView `json:"pins"`

	CoverPhotoID string `json:"coverPhotoId"`

	// The day's records, by source. Each list is capped and comes with the
	// total; a source the caller does not hold is empty and named in
	// UnavailableSections.
	WorkProjects        []*JournalWorkProjectView   `json:"workProjects"`
	CodingSessions      []*JournalCodingSessionView `json:"codingSessions"`
	Documents           []*JournalDocumentView      `json:"documents"`
	DocumentTotal       int                         `json:"documentTotal"`
	Conversations       []*JournalConversationView  `json:"conversations"`
	Chats               []*JournalChatView          `json:"chats"`
	Mail                []*JournalMailView          `json:"mail"`
	MailTotal           int                         `json:"mailTotal"`
	Recordings          []*JournalRecordingView     `json:"recordings"`
	Photos              []*JournalPhotoView         `json:"photos"`
	PhotoTotal          int                         `json:"photoTotal"`
	Visits              []*JournalVisitView         `json:"visits"`
	Events              []*JournalEventView         `json:"events"`
	Reminders           []*JournalReminderView      `json:"reminders"`
	Transactions        []*JournalTransactionView   `json:"transactions"`
	Health              *JournalHealthView          `json:"health"`
	ShoppingTrips       []*JournalShoppingTripView  `json:"shoppingTrips"`
	Notes               []*JournalRecordView        `json:"notes"`
	MemoryPages         []*JournalMemoryPageView    `json:"memoryPages"`
	UnavailableSections []string                    `json:"unavailableSections"`

	// Moments is everything above in the order it happened.
	Moments []*JournalMomentView `json:"moments"`
}

JournalDayView is one day whole.

func ReadJournalDay added in v0.202.0

func ReadJournalDay(ctx context.Context, connection *Client, day string) (*JournalDayView, error)

ReadJournalDay is one day whole.

type JournalDaysQuery added in v0.202.0

type JournalDaysQuery struct {
	FromDay  string
	UntilDay string
	First    int
	Offset   int
}

JournalDaysQuery is a page of the timeline. A zero First is the server's default.

type JournalDocumentView added in v0.202.0

type JournalDocumentView struct {
	DocumentID string    `json:"documentId"`
	Title      string    `json:"title"`
	SourceName string    `json:"sourceName"`
	HappenedAt time.Time `json:"happenedAt"`

	// IsChosen says the agent chose it as mattering, with LinkReason.
	IsChosen   bool   `json:"isChosen"`
	LinkReason string `json:"linkReason"`
}

JournalDocumentView is an ingested document of the day (work chat, a wiki page, a shared document, sent mail) that involves the person.

type JournalEventView added in v0.202.0

type JournalEventView struct {
	EventID      string    `json:"eventId"`
	Title        string    `json:"title"`
	CalendarName string    `json:"calendarName"`
	StartsAt     time.Time `json:"startsAt"`
	EndsAt       time.Time `json:"endsAt"`
	IsAllDay     bool      `json:"isAllDay"`
	Location     string    `json:"location"`

	// Reference names this occurrence, calendar_occurrence:eventId@start.
	Reference string `json:"reference"`
}

JournalEventView is an occurrence of a calendar event that day.

type JournalFactsView added in v0.202.0

type JournalFactsView struct {
	PhotoCount         int     `json:"photoCount"`
	PlaceCount         int     `json:"placeCount"`
	WalkedMeters       float64 `json:"walkedMeters"`
	StepCount          int     `json:"stepCount"`
	SleepMinutes       int     `json:"sleepMinutes"`
	WorkoutMinutes     int     `json:"workoutMinutes"`
	CodingSessionCount int     `json:"codingSessionCount"`
	CodingMinutes      int     `json:"codingMinutes"`
	MeetingCount       int     `json:"meetingCount"`
	MeetingMinutes     int     `json:"meetingMinutes"`
	RecordingCount     int     `json:"recordingCount"`
	ConversationCount  int     `json:"conversationCount"`
	ChatMessageCount   int     `json:"chatMessageCount"`
	MailReceivedCount  int     `json:"mailReceivedCount"`
	MailSentCount      int     `json:"mailSentCount"`
	DocumentCount      int     `json:"documentCount"`
	TransactionCount   int     `json:"transactionCount"`

	// SpentMinorUnits is money spent in SpentCurrency's minor units (cents).
	SpentMinorUnits   int64  `json:"spentMinorUnits"`
	SpentCurrency     string `json:"spentCurrency"`
	ShoppingTripCount int    `json:"shoppingTripCount"`
	MemoryPageCount   int    `json:"memoryPageCount"`

	// MainPlaceName is where the day was mostly spent, empty for none.
	MainPlaceName string `json:"mainPlaceName"`
}

JournalFactsView is a day's numbers, or a period's sums. A source the caller does not have is zero.

type JournalHealthView added in v0.202.0

type JournalHealthView struct {
	StepCount int `json:"stepCount"`

	// StepsByHour is 24 counts from midnight, empty when the readings are not
	// kept.
	StepsByHour []int `json:"stepsByHour"`

	SleepMinutes int `json:"sleepMinutes"`

	// SleepStages are the night before's stages in order, each with its
	// minutes: deep, core, rem, awake, inBed.
	SleepStages []*JournalSleepStageView `json:"sleepStages"`

	RestingHeartRate float64               `json:"restingHeartRate"`
	Workouts         []*JournalWorkoutView `json:"workouts"`
}

JournalHealthView is a day's Health, from the day summaries the phone sent.

type JournalLinkView added in v0.202.0

type JournalLinkView struct {
	LinkID string             `json:"linkId"`
	Record *JournalRecordView `json:"record"`

	// LinkSource is agent (a choice) or person (a pin).
	LinkSource string `json:"linkSource"`
	LinkReason string `json:"linkReason"`
	IsHidden   bool   `json:"isHidden"`
}

JournalLinkView is a record a day or a period links to.

func PinJournalRecord added in v0.202.0

func PinJournalRecord(ctx context.Context, connection *Client, day, recordKind, recordId, linkReason string) (*JournalLinkView, error)

PinJournalRecord pins one of the caller's records to a day.

type JournalLookingBackSaved added in v0.202.0

type JournalLookingBackSaved struct {
	PeriodKind  string            `json:"periodKind"`
	PeriodStart string            `json:"periodStart"`
	PeriodEnd   string            `json:"periodEnd"`
	LookingBack *JournalWordsView `json:"lookingBack"`
}

JournalLookingBackSaved is what a save of looking back answers.

func SetJournalLookingBack added in v0.202.0

func SetJournalLookingBack(ctx context.Context, connection *Client, periodKind, day, lookingBack string, baseModifiedAt *time.Time) (*JournalLookingBackSaved, error)

SetJournalLookingBack replaces the caller's looking back on the week, month or year that contains a day.

type JournalMailView added in v0.202.0

type JournalMailView struct {
	ItemID     string    `json:"itemId"`
	FromName   string    `json:"fromName"`
	Subject    string    `json:"subject"`
	ReceivedAt time.Time `json:"receivedAt"`
	IsSent     bool      `json:"isSent"`

	// IsImportant: high priority, needs a reply, an alert or a follow-up.
	IsImportant bool `json:"isImportant"`

	// IsChosen says the agent chose it as mattering, with LinkReason.
	IsChosen   bool   `json:"isChosen"`
	LinkReason string `json:"linkReason"`

	// RepeatCount is how many messages of the day it stands for.
	RepeatCount int `json:"repeatCount"`
}

JournalMailView is a message that arrived or was sent that day.

type JournalMemoryPageView added in v0.202.0

type JournalMemoryPageView struct {
	NodeID    string `json:"nodeId"`
	Path      string `json:"path"`
	Title     string `json:"title"`
	FactCount int    `json:"factCount"`
}

JournalMemoryPageView is a memory page with a fact about that day.

type JournalMomentView added in v0.202.0

type JournalMomentView struct {
	At         time.Time `json:"at"`
	RecordKind string    `json:"recordKind"`
	RecordID   string    `json:"recordId"`
	Title      string    `json:"title"`
	Detail     string    `json:"detail"`

	DashboardPath string `json:"dashboardPath"`
}

JournalMomentView is one thing in the day's order.

type JournalMonthSummaryView added in v0.202.0

type JournalMonthSummaryView struct {
	PeriodStart string `json:"periodStart"`
	Headline    string `json:"headline"`

	// DayMoods are the month's days in order, each 0 (no mood) or 1 to 5.
	DayMoods []int `json:"dayMoods"`

	PlaceCount int `json:"placeCount"`
	PhotoCount int `json:"photoCount"`
}

JournalMonthSummaryView is a month as a year shows it.

type JournalMoodSaved added in v0.202.0

type JournalMoodSaved struct {
	Day  string           `json:"day"`
	Mood *JournalMoodView `json:"mood"`
}

JournalMoodSaved is what a save of a mood answers.

func SetJournalMood added in v0.202.0

func SetJournalMood(ctx context.Context, connection *Client, day string, moodLevel *int, moodWords string) (*JournalMoodSaved, error)

SetJournalMood sets a day's mood, 1 (awful) to 5 (great), or clears it.

type JournalMoodView added in v0.202.0

type JournalMoodView struct {
	// MoodLevel is 1 (awful) to 5 (great).
	MoodLevel int    `json:"moodLevel"`
	MoodWords string `json:"moodWords"`

	// MoodSource is person or health (Apple Health's State of Mind).
	MoodSource string `json:"moodSource"`
}

JournalMoodView is a day's mood.

type JournalNarrativeView added in v0.202.0

type JournalNarrativeView struct {
	Headline string `json:"headline"`

	// Narrative is a few paragraphs separated by blank lines, in which a
	// record is written [[kind:id]]; References resolves each.
	Narrative  string               `json:"narrative"`
	References []*JournalRecordView `json:"references"`

	WrittenAt *time.Time `json:"writtenAt"`

	// IsStale says what the narrative was written from has changed since; a
	// dream writes it again.
	IsStale bool `json:"isStale"`

	// NarrativePending says it is being written now, at the person's request.
	NarrativePending bool `json:"narrativePending"`

	// IsBeyondDepth says the day is older than the depth dreams write back
	// to and has no narrative of its own until the person asks for one.
	IsBeyondDepth bool `json:"isBeyondDepth"`

	// Failure says why the last attempt was refused, empty when it was not.
	Failure string `json:"failure"`

	Corrections []*JournalCorrectionView `json:"corrections"`

	// IsCorrectionAlreadyKept says CorrectJournalNarrative added nothing: the
	// narrative already keeps those words. Only that mutation asks for it.
	IsCorrectionAlreadyKept bool `json:"isCorrectionAlreadyKept"`

	// SourceCount is how many records it was written from.
	SourceCount int `json:"sourceCount"`
}

JournalNarrativeView is what the agent wrote about a day or a period.

func CorrectJournalNarrative added in v0.202.0

func CorrectJournalNarrative(ctx context.Context, connection *Client, day, periodKind, correctionText string) (*JournalNarrativeView, error)

CorrectJournalNarrative adds a correction to a narrative.

func DeleteJournalNarrative added in v0.202.0

func DeleteJournalNarrative(ctx context.Context, connection *Client, day, periodKind string) (*JournalNarrativeView, error)

DeleteJournalNarrative deletes a narrative and its headline.

func RemoveJournalCorrection added in v0.202.0

func RemoveJournalCorrection(ctx context.Context, connection *Client, day, periodKind string, correctionIndex int) (*JournalNarrativeView, error)

RemoveJournalCorrection removes the correction at correctionIndex, counted from 0.

func WriteJournalNarrative added in v0.202.0

func WriteJournalNarrative(ctx context.Context, connection *Client, day, periodKind string) (*JournalNarrativeView, error)

WriteJournalNarrative asks for a narrative to be written again now.

type JournalNoteView added in v0.202.0

type JournalNoteView struct {
	DocumentID string `json:"documentId"`
	Title      string `json:"title"`
	Text       string `json:"text"`
}

JournalNoteView is a note from the person's notes folder.

type JournalPeriodView added in v0.202.0

type JournalPeriodView struct {
	PeriodKind  string `json:"periodKind"`
	PeriodStart string `json:"periodStart"`

	// PeriodEnd is its last day, included.
	PeriodEnd string `json:"periodEnd"`

	// IsCurrent says today is in it.
	IsCurrent bool `json:"isCurrent"`

	LookingBack *JournalWordsView     `json:"lookingBack"`
	Narrative   *JournalNarrativeView `json:"narrative"`

	// Choices are the moments the agent chose for the period, each a record.
	Choices []*JournalLinkView `json:"choices"`

	// Days are the period's days in order, today and before only, each
	// summarized; a year leaves them out (use Months).
	Days []*JournalDaySummaryView `json:"days"`

	// Months are a year's months, each with its headline and mood counts.
	Months []*JournalMonthSummaryView `json:"months"`

	Totals *JournalFactsView `json:"totals"`

	// MoodCounts are how many days had each mood, awful first; five numbers.
	MoodCounts []int `json:"moodCounts"`

	// DayCount is how many days in it have anything in them.
	DayCount int `json:"dayCount"`

	Chapters []*JournalChapterView `json:"chapters"`
}

JournalPeriodView is one week, month or year.

func ReadJournalPeriod added in v0.202.0

func ReadJournalPeriod(ctx context.Context, connection *Client, periodKind, day string) (*JournalPeriodView, error)

ReadJournalPeriod is the week, month or year that contains a day.

type JournalPhotoView added in v0.202.0

type JournalPhotoView struct {
	PhotoID   string    `json:"photoId"`
	TakenAt   time.Time `json:"takenAt"`
	PlaceName string    `json:"placeName"`
	IsVideo   bool      `json:"isVideo"`
}

JournalPhotoView is a photo taken that day.

type JournalRecordView added in v0.202.0

type JournalRecordView struct {
	// RecordKind is one of the record kinds of memory's links: mail,
	// calendar_event, calendar_occurrence, photo, place_visit,
	// agent_document, chat_message, conversation_message, recording,
	// recording_passage, finance_transaction, finance_receipt, health_day,
	// shopping_trip, note, reminder, idea, goal, contact.
	RecordKind string `json:"recordKind"`
	RecordID   string `json:"recordId"`

	// Reference is how a narrative writes it: kind:id.
	Reference string `json:"reference"`

	Title      string     `json:"title"`
	HappenedAt *time.Time `json:"happenedAt"`

	// DashboardPath opens it on the dashboard; the iPhone app maps it to its
	// own screen.
	DashboardPath string `json:"dashboardPath"`

	// IsUnavailable says it is gone or no longer the caller's; it then has no
	// title, and a narrative shows its words as plain text.
	IsUnavailable bool `json:"isUnavailable"`
}

JournalRecordView is a record of the person's, found again: a link's or a mention's.

type JournalRecordingView added in v0.202.0

type JournalRecordingView struct {
	RecordingID string     `json:"recordingId"`
	Title       string     `json:"title"`
	RecordedAt  *time.Time `json:"recordedAt"`
	DurationMS  int64      `json:"durationMS"`
	Summary     string     `json:"summary"`
}

JournalRecordingView is a recording made that day.

type JournalReminderView added in v0.202.0

type JournalReminderView struct {
	ReminderID string     `json:"reminderId"`
	Title      string     `json:"title"`
	DueAt      *time.Time `json:"dueAt"`
	DoneAt     *time.Time `json:"doneAt"`
}

JournalReminderView is a reminder due or done that day.

type JournalSearchHitView added in v0.202.0

type JournalSearchHitView struct {
	Day        string `json:"day"`
	PeriodKind string `json:"periodKind"`
	Headline   string `json:"headline"`

	// Snippet is the matching words with some around them.
	Snippet string `json:"snippet"`
}

JournalSearchHitView is a day or a period that matched.

type JournalSearchPageView added in v0.202.0

type JournalSearchPageView struct {
	Hits       []*JournalSearchHitView `json:"hits"`
	TotalCount int                     `json:"totalCount"`
}

JournalSearchPageView is a page of search results.

func SearchJournal added in v0.202.0

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

SearchJournal finds days and periods by what is written in them. A zero First is the server's default.

type JournalSettingsChange added in v0.202.0

type JournalSettingsChange struct {
	IsWeatherOn         *bool
	IsEveningQuestionOn *bool
	EveningQuestionTime *string
}

JournalSettingsChange is what to change about the journal's settings; a nil field is left as it is.

type JournalSettingsView added in v0.202.0

type JournalSettingsView struct {
	IsWeatherOn         bool   `json:"isWeatherOn"`
	IsEveningQuestionOn bool   `json:"isEveningQuestionOn"`
	EveningQuestionTime string `json:"eveningQuestionTime"`

	// WeekStartsOn is monday or sunday, from the person's locale.
	WeekStartsOn string `json:"weekStartsOn"`

	// NarrativeDepthDays is how far back dreams write narratives on their own.
	NarrativeDepthDays int `json:"narrativeDepthDays"`

	// ModelProviderName is the provider the agent's model is run by: what the
	// agent reads of the journal goes there.
	ModelProviderName string `json:"modelProviderName"`
}

JournalSettingsView is what a person decided about their journal.

func ReadJournalSettings added in v0.202.0

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

ReadJournalSettings is what the caller decided about their journal.

func UpdateJournalSettings added in v0.202.0

func UpdateJournalSettings(ctx context.Context, connection *Client, change JournalSettingsChange) (*JournalSettingsView, error)

UpdateJournalSettings changes the caller's journal settings.

type JournalShippedView added in v0.202.0

type JournalShippedView struct {
	DocumentID string    `json:"documentId"`
	Title      string    `json:"title"`
	Address    string    `json:"address"`
	HappenedAt time.Time `json:"happenedAt"`
	IsDraft    bool      `json:"isDraft"`
}

JournalShippedView is a pull request, merge request or commit of the day.

type JournalShoppingTripView added in v0.202.0

type JournalShoppingTripView struct {
	TripID        string     `json:"tripId"`
	StoreName     string     `json:"storeName"`
	ListNames     []string   `json:"listNames"`
	StartedAt     time.Time  `json:"startedAt"`
	FinishedAt    *time.Time `json:"finishedAt"`
	DashboardPath string     `json:"dashboardPath"`
}

JournalShoppingTripView is a trip of the person's to the shops that day.

type JournalSleepStageView added in v0.202.0

type JournalSleepStageView struct {
	SleepStage string `json:"sleepStage"`
	Minutes    int    `json:"minutes"`
}

JournalSleepStageView is one stretch of sleep.

type JournalTouchUpView added in v0.202.0

type JournalTouchUpView struct {
	Day        string            `json:"day"`
	PeriodKind string            `json:"periodKind"`
	Words      *JournalWordsView `json:"words"`
}

JournalTouchUpView is the touching up of a day or a period after a change.

func StopJournalTouchUp added in v0.202.0

func StopJournalTouchUp(ctx context.Context, connection *Client, day, periodKind string) (*JournalTouchUpView, error)

StopJournalTouchUp turns touching up off and deletes the touched-up text.

func TouchUpJournalWords added in v0.202.0

func TouchUpJournalWords(ctx context.Context, connection *Client, day, periodKind string, how *string) (*JournalTouchUpView, error)

TouchUpJournalWords asks for a day's words, or a period's looking back, to be touched up. A nil how keeps the last instruction.

type JournalTransactionView added in v0.202.0

type JournalTransactionView struct {
	TransactionID string     `json:"transactionId"`
	PostedOn      string     `json:"postedOn"`
	TransactedAt  *time.Time `json:"transactedAt"`
	Description   string     `json:"description"`
	AccountName   string     `json:"accountName"`

	// AmountMinorUnits is negative for money spent.
	AmountMinorUnits int64  `json:"amountMinorUnits"`
	Currency         string `json:"currency"`
}

JournalTransactionView is money in or out that day.

type JournalVisitView added in v0.202.0

type JournalVisitView struct {
	VisitID    string     `json:"visitId"`
	PlaceID    string     `json:"placeId"`
	PlaceName  string     `json:"placeName"`
	ArrivedAt  *time.Time `json:"arrivedAt"`
	DepartedAt *time.Time `json:"departedAt"`
	Latitude   float64    `json:"latitude"`
	Longitude  float64    `json:"longitude"`
}

JournalVisitView is a stay at a place that day.

type JournalWeatherView added in v0.202.0

type JournalWeatherView struct {
	// WeatherCode is the WMO weather interpretation code; WeatherKind is the
	// same as one word: clear, partlyCloudy, cloudy, fog, drizzle, rain,
	// snow, showers or thunderstorm.
	WeatherCode     int     `json:"weatherCode"`
	WeatherKind     string  `json:"weatherKind"`
	HighCelsius     float64 `json:"highCelsius"`
	LowCelsius      float64 `json:"lowCelsius"`
	PrecipitationMM float64 `json:"precipitationMM"`
	PlaceName       string  `json:"placeName"`
}

JournalWeatherView is a day's weather where the person spent most of it.

type JournalWordsSaved added in v0.202.0

type JournalWordsSaved struct {
	Day   string            `json:"day"`
	Words *JournalWordsView `json:"words"`
	Mood  *JournalMoodView  `json:"mood"`
}

JournalWordsSaved is what a save of words answers: the day with its words and mood.

func SetJournalWords added in v0.202.0

func SetJournalWords(ctx context.Context, connection *Client, day, words string, baseModifiedAt *time.Time) (*JournalWordsSaved, error)

SetJournalWords replaces a day's words. With baseModifiedAt, the words' modifiedAt the caller read, a day saved by somebody else since is refused.

type JournalWordsView added in v0.202.0

type JournalWordsView struct {
	// Original is what the person wrote.
	Original   string     `json:"original"`
	ModifiedAt *time.Time `json:"modifiedAt"`

	// IsTouchUpOn says the person asked for touching up; TouchedUp is the
	// version made from the original, empty while the first is being made.
	// IsTouchedUpStale says the original changed since TouchedUp was made
	// (a new one is on its way while TouchUpPending).
	IsTouchUpOn      bool   `json:"isTouchUpOn"`
	TouchedUp        string `json:"touchedUp"`
	TouchUpHow       string `json:"touchUpHow"`
	IsTouchedUpStale bool   `json:"isTouchedUpStale"`
	TouchUpPending   bool   `json:"touchUpPending"`

	// JournalNotes are notes from the person's notes folder (the journal
	// source) dated that day, read-only. Empty for a period.
	JournalNotes []*JournalNoteView `json:"journalNotes"`
}

JournalWordsView is the person's text on a day or a period, with its touched-up version.

type JournalWorkProjectView added in v0.202.0

type JournalWorkProjectView struct {
	Name          string                `json:"name"`
	FirstAt       time.Time             `json:"firstAt"`
	LastAt        time.Time             `json:"lastAt"`
	ActiveMinutes int                   `json:"activeMinutes"`
	StretchCount  int                   `json:"stretchCount"`
	Topics        []string              `json:"topics"`
	Shipped       []*JournalShippedView `json:"shipped"`
	Summary       string                `json:"summary"`
	DocumentID    string                `json:"documentId"`
}

JournalWorkProjectView is one project the person worked on that day.

type JournalWorkoutView added in v0.202.0

type JournalWorkoutView struct {
	SampleID     string    `json:"sampleId"`
	ActivityType string    `json:"activityType"`
	StartedAt    time.Time `json:"startedAt"`
	Minutes      int       `json:"minutes"`
	Meters       float64   `json:"meters"`
}

JournalWorkoutView is a workout that day.

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 LinkPreview added in v0.191.0

type LinkPreview struct {
	URL               string  `json:"url"`
	CleanedURL        string  `json:"cleanedUrl"`
	DisplayText       string  `json:"displayText"`
	IsAvailable       bool    `json:"isAvailable"`
	Title             string  `json:"title"`
	Description       string  `json:"description"`
	SiteName          string  `json:"siteName"`
	ImageURL          *string `json:"imageUrl"`
	ImageWidthPixels  *int    `json:"imageWidthPixels"`
	ImageHeightPixels *int    `json:"imageHeightPixels"`
}

LinkPreview is one link's preview. When IsAvailable is false the page could not be read, and only the link, cleaned, and its short text are filled in.

func ReadLinkPreviews added in v0.191.0

func ReadLinkPreviews(ctx context.Context, connection *Client, conversationId string, urls []string) ([]*LinkPreview, error)

ReadLinkPreviews is the preview of each link, in the order given, for links in the words of a conversation: a link gets one only if somebody other than the agent wrote it there.

type ListMailboxItemsOptions added in v0.172.0

type ListMailboxItemsOptions struct {
	FolderID      string
	MailboxID     string
	From          string
	To            string
	Subject       string
	Search        string
	Since         *time.Time
	Before        *time.Time
	HasAttachment *bool
	Unread        *bool
	Flagged       *bool
	First         int
	Offset        int
	After         string
}

ListMailboxItemsOptions narrows a list of messages. A field left at its zero value is not sent, so the server's own defaults apply; a boolean is a pointer because "not asked" and "only the ones without" differ.

type Location added in v0.175.0

type Location struct {
	UserID     string `json:"userId"`
	Username   string `json:"username"`
	Name       string `json:"name"`
	ShareLevel string `json:"shareLevel"`
	// GrantedShareLevel is what their shares give the caller; ShareLevel is
	// what the caller sees of it, less when the caller shares less back.
	GrantedShareLevel string         `json:"grantedShareLevel"`
	LatestPoint       *LocationPoint `json:"latestPoint"`
	OpenVisit         *PlaceVisit    `json:"openVisit"`
	Pause             *LocationPause `json:"pause"`

	// NotificationMute is the caller's mute of this person's arrived and left
	// notices, null when not muted. Always null on the caller's own location.
	NotificationMute *LocationNotificationMute `json:"notificationMute"`
}

Location is where a person is. While Pause is set, anybody but the person themselves is shown no latest point and no open visit.

func GetLocation added in v0.175.0

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

GetLocation is where the caller is now.

func GetLocationOf added in v0.175.0

func GetLocationOf(ctx context.Context, connection *Client, userId string) (*Location, error)

GetLocationOf is where a person is, the caller or somebody who shares their location with them, by account identifier.

func ListSharedLocations added in v0.175.0

func ListSharedLocations(ctx context.Context, connection *Client) ([]*Location, error)

ListSharedLocations are the people whose location is shared with the caller.

type LocationHistoryErased added in v0.175.0

type LocationHistoryErased struct {
	PointCount int `json:"pointCount"`
	VisitCount int `json:"visitCount"`
	PlaceCount int `json:"placeCount"`
}

LocationHistoryErased says what erasing history deleted.

func EraseLocationHistory added in v0.175.0

func EraseLocationHistory(ctx context.Context, connection *Client, from, until *time.Time) (*LocationHistoryErased, error)

EraseLocationHistory erases positions and visits in a range, or all of them when both ends are nil, and the places that leaves with no visit that were not named or labeled.

type LocationNotificationMute added in v0.198.0

type LocationNotificationMute struct {
	MutedUntil *time.Time `json:"mutedUntil"`
}

LocationNotificationMute is the caller's mute of the notices that one person arrived at or left a place. MutedUntil is null for a mute that lasts until the caller unmutes.

func MuteLocationNotifications added in v0.198.0

func MuteLocationNotifications(ctx context.Context, connection *Client, userId string, mutedUntil *time.Time) (*LocationNotificationMute, error)

MuteLocationNotifications stops the caller being told that the person userId arrived at or left a place, from now, until mutedUntil, or until the caller unmutes when it is nil. Muting while muted changes the end of the mute.

type LocationPause added in v0.195.0

type LocationPause struct {
	ID        string     `json:"id"`
	StartedAt time.Time  `json:"startedAt"`
	EndedAt   *time.Time `json:"endedAt"`
}

LocationPause is a time during which a person's location is not recorded. EndedAt is null for a pause that lasts until the person resumes.

func ListLocationPauses added in v0.195.0

func ListLocationPauses(ctx context.Context, connection *Client, userId string, from, until time.Time) ([]*LocationPause, error)

ListLocationPauses is the pauses that overlap the range, newest first, of the caller or, with a userId, of somebody who shares their history with them.

func PauseLocation added in v0.195.0

func PauseLocation(ctx context.Context, connection *Client, endedAt *time.Time) (*LocationPause, error)

PauseLocation stops the caller's location being recorded from now, until endedAt, or until they resume when it is nil. Pausing while paused changes the end of the pause in effect.

type LocationPoint added in v0.175.0

type LocationPoint struct {
	LatitudeDegrees      float64   `json:"latitudeDegrees"`
	LongitudeDegrees     float64   `json:"longitudeDegrees"`
	AccuracyMeters       float64   `json:"accuracyMeters"`
	AltitudeMeters       *float64  `json:"altitudeMeters"`
	SpeedMetersPerSecond *float64  `json:"speedMetersPerSecond"`
	CourseDegrees        *float64  `json:"courseDegrees"`
	MeasuredAt           time.Time `json:"measuredAt"`
	LocationSource       string    `json:"locationSource"`
}

LocationPoint is one position a phone or browser reported.

func ListLocationPoints added in v0.175.0

func ListLocationPoints(ctx context.Context, connection *Client, userId string, from, until time.Time) ([]*LocationPoint, error)

ListLocationPoints is the positions of up to two days, oldest first, of the caller or, with a userId, of somebody who shares their history with them.

type LocationShare added in v0.175.0

type LocationShare struct {
	ID                string    `json:"id"`
	GranteeUserID     *string   `json:"granteeUserId"`
	GranteeUsername   string    `json:"granteeUsername"`
	GranteeName       string    `json:"granteeName"`
	GranteeCircleID   *string   `json:"granteeCircleId"`
	GranteeCircleName string    `json:"granteeCircleName"`
	ShareLevel        string    `json:"shareLevel"`
	CreatedAt         time.Time `json:"createdAt"`
}

LocationShare is one share of the caller's location.

func ListLocationShares added in v0.175.0

func ListLocationShares(ctx context.Context, connection *Client) ([]*LocationShare, error)

ListLocationShares are who the caller's location is shared with.

func ShareLocation added in v0.175.0

func ShareLocation(ctx context.Context, connection *Client, granteeUserId, granteeCircleId, shareLevel string) (*LocationShare, error)

ShareLocation shares the caller's location with a person or a circle, given by identifier (one of the two), or changes the level of a share already made.

type LocationSharingLimit added in v0.226.0

type LocationSharingLimit struct {
	ShareLevelLimit    string     `json:"shareLevelLimit"`
	SharingLimitReason string     `json:"sharingLimitReason"`
	PhonePermission    *string    `json:"phonePermission"`
	IsRecordingOn      *bool      `json:"isRecordingOn"`
	ReportedAt         *time.Time `json:"reportedAt"`
}

LocationSharingLimit is the most of anybody's location the caller sees because of their own phone and pause, and why.

func ReadLocationSharingLimit added in v0.226.0

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

ReadLocationSharingLimit is the caller's own limit.

type LocationVisitsQuery added in v0.175.0

type LocationVisitsQuery struct {
	UserID      string
	From, Until *time.Time
	PlaceID     string
	PlaceLabel  string
	Offset      int
	LimitCount  int
}

LocationVisitsQuery narrows and pages a listing of visits. A zero field is left out.

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 MailAttendee added in v0.172.0

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

MailAttendee is one person an invitation asks, and what they have said.

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 MailInvitation added in v0.172.0

type MailInvitation struct {
	ID            string          `json:"id"`
	Status        string          `json:"status"`
	Method        string          `json:"method"`
	Because       string          `json:"because,omitempty"`
	Summary       string          `json:"summary,omitempty"`
	Location      string          `json:"location,omitempty"`
	StartsAt      string          `json:"startsAt,omitempty"`
	EndsAt        string          `json:"endsAt,omitempty"`
	IsAllDay      bool            `json:"allDay"`
	IsCancelled   bool            `json:"cancelled"`
	Organizer     string          `json:"organizer,omitempty"`
	Participation string          `json:"participation,omitempty"`
	Attendees     []*MailAttendee `json:"attendees"`
	CalendarID    string          `json:"calendarId,omitempty"`
	EventID       string          `json:"eventId,omitempty"`
}

MailInvitation is the calendar invitation a message carried, as the reader shows it above the message.

func AnswerMailInvitation added in v0.172.0

func AnswerMailInvitation(ctx context.Context, connection *Client, requestId, itemId, answer string) (*MailInvitation, error)

AnswerMailInvitation says whether the person is coming: ACCEPTED, DECLINED or TENTATIVE. The person's own copy is marked and the answer is mailed to whoever asked. A retry reuses requestId, which is how the server knows it is the same answer and does not mail the organizer twice.

func GetMailInvitation added in v0.172.0

func GetMailInvitation(ctx context.Context, connection *Client, itemId string) (*MailInvitation, error)

GetMailInvitation is the invitation a message carried, or nil for a message that carried none.

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"`
	MailID   string       `json:"mailId,omitempty"`
	Seen     bool         `json:"seen"`
	Flagged  bool         `json:"flagged"`
	Answered bool         `json:"answered,omitempty"`
	Draft    bool         `json:"draft,omitempty"`
	Mail     *MailboxMail `json:"mail"`
}

MailboxItem is one message in one folder.

func GetMailboxItem added in v0.172.0

func GetMailboxItem(ctx context.Context, connection *Client, itemId string) (*MailboxItem, error)

GetMailboxItem is one message of a mailbox, by the identifier of its place in a folder.

func MoveMailboxItems added in v0.172.0

func MoveMailboxItems(ctx context.Context, connection *Client, itemIds []string, folderId string) ([]*MailboxItem, error)

MoveMailboxItems files messages in another folder. A moved message is a new item there with a new identifier, which the answer carries.

func SaveMailboxDraft added in v0.172.0

func SaveMailboxDraft(ctx context.Context, connection *Client, mailboxId string, message *MailboxMessageParameters) (*MailboxItem, error)

SaveMailboxDraft stores a message being written in Drafts, replacing the save of the draft it continues.

type MailboxItemPage added in v0.172.0

type MailboxItemPage struct {
	Items []*MailboxItem `json:"items"`
	Total int64          `json:"total"`
}

MailboxItemPage is one page of the messages in a folder, with how many the folder holds.

func ListMailboxItems added in v0.172.0

func ListMailboxItems(ctx context.Context, connection *Client, options ListMailboxItemsOptions) (*MailboxItemPage, error)

ListMailboxItems is a page of messages, in one folder or, given a mailbox and no folder, in all of it.

type MailboxMail

type MailboxMail struct {
	ID         string     `json:"id"`
	From       string     `json:"from"`
	FromName   string     `json:"fromName"`
	Recipients []string   `json:"recipients,omitempty"`
	Subject    string     `json:"subject"`
	ReceivedAt *time.Time `json:"receivedAt"`
}

MailboxMail is the little of a message a list needs.

type MailboxMessageParameters added in v0.172.0

type MailboxMessageParameters struct {
	From          string   `json:"from"`
	FromName      string   `json:"fromName,omitempty"`
	To            []string `json:"to,omitempty"`
	Cc            []string `json:"cc,omitempty"`
	Bcc           []string `json:"bcc,omitempty"`
	Subject       string   `json:"subject,omitempty"`
	HTMLContent   string   `json:"htmlContent,omitempty"`
	TextContent   string   `json:"textContent,omitempty"`
	ReplyToItemID string   `json:"replyToItemId,omitempty"`
	ForwardItemID string   `json:"forwardItemId,omitempty"`
	DraftItemID   string   `json:"draftItemId,omitempty"`
}

MailboxMessageParameters is what the composer holds: a new message, a reply, a forward, or a draft being written.

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"`

	// Listed is how many messages the call read from the folder.
	Listed int `json:"listed"`

	// Remaining is how many of the messages looked at are still in the
	// folder; the next batch of a larger folder skips that many more.
	Remaining int `json:"remaining"`
}

MailboxRuleApplication is what applying the rules to stored mail did.

func ApplyMailboxRules

func ApplyMailboxRules(ctx context.Context, connection *Client, mailboxId, folderId string, first, offset int) (*MailboxRuleApplication, error)

ApplyMailboxRules runs the stored rules over the mail already in a folder.

func ApplyMailboxRulesToFolder added in v0.242.0

func ApplyMailboxRulesToFolder(ctx context.Context, connection *Client, mailboxId, folderId string) (*MailboxRuleApplication, error)

ApplyMailboxRulesToFolder runs the stored rules over every message of a folder, one batch after another. A batch is the most one call looks at, which is the server's choice of how much to do in one request; the folder as a whole has no bound.

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 MailboxSentMessage added in v0.172.0

type MailboxSentMessage struct {
	Mail *MailboxMail `json:"mail"`
	Item *MailboxItem `json:"item"`
}

MailboxSentMessage is what a send answers: the message as stored and the copy of it filed in Sent.

func SendMailboxMessage added in v0.172.0

func SendMailboxMessage(ctx context.Context, connection *Client, mailboxId, submissionId string, message *MailboxMessageParameters) (*MailboxSentMessage, error)

SendMailboxMessage sends a message from a mailbox as one of its addresses. A retry reuses submissionId and the message unchanged, so that a send whose answer was lost is not sent twice.

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 GetMailboxThread added in v0.172.0

func GetMailboxThread(ctx context.Context, connection *Client, itemId string) (*MailboxThreadView, error)

GetMailboxThread is the whole conversation a message belongs to, across every folder of its mailbox, 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 NamedPhotoFaceGroup added in v0.176.0

type NamedPhotoFaceGroup struct {
	// PhotoFaceGroup is the group that is named. When the contact named
	// another of the person's groups already, that is the group, with the
	// faces of both.
	PhotoFaceGroup *models.PhotoFaceGroup `json:"photoFaceGroup"`

	// MergedPhotoFaceGroupID is the group that was put into PhotoFaceGroup
	// and is gone; empty when nothing was merged.
	MergedPhotoFaceGroupID string `json:"mergedPhotoFaceGroupId"`

	// IsContactPictureSet says the contact had no picture and was given one
	// cut from a face of the group.
	IsContactPictureSet bool `json:"isContactPictureSet"`
}

NamedPhotoFaceGroup is what naming a group answered: the group as it is now, and what else the naming did.

func NamePhotoFaceGroup added in v0.171.0

func NamePhotoFaceGroup(ctx context.Context, executor Executor, photoFaceGroupId, contactId string) (*NamedPhotoFaceGroup, error)

NamePhotoFaceGroup names a group by a contact from the person's address books. A contact names one person, so a contact that names another of the person's groups merges the two.

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 NewAgentFollowUp added in v0.169.0

type NewAgentFollowUp struct {
	FollowUpKind   string
	FollowUpTitle  string
	DueOn          string
	Payee          string
	Amount         string
	CurrencyCode   string
	Carrier        string
	TrackingNumber string
	Place          string
}

NewAgentFollowUp is a follow-up the person names.

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 PasswordItemListView added in v0.193.0

type PasswordItemListView struct {
	Items   []*PasswordItemView `json:"items"`
	ItemIDs []string            `json:"itemIds"`
	// Revision is the highest revision visible.
	Revision int64 `json:"revision"`
}

PasswordItemListView is the items that changed since a revision, and the id of every item the person can reach now.

func ListPasswordItems added in v0.193.0

func ListPasswordItems(ctx context.Context, connection *Client, sinceRevision *int64) (*PasswordItemListView, error)

ListPasswordItems are the items the caller owns (deleted ones included, with a deletion time) and the ones shared with them, whose revision is above sinceRevision. A nil sinceRevision is every item.

type PasswordItemRekeyInput added in v0.193.0

type PasswordItemRekeyInput struct {
	ID                string                       `json:"id"`
	BaseRevision      int64                        `json:"baseRevision"`
	EncryptedFields   string                       `json:"encryptedFields"`
	ItemKey           string                       `json:"itemKey"`
	ShareKeys         []*PasswordItemShareKeyInput `json:"shareKeys"`
	ItemKeyByAgentKey *string                      `json:"itemKeyByAgentKey"`
}

PasswordItemRekeyInput gives an item a new item key when access to it narrows: the same fields sealed under the new key, the new key sealed for the account key, for each recipient who keeps access (the keys AddPasswordShareKeys takes, each naming the item) and, if the agent still uses the item, for the agent key. ItemKeyByAgentKey nil ends the agent's use of the item, and must be nil for an item the agent does not use. BaseRevision is the revision the device read; a newer one is refused as changed on another device.

type PasswordItemShareKeyInput added in v0.193.0

type PasswordItemShareKeyInput struct {
	ItemID                string `json:"itemId"`
	RecipientUserID       string `json:"recipientUserId"`
	ItemKeyByRecipientKey string `json:"itemKeyByRecipientKey"`
	RecipientPublicKey    string `json:"recipientPublicKey"`
	ItemKey               string `json:"itemKey,omitempty"`
}

PasswordItemShareKeyInput is a PasswordShareKeyInput that names its item, for AddPasswordShareKeys and for the share keys of a re-key. ItemKey is the item key the device opened to seal the key, as the item view shows it (the account-sealed text): AddPasswordShareKeys requires it and refuses the key when the item has another now. A re-key leaves it out, because its keys are sealed from the new key in the same call.

func (*PasswordItemShareKeyInput) ForShare added in v0.193.0

ForShare is the same key as SetPasswordItemShares takes it, without the item (and with the item key it was sealed from, which it also requires).

type PasswordItemVersionView added in v0.193.0

type PasswordItemVersionView struct {
	VersionID       string    `json:"versionId"`
	SavedAt         time.Time `json:"savedAt"`
	IsSavedByPerson bool      `json:"isSavedByPerson"`
	EncryptedFields string    `json:"encryptedFields"`
	ItemKey         string    `json:"itemKey"`
	ItemKind        string    `json:"itemKind"`
}

PasswordItemVersionView is one earlier version of an item the caller owns, as the server kept it. VersionID names it for RestorePasswordItemVersion. SavedAt is when a later save replaced it. EncryptedFields and ItemKey are the sealed text the item had then (the fields sealed by the item key, and the item key sealed by the account key); IsSavedByPerson says the person's own tap saved that content and not a program holding a token.

func ListPasswordItemVersions added in v0.193.0

func ListPasswordItemVersions(ctx context.Context, connection *Client, itemID string) ([]*PasswordItemVersionView, error)

ListPasswordItemVersions are the earlier versions the server kept of an item the caller owns, newest first. Only the person's own tap may ask (see IsTapRequired), since it hands out sealed content.

type PasswordItemView added in v0.193.0

type PasswordItemView struct {
	ID                string               `json:"id"`
	OwnerUserID       string               `json:"ownerUserId"`
	OwnerName         string               `json:"ownerName"`
	OwnerPublicKey    string               `json:"ownerPublicKey"`
	ItemKind          string               `json:"itemKind"`
	EncryptedFields   string               `json:"encryptedFields"`
	ItemKey           string               `json:"itemKey"`
	IsSharedWithMe    bool                 `json:"isSharedWithMe"`
	Revision          int64                `json:"revision"`
	IsUsableByAgent   bool                 `json:"isUsableByAgent"`
	LastUsedByAgentAt *time.Time           `json:"lastUsedByAgentAt"`
	NeedsNewKey       bool                 `json:"needsNewKey"`
	DeletedAt         *time.Time           `json:"deletedAt"`
	CreatedAt         time.Time            `json:"createdAt"`
	UpdatedAt         time.Time            `json:"updatedAt"`
	Shares            []*PasswordShareView `json:"shares"`
}

PasswordItemView is one item as the server keeps it. ItemKey is the item key sealed for the reader: by their account key for the owner, by their key pair for a person it is shared with, who opens it with OwnerPublicKey (the owner's current public key, base64 of 65 bytes) once their device knows that key. NeedsNewKey is set on the owner's item when access to it narrowed, so that a copy of the old key may be held: the owner's device re-keys it (RekeyPasswordItem), which clears it. It is always false for a reader.

func DeletePasswordItem added in v0.193.0

func DeletePasswordItem(ctx context.Context, connection *Client, itemID string) (*PasswordItemView, error)

DeletePasswordItem moves an item to Recently deleted, where it stays 30 days.

func RekeyPasswordItem added in v0.193.0

func RekeyPasswordItem(ctx context.Context, connection *Client, input PasswordItemRekeyInput) (*PasswordItemView, error)

RekeyPasswordItem replaces an item's fields and item key with ones sealed under a new item key, and every key stored for a recipient with the given ones. It never widens access, so it needs no tap.

func RestorePasswordItem added in v0.193.0

func RestorePasswordItem(ctx context.Context, connection *Client, itemID string) (*PasswordItemView, error)

RestorePasswordItem brings a deleted item back. Its old shares reach their recipients again, so the server accepts it only as a person's own tap.

func RestorePasswordItemVersion added in v0.193.0

func RestorePasswordItemVersion(ctx context.Context, connection *Client, itemID, versionID string, baseRevision int64) (*PasswordItemView, error)

RestorePasswordItemVersion makes one earlier version of an item (versionID from ListPasswordItemVersions) the item's own. The server keeps the content it replaces as a version, drops the keys it gave other people and the agent, marks the item as needing a new key and gives it the next revision, and the device then gives it a new key. baseRevision is the revision the device read: another is refused as changed on another device. Only the person's own tap may do it (see IsTapRequired).

func SavePasswordItem added in v0.193.0

func SavePasswordItem(ctx context.Context, connection *Client, input *SavePasswordItemInput) (*PasswordItemView, error)

SavePasswordItem makes an item, or changes one the caller owns. A change based on a revision that is no longer the current one is refused.

func SetPasswordItemShares added in v0.193.0

func SetPasswordItemShares(ctx context.Context, connection *Client, input *SetPasswordItemSharesInput) (*PasswordItemView, error)

SetPasswordItemShares replaces who an item is shared with, with the item key sealed for the people they reach. Needs the person's tap when it adds a grantee.

func SetPasswordItemUsableByAgent added in v0.193.0

func SetPasswordItemUsableByAgent(ctx context.Context, connection *Client, input *SetPasswordItemUsableByAgentInput) (*PasswordItemView, error)

SetPasswordItemUsableByAgent lets the agent use an item, or stops it. Needs the person's tap, and a card cannot be used by the agent.

type PasswordRecipientView added in v0.193.0

type PasswordRecipientView struct {
	UserID           string `json:"userId"`
	Name             string `json:"name"`
	Username         string `json:"username"`
	PublicKey        string `json:"publicKey"`
	HasKey           bool   `json:"hasKey"`
	HasTooMuchShared bool   `json:"hasTooMuchShared"`
}

PasswordRecipientView is a person an item can be sealed for. PublicKey is empty when they have not set Passwords up; HasKey says a key sealed for the item and their current public key is already stored. HasTooMuchShared says the person already has the most the server lets others share with them (64 MiB of sealed text and 20,000 items in all, 8 MiB and 5,000 items from one owner), so no key is stored for them for this item.

func ListPasswordRecipients added in v0.193.0

func ListPasswordRecipients(ctx context.Context, connection *Client, granteeUserId, granteeCircleId string) ([]*PasswordRecipientView, error)

ListPasswordRecipients are the people a person or a circle reaches, with the public keys an item key can be sealed for.

type PasswordShareGranteeInput added in v0.193.0

type PasswordShareGranteeInput struct {
	GranteeUserID   *string `json:"granteeUserId,omitempty"`
	GranteeCircleID *string `json:"granteeCircleId,omitempty"`
}

PasswordShareGranteeInput names who an item is shared with: a person or a circle.

type PasswordShareKeyInput added in v0.193.0

type PasswordShareKeyInput struct {
	RecipientUserID       string `json:"recipientUserId"`
	ItemKeyByRecipientKey string `json:"itemKeyByRecipientKey"`
	RecipientPublicKey    string `json:"recipientPublicKey"`
	ItemKey               string `json:"itemKey,omitempty"`
}

PasswordShareKeyInput is an item key sealed for one recipient's public key, in SetPasswordItemShares. RecipientPublicKey is the key it was sealed for, which the server checks is still theirs. ItemKey is the item key the device opened to seal the key, as the item view shows it (the account-sealed text): required whenever keys are given, and a key whose ItemKey is no longer the item's is refused as changed on another device, as in AddPasswordShareKeys.

type PasswordShareView added in v0.193.0

type PasswordShareView struct {
	ID              string                   `json:"id"`
	GranteeUserID   *string                  `json:"granteeUserId"`
	GranteeCircleID *string                  `json:"granteeCircleId"`
	GranteeName     string                   `json:"granteeName"`
	Recipients      []*PasswordRecipientView `json:"recipients"`
}

PasswordShareView is one person or circle an item is shared with, and everyone that share reaches.

type PasswordWaitingShareView added in v0.193.0

type PasswordWaitingShareView struct {
	ItemID         string                 `json:"itemId"`
	Recipient      *PasswordRecipientView `json:"recipient"`
	HasMoreWaiting bool                   `json:"hasMoreWaiting"`
}

PasswordWaitingShareView is a recipient of one of the caller's items who has set Passwords up but has no key for the item yet, and who can be given one: a person who has too much shared with them is left out. The server lists at most 2000, the newest items first, and sets HasMoreWaiting on every entry when more wait.

func ListWaitingPasswordShares added in v0.193.0

func ListWaitingPasswordShares(ctx context.Context, connection *Client) ([]*PasswordWaitingShareView, error)

ListWaitingPasswordShares are the recipients of the caller's items who have set Passwords up but have no key for the item yet.

type PasswordsSetupView added in v0.193.0

type PasswordsSetupView struct {
	IsSetUp                  bool   `json:"isSetUp"`
	PassphraseSalt           string `json:"passphraseSalt"`
	PassphraseIterationCount int    `json:"passphraseIterationCount"`
	PublicKey                string `json:"publicKey"`
	LockAfterMinutes         int    `json:"lockAfterMinutes"`
	ItemCount                int    `json:"itemCount"`
}

PasswordsSetupView is whether a person has set Passwords up, and what a device needs to ask for the keys: the salt and iteration count the passphrase key is made with.

func ChangePasswordsPassphrase added in v0.193.0

func ChangePasswordsPassphrase(ctx context.Context, connection *Client, input *ChangePasswordsPassphraseInput) (*PasswordsSetupView, error)

ChangePasswordsPassphrase seals the account key again under a new passphrase. Needs the person's tap.

func ReadPasswordsSetup added in v0.193.0

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

ReadPasswordsSetup is whether the caller has set Passwords up, with the salt and iteration count their passphrase key is made with.

func ReplacePasswordsRecoveryKey added in v0.193.0

func ReplacePasswordsRecoveryKey(ctx context.Context, connection *Client, input *ReplacePasswordsRecoveryKeyInput) (*PasswordsSetupView, error)

ReplacePasswordsRecoveryKey seals the account key under a new recovery key. Needs the person's tap.

func SetUpPasswords added in v0.193.0

func SetUpPasswords(ctx context.Context, connection *Client, input *SetUpPasswordsInput) (*PasswordsSetupView, error)

SetUpPasswords sets Passwords up for the caller. Only the person's tap on the dashboard or in the iPhone app may do it (see IsTapRequired).

func UpdatePasswordsSettings added in v0.193.0

func UpdatePasswordsSettings(ctx context.Context, connection *Client, lockAfterMinutes int) (*PasswordsSetupView, error)

UpdatePasswordsSettings sets how long a device stays unlocked, from a minute to a week.

type PasswordsUnlockView added in v0.193.0

type PasswordsUnlockView struct {
	AccountKeyWrapped      string `json:"accountKeyWrapped"`
	PrivateKeyByAccountKey string `json:"privateKeyByAccountKey"`
	PublicKey              string `json:"publicKey"`
}

PasswordsUnlockView is what the server hands back for a correct proof: the account key sealed by the secret the proof came from, and the private key sealed by the account key.

func UnlockPasswords added in v0.193.0

func UnlockPasswords(ctx context.Context, connection *Client, proof string, isRecoveryKey bool) (*PasswordsUnlockView, error)

UnlockPasswords sends the proof of the passphrase (or, with isRecoveryKey, of the recovery key) and gets the sealed keys back. The server limits how often a wrong proof may be tried.

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 PersonCard added in v0.188.0

type PersonCard struct {
	// Person is the account, null for a contact that is not linked to one.
	Person *CircleMember `json:"person"`

	// Contact is the signed-in account's own contact for them, null when
	// there is none.
	Contact *Contact `json:"contact"`

	SharedCircles []*PersonCardCircle `json:"sharedCircles"`
	CanMessage    bool                `json:"canMessage"`

	Location   *PersonCardLocation  `json:"location"`
	Health     *PersonCardHealth    `json:"health"`
	Finance    *PersonCardFinance   `json:"finance"`
	Photos     *PersonCardPhotos    `json:"photos"`
	Mail       *PersonCardMail      `json:"mail"`
	Recordings *PersonCardRecording `json:"recordings"`
	Memory     *PersonCardMemory    `json:"memory"`
}

PersonCard is one person's card.

func ReadPersonCard added in v0.188.0

func ReadPersonCard(ctx context.Context, connection Executor, userId, addressBookId, contactId string, itemLimit int) (*PersonCard, error)

ReadPersonCard reads the card of an account the signed-in account shares a circle with, or of one of its own contacts when addressBookId and contactId are given in place of userId. itemLimit is how many items each section keeps; zero is the server's default.

type PersonCardCircle added in v0.188.0

type PersonCardCircle struct {
	CircleID   string `json:"circleId"`
	CircleName string `json:"circleName"`
	CircleKind string `json:"circleKind"`
}

PersonCardCircle is a circle the two share.

type PersonCardFinance added in v0.194.0

type PersonCardFinance struct {
	SectionState PersonCardSectionState `json:"sectionState"`

	// AllFinanceShareLevel is spending or transactions when they share all
	// their finance with you, and empty when they do not.
	AllFinanceShareLevel string `json:"allFinanceShareLevel,omitempty"`

	FinanceAccounts []*SharedFinanceAccount `json:"financeAccounts"`
	HasMore         bool                    `json:"hasMore"`
}

PersonCardFinance is the finance accounts they share, each as the level it was shared at shows it, and the level at which they share all their finance, when they do. Never read by the agent.

type PersonCardHealth added in v0.188.0

type PersonCardHealth struct {
	SectionState PersonCardSectionState `json:"sectionState"`
	HealthTypes  []*HealthTypeView      `json:"healthTypes"`
	HasMore      bool                   `json:"hasMore"`
}

PersonCardHealth is the health they share, one day of each kind.

type PersonCardLocation added in v0.188.0

type PersonCardLocation struct {
	SectionState       PersonCardSectionState `json:"sectionState"`
	Location           *Location              `json:"location"`
	TodayVisits        []*PlaceVisit          `json:"todayVisits"`
	HasMoreTodayVisits bool                   `json:"hasMoreTodayVisits"`
}

PersonCardLocation is where they are and their visits today.

type PersonCardMail added in v0.188.0

type PersonCardMail struct {
	SectionState PersonCardSectionState `json:"sectionState"`
	Mails        []*PersonCardMailItem  `json:"mails"`
	HasMore      bool                   `json:"hasMore"`
}

PersonCardMail is recent mail from or to the addresses on their contact.

type PersonCardMailItem added in v0.188.0

type PersonCardMailItem struct {
	MailboxItemID string    `json:"mailboxItemId"`
	MailboxID     string    `json:"mailboxId"`
	FolderPath    string    `json:"folderPath"`
	Subject       string    `json:"subject"`
	FromAddress   string    `json:"fromAddress"`
	FromName      string    `json:"fromName"`
	IsFromPerson  bool      `json:"isFromPerson"`
	IsUnread      bool      `json:"isUnread"`
	ReceivedAt    time.Time `json:"receivedAt"`
	Snippet       string    `json:"snippet"`
}

PersonCardMailItem is one mail with the person.

type PersonCardMemory added in v0.188.0

type PersonCardMemory struct {
	SectionState PersonCardSectionState  `json:"sectionState"`
	Pages        []*PersonCardMemoryPage `json:"pages"`
	HasMore      bool                    `json:"hasMore"`
}

PersonCardMemory is the memory pages about them.

type PersonCardMemoryPage added in v0.188.0

type PersonCardMemoryPage struct {
	NodePath  string    `json:"nodePath"`
	NodeName  string    `json:"nodeName"`
	NodeKind  string    `json:"nodeKind"`
	Summary   string    `json:"summary"`
	UpdatedAt time.Time `json:"updatedAt"`

	// IsMatchedByName says the page is not tied to the contact: it is the
	// person page with the contact's name.
	IsMatchedByName bool `json:"isMatchedByName"`
}

PersonCardMemoryPage is one memory page about them.

type PersonCardPhotos added in v0.188.0

type PersonCardPhotos struct {
	PhotosState   PersonCardSectionState `json:"photosState"`
	Photos        []*models.Photo        `json:"photos"`
	HasMorePhotos bool                   `json:"hasMorePhotos"`
	AlbumsState   PersonCardSectionState `json:"albumsState"`
	Albums        []*models.PhotoAlbum   `json:"albums"`
	HasMoreAlbums bool                   `json:"hasMoreAlbums"`
}

PersonCardPhotos is photos of them in the library, and the albums they shared.

type PersonCardRecording added in v0.188.0

type PersonCardRecording struct {
	SectionState PersonCardSectionState     `json:"sectionState"`
	Recordings   []*PersonCardRecordingItem `json:"recordings"`
	HasMore      bool                       `json:"hasMore"`
}

PersonCardRecording is the recordings they speak in.

type PersonCardRecordingItem added in v0.188.0

type PersonCardRecordingItem struct {
	RecordingID        string     `json:"recordingId"`
	Title              string     `json:"title"`
	RecordedAt         *time.Time `json:"recordedAt"`
	DurationMS         int64      `json:"durationMS"`
	SpokenPassageCount int        `json:"spokenPassageCount"`
}

PersonCardRecordingItem is one recording they speak in.

type PersonCardSectionState added in v0.188.0

type PersonCardSectionState string

PersonCardSectionState says whether a section has something to show: shown, notShared, needsContact, unavailable or failed.

const (
	PersonCardSectionStateShown        PersonCardSectionState = "shown"
	PersonCardSectionStateNotShared    PersonCardSectionState = "notShared"
	PersonCardSectionStateNeedsContact PersonCardSectionState = "needsContact"
	PersonCardSectionStateUnavailable  PersonCardSectionState = "unavailable"
	PersonCardSectionStateFailed       PersonCardSectionState = "failed"
)

type PhotoAlbumShare added in v0.171.0

type PhotoAlbumShare struct {
	ID           string `json:"id"`
	PhotoAlbumID string `json:"photoAlbumId"`

	GranteeUserID           *string `json:"granteeUserId"`
	GranteeUsername         string  `json:"granteeUsername"`
	GranteeName             string  `json:"granteeName"`
	GranteeAvatarURL        *string `json:"granteeAvatarUrl"`
	GranteeAvatarColorIndex int     `json:"granteeAvatarColorIndex"`
	GranteeCircleID         *string `json:"granteeCircleId"`
	GranteeCircleName       string  `json:"granteeCircleName"`

	// ShareLevel is view or contribute.
	ShareLevel          string    `json:"shareLevel"`
	IsLocationIncluded  bool      `json:"isLocationIncluded"`
	IsFaceNamesIncluded bool      `json:"isFaceNamesIncluded"`
	CreatedAt           time.Time `json:"createdAt"`
}

PhotoAlbumShare gives one person or one circle a level of access to one album. Exactly one of GranteeUserID and GranteeCircleID is set.

func ListPhotoAlbumShares added in v0.171.0

func ListPhotoAlbumShares(ctx context.Context, executor Executor, photoAlbumId string) ([]*PhotoAlbumShare, error)

ListPhotoAlbumShares are who an album is shared with, for its manager.

func SharePhotoAlbum added in v0.171.0

func SharePhotoAlbum(ctx context.Context, executor Executor, photoAlbumId, granteeUserId, granteeCircleId, shareLevel string, isLocationIncluded, isFaceNamesIncluded bool) (*PhotoAlbumShare, error)

SharePhotoAlbum gives a person or a circle (exactly one of the two identifiers) a level of access to an album, or changes the level they have.

func UpdatePhotoAlbumShare added in v0.171.0

func UpdatePhotoAlbumShare(ctx context.Context, executor Executor, photoAlbumShareId, shareLevel string, isLocationIncluded, isFaceNamesIncluded bool) (*PhotoAlbumShare, error)

UpdatePhotoAlbumShare changes the level of one share and whether it includes where photos were taken and the names of the faces in them.

type PhotoFilter added in v0.171.0

type PhotoFilter struct {
	// BeforePhotoID continues after the last photo of the previous page, and
	// Offset skips that many photos instead. Not both.
	BeforePhotoID string
	Offset        int
	PageSize      int

	// IsFavorite keeps favorites when true and the rest when false.
	IsFavorite *bool

	// IsTrashed lists the trash instead of the library.
	IsTrashed bool

	PhotoKind models.PhotoKind

	// TakenAfter and TakenBefore bound the date a photo is placed at.
	TakenAfter  *time.Time
	TakenBefore *time.Time

	SearchText string

	// NearLatitude, NearLongitude and NearDistanceKilometers keep photos
	// taken within that distance of a point. All three or none.
	NearLatitude           *float64
	NearLongitude          *float64
	NearDistanceKilometers *float64

	// AlbumID keeps the photos of one album.
	AlbumID string

	// FaceGroupID keeps the photos with a face in one group of faces, and
	// ContactID the photos with a face in any group that contact names.
	FaceGroupID string
	ContactID   string

	// AccountUserID keeps the photos of the contact the signed-in account
	// linked to that account in their circles. Nothing when there is none.
	AccountUserID string
}

PhotoFilter narrows a listing of the library. Every field is optional.

type PhotoLibrary added in v0.171.0

type PhotoLibrary struct {
	PhotoCount                        int64  `json:"photoCount"`
	VideoCount                        int64  `json:"videoCount"`
	FavoriteCount                     int64  `json:"favoriteCount"`
	TrashedCount                      int64  `json:"trashedCount"`
	UsedBytes                         int64  `json:"usedBytes"`
	MaximumFileBytes                  int64  `json:"maximumFileBytes"`
	MaximumAccountBytes               int64  `json:"maximumAccountBytes"`
	TrashRetentionDays                int    `json:"trashRetentionDays"`
	UploadPath                        string `json:"uploadPath"`
	UploadPartBytes                   int64  `json:"uploadPartBytes"`
	IsFaceRecognitionAvailable        bool   `json:"isFaceRecognitionAvailable"`
	FaceRecognitionUnavailableMessage string `json:"faceRecognitionUnavailableMessage"`
	IsPhotoFaceRecognitionEnabled     bool   `json:"isPhotoFaceRecognitionEnabled"`
	IsDescriptionAvailable            bool   `json:"isDescriptionAvailable"`
	DescriptionUnavailableMessage     string `json:"descriptionUnavailableMessage"`
	IsPhotoReadingEnabled             bool   `json:"isPhotoReadingEnabled"`
}

PhotoLibrary is how much a library holds, how much it may, and where files go up.

func ReadPhotoLibrary added in v0.171.0

func ReadPhotoLibrary(ctx context.Context, executor Executor) (*PhotoLibrary, error)

ReadPhotoLibrary is what the library holds and may hold.

func (*PhotoLibrary) SpaceUsedText added in v0.171.0

func (self *PhotoLibrary) SpaceUsedText() string

SpaceUsedText is the library's space used in the dashboard's words: "1.2 GB of 5 GB", or "1.2 GB · No limit" when the person has no limit.

type PhotoPlace added in v0.179.0

type PhotoPlace struct {
	PlaceName          string   `json:"placeName"`
	Latitude           float64  `json:"latitude"`
	Longitude          float64  `json:"longitude"`
	DistanceKilometers *float64 `json:"distanceKilometers"`
}

PhotoPlace is a city a photo can be said to be taken in. PlaceName is the text a photo's place name is. DistanceKilometers is how far the city is from the point the search was asked to be near, and nil when it was not asked.

func ResolvePhotoPlace added in v0.179.0

func ResolvePhotoPlace(ctx context.Context, executor Executor, words string, latitude, longitude *float64) (*PhotoPlace, error)

ResolvePhotoPlace is the place a set-location goes to: the best match for some words, or a position given as a latitude and a longitude, which the server answers with the nearest city's name or the position itself.

func SearchPhotoPlaces added in v0.179.0

func SearchPhotoPlaces(ctx context.Context, executor Executor, query string, nearLatitude, nearLongitude *float64, limitCount int) ([]*PhotoPlace, error)

SearchPhotoPlaces finds cities by name, best match first, nearest first within one kind of match when a point is given and largest first when not. Text that is a latitude and a longitude answers the one position it says. A limitCount of zero asks for the server's default.

type PhotoPositionPlaceView added in v0.182.0

type PhotoPositionPlaceView struct {
	// LocationPlace is the caller's own Location place the position is inside,
	// nil when there is none or the caller cannot use Location.
	LocationPlace *Place `json:"locationPlace"`

	// AddressText is the street address from the server's place provider, ""
	// when LocationPlace is set, when no provider is switched on, or when the
	// lookup failed.
	AddressText string `json:"addressText"`
}

PhotoPositionPlaceView is where a photo was taken, finer than the city the photo carries.

func ReadPhotoPlace added in v0.182.0

func ReadPhotoPlace(ctx context.Context, executor Executor, photoId string) (*PhotoPositionPlaceView, error)

ReadPhotoPlace is where a photo was taken, by the caller's own place or the street. It is nil when the photo has no position the caller may see.

type PhotoUpload added in v0.171.0

type PhotoUpload struct {
	// Source is the file's bytes and SizeBytes their number. A source that
	// can be read at any offset is what lets a part be sent again without
	// the rest.
	Source    io.ReaderAt
	SizeBytes int64

	// ClientPhotoID is the uploader's stable name for the photo; sending the
	// same name again finds the photo that is there. The SHA-256 of the file
	// is the usual one.
	ClientPhotoID string

	Filename    string
	ContentType string

	// DeclaredSHA256 is the file's digest when the uploader knows it, so the
	// server can refuse bytes that arrived changed.
	DeclaredSHA256 string

	// PhotoSource says where the file came from. The default is commandLine.
	PhotoSource models.PhotoSource

	// OnProgress is told how many bytes the server has, as parts are stored.
	OnProgress func(storedBytes int64)
}

PhotoUpload is one file to send to the library.

type PhotoView added in v0.171.0

type PhotoView struct {
	Photo         *models.Photo          `json:"photo"`
	PhotoFiles    []*models.PhotoFile    `json:"photoFiles"`
	PhotoPreviews []*models.PhotoPreview `json:"photoPreviews"`

	// Albums are the albums the photo is in.
	Albums []*models.PhotoAlbumReference `json:"albums"`

	// Faces are the faces found in the photo, with the people they are.
	Faces []*models.PhotoFace `json:"faces"`
}

PhotoView is one photo with the files it is made of and the previews that have been made of it.

func ReadPhoto added in v0.171.0

func ReadPhoto(ctx context.Context, executor Executor, photoId string) (*PhotoView, error)

ReadPhoto is one photo, with its files and previews.

type Place added in v0.175.0

type Place struct {
	ID                 string     `json:"id"`
	UserID             string     `json:"userId"`
	PlaceName          string     `json:"placeName"`
	IsNamedByPerson    bool       `json:"isNamedByPerson"`
	PlaceLabel         string     `json:"placeLabel"`
	LatitudeDegrees    float64    `json:"latitudeDegrees"`
	LongitudeDegrees   float64    `json:"longitudeDegrees"`
	RadiusMeters       float64    `json:"radiusMeters"`
	OSMType            string     `json:"osmType"`
	OSMID              *int64     `json:"osmId"`
	OSMName            string     `json:"osmName"`
	OSMCategory        string     `json:"osmCategory"`
	AddressText        string     `json:"addressText"`
	IsAddressTyped     bool       `json:"isAddressTyped"`
	VisitCount         int        `json:"visitCount"`
	LastVisitAt        *time.Time `json:"lastVisitAt"`
	NamingErrorMessage string     `json:"namingErrorMessage"`
	CreatedAt          time.Time  `json:"createdAt"`
	UpdatedAt          time.Time  `json:"updatedAt"`
}

Place is a named place with a radius, belonging to one person.

func ReadPlace added in v0.182.0

func ReadPlace(ctx context.Context, connection *Client, userId, placeId string) (*Place, error)

ReadPlace is one place by its id, of the caller or, with a userId, of somebody who shares their history with them.

func SavePlace added in v0.175.0

func SavePlace(ctx context.Context, connection *Client, change PlaceChange) (*Place, error)

SavePlace names, labels, moves or resizes a place, or makes one when there is no PlaceID.

type PlaceChange added in v0.175.0

type PlaceChange struct {
	PlaceID          string
	PlaceName        *string
	PlaceLabel       *string
	LatitudeDegrees  *float64
	LongitudeDegrees *float64
	RadiusMeters     *float64

	// AddressText is an address picked from SearchAddresses, given with the
	// coordinates of that match. With a PlaceID and no coordinates it is an
	// address the provider does not know: the place stays where it is. The
	// address is kept as typed. Empty takes the typed address away.
	AddressText *string
}

PlaceChange is what to change about a place, or what to make a new one from. A nil field is left as it is, and a pointer to an empty name or label is the empty one.

type PlacePage added in v0.175.0

type PlacePage struct {
	Places     []*Place `json:"places"`
	NextOffset *int     `json:"nextOffset"`
}

PlacePage is a page of places; NextOffset is null on the last.

func ListPlaces added in v0.175.0

func ListPlaces(ctx context.Context, connection *Client, query PlacesQuery) (*PlacePage, error)

ListPlaces is a page of the caller's places.

type PlaceSearch added in v0.175.0

type PlaceSearch struct {
	Query            string
	LatitudeDegrees  *float64
	LongitudeDegrees *float64
	PlaceID          string
	RadiusMeters     *float64
	Offset           int
	LimitCount       int
}

PlaceSearch is a search for places by words. Near is a point, a place, or neither, which is where the caller last was.

type PlaceVisit added in v0.175.0

type PlaceVisit struct {
	ID               string     `json:"id"`
	Place            *Place     `json:"place"`
	ArrivedAt        *time.Time `json:"arrivedAt"`
	DepartedAt       *time.Time `json:"departedAt"`
	DurationSeconds  *int       `json:"durationSeconds"`
	LatitudeDegrees  float64    `json:"latitudeDegrees"`
	LongitudeDegrees float64    `json:"longitudeDegrees"`
	AccuracyMeters   float64    `json:"accuracyMeters"`
	VisitSource      string     `json:"visitSource"`

	// PhotoCount and Photos are the person's own photos taken during the
	// visit (the first few, earliest first). Both are nil for somebody
	// else's visits, without Photos, and for a visit with no arrival.
	PhotoCount        *int          `json:"photoCount"`
	Photos            []*VisitPhoto `json:"photos"`
	PhotosTakenBefore *time.Time    `json:"photosTakenBefore"`
}

PlaceVisit is one visit at a place.

func CheckIn added in v0.175.0

func CheckIn(ctx context.Context, connection *Client, at CheckInAt) (*PlaceVisit, error)

CheckIn records that the caller is at a place now.

type PlaceVisitPage added in v0.175.0

type PlaceVisitPage struct {
	PlaceVisits []*PlaceVisit    `json:"placeVisits"`
	NextOffset  *int             `json:"nextOffset"`
	Pauses      []*LocationPause `json:"pauses,omitempty"`
}

PlaceVisitPage is a page of visits; NextOffset is null on the last. Pauses is not part of the answer to the visits: the caller fills it in from ListLocationPauses, for a listing that shows the gaps among the visits.

func ListLocationVisits added in v0.175.0

func ListLocationVisits(ctx context.Context, connection *Client, query LocationVisitsQuery) (*PlaceVisitPage, error)

ListLocationVisits is a page of the caller's visits, newest first.

type PlacesQuery added in v0.175.0

type PlacesQuery struct {
	UserID     string
	PlaceLabel string
	Query      string
	Offset     int
	LimitCount int
}

PlacesQuery narrows and pages a listing of places. A zero field is left out.

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"`
	// AddressBookID and ContactID name one of the person's contacts: the one a
	// speaker-contact ties the speaker to, and optionally the one speaker-confirm
	// and temporary-speaker-name tie the name they give to.
	AddressBookID string `json:"address_book_id"`
	ContactID     string `json:"contact_id"`
	// ShouldUntieContact has speaker-contact take the speaker off its contact.
	ShouldUntieContact bool `json:"should_untie_contact"`
	// 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"`
	// BeforeRecordingID continues a list of recordings after the last one of
	// the page before.
	BeforeRecordingID string `json:"before_recording_id"`
	// GranteeUserID or GranteeCircleID is who share gives the recording to,
	// as the surface resolved it from a username or a circle's name, and
	// RecordingShareLevel is summary or transcript. RecordingShareID is the
	// share unshare takes back, as shares lists it.
	GranteeUserID       string `json:"grantee_user_id"`
	GranteeCircleID     string `json:"grantee_circle_id"`
	RecordingShareLevel string `json:"recording_share_level"`
	RecordingShareID    string `json:"recording_share_id"`
}

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 RecordingShare added in v0.194.0

type RecordingShare struct {
	ID                  string  `json:"id"`
	RecordingID         string  `json:"recordingId"`
	GranteeUserID       *string `json:"granteeUserId"`
	GranteeUsername     string  `json:"granteeUsername"`
	GranteeName         string  `json:"granteeName"`
	GranteeCircleID     *string `json:"granteeCircleId"`
	GranteeCircleName   string  `json:"granteeCircleName"`
	RecordingShareLevel string  `json:"recordingShareLevel"`
	CreatedAt           string  `json:"createdAt"`
}

RecordingShare is one share of the caller's recording.

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 ReplacePasswordsRecoveryKeyInput added in v0.193.0

type ReplacePasswordsRecoveryKeyInput struct {
	Proof                   string `json:"proof"`
	AccountKeyByRecoveryKey string `json:"accountKeyByRecoveryKey"`
	RecoveryKeyProofHash    string `json:"recoveryKeyProofHash"`
}

ReplacePasswordsRecoveryKeyInput is the account key sealed by a new recovery key, with the proof of the passphrase.

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
	IsPrivate   *bool
	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 SavePasswordItemInput added in v0.193.0

type SavePasswordItemInput struct {
	ID              string `json:"id"`
	ItemKind        string `json:"itemKind"`
	EncryptedFields string `json:"encryptedFields"`
	ItemKey         string `json:"itemKey"`
	BaseRevision    *int64 `json:"baseRevision"`
}

SavePasswordItemInput is an item made or changed on a device. ID is chosen by the device, because the encryption names it. BaseRevision is the revision the change was made from, nil for a new item.

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 SearchArea added in v0.187.0

type SearchArea struct {
	SearchArea string          `json:"searchArea"`
	Results    []*SearchResult `json:"results"`
	HasMore    bool            `json:"hasMore"`
}

SearchArea is one area's results.

type SearchResult added in v0.187.0

type SearchResult struct {
	SearchArea string     `json:"searchArea"`
	TargetID   string     `json:"targetId"`
	TitleText  string     `json:"titleText"`
	DetailText string     `json:"detailText"`
	HappenedAt *time.Time `json:"happenedAt"`
	IsMain     bool       `json:"isMain"`
}

SearchResult is one thing found.

type SearchResults added in v0.187.0

type SearchResults struct {
	Words       string        `json:"words"`
	Areas       []*SearchArea `json:"areas"`
	FailedAreas []string      `json:"failedAreas"`
}

SearchResults is what a search across everything found.

func SearchEverything added in v0.187.0

func SearchEverything(ctx context.Context, connection *Client, words string, areas []string, perAreaLimit int) (*SearchResults, error)

SearchEverything looks for the words in the areas named, or in every area the person may use when none is named, and keeps perAreaLimit results from each; zero is the server's default.

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"`
	IsPhotosEnabled          bool `json:"isPhotosEnabled"`
	IsPhotosChosen           bool `json:"isPhotosChosen"`
	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 SetPasswordItemSharesInput added in v0.193.0

type SetPasswordItemSharesInput struct {
	ItemID   string                       `json:"itemId"`
	Grantees []*PasswordShareGranteeInput `json:"grantees"`
	Keys     []*PasswordShareKeyInput     `json:"keys"`
}

SetPasswordItemSharesInput replaces who an item is shared with, and carries the item key sealed for each recipient.

type SetPasswordItemUsableByAgentInput added in v0.193.0

type SetPasswordItemUsableByAgentInput struct {
	ItemID            string `json:"itemId"`
	IsUsableByAgent   bool   `json:"isUsableByAgent"`
	ItemKeyByAgentKey string `json:"itemKeyByAgentKey,omitempty"`
}

SetPasswordItemUsableByAgentInput lets the agent use an item, with the item key sealed for the server's agent key, or stops it.

type SetUpPasswordsInput added in v0.193.0

type SetUpPasswordsInput struct {
	AccountKeyByPassphrase   string `json:"accountKeyByPassphrase"`
	PassphraseSalt           string `json:"passphraseSalt"`
	PassphraseIterationCount int    `json:"passphraseIterationCount"`
	PassphraseProofHash      string `json:"passphraseProofHash"`
	AccountKeyByRecoveryKey  string `json:"accountKeyByRecoveryKey"`
	RecoveryKeyProofHash     string `json:"recoveryKeyProofHash"`
	PublicKey                string `json:"publicKey"`
	PrivateKeyByAccountKey   string `json:"privateKeyByAccountKey"`
}

SetUpPasswordsInput is everything a device makes when a person sets Passwords up. The proof hashes are base64 of the SHA-256 of a proof key.

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 SharedAgentChild added in v0.170.0

type SharedAgentChild struct {
	Path     string `json:"path"`
	Name     string `json:"name"`
	NodeKind string `json:"nodeKind"`
	Opening  string `json:"opening"`
}

SharedAgentChild is a page under a shared page.

type SharedAgentEdge added in v0.170.0

type SharedAgentEdge struct {
	FromPath   string `json:"fromPath"`
	ToPath     string `json:"toPath"`
	FromName   string `json:"fromName"`
	ToName     string `json:"toName"`
	Relation   string `json:"relation"`
	IsProposed bool   `json:"isProposed"`
}

SharedAgentEdge is a link between two shared pages.

type SharedAgentFact added in v0.170.0

type SharedAgentFact struct {
	Number            int        `json:"number"`
	FactKind          string     `json:"factKind"`
	Text              string     `json:"text"`
	HappenedAt        *time.Time `json:"happenedAt"`
	HappenedPrecision string     `json:"happenedPrecision"`
	SaidAt            *time.Time `json:"saidAt"`
	IsInferred        bool       `json:"isInferred"`
	EvidenceSource    string     `json:"evidenceSource"`
	EvidenceQuote     string     `json:"evidenceQuote"`
}

SharedAgentFact is one fact of a shared page.

type SharedAgentPage added in v0.170.0

type SharedAgentPage struct {
	OwnerUserID           string  `json:"ownerUserId"`
	OwnerUsername         string  `json:"ownerUsername"`
	OwnerName             string  `json:"ownerName"`
	OwnerAvatarURL        *string `json:"ownerAvatarUrl"`
	OwnerAvatarColorIndex int     `json:"ownerAvatarColorIndex"`

	Path          string              `json:"path"`
	Name          string              `json:"name"`
	NodeKind      string              `json:"nodeKind"`
	Aliases       []string            `json:"aliases"`
	Opening       string              `json:"opening"`
	IsQuoteShared bool                `json:"isQuoteShared"`
	Facts         []*SharedAgentFact  `json:"facts"`
	Edges         []*SharedAgentEdge  `json:"edges"`
	Children      []*SharedAgentChild `json:"children"`
}

SharedAgentPage is a page another person shared, as the signed-in account is shown it.

func ReadSharedAgentPage added in v0.170.0

func ReadSharedAgentPage(ctx context.Context, connection *Client, ownerUserId, path string) (*SharedAgentPage, error)

ReadSharedAgentPage is one page another person shared, or a page under one.

type SharedAgentPageHit added in v0.170.0

type SharedAgentPageHit struct {
	OwnerUserID   string `json:"ownerUserId"`
	OwnerUsername string `json:"ownerUsername"`
	OwnerName     string `json:"ownerName"`

	Path       string `json:"path"`
	Name       string `json:"name"`
	Opening    string `json:"opening"`
	FactNumber int    `json:"factNumber"`
	Text       string `json:"text"`
}

SharedAgentPageHit is a page or a fact of a shared page that a search found, with whose it is. FactNumber is zero for a page.

type SharedAgentPageRoot added in v0.170.0

type SharedAgentPageRoot struct {
	OwnerUserID           string  `json:"ownerUserId"`
	OwnerUsername         string  `json:"ownerUsername"`
	OwnerName             string  `json:"ownerName"`
	OwnerAvatarURL        *string `json:"ownerAvatarUrl"`
	OwnerAvatarColorIndex int     `json:"ownerAvatarColorIndex"`

	Path          string `json:"path"`
	Name          string `json:"name"`
	NodeKind      string `json:"nodeKind"`
	Opening       string `json:"opening"`
	IsQuoteShared bool   `json:"isQuoteShared"`
}

SharedAgentPageRoot is a root of a subtree another person shared with the signed-in account.

func ListSharedAgentPages added in v0.170.0

func ListSharedAgentPages(ctx context.Context, connection *Client) ([]*SharedAgentPageRoot, error)

ListSharedAgentPages are the roots other people shared with the signed-in account.

type SharedAgentPageSearch added in v0.170.0

type SharedAgentPageSearch struct {
	Hits        []*SharedAgentPageHit `json:"hits"`
	HasMoreHits bool                  `json:"hasMoreHits"`
}

SharedAgentPageSearch is what a search of the shared pages found, and whether more matched than were given back.

func SearchSharedAgentPages added in v0.170.0

func SearchSharedAgentPages(ctx context.Context, connection *Client, query string, first int) (*SharedAgentPageSearch, error)

SearchSharedAgentPages finds, by words, pages and facts in the pages other people shared with the signed-in account; first bounds the hits, 20 when it is zero.

type SharedCreditUsage added in v0.194.0

type SharedCreditUsage struct {
	OwedAmount        string   `json:"owedAmount,omitempty"`
	CreditLimitAmount string   `json:"creditLimitAmount,omitempty"`
	CreditLimitSource string   `json:"creditLimitSource"`
	UsageShare        *float64 `json:"usageShare,omitempty"`
}

SharedCreditUsage is what a shared credit card owes against its limit.

type SharedFinance added in v0.210.0

type SharedFinance struct {
	OwnerUserID       string `json:"ownerUserId"`
	OwnerUsername     string `json:"ownerUsername"`
	OwnerName         string `json:"ownerName"`
	FinanceShareLevel string `json:"financeShareLevel"`
}

SharedFinance is a person who shares all of their finance with the caller, and the level they share it at.

func ListSharedFinance added in v0.210.0

func ListSharedFinance(ctx context.Context, connection *Client, ownerUserId string) ([]*SharedFinance, error)

ListSharedFinance are the people who share all of their finance with the caller, of one person when their identifier is given.

type SharedFinanceAccount added in v0.194.0

type SharedFinanceAccount struct {
	FinanceAccountID  string             `json:"financeAccountId"`
	OwnerUserID       string             `json:"ownerUserId"`
	OwnerUsername     string             `json:"ownerUsername"`
	OwnerName         string             `json:"ownerName"`
	FinanceShareLevel string             `json:"financeShareLevel"`
	AccountName       string             `json:"accountName"`
	AccountMask       string             `json:"accountMask,omitempty"`
	AccountKind       string             `json:"accountKind"`
	CurrencyCode      string             `json:"currencyCode"`
	CurrentBalance    string             `json:"currentBalance,omitempty"`
	BalanceAt         *time.Time         `json:"balanceAt,omitempty"`
	CreditUsage       *SharedCreditUsage `json:"creditUsage"`
}

SharedFinanceAccount is somebody else's finance account as the level it is shared at shows it.

func ListSharedFinanceAccounts added in v0.194.0

func ListSharedFinanceAccounts(ctx context.Context, connection *Client, ownerUserId string) ([]*SharedFinanceAccount, error)

ListSharedFinanceAccounts are the finance accounts other people share with the caller, of one person when their identifier is given.

type SharedFinanceSpendingRow added in v0.194.0

type SharedFinanceSpendingRow struct {
	SpendingMonth           string `json:"spendingMonth"`
	SpendingCategoryName    string `json:"spendingCategoryName"`
	CurrencyCode            string `json:"currencyCode"`
	MoneyOut                string `json:"moneyOut"`
	MoneyIn                 string `json:"moneyIn"`
	FinanceTransactionCount int    `json:"financeTransactionCount"`
}

SharedFinanceSpendingRow is one month of one spending category of a shared account, in one currency.

func ListSharedAllFinanceSpending added in v0.210.0

func ListSharedAllFinanceSpending(ctx context.Context, connection *Client, ownerUserId, from, to string) ([]*SharedFinanceSpendingRow, error)

ListSharedAllFinanceSpending is the same across all of one person's finance accounts together, for a person who shares all their finance.

func ListSharedFinanceSpending added in v0.194.0

func ListSharedFinanceSpending(ctx context.Context, connection *Client, financeAccountId, from, to string) ([]*SharedFinanceSpendingRow, error)

ListSharedFinanceSpending is a shared account's money out and in by month and spending category, for the days from and to (either may be empty).

type SharedFinanceTransaction added in v0.194.0

type SharedFinanceTransaction struct {
	ID                   string `json:"id"`
	PostedOn             string `json:"postedOn"`
	Amount               string `json:"amount"`
	CurrencyCode         string `json:"currencyCode"`
	MerchantName         string `json:"merchantName,omitempty"`
	SpendingCategoryName string `json:"spendingCategoryName,omitempty"`
}

SharedFinanceTransaction is a transaction of a shared account as a reader at the transactions level sees it.

type SharedFinanceTransactionPage added in v0.194.0

type SharedFinanceTransactionPage struct {
	FinanceTransactions []*SharedFinanceTransaction `json:"financeTransactions"`
	NextCursor          string                      `json:"nextCursor,omitempty"`
	TotalCount          int                         `json:"totalCount"`
}

SharedFinanceTransactionPage is one page of a shared account's transactions, and the cursor for the next, empty on the last.

func ListSharedAllFinanceTransactions added in v0.210.0

func ListSharedAllFinanceTransactions(ctx context.Context, connection *Client, ownerUserId, from, to string, limit int, after string, offset int) (*SharedFinanceTransactionPage, error)

ListSharedAllFinanceTransactions is a page of the transactions of all of one person's finance accounts together, for a person who shares all their finance at the transactions level.

func ListSharedFinanceTransactions added in v0.194.0

func ListSharedFinanceTransactions(ctx context.Context, connection *Client, financeAccountId, from, to string, limit int, after string, offset int) (*SharedFinanceTransactionPage, error)

ListSharedFinanceTransactions is a page of a shared account's transactions, newest first. A limit of zero is the server's default; an offset passes over that many transactions first, from the cursor when one is given.

type Sharing added in v0.194.0

type Sharing struct {
	SharesMade     []*SharingMade     `json:"sharesMade"`
	SharesReceived []*SharingReceived `json:"sharesReceived"`
}

Sharing is what the signed-in account shares and what is shared with it, across every kind of thing that can be shared.

func ListSharing added in v0.194.0

func ListSharing(ctx context.Context, connection Executor) (*Sharing, error)

ListSharing returns what the signed-in account shares and what is shared with it.

type SharingMade added in v0.194.0

type SharingMade struct {
	ShareKind         string    `json:"shareKind"`
	ShareID           string    `json:"shareId"`
	SubjectID         string    `json:"subjectId"`
	SubjectName       string    `json:"subjectName"`
	SubjectMask       string    `json:"subjectMask"`
	IsSubjectDeleted  bool      `json:"isSubjectDeleted"`
	ShareLevel        string    `json:"shareLevel"`
	ShareScopes       []string  `json:"shareScopes"`
	PasswordItemCount int       `json:"passwordItemCount"`
	GranteeUserID     *string   `json:"granteeUserId"`
	GranteeUsername   string    `json:"granteeUsername"`
	GranteeName       string    `json:"granteeName"`
	GranteeCircleID   *string   `json:"granteeCircleId"`
	GranteeCircleName string    `json:"granteeCircleName"`
	CreatedAt         time.Time `json:"createdAt"`
}

SharingMade is one share the account made. ShareKind is calendar, location, health, memory_page, photo_album, recording, finance, skill or passwords; ShareID is empty for passwords, whose shares are one for each item and are counted (PasswordItemCount), never named. SubjectMask is the last digits of a finance account's number. IsSubjectDeleted is true for a share of a memory page that no longer exists, which can still be stopped. Exactly one of GranteeUserID and GranteeCircleID is set.

type SharingReceived added in v0.194.0

type SharingReceived struct {
	ShareKind         string    `json:"shareKind"`
	ShareID           string    `json:"shareId"`
	SubjectID         string    `json:"subjectId"`
	SubjectName       string    `json:"subjectName"`
	SubjectMask       string    `json:"subjectMask"`
	ShareLevel        string    `json:"shareLevel"`
	ShareScopes       []string  `json:"shareScopes"`
	PasswordItemCount int       `json:"passwordItemCount"`
	OwnerUserID       string    `json:"ownerUserId"`
	OwnerUsername     string    `json:"ownerUsername"`
	OwnerName         string    `json:"ownerName"`
	GranteeCircleID   *string   `json:"granteeCircleId"`
	GranteeCircleName string    `json:"granteeCircleName"`
	IsDirect          bool      `json:"isDirect"`
	CanDecline        bool      `json:"canDecline"`
	CreatedAt         time.Time `json:"createdAt"`
}

SharingReceived is one share made to the account. A share through a circle names the circle (GranteeCircleName) and cannot be declined; one made by name (IsDirect) can, except passwords.

type ShoppingImportItemView added in v0.201.0

type ShoppingImportItemView struct {
	ItemDescription string `json:"itemDescription"`
	ItemDetails     string `json:"itemDetails"`
	NeededQuantity  string `json:"neededQuantity"`
	QuantityUnit    string `json:"quantityUnit"`
	AisleName       string `json:"aisleName"`
	StoreName       string `json:"storeName"`
	IsStoreBrand    bool   `json:"isStoreBrand"`

	MergedShoppingItemID    string `json:"mergedShoppingItemId"`
	MergedShoppingItemState string `json:"mergedShoppingItemState"`
	MergedNeededQuantity    string `json:"mergedNeededQuantity"`
}

ShoppingImportItemView is one item read out of a pasted list or a picture of one, and the item already on the list that it would merge into.

type ShoppingImportQuery added in v0.201.0

type ShoppingImportQuery struct {
	ShoppingListID     string
	ImportText         string
	AgentAttachmentIDs []string
}

ShoppingImportQuery is a list to read: pasted text, pictures the caller uploaded as their agent's attachments, or both. A list says what each item would merge into.

type ShoppingImportView added in v0.201.0

type ShoppingImportView struct {
	ShoppingItems []*ShoppingImportItemView `json:"shoppingItems"`
}

ShoppingImportView is a list as the model read it; nothing is added.

func PreviewShoppingImport added in v0.201.0

func PreviewShoppingImport(ctx context.Context, executor Executor, query ShoppingImportQuery) (*ShoppingImportView, error)

PreviewShoppingImport reads a pasted list or pictures of one into the items that would be added, and what each would merge into. Nothing is added.

type ShoppingItemAddedView added in v0.201.0

type ShoppingItemAddedView struct {
	ShoppingItem *models.ShoppingItem `json:"shoppingItem"`
	IsMerged     bool                 `json:"isMerged"`
}

ShoppingItemAddedView is one item as added, and whether it was merged into an item already on the list.

func AddShoppingItems added in v0.201.0

func AddShoppingItems(ctx context.Context, executor Executor, shoppingListId string, shoppingItems []ShoppingItemEntry) ([]*ShoppingItemAddedView, error)

AddShoppingItems adds items to a list. An item already on the list is merged into, and a new one gets a picture searched for in the background.

type ShoppingItemEntry added in v0.201.0

type ShoppingItemEntry struct {
	ItemDescription string `json:"itemDescription"`
	ItemDetails     string `json:"itemDetails,omitempty"`
	StoreName       string `json:"storeName,omitempty"`
	IsStoreBrand    bool   `json:"isStoreBrand,omitempty"`
	AisleName       string `json:"aisleName,omitempty"`
	NeededQuantity  string `json:"neededQuantity,omitempty"`
	QuantityUnit    string `json:"quantityUnit,omitempty"`
	UnitPriceAmount string `json:"unitPriceAmount,omitempty"`
	CurrencyCode    string `json:"currencyCode,omitempty"`
}

ShoppingItemEntry is one item to add.

type ShoppingListPageView added in v0.201.0

type ShoppingListPageView struct {
	ShoppingList  *models.ShoppingList   `json:"shoppingList"`
	ShoppingItems []*models.ShoppingItem `json:"shoppingItems"`
	ShoppingTrips []*models.ShoppingTrip `json:"shoppingTrips"`

	// TotalCount is how many of the list's items are in the states asked for.
	TotalCount int `json:"totalCount"`
}

ShoppingListPageView is one list with a page of its items and who is shopping it now.

func GetShoppingList added in v0.201.0

func GetShoppingList(ctx context.Context, executor Executor, query ShoppingListQuery) (*ShoppingListPageView, error)

GetShoppingList is one list with a page of its items.

type ShoppingListQuery added in v0.201.0

type ShoppingListQuery struct {
	ShoppingListID     string
	ShoppingItemStates []string
	SearchText         string
	Offset             int
	PageSize           int
}

ShoppingListQuery is a page of one list's items. No states is every state; a zero PageSize is the server's 200.

type ShoppingPriceEntry added in v0.201.0

type ShoppingPriceEntry struct {
	ShoppingItemID  string
	UnitPriceAmount string
	StoreName       string
	ObservedOn      string
	CurrencyCode    string
}

ShoppingPriceEntry is a price somebody saw. Empty fields are the server's defaults: the item's store, today, and the item's currency.

type ShoppingReceiptLineView added in v0.201.0

type ShoppingReceiptLineView struct {
	FinanceReceiptLineID   string                      `json:"financeReceiptLineId"`
	LineNumber             int                         `json:"lineNumber"`
	Description            string                      `json:"description"`
	Quantity               string                      `json:"quantity"`
	LineAmount             string                      `json:"lineAmount"`
	ShoppingReceiptMatches []*ShoppingReceiptMatchView `json:"shoppingReceiptMatches"`
}

ShoppingReceiptLineView is one item line of a receipt and its matches.

type ShoppingReceiptMatchView added in v0.201.0

type ShoppingReceiptMatchView struct {
	ShoppingReceiptMatch *models.ShoppingReceiptMatch `json:"shoppingReceiptMatch"`
	ShoppingItem         *models.ShoppingItem         `json:"shoppingItem"`
}

ShoppingReceiptMatchView is a match with its item.

type ShoppingReceiptView added in v0.201.0

type ShoppingReceiptView struct {
	FinanceReceiptID     string                     `json:"financeReceiptId"`
	MerchantName         string                     `json:"merchantName"`
	PurchasedOn          string                     `json:"purchasedOn"`
	TotalAmount          string                     `json:"totalAmount"`
	CurrencyCode         string                     `json:"currencyCode"`
	ShoppingReceiptLines []*ShoppingReceiptLineView `json:"shoppingReceiptLines"`
	StillNeededItems     []*models.ShoppingItem     `json:"stillNeededItems"`
}

ShoppingReceiptView is what a receipt did to the lists: each line with its matches, and what is still needed at that store.

func ListShoppingReceiptMatches added in v0.201.0

func ListShoppingReceiptMatches(ctx context.Context, executor Executor, financeReceiptId string) (*ShoppingReceiptView, error)

ListShoppingReceiptMatches is what one of the caller's receipts did to their lists.

type ShoppingStoreListView added in v0.201.0

type ShoppingStoreListView struct {
	ShoppingListID string `json:"shoppingListId"`
	ListName       string `json:"listName"`
	NeededCount    int    `json:"neededCount"`
	IsIncluded     bool   `json:"isIncluded"`
}

ShoppingStoreListView is a list on the store screen: how many of its items are needed at the store, and whether they are in the screen's items.

type ShoppingStoreQuery added in v0.201.0

type ShoppingStoreQuery struct {
	StoreName          string
	ShoppingListIDs    []string
	IsAnyStoreIncluded *bool
}

ShoppingStoreQuery is the store screen. No lists is every list with items there; IsAnyStoreIncluded nil is the server's default, which is true.

type ShoppingStoreView added in v0.201.0

type ShoppingStoreView struct {
	StoreName     string                   `json:"storeName"`
	IsReminded    bool                     `json:"isReminded"`
	ShoppingItems []*models.ShoppingItem   `json:"shoppingItems"`
	ShoppingLists []*ShoppingStoreListView `json:"shoppingLists"`
	ShoppingTrips []*models.ShoppingTrip   `json:"shoppingTrips"`
}

ShoppingStoreView is the store screen: the items to get at one store across lists.

func ListShoppingStoreItems added in v0.201.0

func ListShoppingStoreItems(ctx context.Context, executor Executor, query ShoppingStoreQuery) (*ShoppingStoreView, error)

ListShoppingStoreItems is the store screen: what to get at one store across the lists the caller reaches.

type SkillShare added in v0.170.0

type SkillShare struct {
	ID        string   `json:"id"`
	SkillName string   `json:"skillName"`
	ToolNames []string `json:"toolNames"`

	OwnerUserID           string  `json:"ownerUserId"`
	OwnerUsername         string  `json:"ownerUsername"`
	OwnerName             string  `json:"ownerName"`
	OwnerAvatarURL        *string `json:"ownerAvatarUrl"`
	OwnerAvatarColorIndex int     `json:"ownerAvatarColorIndex"`

	GranteeUserID           string  `json:"granteeUserId"`
	GranteeUsername         string  `json:"granteeUsername"`
	GranteeName             string  `json:"granteeName"`
	GranteeAvatarURL        *string `json:"granteeAvatarUrl"`
	GranteeAvatarColorIndex int     `json:"granteeAvatarColorIndex"`

	// The limits are in the minor unit of CurrencyCode (cents).
	PaymentLimitMinor  *int64 `json:"paymentLimitMinor"`
	MonthlyLimitMinor  *int64 `json:"monthlyLimitMinor"`
	CurrencyCode       string `json:"currencyCode"`
	IsApprovalRequired bool   `json:"isApprovalRequired"`

	IsOwnedByCaller  bool      `json:"isOwnedByCaller"`
	WaitingCallCount int       `json:"waitingCallCount"`
	MonthTotalMinor  int64     `json:"monthTotalMinor"`
	CreatedAt        time.Time `json:"createdAt"`
}

SkillShare is one skill share the signed-in account made or was given.

func ListSkillShares added in v0.170.0

func ListSkillShares(ctx context.Context, connection *Client) ([]*SkillShare, error)

ListSkillShares are the shares the signed-in account made and was given.

func ShareSkill added in v0.170.0

func ShareSkill(ctx context.Context, connection *Client, terms *SkillShareTerms) (*SkillShare, error)

ShareSkill shares tools of an installed skill with a person, or changes the terms when it is shared with them already.

type SkillShareCall added in v0.170.0

type SkillShareCall struct {
	ID           string `json:"id"`
	SkillShareID string `json:"skillShareId"`
	IsShareEnded bool   `json:"isShareEnded"`
	SkillName    string `json:"skillName"`

	GranteeUserID           string  `json:"granteeUserId"`
	GranteeUsername         string  `json:"granteeUsername"`
	GranteeName             string  `json:"granteeName"`
	GranteeAvatarURL        *string `json:"granteeAvatarUrl"`
	GranteeAvatarColorIndex int     `json:"granteeAvatarColorIndex"`
	OwnerName               string  `json:"ownerName"`

	ToolName      string `json:"toolName"`
	ToolArguments string `json:"toolArguments"`
	RequestReason string `json:"requestReason"`

	AmountMinor  *int64 `json:"amountMinor"`
	CurrencyCode string `json:"currencyCode"`

	CallState  string     `json:"callState"`
	ToolOutput string     `json:"toolOutput"`
	AnsweredAt *time.Time `json:"answeredAt"`
	AnswerNote string     `json:"answerNote"`
	ExpiresAt  *time.Time `json:"expiresAt"`
	CreatedAt  time.Time  `json:"createdAt"`

	// ApproveAddress is where a call that waits is approved, filled in by the
	// command line from the server it talked to; the server does not send it.
	ApproveAddress string `json:"approveAddress,omitempty"`
}

SkillShareCall is one call made through a share.

func AnswerSkillShareCall added in v0.170.0

func AnswerSkillShareCall(ctx context.Context, connection *Client, callId string, isApproved bool, answerNote string) (*SkillShareCall, error)

AnswerSkillShareCall approves or declines a call that waits for the signed-in account, which owns the share. Approving runs it.

func ListEndedSkillShareCalls added in v0.170.0

func ListEndedSkillShareCalls(ctx context.Context, connection *Client, callState string) ([]*SkillShareCall, error)

ListEndedSkillShareCalls are the calls of shares that have ended, which the owner keeps as a record: every one for the owner, the caller's own for the person it was shared with. A state narrows them; empty is every state.

func ListSkillShareCalls added in v0.170.0

func ListSkillShareCalls(ctx context.Context, connection *Client, shareId, callState string) ([]*SkillShareCall, error)

ListSkillShareCalls are the calls made through a share, waiting ones first. A state narrows them; empty is every state.

type SkillShareTerms added in v0.170.0

type SkillShareTerms struct {
	SkillName     string
	ToolNames     []string
	GranteeUserID string

	// The limits are in the minor unit of CurrencyCode; nil is none.
	PaymentLimitMinor  *int64
	MonthlyLimitMinor  *int64
	CurrencyCode       string
	IsApprovalRequired bool
}

SkillShareTerms are what a share lets the other person do.

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 StatementReading added in v0.243.0

type StatementReading struct {
	AgentAttachmentID string `json:"agentAttachmentId"`
	AgentJobID        string `json:"agentJobId"`
}

StatementReading is the upload queued to be read as a statement, and the job reading it.

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 StorageDisk added in v0.234.0

type StorageDisk struct {
	DiskLabel       string   `json:"diskLabel"`
	IsDiskMeasured  bool     `json:"isDiskMeasured"`
	DiskTotalBytes  *int64   `json:"diskTotalBytes"`
	DiskFreeBytes   *int64   `json:"diskFreeBytes"`
	DiskUsedBytes   *int64   `json:"diskUsedBytes"`
	ProjectedFullOn *string  `json:"projectedFullOn"`
	DaysUntilFull   *float64 `json:"daysUntilFull"`
	IsProjectedFull bool     `json:"isProjectedFull"`
}

StorageDisk is a disk the server writes to.

type StorageGrowth added in v0.234.0

type StorageGrowth struct {
	GrowthSampleCount         int     `json:"growthSampleCount"`
	IsGrowthProjectable       bool    `json:"isGrowthProjectable"`
	GrowthBytesPerDay         float64 `json:"growthBytesPerDay"`
	CurrentSizeBytes          int64   `json:"currentSizeBytes"`
	ProjectedSize30DaysBytes  int64   `json:"projectedSize30DaysBytes"`
	ProjectedSize90DaysBytes  int64   `json:"projectedSize90DaysBytes"`
	ProjectedSize365DaysBytes int64   `json:"projectedSize365DaysBytes"`
	AreFilesCounted           bool    `json:"areFilesCounted"`
}

StorageGrowth is the line fitted through the last thirty days.

type StorageHistoryDay added in v0.234.0

type StorageHistoryDay struct {
	SampledOn         string           `json:"sampledOn"`
	DatabaseSizeBytes int64            `json:"databaseSizeBytes"`
	FileSizeBytes     int64            `json:"fileSizeBytes"`
	TotalSizeBytes    int64            `json:"totalSizeBytes"`
	BreakdownSizes    []StorageKeySize `json:"breakdownSizes"`
}

StorageHistoryDay is what one day's sample held.

type StorageKeySize added in v0.234.0

type StorageKeySize struct {
	SizeKey   string `json:"sizeKey"`
	SizeBytes int64  `json:"sizeBytes"`
}

StorageKeySize is a size under a key.

type StorageUsage added in v0.234.0

type StorageUsage struct {
	MeasuredAt        time.Time           `json:"measuredAt"`
	BreakdownBy       string              `json:"breakdownBy"`
	DatabaseSizeBytes int64               `json:"databaseSizeBytes"`
	FileSizeBytes     int64               `json:"fileSizeBytes"`
	TotalSizeBytes    int64               `json:"totalSizeBytes"`
	UsageRows         []StorageUsageRow   `json:"usageRows"`
	HistoryDays       []StorageHistoryDay `json:"historyDays"`
	Disks             []StorageDisk       `json:"disks"`
	Growth            StorageGrowth       `json:"growth"`
}

StorageUsage is one answer of the StorageUsage query.

func ReadStorageUsage added in v0.234.0

func ReadStorageUsage(ctx context.Context, connection *Client, since *time.Time, by string) (*StorageUsage, error)

ReadStorageUsage is what the database and the files hold, broken down by area, kind or person, with the trend since a time.

type StorageUsageRow added in v0.234.0

type StorageUsageRow struct {
	RowKey        string           `json:"rowKey"`
	RowLabel      string           `json:"rowLabel"`
	RowSizeBytes  int64            `json:"rowSizeBytes"`
	RowTableCount int              `json:"rowTableCount"`
	RowFileSizes  []StorageKeySize `json:"rowFileSizes"`
}

StorageUsageRow is one row of the breakdown asked for.

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 TravelTotal added in v0.203.0

type TravelTotal struct {
	PeriodStartDay  string  `json:"periodStartDay"`
	TravelMode      string  `json:"travelMode"`
	DistanceMeters  float64 `json:"distanceMeters"`
	DurationSeconds int     `json:"durationSeconds"`
	LegCount        int     `json:"legCount"`
}

TravelTotal is the distance traveled one way in one period. PeriodStartDay is a date written YYYY-MM-DD.

func ListTravelTotals added in v0.203.0

func ListTravelTotals(ctx context.Context, connection *Client, userId *string, period string, from, until time.Time) ([]*TravelTotal, error)

ListTravelTotals is the distance traveled by each way in each period (day, week, month or year) of the range, of the caller or, with a userId, of somebody who shares their history with them.

type Trip added in v0.203.0

type Trip struct {
	ID              string     `json:"id"`
	StartedAt       time.Time  `json:"startedAt"`
	EndedAt         time.Time  `json:"endedAt"`
	DurationSeconds int        `json:"durationSeconds"`
	DistanceMeters  float64    `json:"distanceMeters"`
	FromPlace       *Place     `json:"fromPlace"`
	ToPlace         *Place     `json:"toPlace"`
	Legs            []*TripLeg `json:"legs"`
}

Trip is the travel between the departure from one visit and the arrival at the next. FromPlace and ToPlace are null when the place is gone.

type TripLeg added in v0.203.0

type TripLeg struct {
	ID                    string    `json:"id"`
	StartedAt             time.Time `json:"startedAt"`
	EndedAt               time.Time `json:"endedAt"`
	DurationSeconds       int       `json:"durationSeconds"`
	DistanceMeters        float64   `json:"distanceMeters"`
	TravelMode            string    `json:"travelMode"`
	DetectedTravelMode    string    `json:"detectedTravelMode"`
	IsTravelModeCorrected bool      `json:"isTravelModeCorrected"`
	DetectionSource       string    `json:"detectionSource"`
}

TripLeg is a part of a trip with one way of travel. TravelMode is the way as the person corrected it, if they did, else DetectedTravelMode.

func SetTripLegTravelMode added in v0.203.0

func SetTripLegTravelMode(ctx context.Context, connection *Client, tripLegId string, travelMode *string) (*TripLeg, error)

SetTripLegTravelMode corrects the way of travel of one of the caller's legs; a nil travelMode clears the correction.

type TripPage added in v0.203.0

type TripPage struct {
	Trips      []*Trip `json:"trips"`
	NextOffset *int    `json:"nextOffset"`
}

TripPage is a page of trips, newest first; NextOffset is null on the last.

func ListTrips added in v0.203.0

func ListTrips(ctx context.Context, connection *Client, userId *string, from, until time.Time, offset, limitCount *int) (*TripPage, error)

ListTrips is a page of trips that overlap the range, newest first, of the caller or, with a userId, of somebody who shares their history with them.

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"`

	// Pronoun is how they are described, as they said it: he, she or they;
	// empty until they say.
	Pronoun string `json:"pronoun"`

	// MeasurementSystem is the units they read measurements in: metric, us,
	// or empty to follow their language and region.
	MeasurementSystem string `json:"measurementSystem"`

	// AvatarURL is where their picture is served, nil while they have none.
	AvatarURL        *string `json:"avatarUrl"`
	AvatarColorIndex int     `json:"avatarColorIndex"`
}

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 RemoveUserAvatar added in v0.170.0

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

RemoveUserAvatar takes an account's picture away, so they are shown as their initial. An empty username is the signed-in account.

func SetUserAvatar added in v0.170.0

func SetUserAvatar(ctx context.Context, connection *Client, username string, content []byte) (*User, error)

SetUserAvatar replaces an account's picture with a PNG or JPEG. An empty username is the signed-in account, which needs no lookup and no permission; another account's picture is named by username and needs user:manage, like every other change to somebody else's account.

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, username, pronoun or the units it reads measurements in.

type UserParameters

type UserParameters struct {
	Name        *string
	Email       *string
	NewUsername *string

	// Pronoun is he, she or they; a pointer to the empty string clears it.
	Pronoun *string

	// MeasurementSystem is metric or us; a pointer to the empty string goes
	// back to following their language and region.
	MeasurementSystem *string
}

UserParameters are what UpdateUser can change. A nil field is left alone.

type VisitPhoto added in v0.182.0

type VisitPhoto struct {
	ID              string     `json:"id"`
	SmallPreviewURL string     `json:"smallPreviewUrl"`
	TakenAt         *time.Time `json:"takenAt"`
}

VisitPhoto is one picture shown under a visit.

type WatchedStore added in v0.208.0

type WatchedStore struct {
	StoreName        string  `json:"storeName"`
	StoreKey         string  `json:"storeKey"`
	PlaceName        string  `json:"placeName"`
	OSMType          string  `json:"osmType"`
	OSMID            int64   `json:"osmId"`
	OSMCategory      string  `json:"osmCategory"`
	LatitudeDegrees  float64 `json:"latitudeDegrees"`
	LongitudeDegrees float64 `json:"longitudeDegrees"`
	RadiusMeters     float64 `json:"radiusMeters"`
	DistanceMeters   float64 `json:"distanceMeters"`
	PlaceID          string  `json:"placeId"`
}

WatchedStore is one branch of a store the phone watches, so that walking in is an arrival there.

func ListWatchedStores added in v0.208.0

func ListWatchedStores(ctx context.Context, executor Executor, latitudeDegrees, longitudeDegrees *float64) ([]*WatchedStore, error)

ListWatchedStores are the branches near a position (where the caller was last reported to be when nil) of the stores their lists need something from, as the phone watches them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL