Skip to content

spaces

Spaces: who reaches what, for every collection that shares its documents.

On this page 7
TypeScript
import { spaces } from "copilotz/plugins/access";

What it keeps

It keeps 5 collections, each on the record: every change to one is an event.

CollectionKept asFields
invitationdocumentsspace, name, email, role, by, at
memberdocumentsmember, space, role, on
profiledocumentsname, picture, at
requestdocumentsspace, member, by, reason, at
spacedocumentsname, kind, owner, archived, agent, declared

Its named queries read for callers, as the rules let them:

QueryWho outside runs it
invitation.minepeople, agents for a person, keys and routines
profile.namespeople, agents for a person, keys and routines
profile.picturespeople, agents for a person, keys and routines
request.openpeople, agents for a person, keys and routines
space.handoffspeople, agents for a person, keys and routines
space.reachedpeople, agents for a person, keys and routines

What it lets callers do

Of its 28 Actions, people may call 23; agents may call 8; contacts and someone signed out may call none.

ActionPersonAgentContactAnyoneKeyRoutineWhat it does
invitation.acceptyesnononononoJoins the space an invitation to your email is for.
invitation.declineyesnononononoTurns down an invitation to your email; a space's managers take one back.
invitation.sendyesnononononoInvites someone into a shared space by email, with a role; they join once they accept.
member.removeyesnononononoRemoves someone from a space.
member.setyesnononononoMakes someone a member of a space, with a role.
org.inviteyesnononononoInvites someone to the org by email, with a role; they join when they accept.
org.invitesyesyesnonoyesyesThe org's invitations waiting to be accepted.
org.meyesyesnonoyesyesYour standing in the org: your role, whether you're platform staff, and the org (in an app serving many).
org.peopleyesyesnonoyesyesWho's in the org, with their roles, names and emails: for its members.
org.removeyesnononononoTakes someone out of the org: their memberships end, and the shared spaces only they managed go to to (you, by default).
org.renameyesnononononoRenames the org: its owners'.
org.roleyesnononononoChanges someone's role in the org.
org.uninviteyesnononononoTakes back an invitation to the org.
request.denyyesnononononoTurns a request down.
request.grantyesnononononoLets in whoever a request is for, with a role (viewer by default).
shareyesnononononoShows a labelled document to everyone where it is.
space.agentyesyesnonoyesyesChooses the agent that answers a space's new chats: one working there.
space.archiveyesyesnonoyesyesArchives a space you manage, or brings it back.
space.canyesyesnonoyesyesWhether you may read, write in or manage a space.
space.createyesnononononoMakes a space (a shared one, an org…); its maker manages it.
space.leaveyesnononononoLeaves a shared space you're in.
space.personalyesyesnonoyesyesYour Personal space, where what you make alone lives.
space.renameyesyesnonoyesyesRenames a space you manage.

An agent works for a person, and calls what both may. A key calls only what its scope names. A routine is work done for a person, which they set going.

Only the app's own code calls org.join, org.seats, org.summary, space.keep and space.roster: its plugins, its schedules and the system.

Agents act through its tool, as whoever they work for:

ToolWhat it doesCalls
request_accessAsk the managers of a space you can't see to let the person you work for in, saying why.

It also adds rules every read and write keeps to (guard) and carries what a job read to what it writes (labels).

Where it shows

Its Views show to the model.

  • To the model: context:elsewhere, context:where.
  • Agents' tools: request_access.
  • Front ends: spaces-terminal and spaces-web.
  • What it adds to resources: context (elsewhere, where), names (people), roster (spaces), usageNames (space).

What it needs

Nothing to set. It reads agents, directory, names, org, roles, shared and spaces, resource kinds the app and other plugins fill.

What it requires

The runtime doesn't start without identity: add it too.

It ships with copilotz@1.0.0-rc.34.

What it does on its own

Some of its work starts without a caller: an event, or the time.

  • spaces.agentGone runs on agent.deleted.
  • spaces.profile runs on person.created or person.updated.

Listing

It keeps every listing rule.