{"commit":"e1ccaf9dd4435157b8cf6db7f4f6d4751820b0f9","subject":"There seems to be an spk in the wild with version = 12, so use 13 instead.","message":"There seems to be an spk in the wild with version = 12, so use 13 instead.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 13, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 12, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"1494d9ecd320980afd6c6d533860c732a749bd5a","subject":"Close #94: obsolete comment in rpc.capnp","message":"Close #94: obsolete comment in rpc.capnp\n","repos":"Fraser999\/capnproto,mrdomino\/capnproto,zarvox\/capnproto,ligzy\/capnproto,johnkdoe\/capnproto,a-richardson\/capnproto,maurer\/capnproto,modulexcite\/capnproto,jparyani\/capnproto,maurer\/capnproto,bryce-gibson\/capnproto,nagyistoce\/capnproto,Fraser999\/capnproto,hntrmrrs\/capnproto,jparyani\/capnproto,rcrowder\/capnproto,bryce-gibson\/capnproto,ligzy\/capnproto,joliss\/capnproto,ligzy\/capnproto,a-richardson\/capnproto,mrdomino\/capnproto,ocdtrekkie\/capnproto,bsn069\/capnproto,zarvox\/capnproto,pjulien\/capnproto,MarPiRK\/capnproto,khklau\/capnproto,modulexcite\/capnproto,Fraser999\/capnproto,khklau\/capnproto,rcrowder\/capnproto,johnkdoe\/capnproto,nagyistoce\/capnproto,maurer\/capnproto,geofft\/capnproto,joliss\/capnproto,rcrowder\/capnproto,khklau\/capnproto,vladon\/capnproto,vladon\/capnproto,modulexcite\/capnproto,pjulien\/capnproto,vladon\/capnproto,pjulien\/capnproto,geofft\/capnproto,martindale\/capnproto,mologie\/capnproto,martindale\/capnproto,joliss\/capnproto,kamalmarhubi\/capnproto,MarPiRK\/capnproto,hntrmrrs\/capnproto,hntrmrrs\/capnproto,zarvox\/capnproto,kamalmarhubi\/capnproto,martindale\/capnproto,kamalmarhubi\/capnproto,mologie\/capnproto,bsn069\/capnproto,mrdomino\/capnproto,jparyani\/capnproto,ocdtrekkie\/capnproto,MarPiRK\/capnproto,ocdtrekkie\/capnproto,bryce-gibson\/capnproto,johnkdoe\/capnproto,geofft\/capnproto,bsn069\/capnproto,a-richardson\/capnproto,nagyistoce\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to convert a persistent capability reference into a live one.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf services. This\n# level should be considered only a temporary stepping-stone toward level 1 as the lack of object\n# references drastically changes how protocols are designed. Applications _should not_ attempt\n# to design their protocols around the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities -- i.e. capabilities that remain valid even after disconnect, and can be restored\n# on a future connection.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message which replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages which (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` which had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, which eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise which is known to resolve back to a\n # capability hoste by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise which is known to resolve to a third-party\n # capability which the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target @1 :MessageTarget;\n # What is to be saved.\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released -- thus\n # `Delete` behaves like POSIX's `unlink()` when called on a file that is currently open.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `ReleaseEmbargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `ReleaseEmbargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = AnyPointer;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = AnyPointer;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to convert a persistent capability reference into a live one.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf services. This\n# level should be considered only a temporary stepping-stone toward level 1 as the lack of object\n# references drastically changes how protocols are designed. Applications _should not_ attempt\n# to design their protocols around the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities -- i.e. capabilities that remain valid even after disconnect, and can be restored\n# on a future connection.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message which replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages which (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` which had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are to other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller still wants to receive it \/ hasn't yet finished processing it. It could\n # also be useful to notify the server that it need not marshal the results because the caller\n # doesn't want them anyway, even if the caller is still sending pipelined calls, although this\n # seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, which eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise which is known to resolve back to a\n # capability hoste by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise which is known to resolve to a third-party\n # capability which the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target @1 :MessageTarget;\n # What is to be saved.\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released -- thus\n # `Delete` behaves like POSIX's `unlink()` when called on a file that is currently open.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `ReleaseEmbargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `ReleaseEmbargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = AnyPointer;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = AnyPointer;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"0230f6448493d378df5227f0eb83e66e8692219a","subject":"Reword CapDescriptor.senderHosted description in RPC spec","message":"Reword CapDescriptor.senderHosted description in RPC spec\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability exported by the sender. This may or may not be a new ID in the sender's export\n # table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"1f5933556f1a4a0743835d9c2f46539bfe57e752","subject":"adding in sequence and frame numbers","message":"adding in sequence and frame numbers\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/core\/metadata.capnp","new_file":"src\/core\/metadata.capnp","new_contents":"@0xc61bac6a340f9df1;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing SequenceNumber = UInt16;\nusing FrameNumber = UInt32;\n\nstruct Version\n{\n numberA @0 :UInt8;\n numberB @1 :UInt8;\n numberC @2 :UInt8;\n numberD @3 :UInt8;\n}\n","old_contents":"@0xc61bac6a340f9df1;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nstruct Version\n{\n numberA @0 :UInt8;\n numberB @1 :UInt8;\n numberC @2 :UInt8;\n numberD @3 :UInt8;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"e498bd3a7aa0c39f8ed918f91d4c541056c8b1f3","subject":"Fix typo in grammar.capnp.","message":"Fix typo in grammar.capnp.","repos":"geofft\/capnproto,pjulien\/capnproto,MarPiRK\/capnproto,martindale\/capnproto,nagyistoce\/capnproto,pjulien\/capnproto,mrdomino\/capnproto,modulexcite\/capnproto,johnkdoe\/capnproto,zarvox\/capnproto,nagyistoce\/capnproto,ligzy\/capnproto,bryce-gibson\/capnproto,kamalmarhubi\/capnproto,jparyani\/capnproto,geofft\/capnproto,hntrmrrs\/capnproto,bsn069\/capnproto,joliss\/capnproto,ocdtrekkie\/capnproto,vladon\/capnproto,ocdtrekkie\/capnproto,ligzy\/capnproto,nagyistoce\/capnproto,johnkdoe\/capnproto,MarPiRK\/capnproto,bsn069\/capnproto,vladon\/capnproto,pjulien\/capnproto,kamalmarhubi\/capnproto,maurer\/capnproto,a-richardson\/capnproto,johnkdoe\/capnproto,mologie\/capnproto,maurer\/capnproto,mologie\/capnproto,ocdtrekkie\/capnproto,martindale\/capnproto,kamalmarhubi\/capnproto,jparyani\/capnproto,Fraser999\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,modulexcite\/capnproto,mrdomino\/capnproto,zarvox\/capnproto,rcrowder\/capnproto,a-richardson\/capnproto,bsn069\/capnproto,rcrowder\/capnproto,modulexcite\/capnproto,MarPiRK\/capnproto,a-richardson\/capnproto,joliss\/capnproto,Fraser999\/capnproto,bryce-gibson\/capnproto,maurer\/capnproto,vladon\/capnproto,khklau\/capnproto,bryce-gibson\/capnproto,martindale\/capnproto,geofft\/capnproto,ligzy\/capnproto,hntrmrrs\/capnproto,joliss\/capnproto,rcrowder\/capnproto,mologie\/capnproto,khklau\/capnproto,khklau\/capnproto,Fraser999\/capnproto,zarvox\/capnproto,jparyani\/capnproto","old_file":"c++\/src\/capnp\/compiler\/grammar.capnp","new_file":"c++\/src\/capnp\/compiler\/grammar.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xc56be168dcbbc3c6;\n# The structures in this file correspond to the AST of the Cap'n Proto schema language.\n#\n# This file is intended to be used internally by capnpc. Mostly, it is useful because it is more\n# convenient than defining data classes in C++, particularly where variant types (unions) are\n# needed. Over time, this file may change in backwards-incompatible ways.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n$Cxx.namespace(\"capnp::compiler\");\n\n# TODO(someday): Here's a case where parameterized types might be nice, but note that it would\n# need to support primitive parameters...\nstruct LocatedText {\n value @0 :Text;\n startByte @1 :UInt32;\n endByte @2 :UInt32;\n}\n\nstruct LocatedInteger {\n value @0 :UInt64;\n startByte @1 :UInt32;\n endByte @2 :UInt32;\n}\n\nstruct LocatedFloat {\n value @0 :Float64;\n startByte @1 :UInt32;\n endByte @2 :UInt32;\n}\n\nstruct DeclName {\n # An expressing naming a thing declared elsewhere. Examples:\n # * `MyType`\n # * `foo.bar.Baz`\n # * `.absolute.path.to.SomeType`\n # * `import \"foo.capnp\"`\n\n base :union {\n # The first element of the name.\n\n absoluteName @0 :LocatedText; # A symbol at the global scope.\n relativeName @1 :LocatedText; # A symbol that should be looked up lexically.\n importName @2 :LocatedText; # A file name to import.\n }\n\n memberPath @3 :List(LocatedText);\n # List of `.member` suffixes.\n\n startByte @4 :UInt32;\n endByte @5 :UInt32;\n}\n\nstruct TypeExpression {\n # An expression evaluating to a type.\n\n name @0 :DeclName;\n # Name of the type declaration.\n\n params @1 :List(TypeExpression);\n # Type parameters, if any. E.g. `List(Foo)` has one type parameter `Foo`.\n #\n # If a param failed to parse, its `name` may be null, and it should be ignored.\n\n startByte @2 :UInt32;\n endByte @3 :UInt32;\n}\n\nstruct ValueExpression {\n # An expression evaluating to a value.\n\n union {\n unknown @0 :Void; # e.g. parse error; downstream should ignore\n positiveInt @1 :UInt64;\n negativeInt @2 :UInt64;\n float @3 :Float64;\n string @4 :Text;\n binary @10 :Data;\n name @5 :DeclName;\n list @6 :List(ValueExpression);\n struct @7 :List(FieldAssignment);\n }\n\n struct FieldAssignment {\n fieldName @0 :LocatedText;\n value @1 :ValueExpression;\n }\n\n startByte @8 :UInt32;\n endByte @9 :UInt32;\n}\n\nstruct Declaration {\n # A declaration statement.\n\n name @0 :LocatedText;\n\n id :union {\n unspecified @1 :Void;\n uid @2 :LocatedInteger;\n ordinal @3 :LocatedInteger; # limited to 16 bits\n }\n\n nestedDecls @4 :List(Declaration);\n\n annotations @5 :List(AnnotationApplication);\n struct AnnotationApplication {\n name @0 :DeclName;\n\n value :union {\n none @1 :Void; # None specified; implies void value.\n expression @2 :ValueExpression;\n }\n }\n\n startByte @6 :UInt32;\n endByte @7 :UInt32;\n\n docComment @8 :Text;\n\n union {\n file @9 :Void;\n\n using :group {\n target @10 :DeclName;\n }\n\n const :group {\n type @11 :TypeExpression;\n value @12 :ValueExpression;\n }\n\n enum @13 :Void;\n enumerant @14 :Void;\n\n struct @15 :Void;\n field :group {\n type @16 :TypeExpression;\n defaultValue :union {\n none @17 :Void;\n value @18 :ValueExpression;\n }\n }\n union @19 :Void;\n group @20 :Void;\n\n interface :group {\n extends @21 :List(DeclName);\n }\n method :group {\n params @22 :ParamList;\n results :union {\n none @23 :Void;\n explicit @24 :ParamList;\n }\n }\n\n annotation :group {\n type @25 :TypeExpression;\n\n targetsFile @26 :Bool;\n targetsConst @27 :Bool;\n targetsEnum @28 :Bool;\n targetsEnumerant @29 :Bool;\n targetsStruct @30 :Bool;\n targetsField @31 :Bool;\n targetsUnion @32 :Bool;\n targetsGroup @33 :Bool;\n targetsInterface @34 :Bool;\n targetsMethod @35 :Bool;\n targetsParam @36 :Bool;\n targetsAnnotation @37 :Bool;\n }\n\n nakedId @38 :LocatedInteger;\n nakedAnnotation @39 :AnnotationApplication;\n # A floating UID or annotation (allowed at the file top level).\n\n # The following declaration types are not produced by the parser, but are declared here\n # so that the compiler can handle symbol name lookups more uniformly.\n #\n # New union members added here will magically become visible in the global scope.\n # E.g. \"builtinFoo\" becomes visible as \"Foo\".\n builtinVoid @40 :Void;\n builtinBool @41 :Void;\n builtinInt8 @42 :Void;\n builtinInt16 @43 :Void;\n builtinInt32 @44 :Void;\n builtinInt64 @45 :Void;\n builtinUInt8 @46 :Void;\n builtinUInt16 @47 :Void;\n builtinUInt32 @48 :Void;\n builtinUInt64 @49 :Void;\n builtinFloat32 @50 :Void;\n builtinFloat64 @51 :Void;\n builtinText @52 :Void;\n builtinData @53 :Void;\n builtinList @54 :Void;\n builtinObject @55 :Void; # only for \"renamed to AnyPointer\" error message\n builtinAnyPointer @56 :Void;\n }\n\n struct ParamList {\n # A list of method parameters or method returns.\n\n union {\n namedList @0 :List(Param);\n\n type @1 :DeclName;\n # Specified some other struct type instead of a named list.\n }\n\n startByte @2 :UInt32;\n endByte @3 :UInt32;\n }\n struct Param {\n name @0 :LocatedText; # If null, param failed to parse.\n type @1 :TypeExpression;\n annotations @2 :List(AnnotationApplication);\n defaultValue :union {\n none @3 :Void;\n value @4 :ValueExpression;\n }\n\n startByte @5 :UInt32;\n endByte @6 :UInt32;\n }\n}\n\nstruct ParsedFile {\n root @0 :Declaration;\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xc56be168dcbbc3c6;\n# The structures in this file correspond to the AST of the Cap'n Proto schema language.\n#\n# This file is intended to be used internally by capnpc. Mostly, it is useful because it is more\n# convenient that defining data classes in C++, particularly where variant types (unions) are\n# needed. Over time, this file may change in backwards-incompatible ways.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n$Cxx.namespace(\"capnp::compiler\");\n\n# TODO(someday): Here's a case where parameterized types might be nice, but note that it would\n# need to support primitive parameters...\nstruct LocatedText {\n value @0 :Text;\n startByte @1 :UInt32;\n endByte @2 :UInt32;\n}\n\nstruct LocatedInteger {\n value @0 :UInt64;\n startByte @1 :UInt32;\n endByte @2 :UInt32;\n}\n\nstruct LocatedFloat {\n value @0 :Float64;\n startByte @1 :UInt32;\n endByte @2 :UInt32;\n}\n\nstruct DeclName {\n # An expressing naming a thing declared elsewhere. Examples:\n # * `MyType`\n # * `foo.bar.Baz`\n # * `.absolute.path.to.SomeType`\n # * `import \"foo.capnp\"`\n\n base :union {\n # The first element of the name.\n\n absoluteName @0 :LocatedText; # A symbol at the global scope.\n relativeName @1 :LocatedText; # A symbol that should be looked up lexically.\n importName @2 :LocatedText; # A file name to import.\n }\n\n memberPath @3 :List(LocatedText);\n # List of `.member` suffixes.\n\n startByte @4 :UInt32;\n endByte @5 :UInt32;\n}\n\nstruct TypeExpression {\n # An expression evaluating to a type.\n\n name @0 :DeclName;\n # Name of the type declaration.\n\n params @1 :List(TypeExpression);\n # Type parameters, if any. E.g. `List(Foo)` has one type parameter `Foo`.\n #\n # If a param failed to parse, its `name` may be null, and it should be ignored.\n\n startByte @2 :UInt32;\n endByte @3 :UInt32;\n}\n\nstruct ValueExpression {\n # An expression evaluating to a value.\n\n union {\n unknown @0 :Void; # e.g. parse error; downstream should ignore\n positiveInt @1 :UInt64;\n negativeInt @2 :UInt64;\n float @3 :Float64;\n string @4 :Text;\n binary @10 :Data;\n name @5 :DeclName;\n list @6 :List(ValueExpression);\n struct @7 :List(FieldAssignment);\n }\n\n struct FieldAssignment {\n fieldName @0 :LocatedText;\n value @1 :ValueExpression;\n }\n\n startByte @8 :UInt32;\n endByte @9 :UInt32;\n}\n\nstruct Declaration {\n # A declaration statement.\n\n name @0 :LocatedText;\n\n id :union {\n unspecified @1 :Void;\n uid @2 :LocatedInteger;\n ordinal @3 :LocatedInteger; # limited to 16 bits\n }\n\n nestedDecls @4 :List(Declaration);\n\n annotations @5 :List(AnnotationApplication);\n struct AnnotationApplication {\n name @0 :DeclName;\n\n value :union {\n none @1 :Void; # None specified; implies void value.\n expression @2 :ValueExpression;\n }\n }\n\n startByte @6 :UInt32;\n endByte @7 :UInt32;\n\n docComment @8 :Text;\n\n union {\n file @9 :Void;\n\n using :group {\n target @10 :DeclName;\n }\n\n const :group {\n type @11 :TypeExpression;\n value @12 :ValueExpression;\n }\n\n enum @13 :Void;\n enumerant @14 :Void;\n\n struct @15 :Void;\n field :group {\n type @16 :TypeExpression;\n defaultValue :union {\n none @17 :Void;\n value @18 :ValueExpression;\n }\n }\n union @19 :Void;\n group @20 :Void;\n\n interface :group {\n extends @21 :List(DeclName);\n }\n method :group {\n params @22 :ParamList;\n results :union {\n none @23 :Void;\n explicit @24 :ParamList;\n }\n }\n\n annotation :group {\n type @25 :TypeExpression;\n\n targetsFile @26 :Bool;\n targetsConst @27 :Bool;\n targetsEnum @28 :Bool;\n targetsEnumerant @29 :Bool;\n targetsStruct @30 :Bool;\n targetsField @31 :Bool;\n targetsUnion @32 :Bool;\n targetsGroup @33 :Bool;\n targetsInterface @34 :Bool;\n targetsMethod @35 :Bool;\n targetsParam @36 :Bool;\n targetsAnnotation @37 :Bool;\n }\n\n nakedId @38 :LocatedInteger;\n nakedAnnotation @39 :AnnotationApplication;\n # A floating UID or annotation (allowed at the file top level).\n\n # The following declaration types are not produced by the parser, but are declared here\n # so that the compiler can handle symbol name lookups more uniformly.\n #\n # New union members added here will magically become visible in the global scope.\n # E.g. \"builtinFoo\" becomes visible as \"Foo\".\n builtinVoid @40 :Void;\n builtinBool @41 :Void;\n builtinInt8 @42 :Void;\n builtinInt16 @43 :Void;\n builtinInt32 @44 :Void;\n builtinInt64 @45 :Void;\n builtinUInt8 @46 :Void;\n builtinUInt16 @47 :Void;\n builtinUInt32 @48 :Void;\n builtinUInt64 @49 :Void;\n builtinFloat32 @50 :Void;\n builtinFloat64 @51 :Void;\n builtinText @52 :Void;\n builtinData @53 :Void;\n builtinList @54 :Void;\n builtinObject @55 :Void; # only for \"renamed to AnyPointer\" error message\n builtinAnyPointer @56 :Void;\n }\n\n struct ParamList {\n # A list of method parameters or method returns.\n\n union {\n namedList @0 :List(Param);\n\n type @1 :DeclName;\n # Specified some other struct type instead of a named list.\n }\n\n startByte @2 :UInt32;\n endByte @3 :UInt32;\n }\n struct Param {\n name @0 :LocatedText; # If null, param failed to parse.\n type @1 :TypeExpression;\n annotations @2 :List(AnnotationApplication);\n defaultValue :union {\n none @3 :Void;\n value @4 :ValueExpression;\n }\n\n startByte @5 :UInt32;\n endByte @6 :UInt32;\n }\n}\n\nstruct ParsedFile {\n root @0 :Declaration;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"36a996617781e1f0782f1c09efc7a0447aadfaef","subject":"Change Sandstorm 'New instance' to 'New notebook'","message":"Change Sandstorm 'New instance' to 'New notebook'\n","repos":"keybits\/permanote,keybits\/permanote,keybits\/permanote,keybits\/permanote,keybits\/permanote","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xa821a41ffa687175;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"svwrpwnd3c380d1f99ge7g0qnjdq6y785c36s7qtqryxwkmn20qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Permanote\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Notebook\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin24.png\",\n dpi2x = embed \"app-graphics\/permanote-dolphin48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin150.png\")),\n marketBig = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin300.png\"))\n ),\n website = \"https:\/\/github.com\/keybits\/permanote\",\n codeUrl = \"https:\/\/github.com\/keybits\/permanote\",\n license = (openSource = mit),\n categories = [productivity],\n author = (\n contactEmail = \"tom@keybits.net\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Note-taking\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 841, height = 618, png = embed \"screenshots\/permanote-screen-0.png\"),\n (width = 870, height = 765, png = embed \"screenshots\/permanote-screen-1.png\"),\n (width = 883, height = 548, png = embed \"screenshots\/permanote-screen-2.png\"),\n (width = 842, height = 536, png = embed \"screenshots\/permanote-screen-3.png\"),\n (width = 858, height = 804, png = embed \"screenshots\/permanote-screen-4.png\"),\n (width = 869, height = 813, png = embed \"screenshots\/permanote-screen-5.png\"),\n (width = 858, height = 467, png = embed \"screenshots\/permanote-screen-6.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PYTHONPATH\", value = \"\/opt\/app\"),\n (key = \"HOME\", value = \"\/var\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","old_contents":"@0xa821a41ffa687175;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"svwrpwnd3c380d1f99ge7g0qnjdq6y785c36s7qtqryxwkmn20qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Permanote\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin24.png\",\n dpi2x = embed \"app-graphics\/permanote-dolphin48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin150.png\")),\n marketBig = (png = (dpi1x = embed \"app-graphics\/permanote-dolphin300.png\"))\n ),\n website = \"https:\/\/github.com\/keybits\/permanote\",\n codeUrl = \"https:\/\/github.com\/keybits\/permanote\",\n license = (openSource = mit),\n categories = [productivity],\n author = (\n contactEmail = \"tom@keybits.net\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Note-taking\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 841, height = 618, png = embed \"screenshots\/permanote-screen-0.png\"),\n (width = 870, height = 765, png = embed \"screenshots\/permanote-screen-1.png\"),\n (width = 883, height = 548, png = embed \"screenshots\/permanote-screen-2.png\"),\n (width = 842, height = 536, png = embed \"screenshots\/permanote-screen-3.png\"),\n (width = 858, height = 804, png = embed \"screenshots\/permanote-screen-4.png\"),\n (width = 869, height = 813, png = embed \"screenshots\/permanote-screen-5.png\"),\n (width = 858, height = 467, png = embed \"screenshots\/permanote-screen-6.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PYTHONPATH\", value = \"\/opt\/app\"),\n (key = \"HOME\", value = \"\/var\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"31484c0f780c784c498a7b20729fa6d0bb5fc2a3","subject":"Add openFile and delete procedures","message":"Add openFile and delete procedures\n","repos":"nokaa\/forge,nokaa\/anvil","old_file":"rpc\/rpc.capnp","new_file":"rpc\/rpc.capnp","new_contents":"@0xc020c6481d06e29b;\n\ninterface Editor {\n # An editor.\n\n openFile @0 (path: Text);\n # Opens `path` for editing. If `path` does not exist, it is created.\n\n writeFile @1 (path: Text);\n # Writes the contents of this editor to the file specified by path.\n\n insert @2 (line: UInt64, column: UInt64, string: Text);\n # Inserts `string` at [`line`][`column`] of the file.\n\n delete @3 (line: UInt64, column: UInt64, length: UInt64);\n # Delete the string at [`line`][`column`] with `length`.\n\n quit @4 ();\n # Quits this editor.\n}\n","old_contents":"@0xc020c6481d06e29b;\n\ninterface Editor {\n # An editor.\n\n insert @0 (line: UInt64, column: UInt64, string: Text);\n # Inserts `string` at [`line`][`column`] of the file.\n\n writeFile @1 (path: Text);\n # Writes the contents of this editor to the file specified by path.\n\n quit @2 ();\n # Quits this editor.\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"d37a4e5b0627ac277e5c95b680267bbf4e8c482b","subject":"Changes after feedback","message":"Changes after feedback\n","repos":"utensil\/nupic.core,jaredweiss\/nupic.core,pettitda\/nupic.core,brev\/nupic.core,lscheinkman\/nupic.core,Bemujo\/https-github.com-numenta-nupic,sambitgaan\/nupic.core,rhyolight\/nupic.core,akhilaananthram\/nupic.core,rcrowder\/nupic.core,subutai\/nupic.core,rhyolight\/nupic.core,brev\/nupic.core,metaml\/nupic.core,metaml\/nupic.core,subutai\/nupic.core,brev\/nupic.core,scottpurdy\/nupic.core,Bemujo\/https-github.com-numenta-nupic,akhilaananthram\/nupic.core,rhyolight\/nupic.core,jaredweiss\/nupic.core,EricSB\/nupic.core,lscheinkman\/nupic.core,jaredweiss\/nupic.core,numenta\/htmresearch-core,ywcui1990\/nupic.core,metaml\/nupic.core,pettitda\/nupic.core,utensil\/nupic.core,numenta\/htmresearch-core,metaml\/nupic.core,rcrowder\/nupic.core,scottpurdy\/nupic.core,Bemujo\/https-github.com-numenta-nupic,scottpurdy\/nupic.core,breznak\/nupic.core,lscheinkman\/nupic.core,neuroidss\/nupic.core,lscheinkman\/nupic.core,ywcui1990\/nupic.core,EricSB\/nupic.core,neuroidss\/nupic.core,sambitgaan\/nupic.core,numenta\/nupic.core,rhyolight\/nupic.core,rcrowder\/nupic.core,neuroidss\/nupic.core,EricSB\/nupic.core,jaredweiss\/nupic.core,utensil\/nupic.core,numenta\/htmresearch-core,numenta\/htmresearch-core,brev\/nupic.core,pettitda\/nupic.core,Bemujo\/https-github.com-numenta-nupic,pettitda\/nupic.core,sambitgaan\/nupic.core,subutai\/nupic.core,akhilaananthram\/nupic.core,numenta\/nupic.core,akhilaananthram\/nupic.core,numenta\/nupic.core,rcrowder\/nupic.core,subutai\/nupic.core,numenta\/nupic.core,breznak\/nupic.core,breznak\/nupic.core,scottpurdy\/nupic.core,neuroidss\/nupic.core,breznak\/nupic.core,ywcui1990\/nupic.core,utensil\/nupic.core,EricSB\/nupic.core,ywcui1990\/nupic.core,sambitgaan\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryV1.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryV1.capnp","new_contents":"@0xa64ad1d724c51d4c;\n\n# TODO: Use absolute path\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 72\nstruct TemporalMemoryV1Proto {\n verbosity @0 :UInt8;\n random @1 :RandomProto;\n\n numberOfCols @2 :UInt32;\n cellsPerColumn @3 :UInt32;\n maxSegmentsPerCell @4 :Int32;\n\n activationThreshold @5 :UInt32;\n minThreshold @6 :UInt32;\n segUpdateValidDuration @7 :UInt32;\n newSynapseCount @8 :UInt32;\n maxSynapsesPerSegment @9 :Int32;\n initSegFreq @10 :Float32;\n\n initialPerm @11 :Float32;\n connectedPerm @12 :Float32;\n permanenceMax @13 :Float32;\n permanenceDec @14 :Float32;\n permanenceInc @15 :Float32;\n checkSynapseConsistency @16 :Bool;\n\n doPooling @17 :Bool;\n globalDecay @18 :Float32;\n maxAge @19 :UInt32;\n maxInfBacktrack @20 :UInt32;\n maxLrnBacktrack @21 :UInt32;\n pamLength @22 :UInt32;\n pamCounter @23 :UInt32;\n learnedSeqLength @24 :UInt32;\n avgLearnedSeqLength @25 :Float32;\n maxSeqLength @26 :UInt32;\n avgInputDensity @27 :Float32;\n outputType @28 : Text;\n burnIn @29 : UInt32;\n collectStats @30 : Bool;\n collectSequenceStats @31 :Bool;\n\n iterationIdx @32 :UInt32;\n lrnIterationIdx @33 :UInt32;\n resetCalled @34 :Bool;\n nextSegIdx @35 :UInt32;\n\n cells @36 :List(Cell);\n segmentUpdates @37 :List(SegmentUpdate);\n\n ownsMemory @38 :Bool;\n lrnActiveStateT1 @39 :List(UInt8);\n lrnActiveStateT @40 :List(UInt8);\n lrnPredictedStateT1 @41 :List(UInt8);\n lrnPredictedStateT @42 :List(UInt8);\n infActiveStateT1 @43 :List(UInt8);\n infActiveStateT @44 :List(UInt8);\n infActiveStateBackup @45 :List(UInt8);\n infActiveStateCandidate @46 :List(UInt8);\n infPredictedStateT1 @47 :List(UInt8);\n infPredictedStateT @48 :List(UInt8);\n cellConfidenceT1 @49 :List(Float32);\n cellConfidenceT @50 :List(Float32);\n colConfidenceT1 @51 :List(Float32);\n colConfidenceT @52 :List(Float32);\n\n prevLrnPatterns @53 :List(List(UInt32));\n prevInfPatterns @54 :List(List(UInt32));\n\n statsNumInfersSinceReset @55 : UInt32;\n statsNumPredictions @56 : UInt32;\n statsCurPredictionScore2 @57 :Float32;\n statsPredictionScoreTotal2 @58 :Float32;\n statsCurFalseNegativeScore @59 :Float32;\n statsFalseNegativeScoreTotal @60 :Float32;\n statsCurFalsePositiveScore @61 :Float32;\n statsFalsePositiveScoreTotal @62 :Float32;\n statsPctExtraTotal @63 :Float32;\n statsPctMissingTotal @64 :Float32;\n statsCurMissing @65 : UInt32;\n statsCurExtra @66 : UInt32;\n statsTotalMissing @67 : UInt32;\n statsTotalExtra @68 : UInt32;\n statsPrevSequenceSignature @69 :List(Float32);\n statsConfHistogram @70 :List(List(Float32));\n\n # Next ID: 1\n struct Cell {\n segments @0 :List(Segment);\n }\n\n # Next ID: 10\n struct Segment {\n segIdx @0 :UInt32;\n sequenceSegment @1 :Bool;\n frequency @2 :Float32;\n numConnectedSynapses @3 :UInt32;\n totalActivations @4 :UInt32;\n positiveActivations @5 :UInt32;\n lastActiveIteration @6 :UInt32;\n lastPosDutyCycle @7 :Float32;\n lastPosDutyCycleIteration @8 :UInt32;\n synapses @9 :List(Synapse);\n }\n\n # Next ID: 2\n struct Synapse {\n srcCellIdx @0 :UInt64;\n permanence @1 :Float32;\n }\n\n # Next ID: 8\n struct SegmentUpdate {\n cellIdx @0 :UInt32;\n segIdx @1 :UInt32;\n sequenceSegment @2 :Bool;\n synapses @3 :List(UInt32);\n newSynapses @4 :List(UInt32);\n lrnIterationIdx @5 :UInt32;\n phase1 @6 :Bool;\n weaklyPredicting @7 :Bool;\n }\n}\n","old_contents":"@0xa64ad1d724c51d4c;\n\n# TODO: Use absolute path\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: ???\nstruct TemporalMemoryV1Proto {\n version @0 :UInt16;\n verbosity @1 :UInt8;\n random @2 :RandomProto;\n\n numberOfCols @3 :UInt32;\n cellsPerColumn @4 :UInt32;\n maxSegmentsPerCell @5 :UInt32;\n\n activationThreshold @6 :UInt32;\n minThreshold @7 :UInt32;\n segUpdateValidDuration @8 :UInt32;\n newSynapseCount @9 :UInt32;\n maxSynapsesPerSegment @10 :UInt32;\n initSegFreq @11 :Float32;\n\n initialPerm @12 :Float32;\n connectedPerm @13 :Float32;\n permanenceMax @14 :Float32;\n permanenceDec @15 :Float32;\n permanenceInc @16 :Float32;\n checkSynapseConsistency @17 :Bool;\n\n doPooling @18 :Bool;\n globalDecay @19 :Float32;\n maxAge @20 :UInt32;\n maxInfBacktrack @21 :UInt32;\n maxLrnBacktrack @22 :UInt32;\n pamLength @23 :UInt32;\n pamCounter @24 :UInt32;\n learnedSeqLength @25 :UInt32;\n avgLearnedSeqLength @26 :Float32;\n maxSeqLength @27 :UInt32;\n avgInputDensity @28 :Float32;\n outputType @29 : Text;\n burnIn @30 : UInt32;\n collectStats @31 : Bool;\n collectSequenceStats @32 :Bool;\n\n iterationIdx @33 :UInt32;\n lrnIterationIdx @34 :UInt32;\n resetCalled @35 :Bool;\n nextSegIdx @36 :UInt32;\n\n cells @37 :List(Cell);\n segmentUpdates @38 :List(SegmentUpdate);\n\n ownsMemory @39 :Bool;\n lrnActiveStateT1 @40 :List(UInt8);\n lrnActiveStateT @41 :List(UInt8);\n lrnPredictedStateT1 @42 :List(UInt8);\n lrnPredictedStateT @43 :List(UInt8);\n infActiveStateT1 @44 :List(UInt8);\n infActiveStateT @45 :List(UInt8);\n infActiveStateBackup @46 :List(UInt8);\n infActiveStateCandidate @47 :List(UInt8);\n infPredictedStateT1 @48 :List(UInt8);\n infPredictedStateT @49 :List(UInt8);\n cellConfidenceT1 @50 :List(Float32);\n cellConfidenceT @51 :List(Float32);\n colConfidenceT1 @52 :List(Float32);\n colConfidenceT @53 :List(Float32);\n\n prevLrnPatterns @54 :List(List(UInt32));\n prevInfPatterns @55 :List(List(UInt32));\n\n statsNumInfersSinceReset @56 : UInt32;\n statsNumPredictions @57 : UInt32;\n statsCurPredictionScore2 @58 :Float32;\n statsPredictionScoreTotal2 @59 :Float32;\n statsCurFalseNegativeScore @60 :Float32;\n statsFalseNegativeScoreTotal @61 :Float32;\n statsCurFalsePositiveScore @62 :Float32;\n statsFalsePositiveScoreTotal @63 :Float32;\n statsPctExtraTotal @64 :Float32;\n statsPctMissingTotal @65 :Float32;\n statsCurMissing @66 : UInt32;\n statsCurExtra @67 : UInt32;\n statsTotalMissing @68 : UInt32;\n statsTotalExtra @69 : UInt32;\n statsPrevSequenceSignature @70 :List(Float32);\n statsConfHistogram @71 :List(List(Float32));\n\n # Next ID: ???\n struct Cell {\n segments @0 :List(Segment);\n }\n\n # Next ID: ???\n struct Segment {\n segIdx @0 :UInt32;\n sequenceSegment @1 :Bool;\n frequency @2 :Float32;\n numConnectedSynapses @3 :UInt32;\n totalActivations @4 :UInt32;\n positiveActivations @5 :UInt32;\n lastActiveIteration @6 :UInt32;\n lastPosDutyCycle @7 :Float32;\n lastPosDutyCycleIteration @8 :UInt32;\n synapses @9 :List(Synapse);\n }\n\n # Next ID: ???\n struct Synapse {\n srcCellIdx @0 :UInt64;\n permanence @1 :Float32;\n }\n\n # Next ID: ???\n struct SegmentUpdate {\n cellIdx @0 :UInt32;\n segIdx @1 :UInt32;\n sequenceSegment @2 :Bool;\n synapses @3 :List(UInt32);\n newSynapses @4 :List(UInt64);\n lrnIterationIdx @5 :UInt32;\n phase1 @6 :Bool;\n weaklyPredicting @7 :Bool;\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"563973177144dc3a415c6e6faac85647f6516ba8","subject":"Import schema from upstream Cap'n Proto","message":"Import schema from upstream Cap'n Proto\n\nTaken from Cap'n Proto 0.5.0 release:\n225eda22f8f3fa4921af0eb5fb6f097cce54987a\n","repos":"zombiezen\/go-capnproto2,zombiezen\/go-capnproto2,hodduc\/go-capnproto2,zombiezen\/go-capnproto,zombiezen\/go-capnproto,hodduc\/go-capnproto2","old_file":"capnpc-go\/schema.capnp","new_file":"capnpc-go\/schema.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nusing Go = import \"..\/go.capnp\";\n\n@0xa93fc509624c72d9;\n$Go.package(\"main\");\n$Go.import(\"github.com\/glycerine\/go-capnproto\/capnpc-go\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n parameters @32 :List(Parameter);\n # If this node is parameterized (generic), the list of parameters. Empty for non-generic types.\n\n isGeneric @33 :Bool;\n # True if this node is generic, meaning that it or one of its parent scopes has a non-empty\n # `parameters`.\n\n struct Parameter {\n # Information about one of the node's parameters.\n\n name @0 :Text;\n }\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n\n superclasses @31 :List(Superclass);\n # Superclasses of this interface.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n const noDiscriminant :UInt16 = 0xffff;\n\n discriminantValue @3 :UInt16 = Field.noDiscriminant;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff.\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n\n hadExplicitDefault @10 :Bool;\n # Whether the default value was specified explicitly. Non-explicit default values are always\n # zero or empty values. Usually, whether the default value was explicit shouldn't matter.\n # The main use case for this flag is for structs representing method parameters:\n # explicitly-defaulted parameters may be allowed to be omitted when calling the method.\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Superclass {\n id @0 :Id;\n brand @1 :Brand;\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n implicitParameters @7 :List(Node.Parameter);\n # The parameters listed in [] (typically, type \/ generic parameters), whose bindings are intended\n # to be inferred rather than specified explicitly, although not all languages support this.\n\n paramStructType @2 :Id;\n # ID of the parameter struct type. If a named parameter list was specified in the method\n # declaration (rather than a single struct parameter type) then a corresponding struct type is\n # auto-generated. Such an auto-generated type will not be listed in the interface's\n # `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.\n # (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes\n # this a situation where you can't just climb the scope chain to find where a particular\n # generic parameter was introduced. Making the `scopeId` zero was a mistake.)\n\n paramBrand @5 :Brand;\n # Brand of param struct type.\n\n resultStructType @3 :Id;\n # ID of the return struct type; similar to `paramStructType`.\n\n resultBrand @6 :Brand;\n # Brand of result struct type.\n\n annotations @4 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n brand @21 :Brand;\n }\n struct :group {\n typeId @16 :Id;\n brand @22 :Brand;\n }\n interface :group {\n typeId @17 :Id;\n brand @23 :Brand;\n }\n\n anyPointer :union {\n unconstrained @18 :Void;\n # A regular AnyPointer.\n\n parameter :group {\n # This is actually a reference to a type parameter defined within this scope.\n\n scopeId @19 :Id;\n # ID of the generic type whose parameter we're referencing. This should be a parent of the\n # current scope.\n\n parameterIndex @20 :UInt16;\n # Index of the parameter within the generic type's parameter list.\n }\n\n implicitMethodParameter :group {\n # This is actually a reference to an implicit (generic) parameter of a method. The only\n # legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.\n\n parameterIndex @24 :UInt16;\n }\n }\n }\n}\n\nstruct Brand {\n # Specifies bindings for parameters of generics. Since these bindings turn a generic into a\n # non-generic, we call it the \"brand\".\n\n scopes @0 :List(Scope);\n # For each of the target type and each of its parent scopes, a parameterization may be included\n # in this list. If no parameterization is included for a particular relevant scope, then either\n # that scope has no parameters or all parameters should be considered to be `AnyPointer`.\n\n struct Scope {\n scopeId @0 :Id;\n # ID of the scope to which these params apply.\n\n union {\n bind @1 :List(Binding);\n # List of parameter bindings.\n\n inherit @2 :Void;\n # The place where this Brand appears is actually within this scope or a sub-scope,\n # and the bindings for this scope should be inherited from the reference point.\n }\n }\n\n struct Binding {\n union {\n unbound @0 :Void;\n type @1 :Type;\n\n # TODO(someday): Allow non-type parameters? Unsure if useful.\n }\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :AnyPointer;\n\n enum @15 :UInt16;\n struct @16 :AnyPointer;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n anyPointer @18 :AnyPointer;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n brand @2 :Brand;\n # Brand of the annotation.\n #\n # Note that the annotation itself is not allowed to be parameterized, but its scope might be.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CodeGeneratorRequest {\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nusing Go = import \"..\/go.capnp\";\n\n@0xa93fc509624c72d9;\n$Go.package(\"main\");\n$Go.import(\"github.com\/glycerine\/go-capnproto\/capnpc-go\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.name, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n discriminantValue @3 :UInt16 = 0xffff;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff (so hasDiscriminantValue()\n # returns false).\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n params @2 :List(Param);\n struct Param {\n name @0 :Text;\n type @1 :Type;\n defaultValue @2 :Value;\n annotations @3 :List(Annotation);\n }\n\n requiredParamCount @3 :UInt16;\n # One plus the index of the last parameter that has no default value. In languages where\n # method calls look like function calls, this is the minimum number of parameters that must\n # always be specified, while subsequent parameters are optional.\n\n returnType @4 :Type;\n\n annotations @5 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n }\n struct :group {\n typeId @16 :Id;\n }\n interface :group {\n typeId @17 :Id;\n }\n\n object @18 :Void;\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :Object;\n\n enum @15 :UInt16;\n struct @16 :Object;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n object @18 :Object;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CodeGeneratorRequest {\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"8ceb499d280f4360fe7a3f4ed75b93c73233b02a","subject":"Add docstrings to schema.capnp","message":"Add docstrings to schema.capnp\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/schema.capnp","new_file":"c++\/src\/capnp\/schema.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n@0xa93fc509624c72d9;\n$Cxx.namespace(\"capnp::schema\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n parameters @32 :List(Parameter);\n # If this node is parameterized (generic), the list of parameters. Empty for non-generic types.\n\n isGeneric @33 :Bool;\n # True if this node is generic, meaning that it or one of its parent scopes has a non-empty\n # `parameters`.\n\n struct Parameter {\n # Information about one of the node's parameters.\n\n name @0 :Text;\n }\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n\n superclasses @31 :List(Superclass);\n # Superclasses of this interface.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n}\n\nstruct NodeDoc {\n # separate carrier for documentation comments on Nodes,\n # to keep them out of the binary descriptors\n\n id @0 :Id;\n # ID should exist as Node in the same request\n\n docComment @1 :Text;\n\n fieldDocs @2 :List(FieldDoc);\n # valid only if Node is a \"struct\"\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n const noDiscriminant :UInt16 = 0xffff;\n\n discriminantValue @3 :UInt16 = Field.noDiscriminant;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff.\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n\n hadExplicitDefault @10 :Bool;\n # Whether the default value was specified explicitly. Non-explicit default values are always\n # zero or empty values. Usually, whether the default value was explicit shouldn't matter.\n # The main use case for this flag is for structs representing method parameters:\n # explicitly-defaulted parameters may be allowed to be omitted when calling the method.\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct FieldDoc {\n # separate container to carry field docstrings\n\n codeOrder @0 :UInt16;\n docComment @1 :Text;\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Superclass {\n id @0 :Id;\n brand @1 :Brand;\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n implicitParameters @7 :List(Node.Parameter);\n # The parameters listed in [] (typically, type \/ generic parameters), whose bindings are intended\n # to be inferred rather than specified explicitly, although not all languages support this.\n\n paramStructType @2 :Id;\n # ID of the parameter struct type. If a named parameter list was specified in the method\n # declaration (rather than a single struct parameter type) then a corresponding struct type is\n # auto-generated. Such an auto-generated type will not be listed in the interface's\n # `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.\n # (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes\n # this a situation where you can't just climb the scope chain to find where a particular\n # generic parameter was introduced. Making the `scopeId` zero was a mistake.)\n\n paramBrand @5 :Brand;\n # Brand of param struct type.\n\n resultStructType @3 :Id;\n # ID of the return struct type; similar to `paramStructType`.\n\n resultBrand @6 :Brand;\n # Brand of result struct type.\n\n annotations @4 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n brand @21 :Brand;\n }\n struct :group {\n typeId @16 :Id;\n brand @22 :Brand;\n }\n interface :group {\n typeId @17 :Id;\n brand @23 :Brand;\n }\n\n anyPointer :union {\n unconstrained :union {\n # A regular AnyPointer.\n #\n # The name \"unconstrained\" means as opposed to constraining it to match a type parameter.\n # In retrospect this name is probably a poor choice given that it may still be constrained\n # to be a struct, list, or capability.\n\n anyKind @18 :Void; # truly AnyPointer\n struct @25 :Void; # AnyStruct\n list @26 :Void; # AnyList\n capability @27 :Void; # Capability\n }\n\n parameter :group {\n # This is actually a reference to a type parameter defined within this scope.\n\n scopeId @19 :Id;\n # ID of the generic type whose parameter we're referencing. This should be a parent of the\n # current scope.\n\n parameterIndex @20 :UInt16;\n # Index of the parameter within the generic type's parameter list.\n }\n\n implicitMethodParameter :group {\n # This is actually a reference to an implicit (generic) parameter of a method. The only\n # legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.\n\n parameterIndex @24 :UInt16;\n }\n }\n }\n}\n\nstruct Brand {\n # Specifies bindings for parameters of generics. Since these bindings turn a generic into a\n # non-generic, we call it the \"brand\".\n\n scopes @0 :List(Scope);\n # For each of the target type and each of its parent scopes, a parameterization may be included\n # in this list. If no parameterization is included for a particular relevant scope, then either\n # that scope has no parameters or all parameters should be considered to be `AnyPointer`.\n\n struct Scope {\n scopeId @0 :Id;\n # ID of the scope to which these params apply.\n\n union {\n bind @1 :List(Binding);\n # List of parameter bindings.\n\n inherit @2 :Void;\n # The place where this Brand appears is actually within this scope or a sub-scope,\n # and the bindings for this scope should be inherited from the reference point.\n }\n }\n\n struct Binding {\n union {\n unbound @0 :Void;\n type @1 :Type;\n\n # TODO(someday): Allow non-type parameters? Unsure if useful.\n }\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :AnyPointer;\n\n enum @15 :UInt16;\n struct @16 :AnyPointer;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n anyPointer @18 :AnyPointer;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n brand @2 :Brand;\n # Brand of the annotation.\n #\n # Note that the annotation itself is not allowed to be parameterized, but its scope might be.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CapnpVersion {\n major @0 :UInt16;\n minor @1 :UInt8;\n micro @2 :UInt8;\n}\n\nstruct CodeGeneratorRequest {\n capnpVersion @2 :CapnpVersion;\n # Version of the `capnp` executable. Generally, code generators should ignore this, but the code\n # generators that ship with `capnp` itself will print a warning if this mismatches since that\n # probably indicates something is misconfigured.\n #\n # The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version\n # is older than that.\n\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n nodeDocs @3 :List(NodeDoc);\n # documentation comments for nodes, where present\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n@0xa93fc509624c72d9;\n$Cxx.namespace(\"capnp::schema\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n parameters @32 :List(Parameter);\n # If this node is parameterized (generic), the list of parameters. Empty for non-generic types.\n\n isGeneric @33 :Bool;\n # True if this node is generic, meaning that it or one of its parent scopes has a non-empty\n # `parameters`.\n\n struct Parameter {\n # Information about one of the node's parameters.\n\n name @0 :Text;\n }\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n\n superclasses @31 :List(Superclass);\n # Superclasses of this interface.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n const noDiscriminant :UInt16 = 0xffff;\n\n discriminantValue @3 :UInt16 = Field.noDiscriminant;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff.\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n\n hadExplicitDefault @10 :Bool;\n # Whether the default value was specified explicitly. Non-explicit default values are always\n # zero or empty values. Usually, whether the default value was explicit shouldn't matter.\n # The main use case for this flag is for structs representing method parameters:\n # explicitly-defaulted parameters may be allowed to be omitted when calling the method.\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Superclass {\n id @0 :Id;\n brand @1 :Brand;\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n implicitParameters @7 :List(Node.Parameter);\n # The parameters listed in [] (typically, type \/ generic parameters), whose bindings are intended\n # to be inferred rather than specified explicitly, although not all languages support this.\n\n paramStructType @2 :Id;\n # ID of the parameter struct type. If a named parameter list was specified in the method\n # declaration (rather than a single struct parameter type) then a corresponding struct type is\n # auto-generated. Such an auto-generated type will not be listed in the interface's\n # `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.\n # (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes\n # this a situation where you can't just climb the scope chain to find where a particular\n # generic parameter was introduced. Making the `scopeId` zero was a mistake.)\n\n paramBrand @5 :Brand;\n # Brand of param struct type.\n\n resultStructType @3 :Id;\n # ID of the return struct type; similar to `paramStructType`.\n\n resultBrand @6 :Brand;\n # Brand of result struct type.\n\n annotations @4 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n brand @21 :Brand;\n }\n struct :group {\n typeId @16 :Id;\n brand @22 :Brand;\n }\n interface :group {\n typeId @17 :Id;\n brand @23 :Brand;\n }\n\n anyPointer :union {\n unconstrained :union {\n # A regular AnyPointer.\n #\n # The name \"unconstrained\" means as opposed to constraining it to match a type parameter.\n # In retrospect this name is probably a poor choice given that it may still be constrained\n # to be a struct, list, or capability.\n\n anyKind @18 :Void; # truly AnyPointer\n struct @25 :Void; # AnyStruct\n list @26 :Void; # AnyList\n capability @27 :Void; # Capability\n }\n\n parameter :group {\n # This is actually a reference to a type parameter defined within this scope.\n\n scopeId @19 :Id;\n # ID of the generic type whose parameter we're referencing. This should be a parent of the\n # current scope.\n\n parameterIndex @20 :UInt16;\n # Index of the parameter within the generic type's parameter list.\n }\n\n implicitMethodParameter :group {\n # This is actually a reference to an implicit (generic) parameter of a method. The only\n # legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.\n\n parameterIndex @24 :UInt16;\n }\n }\n }\n}\n\nstruct Brand {\n # Specifies bindings for parameters of generics. Since these bindings turn a generic into a\n # non-generic, we call it the \"brand\".\n\n scopes @0 :List(Scope);\n # For each of the target type and each of its parent scopes, a parameterization may be included\n # in this list. If no parameterization is included for a particular relevant scope, then either\n # that scope has no parameters or all parameters should be considered to be `AnyPointer`.\n\n struct Scope {\n scopeId @0 :Id;\n # ID of the scope to which these params apply.\n\n union {\n bind @1 :List(Binding);\n # List of parameter bindings.\n\n inherit @2 :Void;\n # The place where this Brand appears is actually within this scope or a sub-scope,\n # and the bindings for this scope should be inherited from the reference point.\n }\n }\n\n struct Binding {\n union {\n unbound @0 :Void;\n type @1 :Type;\n\n # TODO(someday): Allow non-type parameters? Unsure if useful.\n }\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :AnyPointer;\n\n enum @15 :UInt16;\n struct @16 :AnyPointer;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n anyPointer @18 :AnyPointer;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n brand @2 :Brand;\n # Brand of the annotation.\n #\n # Note that the annotation itself is not allowed to be parameterized, but its scope might be.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CapnpVersion {\n major @0 :UInt16;\n minor @1 :UInt8;\n micro @2 :UInt8;\n}\n\nstruct CodeGeneratorRequest {\n capnpVersion @2 :CapnpVersion;\n # Version of the `capnp` executable. Generally, code generators should ignore this, but the code\n # generators that ship with `capnp` itself will print a warning if this mismatches since that\n # probably indicates something is misconfigured.\n #\n # The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version\n # is older than that.\n\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"948f74d804927caacc73680bdd7a29365cd02a86","subject":"Updated capnp schema to conform with new union rules","message":"Updated capnp schema to conform with new union rules\n","repos":"rcrowder\/pycapnp,SymbiFlow\/pycapnp,SymbiFlow\/pycapnp,jparyani\/pycapnp,tempbottle\/pycapnp,SymbiFlow\/pycapnp,tempbottle\/pycapnp,jparyani\/pycapnp,rcrowder\/pycapnp,jparyani\/pycapnp,SymbiFlow\/pycapnp,tempbottle\/pycapnp,rcrowder\/pycapnp,tempbottle\/pycapnp,jparyani\/pycapnp,rcrowder\/pycapnp","old_file":"examples\/addressbook.capnp","new_file":"examples\/addressbook.capnp","new_contents":"@0x934efea7f017fff0;\n\nstruct Person {\n id @0 :UInt32;\n name @1 :Text;\n email @2 :Text;\n phones @3 :List(PhoneNumber);\n\n struct PhoneNumber {\n number @0 :Text;\n type @1 :Type;\n\n enum Type {\n mobile @0;\n home @1;\n work @2;\n }\n }\n\n employment :union {\n unemployed @4 :Void;\n employer @5 :Text;\n school @6 :Text;\n selfEmployed @7 :Void;\n # We assume that a person is only one of these.\n }\n}\n\nstruct AddressBook {\n people @0 :List(Person);\n}\n\n","old_contents":"@0x934efea7f017fff0;\n\nstruct Person {\n id @0 :UInt32;\n name @1 :Text;\n email @2 :Text;\n phones @3 :List(PhoneNumber);\n\n struct PhoneNumber {\n number @0 :Text;\n type @1 :Type;\n\n enum Type {\n mobile @0;\n home @1;\n work @2;\n }\n }\n\n employment @4 union {\n unemployed @5 :Void;\n employer @6 :Text;\n school @7 :Text;\n selfEmployed @8 :Void;\n # We assume that a person is only one of these.\n }\n}\n\nstruct AddressBook {\n people @0 :List(Person);\n}\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"5584941332ecef48da42e1bd1c9176ca042d688a","subject":"Added variable field in RealExpr and SetExpr (to explicitly distinguish between symbolic variables and references)","message":"Added variable field in RealExpr and SetExpr (to explicitly distinguish between symbolic variables and references)\n","repos":"niekbouman\/commelec-api,niekbouman\/commelec-api,niekbouman\/commelec-api,niekbouman\/commelec-api","old_file":"src\/schema.capnp","new_file":"src\/schema.capnp","new_contents":"# The MIT License (MIT)\n# \n# Copyright (c) 2015 Andrey Bernstein and Niek J. Bouman\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n# \n@0xdb1b4800e80dbd2d;\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"msg\");\n#\n# COMMELEC message format v1.0\n#\n# Specified in Cap'n Proto's schema language (Requires Cap'n Proto v0.5\n# [ http:\/\/kentonv.github.io\/capnproto\/language.html ] \n#\n# Copyright (c) 2015 by Andrey Bernstein & Niek J. Bouman\n#\n# EPFL - Swiss Federal Institute of Technology Lausanne\n\n#=====================================================\n# Top-Level \"Message\" Type, Request and Advertisement \n#=====================================================\n\nstruct Message {\n agentId @0 :UInt32;\n union {\n request @1 :Request;\n advertisement @2 :Advertisement;\n }\n}\n\nstruct Request {\n setpoint @0 :List(Float64);\n}\n\nstruct Advertisement {\n pQProfile @0 :SetExpr;\n beliefFunction @1 :SetExpr;\n costFunction @2 :RealExpr;\n implementedSetpoint @3 :List(Float64);\n}\n\n#==============================================\n# Definition of RealExpr and its child structs\n#==============================================\n\nstruct RealExpr {\n name @0 :Text;\n union {\n real @1 :Float64;\n polynomial @2 :Polynomial;\n unaryOperation @3 :UnaryOperation;\n binaryOperation @4 :BinaryOperation;\n listOperation @5 :ListOperation;\n caseDistinction @6 :CaseDistinction(RealExpr);\n reference @7 :Text;\n variable @8 :Text;\n }\n}\n\nstruct UnaryOperation {\n arg @0 :RealExpr;\n operation :union {\n negate @1 :Void;\n abs @2 :Void;\n sign @3 :Void;\n multInv @4 :Void;\n square @5 :Void;\n sqrt @6 :Void;\n sin @7 :Void;\n cos @8 :Void;\n tan @9 :Void;\n exp @10 :Void;\n ln @11 :Void;\n log10 @12 :Void;\n round @13 :Void;\n floor @14 :Void;\n ceil @15 :Void;\n }\n}\n\nstruct BinaryOperation {\n argA @0 :RealExpr;\n argB @1 :RealExpr;\n operation :union {\n sum @2 :Void;\n prod @3 :Void;\n pow @4 :Void;\n min @5 :Void;\n max @6 :Void;\n lessEqThan @7 :Void; # expression yields a boolean\n greaterThan @8 :Void; # expression yields a boolean\n }\n}\n\nstruct ListOperation {\n args @0 :List(RealExpr);\n operation :union {\n sum @1 :Void;\n prod @2 :Void;\n }\n}\n\nstruct Polynomial {\n variables @0 :List(Text);\n maxVarDegree @1 :UInt8; \n coefficients @2 :List(SparseCoeff);\n}\n\nstruct SparseCoeff {\n offset @0 :UInt32;\n value @1 :Float64;\n}\n\nstruct CaseDistinction(CaseType) {\n variables @0 :List(Text);\n cases @1 :List(ExprCase(CaseType)); \n}\n\nstruct ExprCase(CaseType) {\n # Representation of a single case for use in CaseDistinction\n # (order of evaluation follows List ordering)\n set @0 :SetExpr;\n expression @1 :CaseType;\n}\n\n#=============================================\n# Definition of SetExpr and its child structs\n#=============================================\n\nstruct SetExpr {\n name @0 :Text;\n union {\n singleton @1 :List(RealExpr); # dimension of the point equals the length of the list \n ball @2 :Ball;\n rectangle @3 :List(BoundaryPair);\n convexPolytope @4 :ConvexPolytope;\n intersection @5 :List(SetExpr);\n caseDistinction @6 :CaseDistinction(SetExpr);\n reference @7 :Text;\n variable @8 :Text;\n }\n}\n\nstruct Ball {\n center @0 :List(RealExpr);\n radius @1 :RealExpr;\n}\n\nstruct BoundaryPair {\n boundA @0 :RealExpr; # the \"interpreter\" is responsible for sorting \n boundB @1 :RealExpr; # the bounds, i.e., which bound is min and max \n}\n\nstruct ConvexPolytope {\n # A convex polytope formed by linear constraints\n # In case of a polygon, i.e., a two-dimensional polytope, the\n # length of the inner list of field 'a' will be equal to two. \n a @0 :List(List(RealExpr));\n b @1 :List(RealExpr);\n}\n","old_contents":"# The MIT License (MIT)\n# \n# Copyright (c) 2015 Andrey Bernstein and Niek J. Bouman\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n# \n@0xdb1b4800e80dbd2d;\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"msg\");\n#\n# COMMELEC message format v1.0\n#\n# Specified in Cap'n Proto's schema language (Requires Cap'n Proto v0.5\n# [ http:\/\/kentonv.github.io\/capnproto\/language.html ] \n#\n# Copyright (c) 2015 by Andrey Bernstein & Niek J. Bouman\n#\n# EPFL - Swiss Federal Institute of Technology Lausanne\n\n#=====================================================\n# Top-Level \"Message\" Type, Request and Advertisement \n#=====================================================\n\nstruct Message {\n agentId @0 :UInt32;\n union {\n request @1 :Request;\n advertisement @2 :Advertisement;\n }\n}\n\nstruct Request {\n setpoint @0 :List(Float64);\n}\n\nstruct Advertisement {\n pQProfile @0 :SetExpr;\n beliefFunction @1 :SetExpr;\n costFunction @2 :RealExpr;\n implementedSetpoint @3 :List(Float64);\n}\n\n#==============================================\n# Definition of RealExpr and its child structs\n#==============================================\n\nstruct RealExpr {\n name @0 :Text;\n union {\n real @1 :Float64;\n polynomial @2 :Polynomial;\n unaryOperation @3 :UnaryOperation;\n binaryOperation @4 :BinaryOperation;\n listOperation @5 :ListOperation;\n caseDistinction @6 :CaseDistinction(RealExpr);\n reference @7 :Text;\n }\n}\n\nstruct UnaryOperation {\n arg @0 :RealExpr;\n operation :union {\n negate @1 :Void;\n abs @2 :Void;\n sign @3 :Void;\n multInv @4 :Void;\n square @5 :Void;\n sqrt @6 :Void;\n sin @7 :Void;\n cos @8 :Void;\n tan @9 :Void;\n exp @10 :Void;\n ln @11 :Void;\n log10 @12 :Void;\n round @13 :Void;\n floor @14 :Void;\n ceil @15 :Void;\n }\n}\n\nstruct BinaryOperation {\n argA @0 :RealExpr;\n argB @1 :RealExpr;\n operation :union {\n sum @2 :Void;\n prod @3 :Void;\n pow @4 :Void;\n min @5 :Void;\n max @6 :Void;\n lessEqThan @7 :Void; # expression yields a boolean\n greaterThan @8 :Void; # expression yields a boolean\n }\n}\n\nstruct ListOperation {\n args @0 :List(RealExpr);\n operation :union {\n sum @1 :Void;\n prod @2 :Void;\n }\n}\n\nstruct Polynomial {\n variables @0 :List(Text);\n maxVarDegree @1 :UInt8; \n coefficients @2 :List(SparseCoeff);\n}\n\nstruct SparseCoeff {\n offset @0 :UInt32;\n value @1 :Float64;\n}\n\nstruct CaseDistinction(CaseType) {\n variables @0 :List(Text);\n cases @1 :List(ExprCase(CaseType)); \n}\n\nstruct ExprCase(CaseType) {\n # Representation of a single case for use in CaseDistinction\n # (order of evaluation follows List ordering)\n set @0 :SetExpr;\n expression @1 :CaseType;\n}\n\n#=============================================\n# Definition of SetExpr and its child structs\n#=============================================\n\nstruct SetExpr {\n name @0 :Text;\n union {\n singleton @1 :List(RealExpr); # dimension of the point equals the length of the list \n ball @2 :Ball;\n rectangle @3 :List(BoundaryPair);\n convexPolytope @4 :ConvexPolytope;\n intersection @5 :List(SetExpr);\n caseDistinction @6 :CaseDistinction(SetExpr);\n reference @7 :Text;\n }\n}\n\nstruct Ball {\n center @0 :List(RealExpr);\n radius @1 :RealExpr;\n}\n\nstruct BoundaryPair {\n boundA @0 :RealExpr; # the \"interpreter\" is responsible for sorting \n boundB @1 :RealExpr; # the bounds, i.e., which bound is min and max \n}\n\nstruct ConvexPolytope {\n # A convex polytope formed by linear constraints\n # In case of a polygon, i.e., a two-dimensional polytope, the\n # length of the inner list of field 'a' will be equal to two. \n a @0 :List(List(RealExpr));\n b @1 :List(RealExpr);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"95e1b808dedf8856531d025245733891b3b5719d","subject":"Added some more buffer data...","message":"Added some more buffer data...\n","repos":"logos-electromechanical\/MultiSpork","old_file":"MultiSpork\/firmware\/multispork.capnp","new_file":"MultiSpork\/firmware\/multispork.capnp","new_contents":"\n# This is the basic interface for manipulating the configuration of remote devices\ninterface Parameter {\n\tget @0 () -> (value :ParamStruct);\n\tstruct ParamStruct {\n\t\tname @0 :Text;\t\t\t\t# name of the parameter\n\t\tuid @1 :UInt64;\t\t\t\t# UID of the parameter\n\t\tchannel @2 :UInt8;\t\t\t# channel to which the parameter applies (255 for all or none)\n\t\tvalue :union {\t\t\t\t# value of the parameter\n\t\t\tswitch @3 :Bool;\n\t\t\tsigned8 @4 :Int8;\n\t\t\tsigned16 @5 :Int16;\n\t\t\tsigned32 @4 :Int32;\n\t\t\tsigned64 @5 :Int64;\n\t\t\tunsigned8 @6 :UInt8;\n\t\t\tunsigned16 @7 :UInt16;\n\t\t\tunsigned32 @8 :UInt32;\n\t\t\tunsigned64 @9 :UInt64;\n\t\t\tfloatNum @10 :Float32;\n\t\t\tdoubleNum @11 :Float64;\n\t\t\tstringVal @12 :Text;\n\t\t}\n\t}\n\t\n\tset @1 (value :ParamStruct) -> (err :ParamErr);\n\tenum ParamErr {\n\t\tnone @0;\n\t\tinvalidParamName @1;\n\t\tinvalidParamUID @2;\n\t\tinvalidParamValue @3;\n\t\tinvalidParamChannel @4;\n\t\taccessDenied @5;\n\t\tparamSetFail @6;\n\t\tinvalidParamType @7;\n\t}\n\t\n\tlist @2 () -> (List(ParamStruct)); # returns a list of valid parameters, with their current values\n}\n\n# This allows the device to interrupt the host (for example, data ready)\ninterface Interrupt {\n\traise @0 (int :IntStruct) -> (ack :Bool);\n\tstruct IntStruct {\n\t\tname @0 :Text;\t\t# name of the interrupt\n\t\tUID @1 :UInt64;\t\t# interrupt UID\n\t\tchannel @2 :UInt8;\t# channel that generated the interrupt (255 if no channel)\n\t}\n}\n\n# write and read buffers\ninterface Buffer {\n\tread @0 (buf :BufID;) -> (buf :BufStruct);\n\tstruct BufID {\n\t\tchannel @0 :UInt8;\t\t# The device channel that the buffer either comes from or is intended for. \n\t\tbufNum @7 :Uint8;\t\t# The buffer number (allows multiple buffers for a single channel)\n\t\trate @1 :Float32;\t\t# The sample rate of the buffer. \n\t\tstartTime @2 :UInt64;\t# The start time of the buffer, in microseconds since the epoch.\n\t\tsize @3 :UInt32;\t\t# Allocated size of the buffer, in samples\n\t\tcontentSize @6 :UInt32;\t# The number of samples currently in the buffer\n\t\tresolution @4 :UInt8;\t# Size of a sample, in bits\n\t\tdirection @5 :Bool;\t\t# True for input buffer, false for output\n\t\tactive @8 :Bool;\t\t# Is the buffer currently being read from or written to?\n\t}\n\tstruct BufStruct {\n\t\tID @0 :BufID;\t\t\t# The identity of the buffer\n\t\tcontents @1 :Data;\t\t# The data to be encoded\n\t}\n\t\n\twrite @1 (buf :BufStruct) -> (err: BufErr);\n\tenum BufErr {\n\t\tnone @0;\n\t\tbufDoesNotExist @1;\n\t\tbufEmpty @2;\n\t\tbufOverflow @3;\n\t\tbufWriteFail @4;\n\t\tinvalidBufType @5;\n\t}\n\t\n\tlist @2 () -> (List(BufID));\n\tlistByChannel @3 (channel :UInt8;) -> (List(BufID));\n}","old_contents":"\n# This is the basic interface for manipulating the configuration of remote devices\ninterface Parameter {\n\tget @0 () -> (value :ParamStruct);\n\tstruct ParamStruct {\n\t\tname @0 :Text;\t\t\t\t# name of the parameter\n\t\tuid @1 :UInt64;\t\t\t\t# UID of the parameter\n\t\tchannel @2 :UInt8;\t\t\t# channel to which the parameter applies (255 for all or none)\n\t\tvalue :union {\t\t\t\t# value of the parameter\n\t\t\tswitch @3 :Bool;\n\t\t\tsigned8 @4 :Int8;\n\t\t\tsigned16 @5 :Int16;\n\t\t\tsigned32 @4 :Int32;\n\t\t\tsigned64 @5 :Int64;\n\t\t\tunsigned8 @6 :UInt8;\n\t\t\tunsigned16 @7 :UInt16;\n\t\t\tunsigned32 @8 :UInt32;\n\t\t\tunsigned64 @9 :UInt64;\n\t\t\tfloatNum @10 :Float32;\n\t\t\tdoubleNum @11 :Float64;\n\t\t\tstringVal @12 :Text;\n\t\t}\n\t}\n\t\n\tset @1 (value :ParamStruct) -> (err :ParamErr);\n\tenum ParamErr {\n\t\tnone @0;\n\t\tinvalidParamName @1;\n\t\tinvalidParamUID @2;\n\t\tinvalidParamValue @3;\n\t\tinvalidParamChannel @4;\n\t\taccessDenied @5;\n\t\tparamSetFail @6;\n\t\tinvalidParamType @7;\n\t}\n\t\n\tlist @2 () -> (List(ParamStruct)); # returns a list of valid parameters, with their current values\n}\n\n# This allows the device to interrupt the host (for example, data ready)\ninterface Interrupt {\n\traise @0 (int :IntStruct) -> (ack :Bool);\n\tstruct IntStruct {\n\t\tname @0 :Text;\t\t# name of the interrupt\n\t\tUID @1 :UInt64;\t\t# interrupt UID\n\t\tchannel @2 :UInt8;\t# channel that generated the interrupt (255 if no channel)\n\t}\n}\n\n# write and read buffers\ninterface Buffer {\n\tread @0 (channel :Uint8;) -> (buf :BufStruct);\n\tstruct BufID {\n\t\tchannel @0 :UInt8;\t\t# The device channel that the buffer either comes from or is intended for. \n\t\trate @1 :Float32;\t\t# The sample rate of the buffer. \n\t\tstartTime @2 :UInt64;\t# The start time of the buffer, in microseconds since the epoch.\n\t\tsize @3 :UInt32;\t\t# Size of the buffer, in samples\n\t\tresolution @4 :UInt8;\t# Size of a sample, in bits\n\t\tdirection @5 :Bool;\t\t# True for input buffer, false for output\n\t}\n\tstruct BufStruct {\n\t\tID @0 :BufID;\t\t\t# The identity of the buffer\n\t\tcontents @1 :Data;\t\t# The data to be encoded\n\t}\n\t\n\twrite @1 (buf :BufStruct) -> (err: BufErr);\n\tenum BufErr {\n\t\tnone @0;\n\t\tbufDoesNotExist @1;\n\t\tbufEmpty @2;\n\t\tbufOverflow @3;\n\t\tbufWriteFail @4;\n\t\tinvalidBufType @5;\n\t}\n\t\n\tlist @2 () -> (List(BufID));\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"df5f450fcb8db0cda78ab596403075c01abc3dde","subject":"shortDescription","message":"shortDescription\n","repos":"dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n\n manifest = (\n appTitle = (defaultText = \"Groove Basin\"),\n appVersion = 8, # Increment this for every release.\n appMarketingVersion = (defaultText = \"2016.02.06 (1.5.1+)\"),\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/groovebasin-128.png\",\n dpi2x = embed \"app-graphics\/groovebasin-256.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/groovebasin-24.png\",\n dpi2x = embed \"app-graphics\/groovebasin-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/groovebasin-150.png\")),\n ),\n website = \"http:\/\/groovebasin.com\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/groovebasin\",\n license = (openSource = mit),\n categories = [media,],\n author = (\n upstreamAuthor = \"Andrew Kelley\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n shortDescription = (defaultText = \"Music player\"),\n description = (defaultText = embed \"description.md\"),\n screenshots = [(width = 448, height = 311, png = embed \"screenshot.png\")],\n changeLog = (defaultText = embed \"changeLog.md\"),\n ),\n\n\n actions = [\n ( title = (defaultText = \"New Music Library\"),\n command = .myCommand,\n nounPhrase = (defaultText = \"Music Library\")\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/app\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows tag editing and track deletion\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"allows listening and downloading\")),\n (name = \"add\", title = (defaultText = \"add\"),\n description = (defaultText = \"allows track uploads\")),\n (name = \"control\", title = (defaultText = \"control\"),\n description = (defaultText = \"allows control of the audio stream\")),\n (name = \"playlist\", title = (defaultText = \"playlist\"),\n description = (defaultText = \"allows playlist editing\"))],\n roles = [(title = (defaultText = \"controller\"),\n permissions = .controllerPermissions,\n verbPhrase = (defaultText = \"can control the stream\")),\n (title = (defaultText = \"disc jockey\"),\n permissions = .djPermissions,\n verbPhrase =\n (defaultText = \"can control the stream, upload tracks, and edit playlists\"),\n default = true),\n (title = (defaultText = \"administrator\"),\n permissions = .adminPermissions,\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"listener\"),\n permissions = .listenerPermissions,\n verbPhrase = (defaultText = \"can only listen\")),\n (title = (defaultText = \"contributor\"),\n permissions = .contributorPermissions,\n verbPhrase = (defaultText = \"can upload tracks and edit playlists\"))\n ]\n )\n )\n);\n\n# admin | read | add | control | playlist |\nconst controllerPermissions : List(Bool) = [ false, true, false, true, false];\nconst djPermissions : List(Bool) = [ false, true, true, true, true];\nconst adminPermissions : List(Bool) = [ true, true, true, true, true];\nconst listenerPermissions : List(Bool) = [ false, true, false, false, false];\nconst contributorPermissions : List(Bool) = [ false, true, true, false, true];\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n\n manifest = (\n appTitle = (defaultText = \"Groove Basin\"),\n appVersion = 8, # Increment this for every release.\n appMarketingVersion = (defaultText = \"2016.02.06 (1.5.1+)\"),\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/groovebasin-128.png\",\n dpi2x = embed \"app-graphics\/groovebasin-256.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/groovebasin-24.png\",\n dpi2x = embed \"app-graphics\/groovebasin-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/groovebasin-150.png\")),\n ),\n website = \"http:\/\/groovebasin.com\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/groovebasin\",\n license = (openSource = mit),\n categories = [media,],\n author = (\n upstreamAuthor = \"Andrew Kelley\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n screenshots = [(width = 448, height = 311, png = embed \"screenshot.png\")],\n changeLog = (defaultText = embed \"changeLog.md\"),\n ),\n\n\n actions = [\n ( title = (defaultText = \"New Music Library\"),\n command = .myCommand,\n nounPhrase = (defaultText = \"Music Library\")\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/app\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows tag editing and track deletion\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"allows listening and downloading\")),\n (name = \"add\", title = (defaultText = \"add\"),\n description = (defaultText = \"allows track uploads\")),\n (name = \"control\", title = (defaultText = \"control\"),\n description = (defaultText = \"allows control of the audio stream\")),\n (name = \"playlist\", title = (defaultText = \"playlist\"),\n description = (defaultText = \"allows playlist editing\"))],\n roles = [(title = (defaultText = \"controller\"),\n permissions = .controllerPermissions,\n verbPhrase = (defaultText = \"can control the stream\")),\n (title = (defaultText = \"disc jockey\"),\n permissions = .djPermissions,\n verbPhrase =\n (defaultText = \"can control the stream, upload tracks, and edit playlists\"),\n default = true),\n (title = (defaultText = \"administrator\"),\n permissions = .adminPermissions,\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"listener\"),\n permissions = .listenerPermissions,\n verbPhrase = (defaultText = \"can only listen\")),\n (title = (defaultText = \"contributor\"),\n permissions = .contributorPermissions,\n verbPhrase = (defaultText = \"can upload tracks and edit playlists\"))\n ]\n )\n )\n);\n\n# admin | read | add | control | playlist |\nconst controllerPermissions : List(Bool) = [ false, true, false, true, false];\nconst djPermissions : List(Bool) = [ false, true, true, true, true];\nconst adminPermissions : List(Bool) = [ true, true, true, true, true];\nconst listenerPermissions : List(Bool) = [ false, true, false, false, false];\nconst contributorPermissions : List(Bool) = [ false, true, true, false, true];\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"e682920de14ccf655937771a730e7c526f1b4c1d","subject":"Add frameid to pc type","message":"Add frameid to pc type\n","repos":"ternaris\/marv-robotics,ternaris\/marv-robotics","old_file":"code\/marv-api\/marv_detail\/types.capnp","new_file":"code\/marv-api\/marv_detail\/types.capnp","new_contents":"# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\n@0xa1475499038e2711;\n\nusing import \"\/marv_nodes\/types.capnp\".Comment;\nusing import \"\/marv_nodes\/types.capnp\".File;\nusing import \"\/marv_nodes\/types.capnp\".GeoJson;\nusing import \"\/marv_pycapnp\/types.capnp\".Timedelta;\nusing import \"\/marv_pycapnp\/types.capnp\".Timestamp;\nusing import \"\/marv_pycapnp\/types.capnp\".TimelineEvent;\n\nusing Filesize = UInt64;\nusing RowId = UInt64;\n\n\nenum Align {\n left @0;\n center @1;\n right @2;\n}\n\n\nenum Formatter {\n string @0;\n filesize @1;\n int @2;\n rellink @3;\n datetime @4;\n timedelta @5;\n link @6;\n route @7;\n distance @8;\n speed @9;\n acceleration @10;\n}\n\n\nstruct Cell {\n union {\n void @0 :Void;\n text @1 :Text;\n bool @2 :Bool;\n uint64 @3 :UInt64;\n link @4 :Link;\n timedelta @5 :Timedelta;\n timestamp @6 :Timestamp;\n route @7 :Route;\n }\n}\n\n\nstruct Link {\n href @0 :Text;\n target @1 :Text = \"_blank\";\n title @2 :Text;\n download @3 :Text;\n}\n\n\nstruct Route {\n route @0 :Text;\n id @1 :Text;\n title @2 :Text;\n}\n\n\nstruct Compare {\n sections @0 :List(Section);\n title @1 :Text;\n error @2 :Text;\n}\n\n\nstruct Detail {\n sections @0 :List(Section);\n summary @1 :Section;\n title @2 :Text;\n error @3 :Text;\n}\n\n\nstruct Section {\n title @0 :Text;\n widgets @1 :List(Widget);\n}\n\n\nstruct Widget {\n title @0 :Text;\n union {\n void @1 :Void;\n custom @12 :Custom;\n dropdown @14 :Dropdown;\n gallery @2 :Gallery;\n image @3 :Image;\n keyval @4 :Keyval;\n link @13 :Link;\n mpld3 @5 :Text; # marv-partial or json\n map @6 :Map;\n mapPartial @11 :Text;\n pre @7 :Pre;\n table @8 :Table;\n pointcloud @9 :Pointcloud;\n video @10 :Video;\n plotly @15: Text; # marv-partial\n pdf @16 :Pdf; # marv-partial\n eventlist @17 :Eventlist;\n }\n\n struct Custom {\n type @0 :Text;\n data @1 :Text; # json\n }\n\n struct Gallery {\n images @0 :List(Image);\n }\n\n struct Image {\n src @0 :Text;\n }\n\n struct Keyval {\n items @0 :List(Item);\n\n struct Item {\n title @0 :Text;\n formatter @1 :Formatter;\n list @2 :Bool;\n cell @3 :Cell;\n }\n }\n\n struct Map {\n zoom @0 :Zoom;\n layers @1 :List(Layer);\n bgcolor @2 :List(UInt8) = [240, 240, 240, 255]; # rgba\n speed :group {\n min @3 :Float32 = 1.0;\n max @4 :Float32 = 1000.0;\n default @5 :Float32 = 1.0;\n }\n\n struct Layer {\n title @0 :Text;\n color @1 :List(UInt8);\n transform @2 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n union {\n geojson @3 :GeoJson;\n tiles @4 :List(Tile);\n }\n }\n\n struct Tile {\n title @0 :Text;\n url @1 :Text;\n attribution @2: Text;\n zoom @3 :Zoom;\n retina @4 :UInt8 = 1;\n }\n\n struct Zoom {\n min @0 :Int8;\n max @1 :Int8;\n }\n }\n\n struct Dropdown {\n widgets @0 :List(Widget);\n }\n\n struct Pre {\n text @0 :Text;\n }\n\n struct Table {\n actions @0 :List(Action);\n columns @1 :List(Column);\n rows @2 :List(Row);\n sortcolumn @3 :Int16;\n sortorder @4 :Sortorder;\n\n struct Action {\n name @0 :Text;\n title @1 :Text;\n method @2 :HTTPMethod;\n data @3 :Text;\n\n enum HTTPMethod {\n post @0;\n get @1;\n }\n }\n\n struct Column {\n title @0 :Text;\n align @1 :Align;\n formatter @2 :Formatter;\n list @3 :Bool;\n sortkey @4 :Text;\n }\n\n struct Row {\n id @0 :RowId;\n cells @1 :List(Cell);\n }\n\n enum Sortorder {\n ascending @0;\n descending @1;\n }\n }\n\n struct Pointcloud {\n uri @0 :Text;\n # TODO: rename to blob or stream or src like for image and video?\n size @1 :UInt64;\n # Bytesize of point cloud stream blob\n pointsize @2 :Float32;\n transform @3 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n speed :group {\n min @4 :Float32 = 1.0;\n max @5 :Float32 = 1000.0;\n default @6 :Float32 = 1.0;\n }\n rangex @7 :List(Float32);\n rangey @8 :List(Float32);\n rangez @9 :List(Float32);\n ranged @10 :List(Float32);\n frameid @11 :Text;\n }\n\n struct Video {\n src @0 :Text;\n }\n\n struct Pdf {\n src @0 :Text;\n }\n\n struct Eventlist {\n subtype @0: Text;\n events @1 :List(TimelineEvent);\n }\n}\n","old_contents":"# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\n@0xa1475499038e2711;\n\nusing import \"\/marv_nodes\/types.capnp\".Comment;\nusing import \"\/marv_nodes\/types.capnp\".File;\nusing import \"\/marv_nodes\/types.capnp\".GeoJson;\nusing import \"\/marv_pycapnp\/types.capnp\".Timedelta;\nusing import \"\/marv_pycapnp\/types.capnp\".Timestamp;\nusing import \"\/marv_pycapnp\/types.capnp\".TimelineEvent;\n\nusing Filesize = UInt64;\nusing RowId = UInt64;\n\n\nenum Align {\n left @0;\n center @1;\n right @2;\n}\n\n\nenum Formatter {\n string @0;\n filesize @1;\n int @2;\n rellink @3;\n datetime @4;\n timedelta @5;\n link @6;\n route @7;\n distance @8;\n speed @9;\n acceleration @10;\n}\n\n\nstruct Cell {\n union {\n void @0 :Void;\n text @1 :Text;\n bool @2 :Bool;\n uint64 @3 :UInt64;\n link @4 :Link;\n timedelta @5 :Timedelta;\n timestamp @6 :Timestamp;\n route @7 :Route;\n }\n}\n\n\nstruct Link {\n href @0 :Text;\n target @1 :Text = \"_blank\";\n title @2 :Text;\n download @3 :Text;\n}\n\n\nstruct Route {\n route @0 :Text;\n id @1 :Text;\n title @2 :Text;\n}\n\n\nstruct Compare {\n sections @0 :List(Section);\n title @1 :Text;\n error @2 :Text;\n}\n\n\nstruct Detail {\n sections @0 :List(Section);\n summary @1 :Section;\n title @2 :Text;\n error @3 :Text;\n}\n\n\nstruct Section {\n title @0 :Text;\n widgets @1 :List(Widget);\n}\n\n\nstruct Widget {\n title @0 :Text;\n union {\n void @1 :Void;\n custom @12 :Custom;\n dropdown @14 :Dropdown;\n gallery @2 :Gallery;\n image @3 :Image;\n keyval @4 :Keyval;\n link @13 :Link;\n mpld3 @5 :Text; # marv-partial or json\n map @6 :Map;\n mapPartial @11 :Text;\n pre @7 :Pre;\n table @8 :Table;\n pointcloud @9 :Pointcloud;\n video @10 :Video;\n plotly @15: Text; # marv-partial\n pdf @16 :Pdf; # marv-partial\n eventlist @17 :Eventlist;\n }\n\n struct Custom {\n type @0 :Text;\n data @1 :Text; # json\n }\n\n struct Gallery {\n images @0 :List(Image);\n }\n\n struct Image {\n src @0 :Text;\n }\n\n struct Keyval {\n items @0 :List(Item);\n\n struct Item {\n title @0 :Text;\n formatter @1 :Formatter;\n list @2 :Bool;\n cell @3 :Cell;\n }\n }\n\n struct Map {\n zoom @0 :Zoom;\n layers @1 :List(Layer);\n bgcolor @2 :List(UInt8) = [240, 240, 240, 255]; # rgba\n speed :group {\n min @3 :Float32 = 1.0;\n max @4 :Float32 = 1000.0;\n default @5 :Float32 = 1.0;\n }\n\n struct Layer {\n title @0 :Text;\n color @1 :List(UInt8);\n transform @2 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n union {\n geojson @3 :GeoJson;\n tiles @4 :List(Tile);\n }\n }\n\n struct Tile {\n title @0 :Text;\n url @1 :Text;\n attribution @2: Text;\n zoom @3 :Zoom;\n retina @4 :UInt8 = 1;\n }\n\n struct Zoom {\n min @0 :Int8;\n max @1 :Int8;\n }\n }\n\n struct Dropdown {\n widgets @0 :List(Widget);\n }\n\n struct Pre {\n text @0 :Text;\n }\n\n struct Table {\n actions @0 :List(Action);\n columns @1 :List(Column);\n rows @2 :List(Row);\n sortcolumn @3 :Int16;\n sortorder @4 :Sortorder;\n\n struct Action {\n name @0 :Text;\n title @1 :Text;\n method @2 :HTTPMethod;\n data @3 :Text;\n\n enum HTTPMethod {\n post @0;\n get @1;\n }\n }\n\n struct Column {\n title @0 :Text;\n align @1 :Align;\n formatter @2 :Formatter;\n list @3 :Bool;\n sortkey @4 :Text;\n }\n\n struct Row {\n id @0 :RowId;\n cells @1 :List(Cell);\n }\n\n enum Sortorder {\n ascending @0;\n descending @1;\n }\n }\n\n struct Pointcloud {\n uri @0 :Text;\n # TODO: rename to blob or stream or src like for image and video?\n size @1 :UInt64;\n # Bytesize of point cloud stream blob\n pointsize @2 :Float32;\n transform @3 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n speed :group {\n min @4 :Float32 = 1.0;\n max @5 :Float32 = 1000.0;\n default @6 :Float32 = 1.0;\n }\n rangex @7 :List(Float32);\n rangey @8 :List(Float32);\n rangez @9 :List(Float32);\n ranged @10 :List(Float32);\n }\n\n struct Video {\n src @0 :Text;\n }\n\n struct Pdf {\n src @0 :Text;\n }\n\n struct Eventlist {\n subtype @0: Text;\n events @1 :List(TimelineEvent);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"e5e1ea1098fc243112e6a95a4a079aed1561b09d","subject":"remove quota field","message":"remove quota field\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"gce-config.capnp","new_file":"gce-config.capnp","new_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","old_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n quotaEnabled = false,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"c77737f6cea0bb6376a722a91045f2681b93f9ba","subject":"aircraft.capnp: Add some interfaces for testing inheritance.","message":"aircraft.capnp: Add some interfaces for testing inheritance.\n","repos":"zenhack\/haskell-capnp","old_file":"tests\/data\/aircraft.capnp","new_file":"tests\/data\/aircraft.capnp","new_contents":"@0x832bcc6686a26d56;\n# A schema with useful declarations for testing.\n#\n# This was originally copied from the Go implementation:\n#\n# https:\/\/github.com\/zombiezen\/go-capnproto2\n#\n# For now, a default values for pointer types have been commented out,\n# so that the compiler plugin will not reject the schema in light of\n# issue #28. These are marked with 'TODO#28' in the source.\n\nconst constDate :Zdate = (year = 2015, month = 8, day = 27);\nconst constList :List(Zdate) = [(year = 2015, month = 8, day = 27), (year = 2015, month = 8, day = 28)];\nconst constEnum :Airport = jfk;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6;\n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n boolvec @39: List(Bool);\n datavec @40: List(Data);\n textvec @41: List(Text);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n zdatavec @38: List(Zdata);\n\n grp :group {\n first @42 :UInt64;\n second @43 :UInt64;\n }\n\n echo @44 :Echo;\n echoBases @45 :EchoBases;\n }\n}\n\n# tests for Text\/List(Text) recusion handling\n\nstruct Counter {\n size @0: Int64;\n words @1: Text;\n wordlist @2: List(Text);\n}\n\nstruct Bag {\n counter @0: Counter;\n}\n\nstruct Zserver {\n waitingjobs @0: List(Zjob);\n}\n\nstruct Zjob {\n cmd @0: Text;\n args @1: List(Text);\n}\n\n# versioning test structs\n\nstruct VerEmpty {\n}\n\nstruct VerOneData {\n val @0: Int16;\n}\n\nstruct VerTwoData {\n val @0: Int16;\n duo @1: Int64;\n}\n\nstruct VerOnePtr {\n ptr @0: VerOneData;\n}\n\nstruct VerTwoPtr {\n ptr1 @0: VerOneData;\n ptr2 @1: VerOneData;\n}\n\nstruct VerTwoDataTwoPtr {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerOneData;\n ptr2 @3: VerOneData;\n}\n\nstruct HoldsVerEmptyList {\n mylist @0: List(VerEmpty);\n}\n\nstruct HoldsVerOneDataList {\n mylist @0: List(VerOneData);\n}\n\nstruct HoldsVerTwoDataList {\n mylist @0: List(VerTwoData);\n}\n\nstruct HoldsVerOnePtrList {\n mylist @0: List(VerOnePtr);\n}\n\nstruct HoldsVerTwoPtrList {\n mylist @0: List(VerTwoPtr);\n}\n\nstruct HoldsVerTwoTwoList {\n mylist @0: List(VerTwoDataTwoPtr);\n}\n\nstruct HoldsVerTwoTwoPlus {\n mylist @0: List(VerTwoTwoPlus);\n}\n\nstruct VerTwoTwoPlus {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerTwoDataTwoPtr;\n ptr2 @3: VerTwoDataTwoPtr;\n tre @4: Int64;\n lst3 @5: List(Int64);\n}\n\n# text handling\n\nstruct HoldsText {\n txt @0: Text;\n lst @1: List(Text);\n lstlst @2: List(List(Text));\n}\n\n# test that we avoid unnecessary truncation\n\nstruct WrapEmpty {\n mightNotBeReallyEmpty @0: VerEmpty;\n}\n\nstruct Wrap2x2 {\n mightNotBeReallyEmpty @0: VerTwoDataTwoPtr;\n}\n\nstruct Wrap2x2plus {\n mightNotBeReallyEmpty @0: VerTwoTwoPlus;\n}\n\n# test voids in a union\n\nstruct VoidUnion {\n union {\n a @0 :Void;\n b @1 :Void;\n }\n}\n\n# test List(List(Struct(List)))\n\nstruct Nester1Capn {\n strs @0: List(Text);\n}\n\nstruct RWTestCapn {\n nestMatrix @0: List(List(Nester1Capn));\n}\n\nstruct ListStructCapn {\n vec @0: List(Nester1Capn);\n}\n\n# test interfaces\n\ninterface Echo {\n echo @0 (in :Text) -> (out :Text);\n}\n\nstruct Hoth {\n base @0 :EchoBase;\n}\n\nstruct EchoBase {\n echo @0 :Echo;\n}\n\n# test List(Struct(Interface))\n\nstruct EchoBases {\n\tbases @0 :List(EchoBase);\n}\n\n# test transforms\n\nstruct StackingRoot {\n a @1 :StackingA;\n aWithDefault @0 :StackingA ;#TODO#28 = (num = 42);\n}\n\nstruct StackingA {\n num @0 :Int32;\n b @1 :StackingB;\n}\n\nstruct StackingB {\n num @0 :Int32;\n}\n\ninterface CallSequence {\n getNumber @0 () -> (n :UInt32);\n}\n\ninterface CounterFactory {\n newCounter @0 (start :UInt32) -> (counter :CallSequence);\n}\n\ninterface CounterAcceptor {\n accept @0 (counter :CallSequence);\n}\n\n# test inheritance\n\ninterface Top {\n\ttop @0 ();\n}\n\ninterface Left extends(Top) {\n\tleft @0 ();\n}\n\ninterface Right extends(Top) {\n\tright @0 ();\n}\n\ninterface Bottom extends(Left, Right) {\n\tbottom @0 ();\n}\n\n# test defaults\n\nstruct Defaults {\n text @0 :Text ;#TODO#28 = \"foo\";\n data @1 :Data ;#TODO#28 = \"bar\";\n float @2 :Float32 = 3.14;\n int @3 :Int32 = -123;\n uint @4 :UInt32 = 42;\n}\n\n# benchmarks\n\nstruct BenchmarkA {\n name @0 :Text;\n birthDay @1 :Int64;\n phone @2 :Text;\n siblings @3 :Int32;\n spouse @4 :Bool;\n money @5 :Float64;\n}\n","old_contents":"@0x832bcc6686a26d56;\n# A schema with useful declarations for testing.\n#\n# This is copied from the Go implementation:\n#\n# https:\/\/github.com\/zombiezen\/go-capnproto2\n#\n# For now, a default values for pointer types have been commented out,\n# so that the compiler plugin will not reject the schema in light of\n# issue #28. These are marked with 'TODO#28' in the source.\n\nconst constDate :Zdate = (year = 2015, month = 8, day = 27);\nconst constList :List(Zdate) = [(year = 2015, month = 8, day = 27), (year = 2015, month = 8, day = 28)];\nconst constEnum :Airport = jfk;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6;\n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n boolvec @39: List(Bool);\n datavec @40: List(Data);\n textvec @41: List(Text);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n zdatavec @38: List(Zdata);\n\n grp :group {\n first @42 :UInt64;\n second @43 :UInt64;\n }\n\n echo @44 :Echo;\n echoBases @45 :EchoBases;\n }\n}\n\n# tests for Text\/List(Text) recusion handling\n\nstruct Counter {\n size @0: Int64;\n words @1: Text;\n wordlist @2: List(Text);\n}\n\nstruct Bag {\n counter @0: Counter;\n}\n\nstruct Zserver {\n waitingjobs @0: List(Zjob);\n}\n\nstruct Zjob {\n cmd @0: Text;\n args @1: List(Text);\n}\n\n# versioning test structs\n\nstruct VerEmpty {\n}\n\nstruct VerOneData {\n val @0: Int16;\n}\n\nstruct VerTwoData {\n val @0: Int16;\n duo @1: Int64;\n}\n\nstruct VerOnePtr {\n ptr @0: VerOneData;\n}\n\nstruct VerTwoPtr {\n ptr1 @0: VerOneData;\n ptr2 @1: VerOneData;\n}\n\nstruct VerTwoDataTwoPtr {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerOneData;\n ptr2 @3: VerOneData;\n}\n\nstruct HoldsVerEmptyList {\n mylist @0: List(VerEmpty);\n}\n\nstruct HoldsVerOneDataList {\n mylist @0: List(VerOneData);\n}\n\nstruct HoldsVerTwoDataList {\n mylist @0: List(VerTwoData);\n}\n\nstruct HoldsVerOnePtrList {\n mylist @0: List(VerOnePtr);\n}\n\nstruct HoldsVerTwoPtrList {\n mylist @0: List(VerTwoPtr);\n}\n\nstruct HoldsVerTwoTwoList {\n mylist @0: List(VerTwoDataTwoPtr);\n}\n\nstruct HoldsVerTwoTwoPlus {\n mylist @0: List(VerTwoTwoPlus);\n}\n\nstruct VerTwoTwoPlus {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerTwoDataTwoPtr;\n ptr2 @3: VerTwoDataTwoPtr;\n tre @4: Int64;\n lst3 @5: List(Int64);\n}\n\n# text handling\n\nstruct HoldsText {\n txt @0: Text;\n lst @1: List(Text);\n lstlst @2: List(List(Text));\n}\n\n# test that we avoid unnecessary truncation\n\nstruct WrapEmpty {\n mightNotBeReallyEmpty @0: VerEmpty;\n}\n\nstruct Wrap2x2 {\n mightNotBeReallyEmpty @0: VerTwoDataTwoPtr;\n}\n\nstruct Wrap2x2plus {\n mightNotBeReallyEmpty @0: VerTwoTwoPlus;\n}\n\n# test voids in a union\n\nstruct VoidUnion {\n union {\n a @0 :Void;\n b @1 :Void;\n }\n}\n\n# test List(List(Struct(List)))\n\nstruct Nester1Capn {\n strs @0: List(Text);\n}\n\nstruct RWTestCapn {\n nestMatrix @0: List(List(Nester1Capn));\n}\n\nstruct ListStructCapn {\n vec @0: List(Nester1Capn);\n}\n\n# test interfaces\n\ninterface Echo {\n echo @0 (in :Text) -> (out :Text);\n}\n\nstruct Hoth {\n base @0 :EchoBase;\n}\n\nstruct EchoBase {\n echo @0 :Echo;\n}\n\n# test List(Struct(Interface))\n\nstruct EchoBases {\n\tbases @0 :List(EchoBase);\n}\n\n# test transforms\n\nstruct StackingRoot {\n a @1 :StackingA;\n aWithDefault @0 :StackingA ;#TODO#28 = (num = 42);\n}\n\nstruct StackingA {\n num @0 :Int32;\n b @1 :StackingB;\n}\n\nstruct StackingB {\n num @0 :Int32;\n}\n\ninterface CallSequence {\n getNumber @0 () -> (n :UInt32);\n}\n\ninterface CounterFactory {\n newCounter @0 (start :UInt32) -> (counter :CallSequence);\n}\n\ninterface CounterAcceptor {\n accept @0 (counter :CallSequence);\n}\n\n# test defaults\n\nstruct Defaults {\n text @0 :Text ;#TODO#28 = \"foo\";\n data @1 :Data ;#TODO#28 = \"bar\";\n float @2 :Float32 = 3.14;\n int @3 :Int32 = -123;\n uint @4 :UInt32 = 42;\n}\n\n# benchmarks\n\nstruct BenchmarkA {\n name @0 :Text;\n birthDay @1 :Int64;\n phone @2 :Text;\n siblings @3 :Int32;\n spouse @4 :Bool;\n money @5 :Float64;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c5c1de7fd20508eb7ea2d4f80ac3d337d5a29b67","subject":"Bumped app version to 9","message":"Bumped app version to 9\n","repos":"JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 9, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2017.09.01\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork notebook\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n marketBig = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"jan@jambor.pro\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Twostairs\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Notetaking\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1166, height = 675, png = embed \"app-graphics\/paperwork_example_01.png\"),\n (width = 1166, height = 675, png = embed \"app-graphics\/paperwork_example_02.png\"),\n (width = 1166, height = 675, png = embed \"app-graphics\/paperwork_example_03.png\")\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n # Used for integrating permissions and roles into the Sandstorm shell\n # and for sandstorm-http-bridge to pass to your app.\n # Uncomment this block and adjust the permissions and roles to make\n # sense for your app.\n # For more information, see high-level documentation at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # and advanced details in the \"BridgeConfig\" section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n viewInfo = (\n # For details on the viewInfo field, consult \"ViewInfo\" in\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n permissions = [\n # Permissions which a user may or may not possess. A user's current\n # permissions are passed to the app as a comma-separated list of `name`\n # fields in the X-Sandstorm-Permissions header with each request.\n #\n # IMPORTANT: only ever append to this list! Reordering or removing fields\n # will change behavior and permissions for existing grains! To deprecate a\n # permission, or for more information, see \"PermissionDef\" in\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n (\n name = \"admin\",\n # Name of the permission, used as an identifier for the permission in cases where string\n # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n\n title = (defaultText = \"admin\"),\n # Display name of the permission, e.g. to display in a checklist of permissions\n # that may be assigned when sharing.\n\n description = (defaultText = \"Is the owner.\")\n # Prose describing what this role means, suitable for a tool tip or similar help text.\n ),\n (\n name = \"write\",\n title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")\n ),\n (\n name = \"read\",\n title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\")\n )\n ],\n roles = [\n # Roles are logical collections of permissions. For instance, your app may have\n # a \"viewer\" role and an \"editor\" role\n (\n title = (defaultText = \"Owner\"),\n # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n\n permissions = [true, true, true],\n # An array indicating which permissions this role carries.\n # It should be the same length as the permissions array in\n # viewInfo, and the order of the lists must match.\n\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n # Brief explanatory text to show in the sharing UI indicating\n # what a user assigned this role will be able to do with the grain.\n\n description = (defaultText = \"Owners may view and edit all notes and change settings.\"),\n # Prose describing what this role means, suitable for a tool tip or similar help text.\n ),\n (\n title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\"),\n description = (defaultText = \"User may view and edit all notes.\")\n ),\n (\n title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"),\n description = (defaultText = \"Users may view all notes.\")\n )\n ]\n )\n # Apps can export an API to the world. The API is to be used primarily by Javascript\n # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # this string, if specified.\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 8, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2017.09.01\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork notebook\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n marketBig = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"jan@jambor.pro\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Twostairs\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Notetaking\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1166, height = 675, png = embed \"app-graphics\/paperwork_example_01.png\"),\n (width = 1166, height = 675, png = embed \"app-graphics\/paperwork_example_02.png\"),\n (width = 1166, height = 675, png = embed \"app-graphics\/paperwork_example_03.png\")\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n # Used for integrating permissions and roles into the Sandstorm shell\n # and for sandstorm-http-bridge to pass to your app.\n # Uncomment this block and adjust the permissions and roles to make\n # sense for your app.\n # For more information, see high-level documentation at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # and advanced details in the \"BridgeConfig\" section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n viewInfo = (\n # For details on the viewInfo field, consult \"ViewInfo\" in\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n permissions = [\n # Permissions which a user may or may not possess. A user's current\n # permissions are passed to the app as a comma-separated list of `name`\n # fields in the X-Sandstorm-Permissions header with each request.\n #\n # IMPORTANT: only ever append to this list! Reordering or removing fields\n # will change behavior and permissions for existing grains! To deprecate a\n # permission, or for more information, see \"PermissionDef\" in\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n (\n name = \"admin\",\n # Name of the permission, used as an identifier for the permission in cases where string\n # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n\n title = (defaultText = \"admin\"),\n # Display name of the permission, e.g. to display in a checklist of permissions\n # that may be assigned when sharing.\n\n description = (defaultText = \"Is the owner.\")\n # Prose describing what this role means, suitable for a tool tip or similar help text.\n ),\n (\n name = \"write\",\n title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")\n ),\n (\n name = \"read\",\n title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\")\n )\n ],\n roles = [\n # Roles are logical collections of permissions. For instance, your app may have\n # a \"viewer\" role and an \"editor\" role\n (\n title = (defaultText = \"Owner\"),\n # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n\n permissions = [true, true, true],\n # An array indicating which permissions this role carries.\n # It should be the same length as the permissions array in\n # viewInfo, and the order of the lists must match.\n\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n # Brief explanatory text to show in the sharing UI indicating\n # what a user assigned this role will be able to do with the grain.\n\n description = (defaultText = \"Owners may view and edit all notes and change settings.\"),\n # Prose describing what this role means, suitable for a tool tip or similar help text.\n ),\n (\n title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\"),\n description = (defaultText = \"User may view and edit all notes.\")\n ),\n (\n title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"),\n description = (defaultText = \"Users may view all notes.\")\n )\n ]\n )\n # Apps can export an API to the world. The API is to be used primarily by Javascript\n # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # this string, if specified.\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"dfd745d00a2093aa22fc17e499a6e0afcdedc89c","subject":"Rename contributor role to 'disc jockey'. Add new contributor role that does not have the 'control' permission.","message":"Rename contributor role to 'disc jockey'. Add new contributor role that does not have the 'control' permission.\n","repos":"dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n\n manifest = (\n appTitle = (defaultText = \"Groove Basin\"),\n appVersion = 7, # Increment this for every release.\n appMarketingVersion = (defaultText = \"2015.08.19 (1.5.1+)\"),\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/groovebasin-128.png\",\n dpi2x = embed \"app-graphics\/groovebasin-256.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/groovebasin-24.png\",\n dpi2x = embed \"app-graphics\/groovebasin-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/groovebasin-150.png\")),\n ),\n website = \"http:\/\/groovebasin.com\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/groovebasin\",\n license = (openSource = mit),\n categories = [media,],\n author = (\n upstreamAuthor = \"Andrew Kelley\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n screenshots = [(width = 448, height = 311, png = embed \"screenshot.png\")],\n changeLog = (defaultText = embed \"changeLog.md\"),\n ),\n\n\n actions = [\n ( title = (defaultText = \"New Music Library\"),\n command = .myCommand,\n nounPhrase = (defaultText = \"Music Library\")\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/app\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows tag editing and track deletion\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"allows listening and downloading\")),\n (name = \"add\", title = (defaultText = \"add\"),\n description = (defaultText = \"allows track uploads\")),\n (name = \"control\", title = (defaultText = \"control\"),\n description = (defaultText = \"allows control of the audio stream\")),\n (name = \"playlist\", title = (defaultText = \"playlist\"),\n description = (defaultText = \"allows playlist editing\"))],\n roles = [(title = (defaultText = \"controller\"),\n permissions = .controllerPermissions,\n verbPhrase = (defaultText = \"can control the stream\")),\n (title = (defaultText = \"disc jockey\"),\n permissions = .djPermissions,\n verbPhrase =\n (defaultText = \"can control the stream, upload tracks, and edit playlists\"),\n default = true),\n (title = (defaultText = \"administrator\"),\n permissions = .adminPermissions,\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"listener\"),\n permissions = .listenerPermissions,\n verbPhrase = (defaultText = \"can only listen\")),\n (title = (defaultText = \"contributor\"),\n permissions = .contributorPermissions,\n verbPhrase = (defaultText = \"can upload tracks and edit playlists\"))\n ]\n )\n )\n);\n\n# admin | read | add | control | playlist |\nconst controllerPermissions : List(Bool) = [ false, true, false, true, false];\nconst djPermissions : List(Bool) = [ false, true, true, true, true];\nconst adminPermissions : List(Bool) = [ true, true, true, true, true];\nconst listenerPermissions : List(Bool) = [ false, true, false, false, false];\nconst contributorPermissions : List(Bool) = [ false, true, true, false, true];\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n\n manifest = (\n appTitle = (defaultText = \"Groove Basin\"),\n appVersion = 7, # Increment this for every release.\n appMarketingVersion = (defaultText = \"2015.08.19 (1.5.1+)\"),\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/groovebasin-128.png\",\n dpi2x = embed \"app-graphics\/groovebasin-256.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/groovebasin-24.png\",\n dpi2x = embed \"app-graphics\/groovebasin-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/groovebasin-150.png\")),\n ),\n website = \"http:\/\/groovebasin.com\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/groovebasin\",\n license = (openSource = mit),\n categories = [media,],\n author = (\n upstreamAuthor = \"Andrew Kelley\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n screenshots = [(width = 448, height = 311, png = embed \"screenshot.png\")],\n changeLog = (defaultText = embed \"changeLog.md\"),\n ),\n\n\n actions = [\n ( title = (defaultText = \"New Music Library\"),\n command = .myCommand,\n nounPhrase = (defaultText = \"Music Library\")\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/app\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows tag editing and track deletion\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"allows listening and downloading\")),\n (name = \"add\", title = (defaultText = \"add\"),\n description = (defaultText = \"allows track uploads\")),\n (name = \"control\", title = (defaultText = \"control\"),\n description = (defaultText = \"allows control of the audio stream\")),\n (name = \"playlist\", title = (defaultText = \"playlist\"),\n description = (defaultText = \"allows playlist editing\"))],\n roles = [(title = (defaultText = \"controller\"),\n permissions = .controllerPermissions,\n verbPhrase = (defaultText = \"can control the stream\")),\n (title = (defaultText = \"contributor\"),\n permissions = .contributorPermissions,\n verbPhrase =\n (defaultText = \"can control the stream, upload tracks, and edit playlists\"),\n default = true),\n (title = (defaultText = \"administrator\"),\n permissions = .adminPermissions,\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"listener\"),\n permissions = .listenerPermissions,\n verbPhrase = (defaultText = \"can only listen\"))\n ]\n )\n )\n);\n\n# admin | read | add | control | playlist |\nconst controllerPermissions : List(Bool) = [ false, true, false, true, false];\nconst contributorPermissions : List(Bool) = [ false, true, true, true, true];\nconst adminPermissions : List(Bool) = [ true, true, true, true, true];\nconst listenerPermissions : List(Bool) = [ false, true, false, false, false];\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"358628f373df9815b3f3c59a6db1482ea5726aed","subject":"All <3: flexin that version bump","message":"All <3: flexin that version bump\n","repos":"sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.2.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"0fbdbe75a99bd6557269cb7fcd7345645cf8b438","subject":"Bump Sandstorm build version to 1.6.0.","message":"Bump Sandstorm build version to 1.6.0.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 12, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 11, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.7\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"cfc2175765c6740191aebd482e3bc358d868c811","subject":"Update urls.","message":"Update urls.\n","repos":"oliver4u\/WEKAN_runpartner,Serubin\/wekan,ddanssaert\/wekan,jtickle\/wekan,oliver4u\/WEKAN_runpartner,wekan\/wekan,Serubin\/wekan,johnleeming\/wekan,wekan\/wekan,johnleeming\/wekan,Serubin\/wekan,GhassenRjab\/wekan,oliver4u\/sap-wekan,nztqa\/wekan,mario-orlicky\/wekan,jtickle\/wekan,ddanssaert\/wekan,oliver4u\/sap-wekan,ddanssaert\/wekan,oliver4u\/WEKAN_runpartner,wekan\/wekan,oliver4u\/sap-wekan,jtickle\/wekan,libreboard\/libreboard,libreboard\/libreboard,wekan\/wekan,johnleeming\/wekan,GhassenRjab\/wekan,nztqa\/wekan,wekan\/wekan,nztqa\/wekan,mario-orlicky\/wekan,johnleeming\/wekan,GhassenRjab\/wekan,mario-orlicky\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 19,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.16.0~2017-03-21\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n upstreamAuthor = \"Maxime Quandalle\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"meta\/dwrensha-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 19,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.16.0~2017-03-21\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wefork\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n upstreamAuthor = \"Maxime Quandalle\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"meta\/dwrensha-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"cb36187dd38146bcf9e6e342f763fe3834c54fc7","subject":"Instance -> Project","message":"Instance -> Project\n","repos":"dwrensha\/sharelatex,neynah\/sharelatex,dwrensha\/sharelatex,neynah\/sharelatex","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"\/home\/david\/appdev\/sharelatex\"),\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","old_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"\/home\/david\/appdev\/sharelatex\"),\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"045e0bdbdc7319750206ccf2bf6046ef525e2df8","subject":"add GPG stuff to sandstorm config","message":"add GPG stuff to sandstorm config\n","repos":"strawlab\/neuron-catalog,strawlab\/neuron-catalog,strawlab\/neuron-catalog","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xe102d2c131b69f04;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u1pa4174jqhvn93fkgr6u07mfgpk53dtgvfqqz9hec0pxk6c8nuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Neuron Catalog\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Neuron Catalog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n # marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/strawlab.org\/neuron-catalog\",\n\n codeUrl = \"https:\/\/github.com\/strawlab\/neuron-catalog\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = agpl3),\n\n categories = [science, productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"strawman@astraw.com\",\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Andrew Straw\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Record keeping\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"read\"), (name = \"write\"), (name = \"admin\")],\n roles = [(title = (defaultText = \"reader\"),\n permissions = [true, false, false]),\n (title = (defaultText = \"writer\"),\n permissions = [true, true, false]),\n (title = (defaultText = \"admin\"),\n permissions = [true, true, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xe102d2c131b69f04;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u1pa4174jqhvn93fkgr6u07mfgpk53dtgvfqqz9hec0pxk6c8nuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Neuron Catalog\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Neuron Catalog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n # marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/strawlab.org\/neuron-catalog\",\n\n codeUrl = \"https:\/\/github.com\/strawlab\/neuron-catalog\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = agpl3),\n\n categories = [science, productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"andrew.straw@biologie.uni-freiburg.de\",\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Andrew Straw\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Record keeping\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"read\"), (name = \"write\"), (name = \"admin\")],\n roles = [(title = (defaultText = \"reader\"),\n permissions = [true, false, false]),\n (title = (defaultText = \"writer\"),\n permissions = [true, true, false]),\n (title = (defaultText = \"admin\"),\n permissions = [true, true, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"a5d4f8e576420603305561b610387843fcab7fe8","subject":"Bump version.","message":"Bump version.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 16, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0~2016-09-19\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\",\n packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\", \"node_modules\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))],\n eventTypes = [\n (name = \"edit\", verbPhrase = (defaultText = \"edited pad\"),\n notifySubscribers = false, autoSubscribeToGrain = true),\n (name = \"comment\", verbPhrase = (defaultText = \"added comment\"),\n notifySubscribers = true, autoSubscribeToThread = true),\n (name = \"reply\", verbPhrase = (defaultText = \"replied to comment\"),\n notifySubscribers = true, autoSubscribeToThread = true)\n ],\n ),\n\n saveIdentityCaps = true,\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 15, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0~2016-09-12\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\",\n packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\", \"node_modules\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))],\n eventTypes = [\n (name = \"edit\", verbPhrase = (defaultText = \"edited pad\"),\n notifySubscribers = false, autoSubscribeToGrain = true),\n (name = \"comment\", verbPhrase = (defaultText = \"added comment\"),\n notifySubscribers = true, autoSubscribeToThread = true),\n (name = \"reply\", verbPhrase = (defaultText = \"replied to comment\"),\n notifySubscribers = true, autoSubscribeToThread = true)\n ],\n ),\n\n saveIdentityCaps = true,\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"e6883926ac87461e16c94c852a40255d7de2679e","subject":"Fix next ID","message":"Fix next ID\n","repos":"rayNymous\/nupic,sambitgaan\/nupic,lscheinkman\/nupic,wanghaven\/nupic,go-bears\/nupic,runt18\/nupic,marionleborgne\/nupic,vitaly-krugl\/nupic,elkingtonmcb\/nupic,SaganBolliger\/nupic,alfonsokim\/nupic,badlogicmanpreet\/nupic,numenta\/nupic,brev\/nupic,sambitgaan\/nupic,fergalbyrne\/nupic,GeraldLoeffler\/nupic,alfonsokim\/nupic,vitaly-krugl\/nupic,cngo-github\/nupic,wanghaven\/nupic,vamsirajendra\/nupic,ywcui1990\/nupic,BeiLuoShiMen\/nupic,pap\/nupic,glorizen\/nupic,virneo\/nupic,scottpurdy\/nupic,eranchetz\/nupic,arhik\/nupic,rhyolight\/nupic,cngo-github\/nupic,akhilaananthram\/nupic,fergalbyrne\/nupic,EricSB\/nupic,go-bears\/nupic,passiweinberger\/nupic,chen0031\/nupic,rhyolight\/nupic,pulinagrawal\/nupic,mcanthony\/nupic,numenta-ci\/nupic,allanino\/nupic,rcrowder\/nupic,passiweinberger\/nupic,neuroidss\/nupic,pap\/nupic,eranchetz\/nupic,blueburningcoder\/nupic,vamsirajendra\/nupic,jcasner\/nupic,virneo\/nupic,allanino\/nupic,breznak\/nupic,breznak\/nupic,numenta\/nupic,rcrowder\/nupic,SaganBolliger\/nupic,darshanthaker\/nupic,akhilaananthram\/nupic,markneville\/nupic,rcrowder\/nupic,jcasner\/nupic,badlogicmanpreet\/nupic,runt18\/nupic,fergalbyrne\/nupic,metaml\/nupic,darshanthaker\/nupic,BoltzmannBrain\/nupic,loretoparisi\/nupic,BeiLuoShiMen\/nupic,go-bears\/nupic,ywcui1990\/nupic,loretoparisi\/nupic,pulinagrawal\/nupic,rhyolight\/nupic,subutai\/nupic,chanceraine\/nupic,mcanthony\/nupic,mcanthony\/nupic,BoltzmannBrain\/nupic,ywcui1990\/nupic,runt18\/nupic,chen0031\/nupic,vitaly-krugl\/nupic,breznak\/nupic,subutai\/nupic,rayNymous\/nupic,arhik\/nupic,metaml\/nupic,elkingtonmcb\/nupic,glorizen\/nupic,darshanthaker\/nupic,blueburningcoder\/nupic,ben-hopps\/nupic,metaml\/nupic,chanceraine\/nupic,numenta\/nupic,EricSB\/nupic,allanino\/nupic,vamsirajendra\/nupic,markneville\/nupic,passiweinberger\/nupic,cogmission\/nupic,blueburningcoder\/nupic,arhik\/nupic,akhilaananthram\/nupic,neuroidss\/nupic,numenta-ci\/nupic,EricSB\/nupic,neuroidss\/nupic,brev\/nupic,cngo-github\/nupic,rayNymous\/nupic,ben-hopps\/nupic,BoltzmannBrain\/nupic,marionleborgne\/nupic,chen0031\/nupic,eranchetz\/nupic,GeraldLoeffler\/nupic,numenta-ci\/nupic,markneville\/nupic,glorizen\/nupic,BeiLuoShiMen\/nupic,SaganBolliger\/nupic,scottpurdy\/nupic,jcasner\/nupic,pulinagrawal\/nupic,alfonsokim\/nupic,pap\/nupic,brev\/nupic,badlogicmanpreet\/nupic,virneo\/nupic,cogmission\/nupic,subutai\/nupic,loretoparisi\/nupic,wanghaven\/nupic,sambitgaan\/nupic,cogmission\/nupic,GeraldLoeffler\/nupic,lscheinkman\/nupic,chanceraine\/nupic,lscheinkman\/nupic,scottpurdy\/nupic,elkingtonmcb\/nupic,ben-hopps\/nupic,marionleborgne\/nupic","old_file":"nupic\/encoders\/adaptivescalar.capnp","new_file":"nupic\/encoders\/adaptivescalar.capnp","new_contents":"@0xf11485b8c813b489;\n\nusing import \"\/nupic\/movingaverage.capnp\".MovingAverageProto;\n\n# Next ID: 10\nstruct AdaptiveScalarEncoderProto {\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n name @5 :Text;\n verbosity @6 :UInt8;\n clipInput @7 :Bool;\n recordNum @8 :UInt32;\n slidingWindow @9 :MovingAverageProto;\n}\n","old_contents":"@0xf11485b8c813b489;\n\nusing import \"\/nupic\/movingaverage.capnp\".MovingAverageProto;\n\n# Next ID: 8\nstruct AdaptiveScalarEncoderProto {\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n name @5 :Text;\n verbosity @6 :UInt8;\n clipInput @7 :Bool;\n recordNum @8 :UInt32;\n slidingWindow @9 :MovingAverageProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"64f15e8d68232f111faa2f0c26e7fe530517e8a2","subject":"bump version","message":"bump version\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 3, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.3\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n (width = 1096, height = 545, png = embed \"screenshots\/screenshot-1.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.2\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n (width = 1096, height = 545, png = embed \"screenshots\/screenshot-1.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"aa233709adf4b1057ec66153c2e1e826fcf91547","subject":"update path of executable","message":"update path of executable\n","repos":"dwrensha\/acronymy,neynah\/acronymy","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","old_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"0954cff5b470712210275a9c0699d85d6579ab54","subject":"Release v0.10.0-rc3","message":"Release v0.10.0-rc3\n","repos":"wykeith\/cp2m,johnleeming\/wekan,oliver4u\/WEKAN_runpartner,wekan\/wekan,nztqa\/wekan,gelojavonitalla\/wekan,nztqa\/wekan,pro-to-tip\/wekan,Xperterra\/wekan,ahmadassaf\/libreboard,wykeith\/cp2m,wekan\/wekan,felipecosta07\/js,Serubin\/wekan,Serubin\/wekan,libreboard\/libreboard,GhassenRjab\/wekan,mario-orlicky\/wekan,oliver4u\/WEKAN_runpartner,mario-orlicky\/wekan,GhassenRjab\/wekan,ahmadassaf\/libreboard,johnleeming\/wekan,wekan\/wekan,atFriendly\/wekan,oliver4u\/sap-wekan,AdrianoCahete\/wekan,AlexanderS\/wekan,floatinghotpot\/wekan,Zyko0\/wekan,oliver4u\/sap-wekan,ahmadassaf\/libreboard,ddanssaert\/wekan,FSFTN\/Wekan,Zyko0\/wekan,ddanssaert\/wekan,mario-orlicky\/wekan,oliver4u\/WEKAN_runpartner,libreboard\/libreboard,wekan\/wekan,araczkowski\/paczka.pro,AdrianoCahete\/wekan,nztqa\/wekan,felipecosta07\/js,GhassenRjab\/wekan,johnleeming\/wekan,oliver4u\/sap-wekan,Serubin\/wekan,araczkowski\/paczka.pro,floatinghotpot\/wekan,atFriendly\/wekan,Xperterra\/wekan,gelojavonitalla\/wekan,jtickle\/wekan,AlexanderS\/wekan,jtickle\/wekan,pro-to-tip\/wekan,wekan\/wekan,ddanssaert\/wekan,johnleeming\/wekan,FSFTN\/Wekan,jtickle\/wekan,araczkowski\/paczka.pro","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 7,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10-rc3\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"Changelog.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 7,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10-RC2\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"Changelog.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"8bb8b84fb6806aa02cab6e624af77907a10f8568","subject":"Bump to v7 (upstream v0.5.8)","message":"Bump to v7 (upstream v0.5.8)\n","repos":"neynah\/GhostSS,jparyani\/GhostSS,jparyani\/GhostSS,jparyani\/GhostSS,neynah\/GhostSS,neynah\/GhostSS","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 7, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 5, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"bf678f8671488207c9eaedc95e9408fba826e777","subject":"Update marketing version.","message":"Update marketing version.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 7, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"2012.05.31 (1.5.6+)\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 7, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"84d1ffd43865a41502ec579a8e040f6590561049","subject":"update codeUrl","message":"update codeUrl\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.0.0\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/sandstorm-io\/collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n (width = 1096, height = 545, png = embed \"screenshots\/screenshot-1.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.0.0\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n (width = 1096, height = 545, png = embed \"screenshots\/screenshot-1.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"4e5e3123af19c89cd00c8b91422652a9d82671fb","subject":"\/target\/acronymy -> \/target\/release\/acronymy","message":"\/target\/acronymy -> \/target\/release\/acronymy\n","repos":"dwrensha\/acronymy,neynah\/acronymy","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/release\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/release\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","old_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"fe14db27e00d2ec8b81470052821be53d2c3153a","subject":"use nvm node","message":"use nvm node\n","repos":"neynah\/sharelatex,dwrensha\/sharelatex,neynah\/sharelatex,dwrensha\/sharelatex","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 6, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.2\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/home\/david\/.nvm\/v0.10.36\/bin\/node\", packagePath = \"usr\/bin\/node\"),\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/host.conf\", \"etc\/localtime\", \"etc\/nsswitch.conf\",\n \"etc\/resolv.conf\"\n ]\n ),\n ( sourcePath = \"\/var\/lib\/texmf\", packagePath=\"usr\/local\/lib\/texmf\")\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"usr\/share\/texmf-dist\",\n \"document-updater\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"web\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"track-changes\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"real-time\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\"]\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/usr\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sharelatex\"),\n (key = \"HOME\", value=\"\/var\")\n ]\n);\n","old_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 6, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.2\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/host.conf\", \"etc\/localtime\", \"etc\/nsswitch.conf\",\n \"etc\/resolv.conf\"\n ]\n ),\n ( sourcePath = \"\/var\/lib\/texmf\", packagePath=\"usr\/local\/lib\/texmf\")\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"usr\/share\/texmf-dist\",\n \"document-updater\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"web\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"track-changes\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"real-time\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\"]\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/usr\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sharelatex\"),\n (key = \"HOME\", value=\"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"94cb33cdbe1ebb341846761134685f22450be716","subject":"Set appTitle and bump version.","message":"Set appTitle and bump version.\n","repos":"ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 4, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"c6c16f2998aea9c260f6a1eac6f0c065f8859a8e","subject":"Bump app version to 1","message":"Bump app version to 1\n","repos":"jparyani\/Telescope,neynah\/Telescope,jparyani\/Telescope,neynah\/Telescope","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x82984481f49bd8f5;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5h13ka55xn93gpenjc29f5kxqpjf5gk4drgx949q4dx7gk968smh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Telescope\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"admin\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x82984481f49bd8f5;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5h13ka55xn93gpenjc29f5kxqpjf5gk4drgx949q4dx7gk968smh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Telescope\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"admin\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"eb725ff6af9995cd08362c32e22dad31633c5636","subject":"Always include media folder for Sandstorm package","message":"Always include media folder for Sandstorm package\n","repos":"ashwini-angular\/lets-chat,neynah\/lets-chat,jparyani\/lets-chat,jparyani\/lets-chat,ashwini-angular\/lets-chat,jparyani\/lets-chat,neynah\/lets-chat,ashwini-angular\/lets-chat,neynah\/lets-chat","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"media\", \"templates\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"templates\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"48aecb5fb65ff436f17fe1501b703cdf1288fd02","subject":"Fixed Next ID value in comment in model.capnp","message":"Fixed Next ID value in comment in model.capnp\n","repos":"alfonsokim\/nupic,ywcui1990\/nupic,rhyolight\/nupic,scottpurdy\/nupic,alfonsokim\/nupic,lscheinkman\/nupic,rcrowder\/nupic,neuroidss\/nupic,vitaly-krugl\/nupic,scottpurdy\/nupic,numenta\/nupic,vitaly-krugl\/nupic,rhyolight\/nupic,rhyolight\/nupic,subutai\/nupic,subutai\/nupic,ywcui1990\/nupic,rcrowder\/nupic,numenta\/nupic,lscheinkman\/nupic,numenta\/nupic,neuroidss\/nupic,alfonsokim\/nupic,lscheinkman\/nupic,vitaly-krugl\/nupic,ywcui1990\/nupic,subutai\/nupic,rcrowder\/nupic,scottpurdy\/nupic,neuroidss\/nupic","old_file":"src\/nupic\/frameworks\/opf\/model.capnp","new_file":"src\/nupic\/frameworks\/opf\/model.capnp","new_contents":"@0xa2163632a7294a0d;\n\nusing import \"\/nupic\/frameworks\/opf\/opf_utils.capnp\".InferenceType;\n\n# Next ID: 2\nstruct ModelProto {\n inferenceType @0 :InferenceType;\n numPredictions @1 :UInt32;\n}\n","old_contents":"@0xa2163632a7294a0d;\n\nusing import \"\/nupic\/frameworks\/opf\/opf_utils.capnp\".InferenceType;\n\n# Next ID: 5\nstruct ModelProto {\n inferenceType @0 :InferenceType;\n numPredictions @1 :UInt32;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"2e3b2cc3cebb3d7497ceed7dfda207871e087408","subject":"admin permission","message":"admin permission\n","repos":"neynah\/groovebasin,neynah\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appVersion = 0, # Increment this for every release.\n\n actions = [\n ( title = (defaultText = \"New GrooveBasin Instance\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\")]\n )\n )\n\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New GrooveBasin Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a39e1f727eb7e4ee59388288d5f2d4ee09581988","subject":"Bumped ordinal number in date.capnp","message":"Bumped ordinal number in date.capnp\n","repos":"rcrowder\/nupic,lscheinkman\/nupic,go-bears\/nupic,sambitgaan\/nupic,EricSB\/nupic,go-bears\/nupic,scottpurdy\/nupic,rhyolight\/nupic,cogmission\/nupic,scottpurdy\/nupic,BoltzmannBrain\/nupic,arhik\/nupic,cogmission\/nupic,ywcui1990\/nupic,badlogicmanpreet\/nupic,neuroidss\/nupic,SaganBolliger\/nupic,subutai\/nupic,runt18\/nupic,jcasner\/nupic,ywcui1990\/nupic,numenta\/nupic,subutai\/nupic,BoltzmannBrain\/nupic,EricSB\/nupic,fergalbyrne\/nupic,blueburningcoder\/nupic,vitaly-krugl\/nupic,jcasner\/nupic,numenta\/nupic,marionleborgne\/nupic,breznak\/nupic,sambitgaan\/nupic,rhyolight\/nupic,breznak\/nupic,BoltzmannBrain\/nupic,fergalbyrne\/nupic,SaganBolliger\/nupic,badlogicmanpreet\/nupic,neuroidss\/nupic,numenta-ci\/nupic,marionleborgne\/nupic,marionleborgne\/nupic,alfonsokim\/nupic,rcrowder\/nupic,vitaly-krugl\/nupic,sambitgaan\/nupic,rhyolight\/nupic,arhik\/nupic,jcasner\/nupic,pulinagrawal\/nupic,runt18\/nupic,blueburningcoder\/nupic,fergalbyrne\/nupic,scottpurdy\/nupic,numenta-ci\/nupic,badlogicmanpreet\/nupic,go-bears\/nupic,alfonsokim\/nupic,SaganBolliger\/nupic,EricSB\/nupic,vitaly-krugl\/nupic,rcrowder\/nupic,subutai\/nupic,lscheinkman\/nupic,numenta-ci\/nupic,ywcui1990\/nupic,numenta\/nupic,alfonsokim\/nupic,pulinagrawal\/nupic,arhik\/nupic,lscheinkman\/nupic,blueburningcoder\/nupic,cogmission\/nupic,pulinagrawal\/nupic,neuroidss\/nupic,breznak\/nupic,runt18\/nupic","old_file":"src\/nupic\/encoders\/date.capnp","new_file":"src\/nupic\/encoders\/date.capnp","new_contents":"@0x9b23d989c61ef9e6;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","old_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"a88c2b8828f846c1189aa59470a54bb7dbe9a5b2","subject":"RPC Returns need to be redirectable to improve pipelining.","message":"RPC Returns need to be redirectable to improve pipelining.\n","repos":"bsn069\/capnproto,a-richardson\/capnproto,MarPiRK\/capnproto,ocdtrekkie\/capnproto,khklau\/capnproto,joliss\/capnproto,rcrowder\/capnproto,johnkdoe\/capnproto,vladon\/capnproto,mrdomino\/capnproto,bryce-gibson\/capnproto,modulexcite\/capnproto,johnkdoe\/capnproto,jparyani\/capnproto,MarPiRK\/capnproto,geofft\/capnproto,khklau\/capnproto,bsn069\/capnproto,artillery\/capnproto,ocdtrekkie\/capnproto,artillery\/capnproto,jparyani\/capnproto,jparyani\/capnproto,Fraser999\/capnproto,rcrowder\/capnproto,mrdomino\/capnproto,artillery\/capnproto,MarPiRK\/capnproto,zarvox\/capnproto,joliss\/capnproto,ligzy\/capnproto,khklau\/capnproto,Fraser999\/capnproto,Fraser999\/capnproto,joliss\/capnproto,zarvox\/capnproto,kamalmarhubi\/capnproto,nagyistoce\/capnproto,vladon\/capnproto,maurer\/capnproto,mrdomino\/capnproto,nagyistoce\/capnproto,johnkdoe\/capnproto,a-richardson\/capnproto,martindale\/capnproto,nagyistoce\/capnproto,mologie\/capnproto,modulexcite\/capnproto,kamalmarhubi\/capnproto,mologie\/capnproto,geofft\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,bryce-gibson\/capnproto,pjulien\/capnproto,maurer\/capnproto,hntrmrrs\/capnproto,zarvox\/capnproto,martindale\/capnproto,mologie\/capnproto,bryce-gibson\/capnproto,hntrmrrs\/capnproto,kamalmarhubi\/capnproto,modulexcite\/capnproto,ocdtrekkie\/capnproto,geofft\/capnproto,pjulien\/capnproto,ligzy\/capnproto,bsn069\/capnproto,vladon\/capnproto,hntrmrrs\/capnproto,martindale\/capnproto,a-richardson\/capnproto,pjulien\/capnproto,maurer\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n params @5 :Object;\n # The params struct. The fields of this struct correspond to the parameters of the method.\n #\n # The params may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n\n sendReturnTo :union {\n # Where should the return message be sent?\n\n caller @6 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @7 :QuestionId;\n # **(level 1)**\n #\n # This is actually an echo of a call originally made by the receiver, with the given question\n # ID. The result of this call should directly resolve the original call, without ever sending\n # a `Return` over the wire.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # - The `Call` for bar'() has `sendReturnTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A does *not* send a `Return` message to Vat B. Instead, it\n # directly returns the result to Alice.\n # - Vat A then sends a `Finish` message for bar().\n # - Vat B, on receiving the `Finish`, sends a corresponding `Finish` for bar'().\n # - Neither bar() nor bar'() ever see a `Return` message sent over the wire.\n\n thirdParty @8 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains a `redirect` to Vat C. When Vat A sends an `Accept` to Vat C,\n # it receives back a `Return` containing the call's actual result. Vat C never sends a `Return`\n # to Vat B, although `Finish` messages must still be sent corresponding to every `Call` as well\n # as the `Accept`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the params to which the callee continues to hold references. Any\n # other capabilities from the params are implicitly released.\n\n union {\n results @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `results` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n\n redirect @6 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The call has been redirected to another vat, and the result should be obtained by connecting\n # to that vat directly. An `Accept` message sent to the vat will return the result. See\n # `Call.sendReturnTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n #\n # TODO(soon): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller hasn't yet finished processing the response.\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the results to which the callee continues to hold references. Any\n # other capabilities from the results that need to be released are implicitly released along\n # with the result itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the results of an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = Object;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = Object;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = Object;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n params @5 :Object;\n # The params struct. The fields of this struct correspond to the parameters of the method.\n #\n # The params may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the params to which the callee continues to hold references. Any\n # other capabilities from the params are implicitly released.\n\n union {\n results @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `results` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n #\n # TODO(soon): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller hasn't yet finished processing the response.\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the results to which the callee continues to hold references. Any\n # other capabilities from the results that need to be released are implicitly released along\n # with the result itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the results of an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = Object;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = Object;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = Object;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a48ec6a4b74a653b55fefeabe752046936e4b687","subject":"Oasis config.","message":"Oasis config.\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"src\/blackrock\/master.capnp","new_file":"src\/blackrock\/master.capnp","new_contents":"# Sandstorm Blackrock\n# Copyright (c) 2015 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0xf58bc2dacec400ce;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"blackrock\");\n\nstruct MasterConfig {\n workerCount @0 :UInt32;\n\n # For now, we expect exactly one of each of the other machine types.\n\n frontendConfig @1 :import \"frontend.capnp\".FrontendConfig;\n\n union {\n vagrant @2 :VagrantConfig;\n gce @3 :GceConfig;\n }\n}\n\nstruct VagrantConfig {}\n\nstruct GceConfig {\n project @0 :Text;\n zone @1 :Text;\n instanceTypes :group {\n storage @2 :Text = \"n1-standard-1\";\n worker @3 :Text = \"n1-highmem-2\";\n coordinator @4 :Text = \"n1-standard-1\";\n frontend @5 :Text = \"n1-standard-1\";\n mongo @6 :Text = \"n1-standard-1\";\n }\n}\n\nconst vagrantConfig :MasterConfig = (\n workerCount = 2,\n frontendConfig = (\n baseUrl = \"http:\/\/localrock.sandstorm.io:6080\",\n wildcardHost = \"*.localrock.sandstorm.io:6080\",\n allowDemoAccounts = false,\n isTesting = true\n ),\n vagrant = ()\n);\n\nconst gceTestConfig :MasterConfig = (\n workerCount = 2,\n frontendConfig = (\n baseUrl = \"https:\/\/testrock.sandstorm.io\",\n wildcardHost = \"*.testrock.sandstorm.io\",\n allowDemoAccounts = false,\n isTesting = true\n ),\n gce = (\n project = \"sandstorm-blackrock-testing\",\n zone = \"us-central1-f\",\n instanceTypes = (\n storage = \"g1-small\",\n worker = \"n1-standard-1\",\n coordinator = \"g1-small\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n\nconst gceOasisConfig :MasterConfig = (\n workerCount = 2,\n frontendConfig = (\n baseUrl = \"https:\/\/oasis.sandstorm.io\",\n wildcardHost = \"*.oasis.sandstorm.io\",\n ddpUrl = \"https:\/\/ddp.oasis.sandstorm.io\",\n allowDemoAccounts = false,\n isTesting = false\n ),\n gce = (\n project = \"sandstorm-oasis\",\n zone = \"us-central1-f\"\n )\n);\n","old_contents":"# Sandstorm Blackrock\n# Copyright (c) 2015 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0xf58bc2dacec400ce;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"blackrock\");\n\nstruct MasterConfig {\n workerCount @0 :UInt32;\n\n # For now, we expect exactly one of each of the other machine types.\n\n frontendConfig @1 :import \"frontend.capnp\".FrontendConfig;\n\n union {\n vagrant @2 :VagrantConfig;\n gce @3 :GceConfig;\n }\n}\n\nstruct VagrantConfig {}\n\nstruct GceConfig {\n project @0 :Text;\n zone @1 :Text;\n instanceTypes :group {\n storage @2 :Text = \"n1-standard-1\";\n worker @3 :Text = \"n1-highmem-2\";\n coordinator @4 :Text = \"n1-standard-1\";\n frontend @5 :Text = \"n1-standard-1\";\n mongo @6 :Text = \"n1-standard-1\";\n }\n}\n\nconst vagrantConfig :MasterConfig = (\n workerCount = 2,\n frontendConfig = (\n baseUrl = \"http:\/\/localrock.sandstorm.io:6080\",\n wildcardHost = \"*.localrock.sandstorm.io:6080\",\n allowDemoAccounts = false,\n isTesting = true\n ),\n vagrant = ()\n);\n\nconst gceTestConfig :MasterConfig = (\n workerCount = 2,\n frontendConfig = (\n baseUrl = \"https:\/\/testrock.sandstorm.io\",\n wildcardHost = \"*.testrock.sandstorm.io\",\n allowDemoAccounts = false,\n isTesting = true\n ),\n gce = (\n project = \"sandstorm-blackrock-testing\",\n zone = \"us-central1-f\",\n instanceTypes = (\n storage = \"g1-small\",\n worker = \"n1-standard-1\",\n coordinator = \"g1-small\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"787d73a4670b27f7648fe61845748bf7f5fee177","subject":"Expanded rules to include where clauses in schema","message":"Expanded rules to include where clauses in schema\n","repos":"chubbymaggie\/holmes,maurer\/holmes,BinaryAnalysisPlatform\/holmes,tempbottle\/holmes,maurer\/holmes","old_file":"server\/src\/holmes.capnp","new_file":"server\/src\/holmes.capnp","new_contents":"@0xaaef86128cdda946;\ninterface Holmes {\n # Values\n struct Val {\n union {\n uint64 @0 :UInt64;\n string @1 :Text;\n blob @2 :Data;\n }\n }\n\n struct HType {\n union {\n uint64 @0 :Void;\n string @1 :Void;\n blob @2 :Void;\n }\n }\n\n # Variables\n using Var = UInt32;\n\n # Logical facts\n using PredName = Text;\n struct Fact {\n predicate @0 :PredName;\n args @1 :List(Val);\n }\n\n struct BodyExpr {\n union {\n unbound @0 :Void;\n var @1 :Var;\n const @2 :Val;\n }\n }\n\n struct BodyClause {\n predicate @0 :PredName;\n args @1 :List(BodyExpr);\n }\n\n struct FExpr {\n func @0 :Text;\n args @1 :List(Expr);\n }\n\n struct Expr {\n union {\n var @0 :Var;\n const @1 :Val;\n app @2 : FExpr;\n }\n }\n\n struct WhereClause {\n lhs @0 :List(BodyExpr);\n rhs @1 :Expr;\n }\n\n struct Rule {\n head @0 :BodyClause;\n body @1 :List(BodyClause);\n where @2 :List(WhereClause);\n }\n\n interface HFunc {\n types @0 ()->(inputTypes : List(HType),\n outputTypes : List(HType));\n run @1 (args :List(Val)) -> (results :List(Val));\n }\n\n # Register a predicate\n newPredicate @0 (predName :PredName,\n argTypes :List(HType)) -> (valid :Bool);\n\n # Add a fact to the extensional database\n newFact @1 (fact :Fact);\n \n # Ask the server to search or expand the intensional database\n # searching for a set of facts that matches a body clause\n # Returns the list of satisfying assignments to the body clauses.\n derive @2 (query :List(BodyClause)) -> (ctx :List(List(Val)));\n\n # Add a rule to expand the intentional database\n newRule @3 (rule :Rule) -> ();\n\n # Register a new external function\n newFunc @4 (name :Text, func :HFunc);\n}\n","old_contents":"@0xaaef86128cdda946;\ninterface Holmes {\n # Values\n struct Val {\n union {\n uint64 @0 :UInt64;\n string @1 :Text;\n blob @2 :Data;\n }\n }\n\n struct HType {\n union {\n uint64 @0 :Void;\n string @1 :Void;\n blob @2 :Void;\n }\n }\n\n # Variables\n using Var = UInt32;\n\n # Logical facts\n using PredName = Text;\n struct Fact {\n predicate @0 :PredName;\n args @1 :List(Val);\n }\n\n struct BodyExpr {\n union {\n unbound @0 :Void;\n var @1 :Var;\n const @2 :Val;\n }\n }\n\n struct BodyClause {\n predicate @0 :PredName;\n args @1 :List(BodyExpr);\n }\n\n struct Rule {\n head @0 :BodyClause;\n body @1 :List(BodyClause);\n }\n\n interface HFunc {\n types @0 ()->(inputTypes : List(HType),\n outputTypes : List(HType));\n run @1 (args :List(Val)) -> (results :List(Val));\n }\n\n # Register a predicate\n newPredicate @0 (predName :PredName,\n argTypes :List(HType)) -> (valid :Bool);\n\n # Add a fact to the extensional database\n newFact @1 (fact :Fact);\n \n # Ask the server to search or expand the intensional database\n # searching for a set of facts that matches a body clause\n # Returns the list of satisfying assignments to the body clauses.\n derive @2 (query :List(BodyClause)) -> (ctx :List(List(Val)));\n\n # Add a rule to expand the intentional database\n newRule @3 (rule :Rule) -> ();\n\n # Register a new external function\n newFunc @4 (name :Text, func :HFunc);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"11146defd4c0d103960e52e28e9e93d5b04cf718","subject":"Fix typo","message":"Fix typo\n","repos":"mrdomino\/capnproto,rcrowder\/capnproto,pjulien\/capnproto,vladon\/capnproto,vladon\/capnproto,maurer\/capnproto,jparyani\/capnproto,mologie\/capnproto,hntrmrrs\/capnproto,rcrowder\/capnproto,maurer\/capnproto,jparyani\/capnproto,mologie\/capnproto,vladon\/capnproto,rcrowder\/capnproto,jparyani\/capnproto,hntrmrrs\/capnproto,hntrmrrs\/capnproto,pjulien\/capnproto,maurer\/capnproto,mologie\/capnproto,mrdomino\/capnproto,pjulien\/capnproto,mrdomino\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` message sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` message sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"44feb71e5a3275730bf9eaed842f32408181ce9c","subject":"adding a sequence number field","message":"adding a sequence number field\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/command.capnp","new_file":"src\/bcprotocol\/command.capnp","new_contents":"@0xc7bd906a94321b78;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/src\/core\/entity.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Rule = import \"\/src\/core\/rule.capnp\";\n\nstruct ErrorVersionMismatch { }\nstruct ErrorNoSuchTeam { }\nstruct ErrorTeamFull { }\nstruct ErrorUniformTaken { }\nstruct ErrorGoalieTaken { }\nstruct ErrorGameInPlayOn { }\n\nstruct InitRequest\n{\n sequence @0 :Metadata.SequenceNumber;\n version @1 :Metadata.Version;\n teamName @2 :Text;\n uniform @3 :Entity.UniformNumber;\n playerType @4 :Entity.PlayerType;\n}\n\nstruct InitReply\n{\n sequence @0 :Metadata.SequenceNumber;\n union\n {\n\tresult @0 :InitResult;\n\terror @1 :InitError;\n }\n}\n\nstruct InitResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct InitError\n{\n union\n {\n\tversionMismatch @0 :ErrorVersionMismatch;\n\tnoSuchTeam @1 :ErrorNoSuchTeam;\n\tteamFull @2 :ErrorTeamFull;\n\tuniformTaken @3 :ErrorUniformTaken;\n\tgoalieTaken @4 :ErrorGoalieTaken;\n }\n}\n\nstruct ReconnectRequest\n{\n sequence @0 :Metadata.SequenceNumber;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n}\n\nstruct ReconnectReply\n{\n sequence @0 :Metadata.SequenceNumber;\n union\n {\n\tresult @0 :ReconnectResult;\n\terror @1 :ReconnectError;\n }\n}\n\nstruct ReconnectResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct ReconnectError\n{\n union\n {\n\tnoSuchTeam @0 :ErrorNoSuchTeam;\n\tteamFull @1 :ErrorTeamFull;\n\tuniformTaken @2 :ErrorUniformTaken;\n\tgameInPlayOn @3 :ErrorGameInPlayOn;\n }\n}\n\nstruct ByeRequest\n{\n sequence @0 :Metadata.SequenceNumber;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n}\n\nstruct ByeReply\n{\n sequence @0 :Metadata.SequenceNumber;\n}\n","old_contents":"@0xc7bd906a94321b78;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/src\/core\/entity.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Rule = import \"\/src\/core\/rule.capnp\";\n\nstruct ErrorVersionMismatch { }\nstruct ErrorNoSuchTeam { }\nstruct ErrorTeamFull { }\nstruct ErrorUniformTaken { }\nstruct ErrorGoalieTaken { }\nstruct ErrorGameInPlayOn { }\n\nstruct InitRequest\n{\n version @0 :Metadata.Version;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct InitReply\n{\n union\n {\n\tresult @0 :InitResult;\n\terror @1 :InitError;\n }\n}\n\nstruct InitResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct InitError\n{\n union\n {\n\tversionMismatch @0 :ErrorVersionMismatch;\n\tnoSuchTeam @1 :ErrorNoSuchTeam;\n\tteamFull @2 :ErrorTeamFull;\n\tuniformTaken @3 :ErrorUniformTaken;\n\tgoalieTaken @4 :ErrorGoalieTaken;\n }\n}\n\nstruct ReconnectRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ReconnectReply\n{\n union\n {\n\tresult @0 :ReconnectResult;\n\terror @1 :ReconnectError;\n }\n}\n\nstruct ReconnectResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct ReconnectError\n{\n union\n {\n\tnoSuchTeam @0 :ErrorNoSuchTeam;\n\tteamFull @1 :ErrorTeamFull;\n\tuniformTaken @2 :ErrorUniformTaken;\n\tgameInPlayOn @3 :ErrorGameInPlayOn;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"682cc0c507bc2f2ede0136cc7e080980350cbead","subject":"capnp\/test: add union in generic struct test - compilation error","message":"capnp\/test: add union in generic struct test - compilation error\n\nAdding union into TestGenerics struct leads to compilation error\nin generated header:\n````cpp\nIn file included from external\/capnproto\/c++\/src\/capnp\/test_capnp\/capnp\/test.capnp.c++:4:0:\nexternal\/capnproto\/c++\/src\/capnp\/test_capnp\/capnp\/test.capnp.h:9565:10: error: need \u2018typename\u2019 before \u2018capnproto_test::capnp::test::TestGenerics::Ug::Reader\u2019 because \u2018capnproto_test::capnp::test::TestGenerics::Ug\u2019 is a dependent scope\n inline Ug::Reader getUg() const;\n````\nRelavant parts in header file:\n\n````cpp\ntemplate \nstruct TestGenerics {\n ...\n struct Ug;\n};\n\ntemplate \nclass TestGenerics::Reader {\n ...\n inline Ug::Reader getUg() const;\n};\n````\n\nCompiler misses `typename` keyword before Ug::Reader.\n","repos":"pjulien\/capnproto,jparyani\/capnproto,mologie\/capnproto,pjulien\/capnproto,jparyani\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,pjulien\/capnproto,mrdomino\/capnproto,mrdomino\/capnproto,jparyani\/capnproto,mologie\/capnproto,hntrmrrs\/capnproto,mologie\/capnproto,hntrmrrs\/capnproto","old_file":"c++\/src\/capnp\/test.capnp","new_file":"c++\/src\/capnp\/test.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xd508eebdc2dc42b8;\n\nusing Cxx = import \"c++.capnp\";\n\n# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified\n# names for stuff in the capnproto namespace.\n$Cxx.namespace(\"capnproto_test::capnp::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = 0x\"62 61 72\"; # \"bar\"\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n\n # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer\n # in the struct.\n}\n\nstruct TestAnyOthers {\n anyStructField @0 :AnyStruct;\n anyListField @1 :AnyList;\n capabilityField @2 :Capability;\n}\n\nstruct TestOutOfOrder {\n foo @3 :Text;\n bar @2 :Text;\n baz @8 :Text;\n qux @0 :Text;\n quux @6 :Text;\n corge @4 :Text;\n grault @1 :Text;\n garply @7 :Text;\n waldo @5 :Text;\n}\n\nstruct TestUnion {\n union0 @0! :union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1! :union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2! :union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3! :union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnnamedUnion {\n before @0 :Text;\n\n union {\n foo @1 :UInt16;\n bar @3 :UInt32;\n }\n\n middle @2 :UInt16;\n\n after @4 :Text;\n}\n\nstruct TestUnionInUnion {\n # There is no reason to ever do this.\n outer :union {\n inner :union {\n foo @0 :Int32;\n bar @1 :Int32;\n }\n baz @2 :Int32;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n }\n }\n}\n\nstruct TestInterleavedGroups {\n group1 :group {\n foo @0 :UInt32;\n bar @2 :UInt64;\n union {\n qux @4 :UInt16;\n corge :group {\n grault @6 :UInt64;\n garply @8 :UInt16;\n plugh @14 :Text;\n xyzzy @16 :Text;\n }\n\n fred @12 :Text;\n }\n\n waldo @10 :Text;\n }\n\n group2 :group {\n foo @1 :UInt32;\n bar @3 :UInt64;\n union {\n qux @5 :UInt16;\n corge :group {\n grault @7 :UInt64;\n garply @9 :UInt16;\n plugh @15 :Text;\n xyzzy @17 :Text;\n }\n\n fred @13 :Text;\n }\n\n waldo @11 :Text;\n }\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),\n union3 = (u3f0s8 = 55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = (u0f1s0 = void), union1 = (u1f0sp = \"foo\"), union2 = (u2f0s1 = true),\n union3 = (u3f0s32 = 12345678));\n\n unnamed1 @2 :TestUnnamedUnion = (foo = 123);\n unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = \"foo\", after = \"bar\");\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n # Versions of the above which cannot be encoded as primitive lists.\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestFieldZeroIsBit {\n bit @0 :Bool;\n secondBit @1 :Bool = true;\n thirdField @2 :UInt8 = 123;\n}\n\nstruct TestListDefaults {\n lists @0 :TestLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false), (f = true), (f = true)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")],\n int32ListList = [[1, 2, 3], [4, 5], [12341234]],\n textListList = [[\"foo\", \"bar\"], [\"baz\"], [\"qux\", \"corge\"]],\n structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);\n}\n\nstruct TestLateUnion {\n # Test what happens if the unions are not the first ordinals in the struct. At one point this\n # was broken for the dynamic API.\n\n foo @0 :Int32;\n bar @1 :Text;\n baz @2 :Int16;\n\n theUnion @3! :union {\n qux @4 :Text;\n corge @5 :List(Int32);\n grault @6 :Float32;\n }\n\n anotherUnion @7! :union {\n qux @8 :Text;\n corge @9 :List(Int32);\n grault @10 :Float32;\n }\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n}\n\nstruct TestOldUnionVersion {\n union {\n a @0 :Void;\n b @1 :UInt64;\n }\n}\n\nstruct TestNewUnionVersion {\n union {\n a :union {\n a0 @0 :Void;\n a1 @2 :UInt64;\n }\n b @1 :UInt64;\n }\n}\n\nstruct TestStructUnion {\n un @0! :union {\n struct @1 :SomeStruct;\n object @2 :TestAnyPointer;\n }\n\n struct SomeStruct {\n someText @0 :Text;\n moreText @1 :Text;\n }\n}\n\nstruct TestPrintInlineStructs {\n someText @0 :Text;\n\n structList @1 :List(InlineStruct);\n struct InlineStruct {\n int32Field @0 :Int32;\n textField @1 :Text;\n }\n}\n\nstruct TestWholeFloatDefault {\n # At one point, these failed to compile in C++ because it would produce literals like \"123f\",\n # which is not valid; it needs to be \"123.0f\".\n field @0 :Float32 = 123;\n bigField @1 :Float32 = 2e30;\n const constant :Float32 = 456;\n const bigConstant :Float32 = 4e30;\n}\n\nstruct TestGenerics(Foo, Bar) {\n foo @0 :Foo;\n rev @1 :TestGenerics(Bar, Foo);\n\n union {\n uv @2:Void;\n ug :group {\n ugfoo @3:Int32;\n }\n }\n\n struct Inner {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n\n struct Inner2(Baz) {\n bar @0 :Bar;\n baz @1 :Baz;\n innerBound @2 :Inner;\n innerUnbound @3 :TestGenerics.Inner;\n\n struct DeepNest(Qux) {\n foo @0 :Foo;\n bar @1 :Bar;\n baz @2 :Baz;\n qux @3 :Qux;\n }\n }\n\n interface Interface(Qux) {\n call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));\n }\n\n annotation ann(struct) :Foo;\n\n using AliasFoo = Foo;\n using AliasInner = Inner;\n using AliasInner2 = Inner2;\n using AliasInner2Text = Inner2(Text);\n using AliasRev = TestGenerics(Bar, Foo);\n\n struct UseAliases {\n foo @0 :AliasFoo;\n inner @1 :AliasInner;\n inner2 @2 :AliasInner2;\n inner2Bind @3 :AliasInner2(Text);\n inner2Text @4 :AliasInner2Text;\n revFoo @5 :AliasRev.AliasFoo;\n }\n}\n\nstruct TestGenericsWrapper(Foo, Bar) {\n value @0 :TestGenerics(Foo, Bar);\n}\n\nstruct TestGenericsWrapper2 {\n value @0 :TestGenericsWrapper(Text, TestAllTypes);\n}\n\ninterface TestImplicitMethodParams {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\ninterface TestImplicitMethodParamsInGeneric(V) {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\nstruct TestGenericsUnion(Foo, Bar) {\n # At one point this failed to compile.\n\n union {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n}\n\nstruct TestUseGenerics $TestGenerics(Text, Data).ann(\"foo\") {\n basic @0 :TestGenerics(TestAllTypes, TestAnyPointer);\n inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner;\n inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text);\n unspecified @3 :TestGenerics;\n unspecifiedInner @4 :TestGenerics.Inner2(Text);\n wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer);\n cap @18 :TestGenerics(TestInterface, Text);\n genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data);\n\n default @5 :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner =\n (foo = (int16Field = 123), bar = \"text\");\n defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123)));\n defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) =\n (value = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultWrapper2 @10 :TestGenericsWrapper2 =\n (value = (value = (foo = \"text\", rev = (foo = (int16Field = 321)))));\n\n aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123);\n aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner\n = (foo = (int16Field = 123));\n aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2\n = (innerBound = (foo = (int16Field = 123)));\n aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32))\n = (baz = [12, 34], innerBound = (foo = (int16Field = 123)));\n aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text\n = (baz = \"text\", innerBound = (foo = (int16Field = 123)));\n aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = \"text\";\n\n useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = (\n foo = (int16Field = 123),\n inner = (foo = (int16Field = 123)),\n inner2 = (innerBound = (foo = (int16Field = 123))),\n inner2Bind = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n inner2Text = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n revFoo = [12, 34, 56]);\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n const textConst :Text = \"foo\";\n const dataConst :Data = \"bar\";\n const structConst :TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n const enumConst :TestEnum = corge;\n\n const voidListConst :List(Void) = [void, void, void, void, void, void];\n const boolListConst :List(Bool) = [true, false, false, true];\n const int8ListConst :List(Int8) = [111, -111];\n const int16ListConst :List(Int16) = [11111, -11111];\n const int32ListConst :List(Int32) = [111111111, -111111111];\n const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];\n const uint8ListConst :List(UInt8) = [111, 222] ;\n const uint16ListConst :List(UInt16) = [33333, 44444];\n const uint32ListConst :List(UInt32) = [3333333333];\n const uint64ListConst :List(UInt64) = [11111111111111111111];\n const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];\n const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];\n const textListConst :List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n const dataListConst :List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n const structListConst :List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n const enumListConst :List(TestEnum) = [foo, garply];\n}\n\nconst globalInt :UInt32 = 12345;\nconst globalText :Text = \"foobar\";\nconst globalStruct :TestAllTypes = (int32Field = 54321);\nconst globalPrintableStruct :TestPrintInlineStructs = (someText = \"foo\");\nconst derivedConstant :TestAllTypes = (\n uInt32Field = .globalInt,\n textField = TestConstants.textConst,\n structField = TestConstants.structConst,\n int16List = TestConstants.int16ListConst,\n structList = TestConstants.structListConst);\n\nconst genericConstant :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n\nconst embeddedData :Data = embed \"testdata\/packed\";\nconst embeddedText :Text = embed \"testdata\/short.txt\";\nconst embeddedStruct :TestAllTypes = embed \"testdata\/binary\";\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x :Text);\n bar @1 () -> ();\n baz @2 (s: TestAllTypes);\n}\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestAllTypes -> ();\n grault @2 () -> TestAllTypes;\n}\n\ninterface TestExtends2 extends(TestExtends) {}\n\ninterface TestPipeline {\n getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);\n testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();\n\n struct Box {\n cap @0 :TestInterface;\n }\n}\n\ninterface TestCallOrder {\n getCallSequence @0 (expected: UInt32) -> (n: UInt32);\n # First call returns 0, next returns 1, ...\n #\n # The input `expected` is ignored but useful for disambiguating debug logs.\n}\n\ninterface TestTailCallee {\n struct TailResult {\n i @0 :UInt32;\n t @1 :Text;\n c @2 :TestCallOrder;\n }\n\n foo @0 (i :Int32, t :Text) -> TailResult;\n}\n\ninterface TestTailCaller {\n foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;\n}\n\ninterface TestHandle {}\n\ninterface TestMoreStuff extends(TestCallOrder) {\n # Catch-all type that contains lots of testing methods.\n\n callFoo @0 (cap :TestInterface) -> (s: Text);\n # Call `cap.foo()`, check the result, and return \"bar\".\n\n callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);\n # Like callFoo but waits for `cap` to resolve first.\n\n neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);\n # Doesn't return. You should cancel it.\n\n hold @3 (cap :TestInterface) -> ();\n # Returns immediately but holds on to the capability.\n\n callHeld @4 () -> (s: Text);\n # Calls the capability previously held using `hold` (and keeps holding it).\n\n getHeld @5 () -> (cap :TestInterface);\n # Returns the capability previously held using `hold` (and keeps holding it).\n\n echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);\n # Just returns the input cap.\n\n expectCancel @7 (cap :TestInterface) -> ();\n # evalLater()-loops forever, holding `cap`. Must be canceled.\n\n methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = \"foo\") -> (d :Text, e :Text = \"bar\");\n\n getHandle @9 () -> (handle :TestHandle);\n # Get a new handle. Tests have an out-of-band way to check the current number of live handles, so\n # this can be used to test garbage collection.\n\n getNull @10 () -> (nullCap :TestMoreStuff);\n # Always returns a null capability.\n}\n\ninterface TestMembrane {\n makeThing @0 () -> (thing :Thing);\n callPassThrough @1 (thing :Thing, tailCall :Bool) -> Result;\n callIntercept @2 (thing :Thing, tailCall :Bool) -> Result;\n loopback @3 (thing :Thing) -> (thing :Thing);\n\n interface Thing {\n passThrough @0 () -> Result;\n intercept @1 () -> Result;\n }\n\n struct Result {\n text @0 :Text;\n }\n}\n\nstruct TestContainMembrane {\n cap @0 :TestMembrane.Thing;\n list @1 :List(TestMembrane.Thing);\n}\n\nstruct TestTransferCap {\n list @0 :List(Element);\n struct Element {\n text @0 :Text;\n cap @1 :TestInterface;\n }\n}\n\ninterface TestKeywordMethods {\n delete @0 ();\n class @1 ();\n void @2 ();\n return @3 ();\n}\n\ninterface TestAuthenticatedBootstrap(VatId) {\n getCallerId @0 () -> (caller :VatId);\n}\n\nstruct TestSturdyRef {\n hostId @0 :TestSturdyRefHostId;\n objectId @1 :AnyPointer;\n}\n\nstruct TestSturdyRefHostId {\n host @0 :Text;\n}\n\nstruct TestSturdyRefObjectId {\n tag @0 :Tag;\n enum Tag {\n testInterface @0;\n testExtends @1;\n testPipeline @2;\n testTailCallee @3;\n testTailCaller @4;\n testMoreStuff @5;\n }\n}\n\nstruct TestProvisionId {}\nstruct TestRecipientId {}\nstruct TestThirdPartyCapId {}\nstruct TestJoinResult {}\n\nstruct TestNameAnnotation $Cxx.name(\"RenamedStruct\") {\n union {\n badFieldName @0 :Bool $Cxx.name(\"goodFieldName\");\n bar @1 :Int8;\n }\n\n enum BadlyNamedEnum $Cxx.name(\"RenamedEnum\") {\n foo @0;\n bar @1;\n baz @2 $Cxx.name(\"qux\");\n }\n\n anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name(\"anotherGoodFieldName\");\n\n struct NestedStruct $Cxx.name(\"RenamedNestedStruct\") {\n badNestedFieldName @0 :Bool $Cxx.name(\"goodNestedFieldName\");\n anotherBadNestedFieldName @1 :NestedStruct $Cxx.name(\"anotherGoodNestedFieldName\");\n\n enum DeeplyNestedEnum $Cxx.name(\"RenamedDeeplyNestedEnum\") {\n quux @0;\n corge @1;\n grault @2 $Cxx.name(\"garply\");\n }\n }\n\n badlyNamedUnion :union $Cxx.name(\"renamedUnion\") {\n badlyNamedGroup :group $Cxx.name(\"renamedGroup\") {\n foo @3 :Void;\n bar @4 :Void;\n }\n baz @5 :NestedStruct $Cxx.name(\"qux\");\n }\n}\n\ninterface TestNameAnnotationInterface $Cxx.name(\"RenamedInterface\") {\n badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name(\"renamedParam\")) $Cxx.name(\"renamedMethod\");\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xd508eebdc2dc42b8;\n\nusing Cxx = import \"c++.capnp\";\n\n# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified\n# names for stuff in the capnproto namespace.\n$Cxx.namespace(\"capnproto_test::capnp::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = 0x\"62 61 72\"; # \"bar\"\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n\n # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer\n # in the struct.\n}\n\nstruct TestAnyOthers {\n anyStructField @0 :AnyStruct;\n anyListField @1 :AnyList;\n capabilityField @2 :Capability;\n}\n\nstruct TestOutOfOrder {\n foo @3 :Text;\n bar @2 :Text;\n baz @8 :Text;\n qux @0 :Text;\n quux @6 :Text;\n corge @4 :Text;\n grault @1 :Text;\n garply @7 :Text;\n waldo @5 :Text;\n}\n\nstruct TestUnion {\n union0 @0! :union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1! :union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2! :union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3! :union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnnamedUnion {\n before @0 :Text;\n\n union {\n foo @1 :UInt16;\n bar @3 :UInt32;\n }\n\n middle @2 :UInt16;\n\n after @4 :Text;\n}\n\nstruct TestUnionInUnion {\n # There is no reason to ever do this.\n outer :union {\n inner :union {\n foo @0 :Int32;\n bar @1 :Int32;\n }\n baz @2 :Int32;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n }\n }\n}\n\nstruct TestInterleavedGroups {\n group1 :group {\n foo @0 :UInt32;\n bar @2 :UInt64;\n union {\n qux @4 :UInt16;\n corge :group {\n grault @6 :UInt64;\n garply @8 :UInt16;\n plugh @14 :Text;\n xyzzy @16 :Text;\n }\n\n fred @12 :Text;\n }\n\n waldo @10 :Text;\n }\n\n group2 :group {\n foo @1 :UInt32;\n bar @3 :UInt64;\n union {\n qux @5 :UInt16;\n corge :group {\n grault @7 :UInt64;\n garply @9 :UInt16;\n plugh @15 :Text;\n xyzzy @17 :Text;\n }\n\n fred @13 :Text;\n }\n\n waldo @11 :Text;\n }\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),\n union3 = (u3f0s8 = 55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = (u0f1s0 = void), union1 = (u1f0sp = \"foo\"), union2 = (u2f0s1 = true),\n union3 = (u3f0s32 = 12345678));\n\n unnamed1 @2 :TestUnnamedUnion = (foo = 123);\n unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = \"foo\", after = \"bar\");\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n # Versions of the above which cannot be encoded as primitive lists.\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestFieldZeroIsBit {\n bit @0 :Bool;\n secondBit @1 :Bool = true;\n thirdField @2 :UInt8 = 123;\n}\n\nstruct TestListDefaults {\n lists @0 :TestLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false), (f = true), (f = true)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")],\n int32ListList = [[1, 2, 3], [4, 5], [12341234]],\n textListList = [[\"foo\", \"bar\"], [\"baz\"], [\"qux\", \"corge\"]],\n structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);\n}\n\nstruct TestLateUnion {\n # Test what happens if the unions are not the first ordinals in the struct. At one point this\n # was broken for the dynamic API.\n\n foo @0 :Int32;\n bar @1 :Text;\n baz @2 :Int16;\n\n theUnion @3! :union {\n qux @4 :Text;\n corge @5 :List(Int32);\n grault @6 :Float32;\n }\n\n anotherUnion @7! :union {\n qux @8 :Text;\n corge @9 :List(Int32);\n grault @10 :Float32;\n }\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n}\n\nstruct TestOldUnionVersion {\n union {\n a @0 :Void;\n b @1 :UInt64;\n }\n}\n\nstruct TestNewUnionVersion {\n union {\n a :union {\n a0 @0 :Void;\n a1 @2 :UInt64;\n }\n b @1 :UInt64;\n }\n}\n\nstruct TestStructUnion {\n un @0! :union {\n struct @1 :SomeStruct;\n object @2 :TestAnyPointer;\n }\n\n struct SomeStruct {\n someText @0 :Text;\n moreText @1 :Text;\n }\n}\n\nstruct TestPrintInlineStructs {\n someText @0 :Text;\n\n structList @1 :List(InlineStruct);\n struct InlineStruct {\n int32Field @0 :Int32;\n textField @1 :Text;\n }\n}\n\nstruct TestWholeFloatDefault {\n # At one point, these failed to compile in C++ because it would produce literals like \"123f\",\n # which is not valid; it needs to be \"123.0f\".\n field @0 :Float32 = 123;\n bigField @1 :Float32 = 2e30;\n const constant :Float32 = 456;\n const bigConstant :Float32 = 4e30;\n}\n\nstruct TestGenerics(Foo, Bar) {\n foo @0 :Foo;\n rev @1 :TestGenerics(Bar, Foo);\n\n struct Inner {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n\n struct Inner2(Baz) {\n bar @0 :Bar;\n baz @1 :Baz;\n innerBound @2 :Inner;\n innerUnbound @3 :TestGenerics.Inner;\n\n struct DeepNest(Qux) {\n foo @0 :Foo;\n bar @1 :Bar;\n baz @2 :Baz;\n qux @3 :Qux;\n }\n }\n\n interface Interface(Qux) {\n call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));\n }\n\n annotation ann(struct) :Foo;\n\n using AliasFoo = Foo;\n using AliasInner = Inner;\n using AliasInner2 = Inner2;\n using AliasInner2Text = Inner2(Text);\n using AliasRev = TestGenerics(Bar, Foo);\n\n struct UseAliases {\n foo @0 :AliasFoo;\n inner @1 :AliasInner;\n inner2 @2 :AliasInner2;\n inner2Bind @3 :AliasInner2(Text);\n inner2Text @4 :AliasInner2Text;\n revFoo @5 :AliasRev.AliasFoo;\n }\n}\n\nstruct TestGenericsWrapper(Foo, Bar) {\n value @0 :TestGenerics(Foo, Bar);\n}\n\nstruct TestGenericsWrapper2 {\n value @0 :TestGenericsWrapper(Text, TestAllTypes);\n}\n\ninterface TestImplicitMethodParams {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\ninterface TestImplicitMethodParamsInGeneric(V) {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\nstruct TestGenericsUnion(Foo, Bar) {\n # At one point this failed to compile.\n\n union {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n}\n\nstruct TestUseGenerics $TestGenerics(Text, Data).ann(\"foo\") {\n basic @0 :TestGenerics(TestAllTypes, TestAnyPointer);\n inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner;\n inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text);\n unspecified @3 :TestGenerics;\n unspecifiedInner @4 :TestGenerics.Inner2(Text);\n wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer);\n cap @18 :TestGenerics(TestInterface, Text);\n genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data);\n\n default @5 :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner =\n (foo = (int16Field = 123), bar = \"text\");\n defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123)));\n defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) =\n (value = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultWrapper2 @10 :TestGenericsWrapper2 =\n (value = (value = (foo = \"text\", rev = (foo = (int16Field = 321)))));\n\n aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123);\n aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner\n = (foo = (int16Field = 123));\n aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2\n = (innerBound = (foo = (int16Field = 123)));\n aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32))\n = (baz = [12, 34], innerBound = (foo = (int16Field = 123)));\n aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text\n = (baz = \"text\", innerBound = (foo = (int16Field = 123)));\n aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = \"text\";\n\n useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = (\n foo = (int16Field = 123),\n inner = (foo = (int16Field = 123)),\n inner2 = (innerBound = (foo = (int16Field = 123))),\n inner2Bind = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n inner2Text = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n revFoo = [12, 34, 56]);\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n const textConst :Text = \"foo\";\n const dataConst :Data = \"bar\";\n const structConst :TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n const enumConst :TestEnum = corge;\n\n const voidListConst :List(Void) = [void, void, void, void, void, void];\n const boolListConst :List(Bool) = [true, false, false, true];\n const int8ListConst :List(Int8) = [111, -111];\n const int16ListConst :List(Int16) = [11111, -11111];\n const int32ListConst :List(Int32) = [111111111, -111111111];\n const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];\n const uint8ListConst :List(UInt8) = [111, 222] ;\n const uint16ListConst :List(UInt16) = [33333, 44444];\n const uint32ListConst :List(UInt32) = [3333333333];\n const uint64ListConst :List(UInt64) = [11111111111111111111];\n const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];\n const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];\n const textListConst :List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n const dataListConst :List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n const structListConst :List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n const enumListConst :List(TestEnum) = [foo, garply];\n}\n\nconst globalInt :UInt32 = 12345;\nconst globalText :Text = \"foobar\";\nconst globalStruct :TestAllTypes = (int32Field = 54321);\nconst globalPrintableStruct :TestPrintInlineStructs = (someText = \"foo\");\nconst derivedConstant :TestAllTypes = (\n uInt32Field = .globalInt,\n textField = TestConstants.textConst,\n structField = TestConstants.structConst,\n int16List = TestConstants.int16ListConst,\n structList = TestConstants.structListConst);\n\nconst genericConstant :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n\nconst embeddedData :Data = embed \"testdata\/packed\";\nconst embeddedText :Text = embed \"testdata\/short.txt\";\nconst embeddedStruct :TestAllTypes = embed \"testdata\/binary\";\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x :Text);\n bar @1 () -> ();\n baz @2 (s: TestAllTypes);\n}\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestAllTypes -> ();\n grault @2 () -> TestAllTypes;\n}\n\ninterface TestExtends2 extends(TestExtends) {}\n\ninterface TestPipeline {\n getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);\n testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();\n\n struct Box {\n cap @0 :TestInterface;\n }\n}\n\ninterface TestCallOrder {\n getCallSequence @0 (expected: UInt32) -> (n: UInt32);\n # First call returns 0, next returns 1, ...\n #\n # The input `expected` is ignored but useful for disambiguating debug logs.\n}\n\ninterface TestTailCallee {\n struct TailResult {\n i @0 :UInt32;\n t @1 :Text;\n c @2 :TestCallOrder;\n }\n\n foo @0 (i :Int32, t :Text) -> TailResult;\n}\n\ninterface TestTailCaller {\n foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;\n}\n\ninterface TestHandle {}\n\ninterface TestMoreStuff extends(TestCallOrder) {\n # Catch-all type that contains lots of testing methods.\n\n callFoo @0 (cap :TestInterface) -> (s: Text);\n # Call `cap.foo()`, check the result, and return \"bar\".\n\n callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);\n # Like callFoo but waits for `cap` to resolve first.\n\n neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);\n # Doesn't return. You should cancel it.\n\n hold @3 (cap :TestInterface) -> ();\n # Returns immediately but holds on to the capability.\n\n callHeld @4 () -> (s: Text);\n # Calls the capability previously held using `hold` (and keeps holding it).\n\n getHeld @5 () -> (cap :TestInterface);\n # Returns the capability previously held using `hold` (and keeps holding it).\n\n echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);\n # Just returns the input cap.\n\n expectCancel @7 (cap :TestInterface) -> ();\n # evalLater()-loops forever, holding `cap`. Must be canceled.\n\n methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = \"foo\") -> (d :Text, e :Text = \"bar\");\n\n getHandle @9 () -> (handle :TestHandle);\n # Get a new handle. Tests have an out-of-band way to check the current number of live handles, so\n # this can be used to test garbage collection.\n\n getNull @10 () -> (nullCap :TestMoreStuff);\n # Always returns a null capability.\n}\n\ninterface TestMembrane {\n makeThing @0 () -> (thing :Thing);\n callPassThrough @1 (thing :Thing, tailCall :Bool) -> Result;\n callIntercept @2 (thing :Thing, tailCall :Bool) -> Result;\n loopback @3 (thing :Thing) -> (thing :Thing);\n\n interface Thing {\n passThrough @0 () -> Result;\n intercept @1 () -> Result;\n }\n\n struct Result {\n text @0 :Text;\n }\n}\n\nstruct TestContainMembrane {\n cap @0 :TestMembrane.Thing;\n list @1 :List(TestMembrane.Thing);\n}\n\nstruct TestTransferCap {\n list @0 :List(Element);\n struct Element {\n text @0 :Text;\n cap @1 :TestInterface;\n }\n}\n\ninterface TestKeywordMethods {\n delete @0 ();\n class @1 ();\n void @2 ();\n return @3 ();\n}\n\ninterface TestAuthenticatedBootstrap(VatId) {\n getCallerId @0 () -> (caller :VatId);\n}\n\nstruct TestSturdyRef {\n hostId @0 :TestSturdyRefHostId;\n objectId @1 :AnyPointer;\n}\n\nstruct TestSturdyRefHostId {\n host @0 :Text;\n}\n\nstruct TestSturdyRefObjectId {\n tag @0 :Tag;\n enum Tag {\n testInterface @0;\n testExtends @1;\n testPipeline @2;\n testTailCallee @3;\n testTailCaller @4;\n testMoreStuff @5;\n }\n}\n\nstruct TestProvisionId {}\nstruct TestRecipientId {}\nstruct TestThirdPartyCapId {}\nstruct TestJoinResult {}\n\nstruct TestNameAnnotation $Cxx.name(\"RenamedStruct\") {\n union {\n badFieldName @0 :Bool $Cxx.name(\"goodFieldName\");\n bar @1 :Int8;\n }\n\n enum BadlyNamedEnum $Cxx.name(\"RenamedEnum\") {\n foo @0;\n bar @1;\n baz @2 $Cxx.name(\"qux\");\n }\n\n anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name(\"anotherGoodFieldName\");\n\n struct NestedStruct $Cxx.name(\"RenamedNestedStruct\") {\n badNestedFieldName @0 :Bool $Cxx.name(\"goodNestedFieldName\");\n anotherBadNestedFieldName @1 :NestedStruct $Cxx.name(\"anotherGoodNestedFieldName\");\n\n enum DeeplyNestedEnum $Cxx.name(\"RenamedDeeplyNestedEnum\") {\n quux @0;\n corge @1;\n grault @2 $Cxx.name(\"garply\");\n }\n }\n\n badlyNamedUnion :union $Cxx.name(\"renamedUnion\") {\n badlyNamedGroup :group $Cxx.name(\"renamedGroup\") {\n foo @3 :Void;\n bar @4 :Void;\n }\n baz @5 :NestedStruct $Cxx.name(\"qux\");\n }\n}\n\ninterface TestNameAnnotationInterface $Cxx.name(\"RenamedInterface\") {\n badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name(\"renamedParam\")) $Cxx.name(\"renamedMethod\");\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a56e28f0175187a5f70fec1d47d8f0190a9966e0","subject":"Name the java class correctly! Ref T34","message":"Name the java class correctly!\nRef T34\n\n--HG--\nbranch : T34\n","repos":"goshawkdb\/common","old_file":"capnp\/capabilities.capnp","new_file":"capnp\/capabilities.capnp","new_contents":"using Go = import \"go.capnp\";\n$Go.package(\"capnp\");\n$Go.import(\"goshawkdb.io\/common\/capnp\");\n\nusing Java = import \"java.capnp\";\n$Java.package(\"io.goshawkdb.client.capnp\");\n$Java.outerClassname(\"CapabilitiesCap\");\n\n@0xd9bafc2f09656f8c;\n\nstruct Capability {\n union {\n none @0: Void;\n read @1: Void;\n write @2: Void;\n readWrite @3: Void;\n }\n}\n","old_contents":"using Go = import \"go.capnp\";\n$Go.package(\"capnp\");\n$Go.import(\"goshawkdb.io\/common\/capnp\");\n\nusing Java = import \"java.capnp\";\n$Java.package(\"io.goshawkdb.client.capnp\");\n$Java.outerClassname(\"TransactionCap\");\n\n@0xd9bafc2f09656f8c;\n\nstruct Capability {\n union {\n none @0: Void;\n read @1: Void;\n write @2: Void;\n readWrite @3: Void;\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"dd9b4ae2f353508f7ee2dc4fbedf45b5b34b3bfa","subject":"Update Temoral Memory Proto to include Orphan Decay","message":"Update Temoral Memory Proto to include Orphan Decay\n","repos":"pettitda\/nupic.core,EricSB\/nupic.core,rhyolight\/nupic.core,lscheinkman\/nupic.core,Bemujo\/https-github.com-numenta-nupic,pettitda\/nupic.core,ywcui1990\/nupic.core,sambitgaan\/nupic.core,utensil\/nupic.core,akhilaananthram\/nupic.core,sambitgaan\/nupic.core,metaml\/nupic.core,akhilaananthram\/nupic.core,numenta\/htmresearch-core,ywcui1990\/nupic.core,lscheinkman\/nupic.core,lscheinkman\/nupic.core,subutai\/nupic.core,metaml\/nupic.core,Bemujo\/https-github.com-numenta-nupic,akhilaananthram\/nupic.core,scottpurdy\/nupic.core,akhilaananthram\/nupic.core,ywcui1990\/nupic.core,metaml\/nupic.core,rhyolight\/nupic.core,scottpurdy\/nupic.core,breznak\/nupic.core,Bemujo\/https-github.com-numenta-nupic,rcrowder\/nupic.core,subutai\/nupic.core,utensil\/nupic.core,pettitda\/nupic.core,brev\/nupic.core,numenta\/htmresearch-core,subutai\/nupic.core,sambitgaan\/nupic.core,brev\/nupic.core,scottpurdy\/nupic.core,EricSB\/nupic.core,rcrowder\/nupic.core,numenta\/nupic.core,utensil\/nupic.core,brev\/nupic.core,breznak\/nupic.core,utensil\/nupic.core,EricSB\/nupic.core,numenta\/htmresearch-core,numenta\/nupic.core,rhyolight\/nupic.core,Bemujo\/https-github.com-numenta-nupic,lscheinkman\/nupic.core,EricSB\/nupic.core,rcrowder\/nupic.core,rcrowder\/nupic.core,sambitgaan\/nupic.core,numenta\/htmresearch-core,neuroidss\/nupic.core,neuroidss\/nupic.core,jaredweiss\/nupic.core,jaredweiss\/nupic.core,pettitda\/nupic.core,scottpurdy\/nupic.core,neuroidss\/nupic.core,numenta\/nupic.core,neuroidss\/nupic.core,jaredweiss\/nupic.core,breznak\/nupic.core,jaredweiss\/nupic.core,breznak\/nupic.core,brev\/nupic.core,ywcui1990\/nupic.core,rhyolight\/nupic.core,numenta\/nupic.core,metaml\/nupic.core,subutai\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 18\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n matchingSegments @16 :List(UInt32);\n matchingCells @17 :List(UInt32);\n}\n","old_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 16\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"e72edbf9294f970d5544c96fdfe949aebb170524","subject":"Test out multiple actions","message":"Test out multiple actions\n","repos":"zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xfa677f714b89876c;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\nusing Util = import \"\/sandstorm\/util.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qw9ge09e8m0v22hkfm6jf6nekfwh7yz64eamsa6ddg064krza3gh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Filesystem Demo App\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"hello\"),\n command = (\n argv = [\"\/opt\/app\/app\", \"hello\"],\n environ = .myEnviron,\n ),\n ),\n ( nounPhrase = (defaultText = \"goodbye\"),\n command = (\n argv = [\"\/opt\/app\/app\", \"goodbye\"],\n environ = .myEnviron,\n ),\n ),\n ],\n\n continueCommand = (\n argv = [\"\/opt\/app\/app\", \"restore\"],\n environ = .myEnviron,\n ),\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"http:\/\/example.com\",\n # This should be the app's main website url.\n\n codeUrl = \"http:\/\/example.com\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"youremail@example.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"one-to-three words\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myEnviron :List(Util.KeyValue) = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ];\n","old_contents":"@0xfa677f714b89876c;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\nusing Util = import \"\/sandstorm\/util.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qw9ge09e8m0v22hkfm6jf6nekfwh7yz64eamsa6ddg064krza3gh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Filesystem Demo App\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"hello\"),\n command = .helloCommand,\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .restoreCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"http:\/\/example.com\",\n # This should be the app's main website url.\n\n codeUrl = \"http:\/\/example.com\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"youremail@example.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"one-to-three words\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myEnviron :List(Util.KeyValue) = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ];\n\nconst helloCommand :Spk.Manifest.Command = (\n\targv = [\"\/opt\/app\/app\", \"hello\"],\n\tenviron = .myEnviron,\n);\n\nconst restoreCommand :Spk.Manifest.Command = (\n\targv = [\"\/opt\/app\/app\", \"restore\"],\n\tenviron = .myEnviron,\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"c19599c98b362e95c8e9a9dca02d353bde4a2670","subject":"request encoding","message":"request encoding\n","repos":"rustyrazorblade\/FrankDux,rustyrazorblade\/FrankDux","old_file":"frankdux\/request.capnp","new_file":"frankdux\/request.capnp","new_contents":"@0xc2b429cb75fe750c;\n\nstruct Argument {\n type @0 : Text;\n value @1 : Data;\n}\n\nstruct Request {\n func @0 : Text;\n arguments @1 : List(Argument);\n}\n","old_contents":"@0xc2b429cb75fe750c;\n\n\nstruct Request {\n func @0 : Text\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"d54056e3ef03a20e7a10c5bea1971fdd519fadf6","subject":"capitalization","message":"capitalization\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.2\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.2\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"d06422d4aa877da07f51285d134e1d4e038baf55","subject":"Workaround re: name collisions in schema output.","message":"Workaround re: name collisions in schema output.\n","repos":"zenhack\/haskell-capnp","old_file":"tests\/data\/aircraft.capnp","new_file":"tests\/data\/aircraft.capnp","new_contents":"@0x832bcc6686a26d56;\n# A schema with useful declarations for testing.\n#\n# This was originally copied from the Go implementation:\n#\n# https:\/\/github.com\/zombiezen\/go-capnproto2\n#\n# For now, a default values for pointer types have been commented out,\n# so that the compiler plugin will not reject the schema in light of\n# issue #28. These are marked with 'TODO#28' in the source.\n\nconst constDate :Zdate = (year = 2015, month = 8, day = 27);\nconst constList :List(Zdate) = [(year = 2015, month = 8, day = 27), (year = 2015, month = 8, day = 28)];\nconst constEnum :Airport = jfk;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6;\n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n boolvec @39: List(Bool);\n datavec @40: List(Data);\n textvec @41: List(Text);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n zdatavec @38: List(Zdata);\n\n grp :group {\n first @42 :UInt64;\n second @43 :UInt64;\n }\n\n echo @44 :Echo;\n echoBases @45 :EchoBases;\n }\n}\n\n# tests for Text\/List(Text) recusion handling\n\nstruct Counter {\n size @0: Int64;\n words @1: Text;\n wordlist @2: List(Text);\n}\n\nstruct Bag {\n counter @0: Counter;\n}\n\nstruct Zserver {\n waitingjobs @0: List(Zjob);\n}\n\nstruct Zjob {\n cmd @0: Text;\n args @1: List(Text);\n}\n\n# versioning test structs\n\nstruct VerEmpty {\n}\n\nstruct VerOneData {\n val @0: Int16;\n}\n\nstruct VerTwoData {\n val @0: Int16;\n duo @1: Int64;\n}\n\nstruct VerOnePtr {\n ptr @0: VerOneData;\n}\n\nstruct VerTwoPtr {\n ptr1 @0: VerOneData;\n ptr2 @1: VerOneData;\n}\n\nstruct VerTwoDataTwoPtr {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerOneData;\n ptr2 @3: VerOneData;\n}\n\nstruct HoldsVerEmptyList {\n mylist @0: List(VerEmpty);\n}\n\nstruct HoldsVerOneDataList {\n mylist @0: List(VerOneData);\n}\n\nstruct HoldsVerTwoDataList {\n mylist @0: List(VerTwoData);\n}\n\nstruct HoldsVerOnePtrList {\n mylist @0: List(VerOnePtr);\n}\n\nstruct HoldsVerTwoPtrList {\n mylist @0: List(VerTwoPtr);\n}\n\nstruct HoldsVerTwoTwoList {\n mylist @0: List(VerTwoDataTwoPtr);\n}\n\nstruct HoldsVerTwoTwoPlus {\n mylist @0: List(VerTwoTwoPlus);\n}\n\nstruct VerTwoTwoPlus {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerTwoDataTwoPtr;\n ptr2 @3: VerTwoDataTwoPtr;\n tre @4: Int64;\n lst3 @5: List(Int64);\n}\n\n# text handling\n\nstruct HoldsText {\n txt @0: Text;\n lst @1: List(Text);\n lstlst @2: List(List(Text));\n}\n\n# test that we avoid unnecessary truncation\n\nstruct WrapEmpty {\n mightNotBeReallyEmpty @0: VerEmpty;\n}\n\nstruct Wrap2x2 {\n mightNotBeReallyEmpty @0: VerTwoDataTwoPtr;\n}\n\nstruct Wrap2x2plus {\n mightNotBeReallyEmpty @0: VerTwoTwoPlus;\n}\n\n# test voids in a union\n\nstruct VoidUnion {\n union {\n a @0 :Void;\n b @1 :Void;\n }\n}\n\n# test List(List(Struct(List)))\n\nstruct Nester1Capn {\n strs @0: List(Text);\n}\n\nstruct RWTestCapn {\n nestMatrix @0: List(List(Nester1Capn));\n}\n\nstruct ListStructCapn {\n vec @0: List(Nester1Capn);\n}\n\n# test interfaces\n\ninterface Echo {\n echo @0 (in :Text) -> (out :Text);\n}\n\nstruct Hoth {\n base @0 :EchoBase;\n}\n\nstruct EchoBase {\n echo @0 :Echo;\n}\n\n# test List(Struct(Interface))\n\nstruct EchoBases {\n\tbases @0 :List(EchoBase);\n}\n\n# test transforms\n\nstruct StackingRoot {\n a @1 :StackingA;\n aWithDefault @0 :StackingA ;#TODO#28 = (num = 42);\n}\n\nstruct StackingA {\n num @0 :Int32;\n b @1 :StackingB;\n}\n\nstruct StackingB {\n num @0 :Int32;\n}\n\ninterface CallSequence {\n getNumber @0 () -> (n :UInt32);\n}\n\ninterface CounterFactory {\n newCounter @0 (start :UInt32) -> (counter :CallSequence);\n}\n\ninterface CounterAcceptor {\n accept @0 (counter :CallSequence);\n}\n\n# test inheritance\n#\n# The *I suffixes are to work around a bug where generated names can collide\n# with things defined int he prelude; Left and Right cause problems here.\n\ninterface TopI {\n\ttop @0 ();\n}\n\ninterface LeftI extends(TopI) {\n\tleft @0 ();\n}\n\ninterface RightI extends(TopI) {\n\tright @0 ();\n}\n\ninterface BottomI extends(LeftI, RightI) {\n\tbottom @0 ();\n}\n\n# test defaults\n\nstruct Defaults {\n text @0 :Text ;#TODO#28 = \"foo\";\n data @1 :Data ;#TODO#28 = \"bar\";\n float @2 :Float32 = 3.14;\n int @3 :Int32 = -123;\n uint @4 :UInt32 = 42;\n}\n\n# benchmarks\n\nstruct BenchmarkA {\n name @0 :Text;\n birthDay @1 :Int64;\n phone @2 :Text;\n siblings @3 :Int32;\n spouse @4 :Bool;\n money @5 :Float64;\n}\n","old_contents":"@0x832bcc6686a26d56;\n# A schema with useful declarations for testing.\n#\n# This was originally copied from the Go implementation:\n#\n# https:\/\/github.com\/zombiezen\/go-capnproto2\n#\n# For now, a default values for pointer types have been commented out,\n# so that the compiler plugin will not reject the schema in light of\n# issue #28. These are marked with 'TODO#28' in the source.\n\nconst constDate :Zdate = (year = 2015, month = 8, day = 27);\nconst constList :List(Zdate) = [(year = 2015, month = 8, day = 27), (year = 2015, month = 8, day = 28)];\nconst constEnum :Airport = jfk;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6;\n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n boolvec @39: List(Bool);\n datavec @40: List(Data);\n textvec @41: List(Text);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n zdatavec @38: List(Zdata);\n\n grp :group {\n first @42 :UInt64;\n second @43 :UInt64;\n }\n\n echo @44 :Echo;\n echoBases @45 :EchoBases;\n }\n}\n\n# tests for Text\/List(Text) recusion handling\n\nstruct Counter {\n size @0: Int64;\n words @1: Text;\n wordlist @2: List(Text);\n}\n\nstruct Bag {\n counter @0: Counter;\n}\n\nstruct Zserver {\n waitingjobs @0: List(Zjob);\n}\n\nstruct Zjob {\n cmd @0: Text;\n args @1: List(Text);\n}\n\n# versioning test structs\n\nstruct VerEmpty {\n}\n\nstruct VerOneData {\n val @0: Int16;\n}\n\nstruct VerTwoData {\n val @0: Int16;\n duo @1: Int64;\n}\n\nstruct VerOnePtr {\n ptr @0: VerOneData;\n}\n\nstruct VerTwoPtr {\n ptr1 @0: VerOneData;\n ptr2 @1: VerOneData;\n}\n\nstruct VerTwoDataTwoPtr {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerOneData;\n ptr2 @3: VerOneData;\n}\n\nstruct HoldsVerEmptyList {\n mylist @0: List(VerEmpty);\n}\n\nstruct HoldsVerOneDataList {\n mylist @0: List(VerOneData);\n}\n\nstruct HoldsVerTwoDataList {\n mylist @0: List(VerTwoData);\n}\n\nstruct HoldsVerOnePtrList {\n mylist @0: List(VerOnePtr);\n}\n\nstruct HoldsVerTwoPtrList {\n mylist @0: List(VerTwoPtr);\n}\n\nstruct HoldsVerTwoTwoList {\n mylist @0: List(VerTwoDataTwoPtr);\n}\n\nstruct HoldsVerTwoTwoPlus {\n mylist @0: List(VerTwoTwoPlus);\n}\n\nstruct VerTwoTwoPlus {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerTwoDataTwoPtr;\n ptr2 @3: VerTwoDataTwoPtr;\n tre @4: Int64;\n lst3 @5: List(Int64);\n}\n\n# text handling\n\nstruct HoldsText {\n txt @0: Text;\n lst @1: List(Text);\n lstlst @2: List(List(Text));\n}\n\n# test that we avoid unnecessary truncation\n\nstruct WrapEmpty {\n mightNotBeReallyEmpty @0: VerEmpty;\n}\n\nstruct Wrap2x2 {\n mightNotBeReallyEmpty @0: VerTwoDataTwoPtr;\n}\n\nstruct Wrap2x2plus {\n mightNotBeReallyEmpty @0: VerTwoTwoPlus;\n}\n\n# test voids in a union\n\nstruct VoidUnion {\n union {\n a @0 :Void;\n b @1 :Void;\n }\n}\n\n# test List(List(Struct(List)))\n\nstruct Nester1Capn {\n strs @0: List(Text);\n}\n\nstruct RWTestCapn {\n nestMatrix @0: List(List(Nester1Capn));\n}\n\nstruct ListStructCapn {\n vec @0: List(Nester1Capn);\n}\n\n# test interfaces\n\ninterface Echo {\n echo @0 (in :Text) -> (out :Text);\n}\n\nstruct Hoth {\n base @0 :EchoBase;\n}\n\nstruct EchoBase {\n echo @0 :Echo;\n}\n\n# test List(Struct(Interface))\n\nstruct EchoBases {\n\tbases @0 :List(EchoBase);\n}\n\n# test transforms\n\nstruct StackingRoot {\n a @1 :StackingA;\n aWithDefault @0 :StackingA ;#TODO#28 = (num = 42);\n}\n\nstruct StackingA {\n num @0 :Int32;\n b @1 :StackingB;\n}\n\nstruct StackingB {\n num @0 :Int32;\n}\n\ninterface CallSequence {\n getNumber @0 () -> (n :UInt32);\n}\n\ninterface CounterFactory {\n newCounter @0 (start :UInt32) -> (counter :CallSequence);\n}\n\ninterface CounterAcceptor {\n accept @0 (counter :CallSequence);\n}\n\n# test inheritance\n\ninterface Top {\n\ttop @0 ();\n}\n\ninterface Left extends(Top) {\n\tleft @0 ();\n}\n\ninterface Right extends(Top) {\n\tright @0 ();\n}\n\ninterface Bottom extends(Left, Right) {\n\tbottom @0 ();\n}\n\n# test defaults\n\nstruct Defaults {\n text @0 :Text ;#TODO#28 = \"foo\";\n data @1 :Data ;#TODO#28 = \"bar\";\n float @2 :Float32 = 3.14;\n int @3 :Int32 = -123;\n uint @4 :UInt32 = 42;\n}\n\n# benchmarks\n\nstruct BenchmarkA {\n name @0 :Text;\n birthDay @1 :Int64;\n phone @2 :Text;\n siblings @3 :Int32;\n spouse @4 :Bool;\n money @5 :Float64;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"2c9977b081eae3f57a0e68c15665d293aab6e86f","subject":"Bumped ordinal number (the right one this time - doh) in date.capnp","message":"Bumped ordinal number (the right one this time - doh) in date.capnp\n","repos":"sambitgaan\/nupic,arhik\/nupic,marionleborgne\/nupic,alfonsokim\/nupic,rcrowder\/nupic,go-bears\/nupic,neuroidss\/nupic,neuroidss\/nupic,rhyolight\/nupic,fergalbyrne\/nupic,sambitgaan\/nupic,ywcui1990\/nupic,BoltzmannBrain\/nupic,ywcui1990\/nupic,badlogicmanpreet\/nupic,SaganBolliger\/nupic,vitaly-krugl\/nupic,EricSB\/nupic,scottpurdy\/nupic,SaganBolliger\/nupic,runt18\/nupic,sambitgaan\/nupic,BoltzmannBrain\/nupic,breznak\/nupic,EricSB\/nupic,badlogicmanpreet\/nupic,breznak\/nupic,fergalbyrne\/nupic,go-bears\/nupic,BoltzmannBrain\/nupic,jcasner\/nupic,subutai\/nupic,rhyolight\/nupic,rcrowder\/nupic,rhyolight\/nupic,pulinagrawal\/nupic,subutai\/nupic,lscheinkman\/nupic,blueburningcoder\/nupic,vitaly-krugl\/nupic,scottpurdy\/nupic,runt18\/nupic,neuroidss\/nupic,go-bears\/nupic,numenta-ci\/nupic,alfonsokim\/nupic,lscheinkman\/nupic,jcasner\/nupic,subutai\/nupic,numenta\/nupic,breznak\/nupic,jcasner\/nupic,rcrowder\/nupic,vitaly-krugl\/nupic,fergalbyrne\/nupic,blueburningcoder\/nupic,pulinagrawal\/nupic,EricSB\/nupic,marionleborgne\/nupic,ywcui1990\/nupic,scottpurdy\/nupic,arhik\/nupic,runt18\/nupic,numenta\/nupic,arhik\/nupic,cogmission\/nupic,blueburningcoder\/nupic,numenta-ci\/nupic,SaganBolliger\/nupic,pulinagrawal\/nupic,marionleborgne\/nupic,cogmission\/nupic,badlogicmanpreet\/nupic,alfonsokim\/nupic,numenta\/nupic,cogmission\/nupic,numenta-ci\/nupic,lscheinkman\/nupic","old_file":"src\/nupic\/encoders\/date.capnp","new_file":"src\/nupic\/encoders\/date.capnp","new_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @7 :ScalarEncoderProto;\n}\n","old_contents":"@0x9b23d989c61ef9e6;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"8edcfedc1d558c21b3d042b3a0980d5f8d271e86","subject":"Remove proto namespace that SWIG doesn't pick up.","message":"Remove proto namespace that SWIG doesn't pick up.\n","repos":"pettitda\/nupic.core,breznak\/nupic.core,EricSB\/nupic.core,jaredweiss\/nupic.core,rcrowder\/nupic.core,akhilaananthram\/nupic.core,akhilaananthram\/nupic.core,numenta\/htmresearch-core,metaml\/nupic.core,lscheinkman\/nupic.core,rcrowder\/nupic.core,neuroidss\/nupic.core,rcrowder\/nupic.core,sambitgaan\/nupic.core,metaml\/nupic.core,akhilaananthram\/nupic.core,sambitgaan\/nupic.core,numenta\/nupic.core,rcrowder\/nupic.core,neuroidss\/nupic.core,breznak\/nupic.core,akhilaananthram\/nupic.core,EricSB\/nupic.core,scottpurdy\/nupic.core,subutai\/nupic.core,neuroidss\/nupic.core,Bemujo\/https-github.com-numenta-nupic,sambitgaan\/nupic.core,EricSB\/nupic.core,breznak\/nupic.core,ywcui1990\/nupic.core,Bemujo\/https-github.com-numenta-nupic,brev\/nupic.core,neuroidss\/nupic.core,numenta\/nupic.core,numenta\/htmresearch-core,utensil\/nupic.core,scottpurdy\/nupic.core,jaredweiss\/nupic.core,breznak\/nupic.core,subutai\/nupic.core,scottpurdy\/nupic.core,lscheinkman\/nupic.core,sambitgaan\/nupic.core,brev\/nupic.core,subutai\/nupic.core,pettitda\/nupic.core,metaml\/nupic.core,pettitda\/nupic.core,rhyolight\/nupic.core,pettitda\/nupic.core,numenta\/nupic.core,ywcui1990\/nupic.core,rhyolight\/nupic.core,jaredweiss\/nupic.core,rhyolight\/nupic.core,ywcui1990\/nupic.core,numenta\/htmresearch-core,jaredweiss\/nupic.core,Bemujo\/https-github.com-numenta-nupic,brev\/nupic.core,utensil\/nupic.core,numenta\/nupic.core,lscheinkman\/nupic.core,ywcui1990\/nupic.core,utensil\/nupic.core,scottpurdy\/nupic.core,Bemujo\/https-github.com-numenta-nupic,lscheinkman\/nupic.core,brev\/nupic.core,utensil\/nupic.core,rhyolight\/nupic.core,EricSB\/nupic.core,numenta\/htmresearch-core,subutai\/nupic.core,metaml\/nupic.core","old_file":"src\/nupic\/utils\/RandomProto.capnp","new_file":"src\/nupic\/utils\/RandomProto.capnp","new_contents":"@0x88eaee6db8e1f67c;\n\nstruct RandomProto {\n seed @0 :UInt64;\n impl @1 :RandomImplProto;\n}\n\nstruct RandomImplProto {\n state @0 :List(Int64);\n rptr @1 :Int64;\n fptr @2 :Int64;\n}\n","old_contents":"@0x88eaee6db8e1f67c;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"nupic\");\n\nstruct RandomProto {\n seed @0 :UInt64;\n impl @1 :RandomImplProto;\n}\n\nstruct RandomImplProto {\n state @0 :List(Int64);\n rptr @1 :Int64;\n fptr @2 :Int64;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"ab0d68f9426d1d3c338838ffe2ffb2ac01fe3d38","subject":"Added hourOfWeek encoder to date.capnp","message":"Added hourOfWeek encoder to date.capnp\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"src\/nupic\/encoders\/date.capnp","new_file":"src\/nupic\/encoders\/date.capnp","new_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","old_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"022798f80fb6885606476df665a791aa45f9a696","subject":"Bump version","message":"Bump version","repos":"neynah\/draw,ocdtrekkie\/draw,neynah\/draw,ocdtrekkie\/draw,neynah\/draw,ocdtrekkie\/draw","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x8b8d9e21789be80e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"1gda5n8p8zsc0r9pcana2yjgtvsq169068k4ve8mk68z4x9fvzuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"EtherDraw\"),\n\n appVersion = 1, # Increment this for every release.\n\tappMarketingVersion = (defaultText = \"0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New EtherDraw\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9002\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x8b8d9e21789be80e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"1gda5n8p8zsc0r9pcana2yjgtvsq169068k4ve8mk68z4x9fvzuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"EtherDraw\"),\n\n appVersion = 0, # Increment this for every release.\n\tappMarketingVersion = (defaultText = \"0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New EtherDraw\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9002\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"ea2cc53294da91c9e38e63f37f9e6d58ae1fa051","subject":"Bumped ordinal number (the right one this time - doh) in date.capnp","message":"Bumped ordinal number (the right one this time - doh) in date.capnp\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"src\/nupic\/encoders\/date.capnp","new_file":"src\/nupic\/encoders\/date.capnp","new_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @7 :ScalarEncoderProto;\n}\n","old_contents":"@0x9b23d989c61ef9e6;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"2b777b3bdb9495fd75d45404eb4b3dc72d2267f9","subject":"remove quota field","message":"remove quota field\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"gce-config.capnp","new_file":"gce-config.capnp","new_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","old_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n quotaEnabled = false,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"e44be93fbc29b74ade662b559a5179132289128b","subject":"adding in a sequence number type","message":"adding in a sequence number type\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/core\/metadata.capnp","new_file":"src\/core\/metadata.capnp","new_contents":"@0xc61bac6a340f9df1;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing ChannelId = UInt8;\nusing FrameNumber = UInt32;\nusing SequenceNumber = UInt16;\n\nstruct Version\n{\n numberA @0 :UInt8;\n numberB @1 :UInt8;\n numberC @2 :UInt8;\n numberD @3 :UInt8;\n}\n","old_contents":"@0xc61bac6a340f9df1;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing SequenceNumber = UInt16;\nusing FrameNumber = UInt32;\n\nstruct Version\n{\n numberA @0 :UInt8;\n numberB @1 :UInt8;\n numberC @2 :UInt8;\n numberD @3 :UInt8;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"268ecfe97e576dd9816246bdd79ddae4f1dc4cab","subject":"Fix VPATH build.","message":"Fix VPATH build.\n","repos":"kamalmarhubi\/capnproto,artillery\/capnproto,bsn069\/capnproto,khklau\/capnproto,nagyistoce\/capnproto,hntrmrrs\/capnproto,modulexcite\/capnproto,geofft\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,mrdomino\/capnproto,jparyani\/capnproto,kamalmarhubi\/capnproto,maurer\/capnproto,johnkdoe\/capnproto,rcrowder\/capnproto,rcrowder\/capnproto,mologie\/capnproto,bryce-gibson\/capnproto,MarPiRK\/capnproto,mrdomino\/capnproto,MarPiRK\/capnproto,bryce-gibson\/capnproto,bsn069\/capnproto,geofft\/capnproto,artillery\/capnproto,hntrmrrs\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,ligzy\/capnproto,ligzy\/capnproto,vladon\/capnproto,jparyani\/capnproto,vladon\/capnproto,nagyistoce\/capnproto,martindale\/capnproto,zarvox\/capnproto,pjulien\/capnproto,pjulien\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,joliss\/capnproto,geofft\/capnproto,a-richardson\/capnproto,bsn069\/capnproto,artillery\/capnproto,maurer\/capnproto,maurer\/capnproto,ocdtrekkie\/capnproto,mologie\/capnproto,Fraser999\/capnproto,a-richardson\/capnproto,modulexcite\/capnproto,khklau\/capnproto,jparyani\/capnproto,Fraser999\/capnproto,zarvox\/capnproto,vladon\/capnproto,khklau\/capnproto,martindale\/capnproto,zarvox\/capnproto,bryce-gibson\/capnproto,pjulien\/capnproto,ocdtrekkie\/capnproto,martindale\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,nagyistoce\/capnproto,ocdtrekkie\/capnproto,MarPiRK\/capnproto,a-richardson\/capnproto,kamalmarhubi\/capnproto,mologie\/capnproto,modulexcite\/capnproto,Fraser999\/capnproto","old_file":"c++\/src\/capnp\/test-import2.capnp","new_file":"c++\/src\/capnp\/test-import2.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xc64a3bf0338a124a;\n\nusing Import1 = import \"\/capnp\/schema.capnp\";\nusing Import2 = import \"test-import.capnp\";\nusing Import3 = import \"test.capnp\";\n\nstruct TestImport2 {\n foo @0 :Import3.TestAllTypes;\n bar @1 :Import1.Node;\n baz @2 :Import2.TestImport;\n}\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xc64a3bf0338a124a;\n\nusing Import1 = import \"schema.capnp\";\nusing Import2 = import \"test-import.capnp\";\nusing Import3 = import \"test.capnp\";\n\nstruct TestImport2 {\n foo @0 :Import3.TestAllTypes;\n bar @1 :Import1.Node;\n baz @2 :Import2.TestImport;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"7ea2758fb02440940bd39353ac214b501b2c48d9","subject":"Remove unused code","message":"Remove unused code\n","repos":"cloudflare\/lua-capnproto,calio\/lua-capnproto,calio\/lua-capnproto,cloudflare\/lua-capnproto","old_file":"proto\/enums.capnp","new_file":"proto\/enums.capnp","new_contents":"@0xa7e0ba9e3ca0988d;\n\nusing Lua = import \"lua.capnp\";\n\nenum EnumType2 $Lua.naming(\"lower_underscore\") {\n enum5 @0;\n enum6 @1;\n enum7 @2;\n upperDash @3 $Lua.naming(\"upper_dash\");\n lowerUnderScore @4 $Lua.naming(\"lower_underscore\");\n upperUnderScore @5 $Lua.naming(\"upper_underscore\");\n}\n","old_contents":"@0xa7e0ba9e3ca0988d;\n\nusing Lua = import \"lua.capnp\";\n\nenum EnumType2 $Lua.naming(\"lower_underscore\") {\n enum5 @0;\n enum6 @1;\n enum7 @2;\n}\nenum EnumType3 $Lua.naming(\"lower_underscore\") {\n enum5 @0;\n enum6 @1;\n enum7 @2;\n upperDash @3 $Lua.naming(\"upper_dash\");\n lowerUnderScore @4 $Lua.naming(\"lower_underscore\");\n upperUnderScore @5 $Lua.naming(\"upper_underscore\");\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"92b3a2ffa7c0be21b5d5990c520aea1d2bc94bfb","subject":"thinking about Entry extensions","message":"thinking about Entry extensions\n","repos":"FauxFaux\/contentin,FauxFaux\/contentin,FauxFaux\/contentin","old_file":"entry.capnp","new_file":"entry.capnp","new_contents":"@0xb3afa6ab952b49de;\n\nstruct Entry {\n magic @0 :UInt32;\n\n # the number of bytes of file content; typically following this header\n len @1 :UInt64;\n\n # the name of this file (paths[0]), and the things it is in.\n # Read as: main.c (0) is in code.tar (1) is in code.tar.gz (2) is in ...\n paths @2 :List(Text);\n\n # the access, modification, change and birth times of the file,\n # in nanoseconds since the UNIX epoch\n atime @3 :UInt64;\n mtime @4 :UInt64;\n ctime @5 :UInt64;\n btime @6 :UInt64;\n\n ownership :union {\n unknown @7 :Void;\n\n posix :group {\n user @8 :PosixEntity;\n group @9 :PosixEntity;\n mode @10 :UInt32;\n }\n }\n\n type :union {\n normal @11 :Void;\n directory @12 :Void;\n fifo @13 :Void;\n softLinkTo @14 :Text;\n hardLinkTo @15 :Text;\n charDevice @16 :DeviceNumbers;\n blockDevice @17 :DeviceNumbers;\n }\n\n content :union {\n absent @18 :Void;\n follows @19 :Void;\n }\n\n container :union {\n # we didn't expect to be able to unpack this,\n # we couldn't identify it as any supported type of archive\n unrecognised @20 :Void;\n\n # we successfully unpacked this, but included it anyway\n # in the stream, the entries for it will probably appear elsewhere too\n included @21 :Void;\n\n # we expected to open this, but failed to parse its header or metadata;\n # so it's included as if it's unrecognised, and no entries were read from it.\n # e.g. a zip file with a corrupt central directory (~= header)\n openError @22 :Text;\n\n # we opened this in a way that we thought was successful, but, after\n # reading it, we discovered there was a problem. Some or all of the entries\n # may be present in the stream, and they may individually be corrupt.\n # e.g. gzip with a checksum at the end, we detect the failure after emitting\n # all of the entries, which may be corrupt.\n readError @23 :Text;\n }\n\n # Intended to carry filesystem xattrs, like acls and capabilities,\n # but I'm not going to stop you ramming crap in here.\n # For the filesystem, 'name' should be of the format namespace.name, or namespace.name.sub_name\n # The namespaces \"user.\", \"system.\", \"trusted.\", and \"security.\" are defined in man:attr(5).\n # Note: Real (2017) filesystems support only around 5kb of attributes total,\n # including their names, data, and overhead.\n xattrs @24 :List(ExtendedAttribute);\n}\n\nstruct PosixEntity {\n id @0 :UInt32;\n name @1 :Text;\n}\n\nstruct DeviceNumbers {\n # Even though I've never seen a device number over ~255,\n # man:mknod(2) defines these as mode_t and dev_t respectively,\n # which the current kernel has as:\n # mode_t: \"unsigned short\" (16-bits on all Debian platforms)\n # dev_t: \"u32\" (much less ambiguous)\n\n major @0 :UInt16;\n minor @1 :UInt32;\n}\n\nstruct ExtendedAttribute {\n name @0 :Text;\n value @1 :Data;\n}\n","old_contents":"@0xb3afa6ab952b49de;\n\nstruct Entry {\n magic @0 :UInt32;\n\n # the number of bytes of file content; typically following this header\n len @1 :UInt64;\n\n # the name of this file (paths[0]), and the things it is in.\n # Read as: main.c (0) is in code.tar (1) is in code.tar.gz (2) is in ...\n paths @2 :List(Text);\n\n # the access, modification, change and birth times of the file,\n # in nanoseconds since the UNIX epoch\n atime @3 :UInt64;\n mtime @4 :UInt64;\n ctime @5 :UInt64;\n btime @6 :UInt64;\n\n ownership :union {\n unknown @7 :Void;\n\n posix :group {\n user @8 :PosixEntity;\n group @9 :PosixEntity;\n mode @10 :UInt32;\n }\n }\n\n type :union {\n normal @11 :Void;\n directory @12 :Void;\n fifo @13 :Void;\n softLinkTo @14 :Text;\n hardLinkTo @15 :Text;\n charDevice @16 :DeviceNumbers;\n blockDevice @17 :DeviceNumbers;\n }\n\n content :union {\n absent @18 :Void;\n follows @19 :Void;\n }\n}\n\nstruct PosixEntity {\n id @0 :UInt32;\n name @1 :Text;\n}\n\nstruct DeviceNumbers {\n # Even though I've never seen a device number over ~255,\n # man:mknod(2) defines these as mode_t and dev_t respectively,\n # which the current kernel has as:\n # mode_t: \"unsigned short\" (16-bits on all Debian platforms)\n # dev_t: \"u32\" (much less ambiguous)\n\n major @0 :UInt16;\n minor @1 :UInt32;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a334ae13b552c0593b6d268f6c4a5fbb4cc383b4","subject":"Bump to v9","message":"Bump to v9\n","repos":"neynah\/GhostSS,neynah\/GhostSS,jparyani\/GhostSS,jparyani\/GhostSS,neynah\/GhostSS,jparyani\/GhostSS","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 9, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 7, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c8fe72a6949bc708a9074bbdd8405286891d5b90","subject":"formatting for explorers.capnp","message":"formatting for explorers.capnp\n","repos":"danburkert\/capnproto-rust,larquin\/capnproto-rust,tempbottle\/capnproto-rust,maurer\/capnproto-rust,placrosse\/capnproto-rust,dwrensha\/capnproto-rust","old_file":"examples\/zmq-explorers\/explorers.capnp","new_file":"examples\/zmq-explorers\/explorers.capnp","new_contents":"@0xee82762a0e12b9f0;\n\nstruct Observation {\n timestamp @0 : Int64; # seconds\n x @1 : Float32;\n y @2 : Float32;\n red @3 : UInt8;\n green @4 : UInt8;\n blue @5 : UInt8;\n\n diagnostic : union {\n ok @6 : Void;\n warning @7 : Text;\n }\n}\n\nstruct Grid {\n cells @0 : List(List(Cell));\n numberOfUpdates @1 : UInt32;\n latestTimestamp @2 : Int64;\n\n struct Cell {\n latestTimestamp @0 : Int64;\n numberOfUpdates @1 : UInt32;\n meanRed @2 : Float32;\n meanGreen @3 : Float32;\n meanBlue @4 : Float32;\n }\n}","old_contents":"@0xee82762a0e12b9f0;\n\nstruct Observation {\n timestamp @0 : Int64;\n x @1 : Float32;\n y @2 : Float32;\n red @3 : UInt8;\n green @4 : UInt8;\n blue @5 : UInt8;\n\n diagnostic : union {\n ok @6 : Void;\n warning @7 : Text;\n }\n}\n\nstruct Grid {\n struct Cell {\n latestTimestamp @0 : Int64;\n numberOfUpdates @1 : UInt32;\n meanRed @2 : Float32;\n meanGreen @3 : Float32;\n meanBlue @4 : Float32;\n }\n\n cells @0 : List(List(Cell));\n numberOfUpdates @1 : UInt32;\n latestTimestamp @2 : Int64;\n}","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"89e7adf207ccf88e53518ffd1c662ac1d41ed415","subject":"always include usr\/share\/texmf-dist","message":"always include usr\/share\/texmf-dist\n","repos":"dwrensha\/sharelatex,dwrensha\/sharelatex,neynah\/sharelatex,neynah\/sharelatex","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"\/home\/david\/appdev\/sharelatex\"),\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","old_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"\/home\/david\/appdev\/sharelatex\"),\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"1e2910af18c7dd17a7384d02646db52422b56ad0","subject":"Going to need to bump app version.","message":"Going to need to bump app version.\n","repos":"ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 6, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"reader\"),\n permissions = [false],\n verbPhrase = (defaultText = \"can read\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 5, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"reader\"),\n permissions = [false],\n verbPhrase = (defaultText = \"can read\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"cad736e74f74b04b2164d74de6e4555d55835a07","subject":"Create sandstorm-pkgdef.capnp","message":"Create sandstorm-pkgdef.capnp","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 22, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.1~2017-03-07\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 1280, height = 614, png = embed \"screenshot_etherpad_index.png\"),\n (width = 1280, height = 614, png = embed \"screenshot_etherpad_history.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"etc\/passwd\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\",\n packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\", \"node_modules\", \"cache\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))],\n eventTypes = [\n (name = \"edit\", verbPhrase = (defaultText = \"edited pad\"),\n notifySubscribers = false, autoSubscribeToGrain = true),\n (name = \"comment\", verbPhrase = (defaultText = \"added comment\"),\n notifySubscribers = true, autoSubscribeToThread = true),\n (name = \"reply\", verbPhrase = (defaultText = \"replied to comment\"),\n notifySubscribers = true, autoSubscribeToThread = true)\n ],\n ),\n\n saveIdentityCaps = true,\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"HOME\", value = \"\/var\"), # Etherpad imports `npm` which crashes on start without this.\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 22, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.1~2017-03-07\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"etc\/passwd\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\",\n packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\", \"node_modules\", \"cache\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))],\n eventTypes = [\n (name = \"edit\", verbPhrase = (defaultText = \"edited pad\"),\n notifySubscribers = false, autoSubscribeToGrain = true),\n (name = \"comment\", verbPhrase = (defaultText = \"added comment\"),\n notifySubscribers = true, autoSubscribeToThread = true),\n (name = \"reply\", verbPhrase = (defaultText = \"replied to comment\"),\n notifySubscribers = true, autoSubscribeToThread = true)\n ],\n ),\n\n saveIdentityCaps = true,\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"HOME\", value = \"\/var\"), # Etherpad imports `npm` which crashes on start without this.\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f7a7714c642098384028ed9c4f0df0b760a8defa","subject":"Let's go ahead and rename to , acknowledging that this may expand to support pipeline operations that are not simply fetching members.","message":"Let's go ahead and rename to , acknowledging that this may expand to support pipeline operations that are not simply fetching members.\n","repos":"MarPiRK\/capnproto,ocdtrekkie\/capnproto,Fraser999\/capnproto,zarvox\/capnproto,hntrmrrs\/capnproto,nagyistoce\/capnproto,jparyani\/capnproto,geofft\/capnproto,nagyistoce\/capnproto,pjulien\/capnproto,a-richardson\/capnproto,artillery\/capnproto,zarvox\/capnproto,mologie\/capnproto,bryce-gibson\/capnproto,a-richardson\/capnproto,johnkdoe\/capnproto,vladon\/capnproto,ligzy\/capnproto,bryce-gibson\/capnproto,rcrowder\/capnproto,ligzy\/capnproto,vladon\/capnproto,martindale\/capnproto,bsn069\/capnproto,martindale\/capnproto,modulexcite\/capnproto,khklau\/capnproto,ocdtrekkie\/capnproto,ligzy\/capnproto,Fraser999\/capnproto,zarvox\/capnproto,mrdomino\/capnproto,bryce-gibson\/capnproto,pjulien\/capnproto,MarPiRK\/capnproto,rcrowder\/capnproto,modulexcite\/capnproto,kamalmarhubi\/capnproto,geofft\/capnproto,Fraser999\/capnproto,hntrmrrs\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,joliss\/capnproto,ocdtrekkie\/capnproto,pjulien\/capnproto,bsn069\/capnproto,mrdomino\/capnproto,maurer\/capnproto,mologie\/capnproto,geofft\/capnproto,MarPiRK\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,rcrowder\/capnproto,martindale\/capnproto,modulexcite\/capnproto,bsn069\/capnproto,joliss\/capnproto,kamalmarhubi\/capnproto,khklau\/capnproto,maurer\/capnproto,a-richardson\/capnproto,khklau\/capnproto,jparyani\/capnproto,mologie\/capnproto,johnkdoe\/capnproto,maurer\/capnproto,artillery\/capnproto,artillery\/capnproto,vladon\/capnproto,jparyani\/capnproto,kamalmarhubi\/capnproto,nagyistoce\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 0 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n finish @2 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @3 :Resolve; # Resolve a previously-sent promise.\n release @4 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @5 :Save; # Save a capability persistently.\n restore @6 :Restore; # Restore a persistent capability from a previous connection.\n delete @7 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @8 :Provide; # Provide a capability to a third party.\n accept @9 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @10 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Level 0 implementations may want to respond to a `Resolve` by sending an appropriate `Release`\n # message, otherwise the object will stick around until the connection is closed even though\n # it will never be used.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should\n # reply with a `Return` with `unsupportedPipelineOp` set.\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 0 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n finish @2 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @3 :Resolve; # Resolve a previously-sent promise.\n release @4 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @5 :Save; # Save a capability persistently.\n restore @6 :Restore; # Restore a persistent capability from a previous connection.\n delete @7 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @8 :Provide; # Provide a capability to a third party.\n accept @9 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @10 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Level 0 implementations may want to respond to a `Resolve` by sending an appropriate `Release`\n # message, otherwise the object will stick around until the connection is closed even though\n # it will never be used.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(PathPart);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n\n struct PathPart {\n union {\n noop @0 :Void;\n # Dummy. Ignore this part. This field is only here so that we can define PathPart to be\n # a union which we might extend in the future. If an RPC implementation receives a PathPart\n # of a type it doesn't recognize, it should reply with a `Return` with `unsupportedPipelineOp`\n # set.\n\n pointerIndex @1 :UInt16;\n # Index of a pointer in the pointer section of a struct. Only valid when addressing a\n # struct.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based \/ point-free language where `PathPart`\n # specifies one \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"950c9684e5e86e5481433fa9012e8e0248d03aed","subject":"Make contributor the default role. Bump version.","message":"Make contributor the default role. Bump version.\n","repos":"neynah\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n\n manifest = (\n appTitle = (defaultText = \"Groove Basin\"),\n appVersion = 5, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.5\"),\n\n actions = [\n ( title = (defaultText = \"New Music Library\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows tag editing and track deletion\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"allows listening and downloading\")),\n (name = \"add\", title = (defaultText = \"add\"),\n description = (defaultText = \"allows track uploads\")),\n (name = \"control\", title = (defaultText = \"control\"),\n description = (defaultText = \"allows control of the audio stream\")),\n (name = \"playlist\", title = (defaultText = \"playlist\"),\n description = (defaultText = \"allows playlist editing\"))],\n roles = [(title = (defaultText = \"controller\"),\n permissions = .controllerPermissions,\n verbPhrase = (defaultText = \"can control the stream\")),\n (title = (defaultText = \"contributor\"),\n permissions = .contributorPermissions,\n verbPhrase =\n (defaultText = \"can control the stream, upload tracks, and edit playlists\"),\n default = true),\n (title = (defaultText = \"administrator\"),\n permissions = .adminPermissions,\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"listener\"),\n permissions = .listenerPermissions,\n verbPhrase = (defaultText = \"can only listen\"))\n ]\n )\n )\n);\n\n# admin | read | add | control | playlist |\nconst controllerPermissions : List(Bool) = [ false, true, false, true, false];\nconst contributorPermissions : List(Bool) = [ false, true, true, true, true];\nconst adminPermissions : List(Bool) = [ true, true, true, true, true];\nconst listenerPermissions : List(Bool) = [ false, true, false, false, false];\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n\n manifest = (\n appTitle = (defaultText = \"Groove Basin\"),\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.4\"),\n\n actions = [\n ( title = (defaultText = \"New Music Library\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows tag editing and track deletion\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"allows listening and downloading\")),\n (name = \"add\", title = (defaultText = \"add\"),\n description = (defaultText = \"allows track uploads\")),\n (name = \"control\", title = (defaultText = \"control\"),\n description = (defaultText = \"allows control of the audio stream\")),\n (name = \"playlist\", title = (defaultText = \"playlist\"),\n description = (defaultText = \"allows playlist editing\"))],\n roles = [(title = (defaultText = \"controller\"),\n permissions = .controllerPermissions,\n verbPhrase = (defaultText = \"can control the stream\")),\n (title = (defaultText = \"contributor\"),\n permissions = .contributorPermissions,\n verbPhrase =\n (defaultText = \"can control the stream, upload tracks, and edit playlists\")),\n (title = (defaultText = \"administrator\"),\n permissions = .adminPermissions,\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"listener\"),\n permissions = .listenerPermissions,\n verbPhrase = (defaultText = \"can only listen\"))\n ]\n )\n )\n);\n\n# admin | read | add | control | playlist |\nconst controllerPermissions : List(Bool) = [ false, true, false, true, false];\nconst contributorPermissions : List(Bool) = [ false, true, true, true, true];\nconst adminPermissions : List(Bool) = [ true, true, true, true, true];\nconst listenerPermissions : List(Bool) = [ false, true, false, false, false];\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"b6c5e429a68ce82adbb0146acef46053c3c79267","subject":"bump pkgdef version","message":"bump pkgdef version\n","repos":"mnutt\/davros,mnutt\/davros,mnutt\/davros,mnutt\/davros","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"8aspz4sfjnp8u89000mh2v1xrdyx97ytn8hq71mdzv4p4d8n0n3h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 280, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.28.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Shared Directory\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/icon-128.png\",\n dpi2x = embed \"app-graphics\/icon-256.jpg\")),\n grain = (png = (dpi1x = embed \"app-graphics\/icon-24.png\",\n dpi2x = embed \"app-graphics\/icon-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/icon-150.png\",\n dpi2x = embed \"app-graphics\/icon-300.jpg\")),\n marketBig = (png = (dpi1x = embed \"app-graphics\/icon-300.jpg\",\n dpi2x = embed \"app-graphics\/icon-600.jpg\")),\n ),\n\n website = \"https:\/\/github.com\/mnutt\/davros\/\",\n codeUrl = \"https:\/\/github.com\/mnutt\/davros\/\",\n license = (openSource = apache2),\n categories = [productivity, media],\n\n author = (\n contactEmail = \"michael@nutt.im\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"File storage\"),\n\n screenshots = [\n (width = 2418, height = 1326, png = embed \"app-graphics\/screenshot-1.png\"),\n (width = 2418, height = 1326, jpeg = embed \"app-graphics\/screenshot-2.jpg\"),\n (width = 2418, height = 1326, png = embed \"app-graphics\/screenshot-3.png\"),\n ],\n\n changeLog = (defaultText = embed \"..\/CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n # fake out libreoffice\n ( packagePath = \"proc\/version\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-version\" ),\n ( packagePath = \"proc\/mounts\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-mounts\" ),\n ( packagePath = \"proc\/filesystems\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-filesystems\" ),\n ( packagePath = \"proc\/meminfo\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-meminfo\" ),\n ( packagePath = \"proc\/self\/exe\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-self-exe\" ),\n ( packagePath = \"etc\/passwd\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/etc-passwd\" ),\n # end fake out libreoffice\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\n \"opt\/app\/.sandstorm\",\n \"opt\/app\/dist\", # css\/js files change due to fingerprinting\n \"opt\/app\/server\",\n \"opt\/app\/sample-files\",\n # libreoffice stats() some files without reading them\n \"usr\/lib\/libreoffice\/presets\/config\/autotbl.fmt\",\n \"usr\/lib\/libreoffice\/program\",\n \"usr\/lib\/python3.5\", # pull in the whole Python 3 runtime\n \"usr\/lib\/python3\", # pull in any Debian pure-Python packages\n ],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n apiPath = \"\/\",\n viewInfo = (\n permissions = [(name = \"view\"), (name = \"edit\")],\n roles = [(title = (defaultText = \"viewer\"),\n permissions = [true,false],\n verbPhrase = (defaultText = \"can view files\"),\n default = true),\n (title = (defaultText = \"admin\"),\n permissions = [true,true],\n verbPhrase = (defaultText = \"can edit files\"))],\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/opt\/app\/vendor:\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PORT\", value = \"8000\"),\n (key = \"HOME\", value = \"\/var\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"CACHE_REQUIRE_PATHS_FILE\", value = \"\/var\/davros\/.require-cache.0\"),\n (key = \"STORAGE_PATH\", value = \"\/var\/davros\/data\"),\n (key = \"TEMP_STORAGE_PATH\", value = \"\/var\/davros\/tmp\"),\n (key = \"CONFIG_PATH\", value = \"\/var\/davros\/config\"),\n (key = \"TMPDIR\", value = \"\/var\/davros\/tmp\"),\n (key = \"UserInstallation\", value = \"file:\/\/\/var\/libreoffice\/config\"),\n ]\n);\n","old_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"8aspz4sfjnp8u89000mh2v1xrdyx97ytn8hq71mdzv4p4d8n0n3h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 273, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.27.3\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Shared Directory\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/icon-128.png\",\n dpi2x = embed \"app-graphics\/icon-256.jpg\")),\n grain = (png = (dpi1x = embed \"app-graphics\/icon-24.png\",\n dpi2x = embed \"app-graphics\/icon-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/icon-150.png\",\n dpi2x = embed \"app-graphics\/icon-300.jpg\")),\n marketBig = (png = (dpi1x = embed \"app-graphics\/icon-300.jpg\",\n dpi2x = embed \"app-graphics\/icon-600.jpg\")),\n ),\n\n website = \"https:\/\/github.com\/mnutt\/davros\/\",\n codeUrl = \"https:\/\/github.com\/mnutt\/davros\/\",\n license = (openSource = apache2),\n categories = [productivity, media],\n\n author = (\n contactEmail = \"michael@nutt.im\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"File storage\"),\n\n screenshots = [\n (width = 2418, height = 1326, png = embed \"app-graphics\/screenshot-1.png\"),\n (width = 2418, height = 1326, jpeg = embed \"app-graphics\/screenshot-2.jpg\"),\n (width = 2418, height = 1326, png = embed \"app-graphics\/screenshot-3.png\"),\n ],\n\n changeLog = (defaultText = embed \"..\/CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n # fake out libreoffice\n ( packagePath = \"proc\/version\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-version\" ),\n ( packagePath = \"proc\/mounts\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-mounts\" ),\n ( packagePath = \"proc\/filesystems\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-filesystems\" ),\n ( packagePath = \"proc\/meminfo\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-meminfo\" ),\n ( packagePath = \"proc\/self\/exe\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/proc-self-exe\" ),\n ( packagePath = \"etc\/passwd\",\n sourcePath = \"\/opt\/app\/.sandstorm\/fake\/etc-passwd\" ),\n # end fake out libreoffice\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\n \"opt\/app\/.sandstorm\",\n \"opt\/app\/dist\", # css\/js files change due to fingerprinting\n \"opt\/app\/server\",\n \"opt\/app\/sample-files\",\n # libreoffice stats() some files without reading them\n \"usr\/lib\/libreoffice\/presets\/config\/autotbl.fmt\",\n \"usr\/lib\/libreoffice\/program\",\n \"usr\/lib\/python3.5\", # pull in the whole Python 3 runtime\n \"usr\/lib\/python3\", # pull in any Debian pure-Python packages\n ],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n apiPath = \"\/\",\n viewInfo = (\n permissions = [(name = \"view\"), (name = \"edit\")],\n roles = [(title = (defaultText = \"viewer\"),\n permissions = [true,false],\n verbPhrase = (defaultText = \"can view files\"),\n default = true),\n (title = (defaultText = \"admin\"),\n permissions = [true,true],\n verbPhrase = (defaultText = \"can edit files\"))],\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/opt\/app\/vendor:\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PORT\", value = \"8000\"),\n (key = \"HOME\", value = \"\/var\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"CACHE_REQUIRE_PATHS_FILE\", value = \"\/var\/davros\/.require-cache.0\"),\n (key = \"STORAGE_PATH\", value = \"\/var\/davros\/data\"),\n (key = \"TEMP_STORAGE_PATH\", value = \"\/var\/davros\/tmp\"),\n (key = \"CONFIG_PATH\", value = \"\/var\/davros\/config\"),\n (key = \"TMPDIR\", value = \"\/var\/davros\/tmp\"),\n (key = \"UserInstallation\", value = \"file:\/\/\/var\/libreoffice\/config\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"0b4a459c5ba23c821f9e8c1a8887a7086551596f","subject":"RPC doc tweaks.","message":"RPC doc tweaks.\n","repos":"kamalmarhubi\/capnproto,Fraser999\/capnproto,MarPiRK\/capnproto,mologie\/capnproto,jparyani\/capnproto,johnkdoe\/capnproto,modulexcite\/capnproto,zarvox\/capnproto,bsn069\/capnproto,artillery\/capnproto,khklau\/capnproto,a-richardson\/capnproto,johnkdoe\/capnproto,martindale\/capnproto,zarvox\/capnproto,mrdomino\/capnproto,khklau\/capnproto,ocdtrekkie\/capnproto,jparyani\/capnproto,rcrowder\/capnproto,modulexcite\/capnproto,nagyistoce\/capnproto,MarPiRK\/capnproto,maurer\/capnproto,bsn069\/capnproto,vladon\/capnproto,geofft\/capnproto,a-richardson\/capnproto,hntrmrrs\/capnproto,Fraser999\/capnproto,joliss\/capnproto,pjulien\/capnproto,maurer\/capnproto,joliss\/capnproto,bryce-gibson\/capnproto,ocdtrekkie\/capnproto,kamalmarhubi\/capnproto,artillery\/capnproto,johnkdoe\/capnproto,MarPiRK\/capnproto,modulexcite\/capnproto,bryce-gibson\/capnproto,mrdomino\/capnproto,khklau\/capnproto,martindale\/capnproto,hntrmrrs\/capnproto,geofft\/capnproto,ligzy\/capnproto,mrdomino\/capnproto,joliss\/capnproto,zarvox\/capnproto,Fraser999\/capnproto,ligzy\/capnproto,artillery\/capnproto,a-richardson\/capnproto,nagyistoce\/capnproto,martindale\/capnproto,nagyistoce\/capnproto,jparyani\/capnproto,bsn069\/capnproto,kamalmarhubi\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,ocdtrekkie\/capnproto,geofft\/capnproto,vladon\/capnproto,pjulien\/capnproto,mologie\/capnproto,mologie\/capnproto,vladon\/capnproto,pjulien\/capnproto,hntrmrrs\/capnproto,rcrowder\/capnproto,maurer\/capnproto,bryce-gibson\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore frame\n# to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. Comments in this file indicate which level requires the corresponding\n# feature to be implemented -- if unspecified, the feature must be implemented at level 1.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction, but interactions between\n# three or more parties are supported only via proxying of objects. E.g. if Alice wants to send\n# Bob a capability pointing to Carol, Alice must host a local proxy of Carol and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support \"join\" or \"eq\" across capabilities received from different vats, although they\n# should be supported on capabilities received from the same vat.\n#\n# * **Level 2:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 3:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, \"Level 2\" is irrelevant and\n# \"Level 3\" is much easier than usual to implement. When such an implementation is actually run\n# inside a container, the contained app effectively gets to make full use of the container's\n# network at level 3. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n\nusing QuestionId = UInt32;\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a ReleaseAnswer\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve frame which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `ReleaseAnswer`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a Frame but not embedded in a question or answer, its\n# reference count is automatically incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n\n# ========================================================================================\n# Frames\n\nstruct Frame {\n # An RPC connection is a bi-directional stream of Frames.\n #\n # When the RPC system wants to send a Frame, it instructs the transport layer to keep trying to\n # send the frame until the transport can guarantee that one of the following is true:\n # 1) The Frame was received.\n # 2) The sessing is broken, and no further Frames can be sent.\n\n union {\n # Level 1 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n resolve @2 :Resolve; # Resolve a previously-sent promise.\n\n release @3 :Release; # Release a capability so that the remote object can be deallocated.\n releaseAnswer @4 :ReleaseAnswer; # Release a returned answer \/ cancel a call.\n\n restore @5 :Restore; # Restore a persistent capability from a previous connection.\n\n # Level 2 features -----------------------------------------------\n\n provide @6 :Provide; # Provide a capability to a third party.\n accept @7 :Accept; # Accept a capability provided by a third party.\n\n # Level 3 features -----------------------------------------------\n\n join @8 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\nstruct Call {\n # Frame type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with call IDs originating from the opposite end). A fine strategy is to use\n # sequential call IDs, but the recipient should not assume this.\n #\n # TODO: Decide if it is safe to reuse a call ID. If not, extend to 64 bits.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return frame explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # Frame type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # If the response contains any capabilities, the caller is expected to send a Release frame for\n # each one when done with them.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a ReleaseAnswer message\n # before the call had completed.\n }\n}\n\nstruct Resolve {\n # Frame type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # Frame type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The number of times this ID has been received by the importer. The object is only truly\n # released when the referenceCount from all Release messages for the ID adds up to the number of\n # times the exporter has actually sent the object to the importer. This avoids a race condition\n # where the exporter happens to send another copy of the same ID at the same time as the importer\n # is sending a Release message for it.\n}\n\nstruct ReleaseAnswer {\n # Frame type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\nstruct Restore {\n # Frame type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this restore message, which will eventually receive a Return\n # message containing the restored capability.\n\n ref @1 :SturdyRef;\n # An object designating the capability to restore.\n}\n\nstruct Provide {\n # **Level 2 feature**\n #\n # Frame type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a ReleaseAnswer message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **Level 2 feature**\n #\n # Frame type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\nstruct Join {\n # **Level 3 feature**\n #\n # Frame type sent to implement E.join(), which, given a number of capabilities which are expected\n # to be equivalent, finds the underlying object upon which they all agree and forms a direct\n # connection to it, skipping any proxies which may have been constructed by other vats while\n # transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinHostIds to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n struct Answer {\n # The answer to a `Join` frame (sent in a `Return` frame).\n\n hostId @0 :JoinHostId;\n # Information indicating where to connect to complete the join. Also used to verify that all\n # the joins actually reached the same object.\n\n vineId @1 :ExportId;\n # A new capability in the sender's export table which must be released once the join is\n # complete. This capability has no methods. This allows the joined capability's host to\n # detect when a Join has failed and release the associated resources on its end.\n }\n}\n\n# ========================================================================================\n# Common structures used in frames\n\nstruct CapDescriptor {\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n\n sturdyRef @6 :SturdyRef;\n # If non-null, this is a SturdyRef that can be used to store this capability persistently and\n # restore access to in in the future (using a `Restore` frame). If null, this capability will be\n # lost if the connection dies. Generally, application interfaces should define when a client can\n # expect a capability to be persistent (and therefore have a SturdyRef attached). However,\n # application protocols should never embed SturdyRefs directly, as various infrastructure like\n # transports, gateways, and sandboxes may need to be aware of SturdyRefs being passed over the\n # wire in order to transform them into different namespaces.\n}\n\nstruct PromisedAnswer {\n questionId @0 :QuestionId;\n # ID of the question whose answer is expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list?\n}\n\nstruct ThirdPartyCapDescriptor {\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 3 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to authenticate vats in three-party introductions.\n# - How to implement `Join`.\n# - How to store capabilities long-term without holding a connection open.\n#\n# Three-party interactions\n# ------------------------\n#\n# **Level 2 feature**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **Level 3 feature**\n#\n# The `Join` frame type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n#\n# Persistent references\n# ---------------------\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n\nusing SturdyRef = Object;\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` frame. The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n\nusing ProvisionId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in an `Accept` frame to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` frame sent from\n# that provider.\n\nusing RecipientId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in a `Provide` frame to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **Level 2 feature**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` frame sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the \"Join\" frame type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinHostId = Object;\n# Information needed by the joiner in order to form a direct connection to a joined object. One\n# of these is returned in response to each `Join` frame. This might simply be the address of the\n# joined object's host vat, since the `JoinKey` has already been communicated so the two vats\n# already have a shared secret to use to authenticate each other.\n#\n# The `JoinHostId` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinHostId`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 1 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` frame.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received frame will usually be a `Restore`.\n#\n# # Level 3 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join frames to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addHostId(hostId :JoinHostId) :Void;\n# # Add a host ID at which the host might live. All `JoinHostId`s returned from all paths\n# # must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # frame on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` frame over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 1 features -----------------------------------------------\n#\n# send(frame :Frame) :Void;\n# # Send the frame. Returns successfully when the frame (and all preceding frames) has been\n# # acknowledged by the recipient.\n#\n# receive() :Frame;\n# # Receive the next frame, and acknowledges receipt to the sender. Frames are received in the\n# # order in which they are sent.\n#\n# # Level 2 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` frame is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` frame over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` frame on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first frame received\n# # on the new connection will be an `Accept` frame.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# connection :Connection;\n# # Connection on which to issue `Accept` frame.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` frame.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore frame\n# to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. Comments in this file indicate which level requires the corresponding\n# feature to be implemented -- if unspecified, the feature must be implemented at level 1.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction, but interactions between\n# three or more parties are supported only via proxying of objects. E.g. if Alice wants to send\n# Bob a capability pointing to Carol, Alice must host a local proxy of Carol and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support \"join\" or \"eq\" across capabilities received from different vats, although they\n# should be supported on capabilities received from the same vat.\n#\n# * **Level 2:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 3:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, \"Level 2\" is irrelevant and\n# \"Level 3\" is much easier than usual to implement. When such an implementation is actually run\n# inside a container, the contained app effectively gets to make full use of the container's\n# network at level 3. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table. Additionally, the export table is further subdivited into\n# promises and capabilities. A promise will eventually be resolved and replaced with a capability,\n# although the eventual replacement capability might live in some other vat and so may not be on\n# the same table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports table are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the unknown result of an ongoing operation and will eventually be resolved to some other object\n# once that operation completes. Calls made to a promise will be forwarded to the eventual target\n# once it is known.\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n\nusing QuestionId = UInt32;\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a ReleaseAnswer\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is transmitted; in this case, the importer shall\n# expect a later Resolve frame which replaces the promise.\n#\n# ExportIds are subject to reference counting on the importing end. When an `ExportId` is received\n# embedded in an question or answer, the export has an implicit reference until that question or\n# answer is released (questions are released by `Return`, answers are released by `ReleaseAnswer`).\n# Such an export can be retained beyond that point by including it in the `retainedCaps` list\n# at the time the question\/answer is released, thus incrementing its reference count. The\n# reference count is later decremented by a `Release` message. Since the `Release` message can\n# specify an arbitrary number by which to reduce the reference count, the importer should usually\n# batch reference decrements and only send a `Release` when it believes the refererce count has\n# hit zero.\n#\n# When an `ExportId` is received as part of a Frame but not embedded in a quention or answer, its\n# reference count is automatically incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n\n# ========================================================================================\n# Frames\n\nstruct Frame {\n # An RPC connection is a bi-directional stream of Frames.\n #\n # When the RPC system wants to send a Frame, it instructs the transport layer to keep trying to\n # send the frame until the transport can guarantee that one of the following is true:\n # 1) The Frame was received, possibly multiple times.\n # 2) The sessing is broken, and no further Frames can be sent.\n # 3) The RPC system has asked to stop trying to send the Frame (e.g. because the call was canceled\n # or timed out).\n #\n # In case 1, the Frame may have been received multiple times. In cases 2 and 3, it may have been\n # received any number of times, including zero. The RPC system must handle all of these cases\n # with some modicum of grace. Moreover, applications should design their interfaces such that\n # methods are idempotent.\n\n union {\n # Level 1 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n resolve @2 :Resolve; # Resolve a previously-sent promise.\n\n release @3 :Release; # Release a capability so that the remote object can be deallocated.\n releaseAnswer @4 :ReleaseAnswer; # Release a returned answer \/ cancel a call.\n\n restore @5 :Restore; # Restore a persistent capability from a previous connection.\n\n # Level 2 features -----------------------------------------------\n\n provide @6 :Provide; # Provide a capability to a third party.\n accept @7 :Accept; # Accept a capability provided by a third party.\n\n # Level 3 features -----------------------------------------------\n\n join @8 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\nstruct Call {\n # Frame type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with call IDs originating from the opposite end). A fine strategy is to use\n # sequential call IDs, but the recipient should not assume this.\n #\n # TODO: Decide if it is safe to reuse a call ID. If not, extend to 64 bits.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return frame explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # Frame type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # If the response contains any capabilities, the caller is expected to send a Release frame for\n # each one when done with them.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a ReleaseAnswer message\n # before the call had completed.\n }\n}\n\nstruct Resolve {\n # Frame type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # Frame type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The number of times this ID has been received by the importer. The object is only truly\n # released when the referenceCount from all Release messages for the ID adds up to the number of\n # times the exporter has actually sent the object to the importer. This avoids a race condition\n # where the exporter happens to send another copy of the same ID at the same time as the importer\n # is sending a Release message for it.\n}\n\nstruct ReleaseAnswer {\n # Frame type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\nstruct Restore {\n # Frame type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this restore message, which will eventually receive a Return\n # message containing the restored capability.\n\n ref @1 :SturdyRef;\n # An object designating the capability to restore.\n}\n\nstruct Provide {\n # **Level 2 feature**\n #\n # Frame type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a ReleaseAnswer message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **Level 2 feature**\n #\n # Frame type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\nstruct Join {\n # **Level 3 feature**\n #\n # Frame type sent to implement E.join(), which, given a number of capabilities which are expected\n # to be equivalent, finds the underlying object upon which they all agree and forms a direct\n # connection to it, skipping any proxies which may have been constructed by other vats while\n # transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinHostIds to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n struct Answer {\n # The answer to a `Join` frame (sent in a `Return` frame).\n\n hostId @0 :JoinHostId;\n # Information indicating where to connect to complete the join. Also used to verify that all\n # the joins actually reached the same object.\n\n vineId @1 :ExportId;\n # A new capability in the sender's export table which must be released once the join is\n # complete. This capability has no methods. This allows the joined capability's host to\n # detect when a Join has failed and release the associated resources on its end.\n }\n}\n\n# ========================================================================================\n# Common structures used in frames\n\nstruct CapDescriptor {\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n\n sturdyRef @6 :SturdyRef;\n # If non-null, this is a SturdyRef that can be used to store this capability persistently and\n # restore access to in in the future (using a `Restore` frame). If null, this capability will be\n # lost if the connection dies. Generally, application interfaces should define when a client can\n # expect a capability to be persistent (and therefore have a SturdyRef attached). However,\n # application protocols should never embed SturdyRefs directly, as various infrastructure like\n # transports, gateways, and sandboxes may need to be aware of SturdyRefs being passed over the\n # wire in order to transform them into different namespaces.\n}\n\nstruct PromisedAnswer {\n questionId @0 :QuestionId;\n # ID of the question whose answer is expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list?\n}\n\nstruct ThirdPartyCapDescriptor {\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 3 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to authenticate vats in three-party introductions.\n# - How to implement `Join`.\n# - How to store capabilities long-term without holding a connection open.\n#\n# Three-party interactions\n# ------------------------\n#\n# **Level 2 feature**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **Level 3 feature**\n#\n# The `Join` frame type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n#\n# Persistent references\n# ---------------------\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n\nusing SturdyRef = Object;\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` frame. The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n\nusing ProvisionId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in an `Accept` frame to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` frame sent from\n# that provider.\n\nusing RecipientId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in a `Provide` frame to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **Level 2 feature**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` frame sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the \"Join\" frame type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinHostId = Object;\n# Information needed by the joiner in order to form a direct connection to a joined object. One\n# of these is returned in response to each `Join` frame. This might simply be the address of the\n# joined object's host vat, since the `JoinKey` has already been communicated so the two vats\n# already have a shared secret to use to authenticate each other.\n#\n# The `JoinHostId` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinHostId`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 1 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` frame.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received frame will usually be a `Restore`.\n#\n# # Level 3 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join frames to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addHostId(hostId :JoinHostId) :Void;\n# # Add a host ID at which the host might live. All `JoinHostId`s returned from all paths\n# # must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # frame on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` frame over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 1 features -----------------------------------------------\n#\n# send(frame :Frame) :Void;\n# # Send the frame. Returns successfully when the frame (and all preceding frames) has been\n# # acknowledged by the recipient.\n#\n# receive() :Frame;\n# # Receive the next frame, and acknowledges receipt to the sender. Frames are received in the\n# # order in which they are sent.\n#\n# # Level 2 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` frame is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` frame over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` frame on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first frame received\n# # on the new connection will be an `Accept` frame.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# connection :Connection;\n# # Connection on which to issue `Accept` frame.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` frame.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"9007a4fbc96d40f67af80a03ef376a32374cbb9e","subject":"Clarify that takeFromOtherQuestion can only be used once","message":"Clarify that takeFromOtherQuestion can only be used once\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"643889a12d1bf775e179e697cedb77a349d4712e","subject":"v0.0.1","message":"v0.0.1\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.0\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"dc67f6e18e256c4e3e1a85997f61a3cca54a13bf","subject":"fixed naming typo","message":"fixed naming typo\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/protocol.capnp","new_file":"src\/bcprotocol\/protocol.capnp","new_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\n\nstruct RequestHeader\n{\n sequence @0 :Metadata.SequenceNumber;\n}\n\nstruct Request\n{\n header @0 :RequestHeader;\n union\n {\n\tinit @1 :Command.InitRequest;\n\treconnect @2 :Command.ReconnectRequest;\n\tbye @3 :Command.ByeRequest;\n }\n}\n\nstruct ReplyHeader\n{\n sequence @0 :Metadata.SequenceNumber;\n}\n\nstruct Reply\n{\n header @0 :ReplyHeader;\n union\n {\n\tinit @1 :Command.InitReply;\n\treconnect @2 :Command.ReconnectReply;\n\tbye @3 :Command.ByeReply;\n }\n}\n","old_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Command = import \"command.capnp\";\n\nStruct RequestHeader\n{\n sequence @0 :Metadata.SequenceNumber;\n}\n\nstruct Request\n{\n header @0 :RequestHeader\n union\n {\n\tinit @1 :Command.InitRequest;\n\treconnect @2 :Command.ReconnectRequest;\n\tbye @3 :Command.ByeRequest;\n }\n}\n\nstruct ReplyHeader\n{\n sequence @0 :Metadata.SequenceNumber;\n}\n\nstruct Reply\n{\n header @0 :ReplyHeader;\n union\n {\n\tinit @1 :Command.InitReply;\n\treconnect @2 :Command.ReconnectReply;\n\tbye @3 :Command.ByeReply;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"64466867386acd29a966f07bd43c8f9ea677f180","subject":"capnp schema compiles but is not able to import go.capnp","message":"capnp schema compiles but is not able to import go.capnp\n","repos":"fehlmach\/rains","old_file":"proto\/rainsMsg.capnp","new_file":"proto\/rainsMsg.capnp","new_contents":"@0xfb2d77234707241e; # unique file ID, generated by `capnp id`\nusing Go = import \"\/home\/christian\/go\/src\/zombiezen.com\/go\/capnproto2\/std\";\n$Go.package(\"proto\");\n$Go.import(\"rains\/proto\");\n\nstruct RainsMessage {\n #RainsMessage contains the data of a message\n\ttoken @0 :Data;\n\tcontent @1 :List(MessageSection);\n\tsignatures @2 :List(Signature);\n\tcapabilities @3 :List(Text);\n}\n\ninterface MessageSection {\n}\n\nconst noCapability :Text = \"\";\nconst tLSOverTCP :Text = \"urn:x-rains:tlssrv\";\n\n\ninterface MessageSectionWithSig extends(MessageSection, Interval) {\n #MessageSectionWithSig can be either an Assertion, Shard or Zone\n\tsigs @0 () -> (sig :Signature);\n\taddSig @1 (sig :Signature);\n\tdeleteSig @2 (int :Int32);\n\tdeleteAllSigs @3 ();\n #TODO CFE what is the syntax of a method without arguments\n\tgetContext @4 () -> (context :Text);\n\tgetSubjectZone @5 () -> (zone :Text);\n\tcreateStub @6 () -> (section :MessageSectionWithSig);\n\tvalidFrom @7 () -> (validFrom :Int64);\n\tvalidUntil @8 () -> (validUntil :Int64);\n\thash @9 () -> (hash :Text);\n}\n\ninterface Interval {\n #Interval defines an interval over strings\n\tbegin @0 () -> (begin :Text);\n end @1 () -> (end :Text);\n}\n\ninterface Hashable {\n #Hashable can be implemented by objects that are not natively hashable.\n\thash @0 () -> (hash :Text);\n}\n\nstruct AssertionSection {\n #AssertionSection contains information about the assertion\n\tsubjectName @0 :Text;\n\tcontent @1 :List(Obj);\n\tsignatures @2 :List(Signature);\n\tsubjectZone @3 :Text;\n\tcontext @4 :Text;\n}\n\n\nstruct ShardSection {\n #ShardSection contains information about the shard\n\tcontent @0 :List(AssertionSection);\n\tsignatures @1 :List(Signature);\n\tsubjectZone @2 :Text;\n\tcontext @3 :Text;\n\trangeFrom @4 :Text;\n\trangeTo @5 :Text;\n}\n\n\nstruct ZoneSection {\n #ZoneSection contains information about the zone\n\tsignatures @0 :List(Signature);\n\tsubjectZone @1 :Text;\n\tcontext @2 :Text;\n\tcontent @3 :List(MessageSectionWithSig);\n}\n\nstruct QuerySection {\n #QuerySection contains information about the query\n\ttoken @0 :Data;\n\tname @1 :Text;\n\tcontext @2 :Text;\n\ttype @3 :ObjectType;\n\texpires @4 :Int64; #time when this query expires represented as the number of seconds elapsed since January 1, 1970 UTC\n\toptions @5 :List(QueryOption);\n}\n\nenum QueryOption {\n\tminE2ELatency @0;\n\tminLastHopAnswerSize @1;\n\tminInfoLeakage @2;\n\tcachedAnswersOnly @3;\n\texpiredAssertionsOk @4;\n\ttokenTracing @5;\n\tnoVerificationDelegation @6;\n\tnoProactiveCaching @7;\n}\n\nenum ObjectType {\n\toTName @0;\n\toTIP6Addr @1;\n\toTIP4Addr @2;\n\toTRedirection @3;\n\toTDelegation @4;\n\toTNameset @5;\n\toTCertInfo @6;\n\toTServiceInfo @7;\n\toTRegistrar @8;\n\toTRegistrant @9;\n\toTInfraKey @10;\n\toTExtraKey @11;\n}\n\nstruct SubjectAddr {\n\taddressFamily @0 :Text;\n\tprefixLength @1 :UInt32;\n\taddress @2 :Text;\n}\n\nstruct AddressAssertionSection {\n #AddressAssertionSection contains information about the address assertion\n\tsubjectAddr @0 :SubjectAddr;\n\tcontent @1 :List(Obj);\n\tsignatures @2 :List(Signature);\n\tcontext @3 :Text;\n}\n\n\nstruct AddressZoneSection {\n #AddressZoneSection contains information about the address zone\n\tsubjectAddr @0 :SubjectAddr;\n\tsignatures @1 :List(Signature);\n\tcontext @2 :Text;\n\tcontent @3 :List(AddressAssertionSection);\n}\n\nstruct AddressQuerySection {\n #AddressQuerySection contains information about the address query\n\tsubjectAddr @0 :SubjectAddr;\n\ttoken @1 :Data;\n\tcontext @2 :Text;\n\ttypes @3 :List(Int32);\n\texpires @4 :Int64;\n\toptions @5 :List(QueryOption);\n}\n\n\nstruct NotificationSection {\n #NotificationSection contains information about the notification\n\ttoken @0 :Data;\n\ttype @1 :NotificationType;\n\tdata @2 :Text;\n}\n\nenum NotificationType {\n\theartbeat @0;\n\tcapHashNotKnown @1;\n\tbadMessage @2;\n\trcvInconsistentMsg @3;\n\tnoAssertionsExist @4;\n\tmsgTooLarge @5;\n\tunspecServerErr @6;\n\tserverNotCapable @7;\n\tnoAssertionAvail @8;\n}\n\n\nstruct Signature {\n #Signature on a Rains message or section\n\tkeySpace @0 :KeySpaceID;\n\talgorithm @1 :SignatureAlgorithmType;\n\tvalidSince @2 :Int64;\n\tvalidUntil @3 :Int64;\n\tdata @4 :Data;\n}\n\nenum KeySpaceID {\n#KeySpaceID identifies a key space\n\trainsKeySpace @0;\n}\n\nenum SignatureAlgorithmType {\n#SignatureAlgorithmType specifies a signature algorithm type\n\ted25519 @0;\n\ted448 @1;\n\tecdsa256 @2;\n\tecdsa384 @3;\n}\n\nenum HashAlgorithmType {\n#HashAlgorithmType specifies a hash algorithm type\n\tnoHashAlgo @0;\n\tsha256 @1;\n\tsha384 @2;\n\tsha512 @3;\n}\n\nstruct PublicKey {\n #PublicKey contains information about a public key\n\ttype @0 :SignatureAlgorithmType;\n\tkey @1 :Data;\n\tvalidFrom @2 :Int64;\n\tvalidUntil @3 :Int64;\n}\n\nstruct CertificateObject {\n #CertificateObject contains certificate information\n\ttype @0 :ProtocolType;\n\tusage @1 :CertificateUsage;\n\thashAlgo @2 :HashAlgorithmType;\n\tdata @3 :Data;\n}\n\nenum ProtocolType {\n\tpTUnspecified @0;\n\tpTTLS @1;\n}\n\nenum CertificateUsage {\n\tcUTrustAnchor @0;\n\tcUEndEntity @1;\n}\n\nstruct ServiceInfo {\n #ServiceInfo contains information how to access a named service\n\tname @0 :Text;\n\tport @1 :UInt16;\n\tpriority @2 :UInt32;\n}\n\nstruct Obj {\n #Object is a container for different values determined by the given type.\n\ttype @0 :ObjectType;\n\tvalue @1 :Data;\n}\n\n\n","old_contents":"@0xfb2d77234707241e; # unique file ID, generated by `capnp id`\nusing Go = import \"go.capnp\";\n$Go.package(\"proto\");\n$Go.import(\"rains\/proto\");\n\nstruct RainsMessage {\n #RainsMessage contains the data of a message\n\ttoken @0 :Data;\n\tcontent @1 :List(MessageSection);\n\tsignatures @2 :List(Signature);\n\tcapabilities @3 :List(Text);\n}\n\ninterface MessageSection {\n}\n\nconst noCapability :Text = \"\";\nconst tLSOverTCP :Text = \"urn:x-rains:tlssrv\";\n\n\ninterface MessageSectionWithSig extends(MessageSection, Interval) {\n #MessageSectionWithSig can be either an Assertion, Shard or Zone\n\tsigs @0 () -> (sig :Signature);\n\taddSig @1 (sig :Signature);\n\tdeleteSig @2 (int :Int32);\n\tdeleteAllSigs @3 ();\n #TODO CFE what is the syntax of a method without arguments\n\tgetContext @4 () -> (context :Text);\n\tgetSubjectZone @5 () -> (zone :Text);\n\tcreateStub @6 () -> (section :MessageSectionWithSig);\n\tvalidFrom @7 () -> (validFrom :Int64);\n\tvalidUntil @8 () -> (validUntil :Int64);\n\thash @9 () -> (hash :Text);\n}\n\ninterface Interval {\n #Interval defines an interval over strings\n\tbegin @0 () -> (begin :Text);\n end @1 () -> (end :Text);\n}\n\ninterface Hashable {\n #Hashable can be implemented by objects that are not natively hashable.\n\thash @0 () -> (hash :Text);\n}\n\nstruct AssertionSection {\n #AssertionSection contains information about the assertion\n\tsubjectName @0 :Text;\n\tcontent @1 :List(Obj);\n\tsignatures @2 :List(Signature);\n\tsubjectZone @3 :Text;\n\tcontext @4 :Text;\n}\n\n\nstruct ShardSection {\n #ShardSection contains information about the shard\n\tcontent @0 :List(AssertionSection);\n\tsignatures @1 :List(Signature);\n\tsubjectZone @2 :Text;\n\tcontext @3 :Text;\n\trangeFrom @4 :Text;\n\trangeTo @5 :Text;\n}\n\n\nstruct ZoneSection {\n #ZoneSection contains information about the zone\n\tsignatures @0 :List(Signature);\n\tsubjectZone @1 :Text;\n\tcontext @2 :Text;\n\tcontent @3 :List(MessageSectionWithSig);\n}\n\nstruct QuerySection {\n #QuerySection contains information about the query\n\ttoken @0 :Data;\n\tname @1 :Text;\n\tcontext @2 :Text;\n\ttype @3 :ObjectType;\n\texpires @4 :Int64; #time when this query expires represented as the number of seconds elapsed since January 1, 1970 UTC\n\toptions @5 :List(QueryOption);\n}\n\nenum QueryOption {\n\tminE2ELatency @0;\n\tminLastHopAnswerSize @1;\n\tminInfoLeakage @2;\n\tcachedAnswersOnly @3;\n\texpiredAssertionsOk @4;\n\ttokenTracing @5;\n\tnoVerificationDelegation @6;\n\tnoProactiveCaching @7;\n}\n\nenum ObjectType {\n\toTName @0;\n\toTIP6Addr @1;\n\toTIP4Addr @2;\n\toTRedirection @3;\n\toTDelegation @4;\n\toTNameset @5;\n\toTCertInfo @6;\n\toTServiceInfo @7;\n\toTRegistrar @8;\n\toTRegistrant @9;\n\toTInfraKey @10;\n\toTExtraKey @11;\n}\n\nstruct SubjectAddr {\n\taddressFamily @0 :Text;\n\tprefixLength @1 :UInt32;\n\taddress @2 :Text;\n}\n\nstruct AddressAssertionSection {\n #AddressAssertionSection contains information about the address assertion\n\tsubjectAddr @0 :SubjectAddr;\n\tcontent @1 :List(Obj);\n\tsignatures @2 :List(Signature);\n\tcontext @3 :Text;\n}\n\n\nstruct AddressZoneSection {\n #AddressZoneSection contains information about the address zone\n\tsubjectAddr @0 :SubjectAddr;\n\tsignatures @1 :List(Signature);\n\tcontext @2 :Text;\n\tcontent @3 :List(AddressAssertionSection);\n}\n\nstruct AddressQuerySection {\n #AddressQuerySection contains information about the address query\n\tsubjectAddr @0 :SubjectAddr;\n\ttoken @1 :Data;\n\tcontext @2 :Text;\n\ttypes @3 :List(Int32);\n\texpires @4 :Int64;\n\toptions @5 :List(QueryOption);\n}\n\n\nstruct NotificationSection {\n #NotificationSection contains information about the notification\n\ttoken @0 :Data;\n\ttype @1 :NotificationType;\n\tdata @2 :Text;\n}\n\nenum NotificationType {\n\theartbeat @0;\n\tcapHashNotKnown @1;\n\tbadMessage @2;\n\trcvInconsistentMsg @3;\n\tnoAssertionsExist @4;\n\tmsgTooLarge @5;\n\tunspecServerErr @6;\n\tserverNotCapable @7;\n\tnoAssertionAvail @8;\n}\n\n\nstruct Signature {\n #Signature on a Rains message or section\n\tkeySpace @0 :KeySpaceID;\n\talgorithm @1 :SignatureAlgorithmType;\n\tvalidSince @2 :Int64;\n\tvalidUntil @3 :Int64;\n\tdata @4 :Data;\n}\n\nenum KeySpaceID {\n#KeySpaceID identifies a key space\n\trainsKeySpace @0;\n}\n\nenum SignatureAlgorithmType {\n#SignatureAlgorithmType specifies a signature algorithm type\n\ted25519 @0;\n\ted448 @1;\n\tecdsa256 @2;\n\tecdsa384 @3;\n}\n\nenum HashAlgorithmType {\n#HashAlgorithmType specifies a hash algorithm type\n\tnoHashAlgo @0;\n\tsha256 @1;\n\tsha384 @2;\n\tsha512 @3;\n}\n\nstruct PublicKey {\n #PublicKey contains information about a public key\n\ttype @0 :SignatureAlgorithmType;\n\tkey @1 :Data;\n\tvalidFrom @2 :Int64;\n\tvalidUntil @3 :Int64;\n}\n\nstruct CertificateObject {\n #CertificateObject contains certificate information\n\ttype @0 :ProtocolType;\n\tusage @1 :CertificateUsage;\n\thashAlgo @2 :HashAlgorithmType;\n\tdata @3 :Data;\n}\n\nenum ProtocolType {\n\tpTUnspecified @0;\n\tpTTLS @1;\n}\n\nenum CertificateUsage {\n\tcUTrustAnchor @0;\n\tcUEndEntity @1;\n}\n\nstruct ServiceInfo {\n #ServiceInfo contains information how to access a named service\n\tname @0 :Text;\n\tport @1 :UInt16;\n\tpriority @2 :UInt32;\n}\n\nstruct Obj {\n #Object is a container for different values determined by the given type.\n\ttype @0 :ObjectType;\n\tvalue @1 :Data;\n}\n\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"6a901a85f62db0b90fbf6ddd557c62e84912f491","subject":"catalog.capnp: give safe defaults for unions","message":"catalog.capnp: give safe defaults for unions\n","repos":"zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm","old_file":"catalog.capnp","new_file":"catalog.capnp","new_contents":"using Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n }\n}\n","old_contents":"using Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @3 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @1 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n file @2 :File;\n exec @4 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n absent @1 :Void;\n plain :group {\n content @2 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the capo, but it is an error if the file does not\n # exist.\n\n mode @3 :Mode;\n }\n directory :group {\n mode @4 :Mode;\n }\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"58f064c5f285bfd5a603c21f25c00e001d59740b","subject":"Use absolute capnp import path","message":"Use absolute capnp import path\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"nupic\/encoders\/category.capnp","new_file":"nupic\/encoders\/category.capnp","new_contents":"@0xb639caa166140b0f;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\n# Next ID: 5\nstruct CategoryEncoderProto {\n\n # Next ID: 2\n struct CategoryMapping {\n index @0 :UInt32;\n category @1 :Text;\n }\n\n width @0 :UInt32;\n indexToCategory @1 :List(CategoryMapping);\n name @2 :Text;\n verbosity @3 :UInt8;\n encoder @4 :ScalarEncoderProto;\n}\n","old_contents":"@0xb639caa166140b0f;\n\nusing import \"scalar.capnp\".ScalarEncoderProto;\n\n# Next ID: 5\nstruct CategoryEncoderProto {\n\n # Next ID: 2\n struct CategoryMapping {\n index @0 :UInt32;\n category @1 :Text;\n }\n\n width @0 :UInt32;\n indexToCategory @1 :List(CategoryMapping);\n name @2 :Text;\n verbosity @3 :UInt8;\n encoder @4 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"004ad82465961669a99c81e1905a85587c066443","subject":"Clarify documentation re: filename arguments.","message":"Clarify documentation re: filename arguments.\n\nThanks to @kentonv for pointing out that this was ambiguous.\n","repos":"zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem","old_file":"filesystem\/filesystem.capnp","new_file":"filesystem\/filesystem.capnp","new_contents":"@0xe91f231103c0780e;\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# We follow the suggested conventions for doing requests\/offers. Any of the\n# interfaces in this file may be requested or offered; use the interface id\n# as the tag, and leave the value null.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n\n# General notes:\n#\n# * All file names that appear in the API are *single* path segments --\n# implementations of these interfaces must not interpret multi-part paths,\n# and must throw exceptions when given filenames containing slashes.\n# * The filenames \"\", \".\" and \"..\" are illegal, and implementations must\n# throw an exception if given one of these. Note that \"..\" in particular\n# is very capability-unfriendly; traversing to a parent directory is very\n# purposfully not facilitated by the API.\n\nusing Util = import \"\/util.capnp\";\n\n# Note to non go users: you can just delete this if you don't want to\n# install the go plugin:\nusing Go = import \"\/go.capnp\";\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\/filesystem\");\n\ninterface Node @0x955400781a01b061 {\n # A node in the filesystem. This is either a file or a directory.\n\n stat @0 () -> (info :StatInfo);\n # Report information about the node.\n}\n\nstruct StatInfo {\n union {\n dir @0 :Void;\n file :group {\n size @1 :Int64;\n }\n }\n executable @2 :Bool;\n writable @3 :Bool;\n}\n\ninterface Directory @0xce3039544779e0fc extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 (stream :Entry.Stream);\n # List the contents of the directory. Entries are pushed into `stream`.\n #\n # `list` will not return until all of the entries have been pushed into\n # `stream` (or an error has occurred).\n\n struct Entry {\n # Information about a child of a directory.\n name @0 :Text;\n info @1 :StatInfo;\n\n interface Stream {\n # A stream of directories, for use with `list`, above.\n push @0 (entries :List(Entry));\n done @1 ();\n }\n }\n\n walk @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory @0xdffe2836f5c5dffc extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, executable :Bool) -> (file :RwFile);\n # Create a file in the current directory.\n\n mkdir @1 (name :Text) -> (dir :RwDirectory);\n # Create a sub-directory in the current directory.\n\n delete @2 (name :Text);\n # Delete the node in this directory named `name`. If it is a directory,\n # it must be empty.\n}\n\ninterface File @0xaa5b133d60884bbd extends(Node) {\n # A regular file\n\n read @0 (startAt :Int64, amount :UInt64, sink :Util.ByteStream);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # If there are fewer than `amount` bytes, available, data will be read\n # until the end of the file.\n #\n # `read` will not return until all of the data has been written into\n # `sink` (or an error has occurred).\n}\n\ninterface RwFile @0xb4810121539f6e53 extends(File) {\n # A file, with write access.\n\n write @0 (startAt :Int64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`. `-1` denotes the end of the file.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n\n setExec @2 (exec :Bool);\n # Set the executable bit to `exec`.\n}\n\n# vim: set ts=2 sw=2 et :\n","old_contents":"@0xe91f231103c0780e;\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# We follow the suggested conventions for doing requests\/offers. Any of the\n# interfaces in this file may be requested or offered; use the interface id\n# as the tag, and leave the value null.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n\nusing Util = import \"\/util.capnp\";\n\n# Note to non go users: you can just delete this if you don't want to\n# install the go plugin:\nusing Go = import \"\/go.capnp\";\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\/filesystem\");\n\ninterface Node @0x955400781a01b061 {\n # A node in the filesystem. This is either a file or a directory.\n\n stat @0 () -> (info :StatInfo);\n # Report information about the node.\n}\n\nstruct StatInfo {\n union {\n dir @0 :Void;\n file :group {\n size @1 :Int64;\n }\n }\n executable @2 :Bool;\n writable @3 :Bool;\n}\n\ninterface Directory @0xce3039544779e0fc extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 (stream :Entry.Stream);\n # List the contents of the directory. Entries are pushed into `stream`.\n #\n # `list` will not return until all of the entries have been pushed into\n # `stream` (or an error has occurred).\n\n struct Entry {\n # Information about a child of a directory.\n name @0 :Text;\n info @1 :StatInfo;\n\n interface Stream {\n # A stream of directories, for use with `list`, above.\n push @0 (entries :List(Entry));\n done @1 ();\n }\n }\n\n walk @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory @0xdffe2836f5c5dffc extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, executable :Bool) -> (file :RwFile);\n # Create a file in the current directory.\n\n mkdir @1 (name :Text) -> (dir :RwDirectory);\n # Create a sub-directory in the current directory.\n\n delete @2 (name :Text);\n # Delete the node in this directory named `name`. If it is a directory,\n # it must be empty.\n}\n\ninterface File @0xaa5b133d60884bbd extends(Node) {\n # A regular file\n\n read @0 (startAt :Int64, amount :UInt64, sink :Util.ByteStream);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # If there are fewer than `amount` bytes, available, data will be read\n # until the end of the file.\n #\n # `read` will not return until all of the data has been written into\n # `sink` (or an error has occurred).\n}\n\ninterface RwFile @0xb4810121539f6e53 extends(File) {\n # A file, with write access.\n\n write @0 (startAt :Int64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`. `-1` denotes the end of the file.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n\n setExec @2 (exec :Bool);\n # Set the executable bit to `exec`.\n}\n\n# vim: set ts=2 sw=2 et :\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"aa69b6c37a047e64b0557d3c159fc9d969b1493b","subject":"catalog: add Exec.ifDepsChanged condition","message":"catalog: add Exec.ifDepsChanged condition\n","repos":"zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm","old_file":"catalog.capnp","new_file":"catalog.capnp","new_contents":"# Copyright 2016 The Minimal Configuration Manager Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nusing Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful\n # exit code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit\n # code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n ifDepsChanged @5 :List(ResourceId);\n # Command will be run only if one of the resources listed made a\n # change to the system during application. It is an error for the\n # list to be empty or for the list to contain IDs that are not in\n # the resource's dependencies list.\n }\n}\n","old_contents":"# Copyright 2016 The Minimal Configuration Manager Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nusing Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f2786fe5f7634ed95085a21e132b59595bce2728","subject":"generic import, satisfies the compiler","message":"generic import, satisfies the compiler\n","repos":"zombiezen\/go-capnproto2,zombiezen\/go-capnproto,hodduc\/go-capnproto2,hodduc\/go-capnproto2,tpukep\/caps,zombiezen\/go-capnproto2,zombiezen\/go-capnproto","old_file":"test.capnp","new_file":"test.capnp","new_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n }\n}\n\n\n\n","old_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"capn_test\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test loc must be last because we use it to count\n # the number of elements in the Airport enum!!\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n }\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"e30c9953c6e83097143531d9214c056a73962560","subject":"Problem: travis failed deliberately, but this is obviously incorrect","message":"Problem: travis failed deliberately, but this is obviously incorrect\n\nSolution: finally make it pass\n","repos":"ethereumproject\/sputnikvm,ethereumproject\/sputnikvm,sjmackenzie\/sputnikvm,sorpaas\/sputnikvm","old_file":"tests\/arith\/add.capnp","new_file":"tests\/arith\/add.capnp","new_contents":"@0xda7d72d8f4b3c0c1;\n\nusing Test = import \"..\/..\/src\/schema\/test.capnp\";\nusing Op = import \"..\/..\/src\/schema\/opcodes.capnp\";\nusing Hierarchy = import \"..\/..\/src\/schema\/hierarchy.capnp\";\n\nconst all: Hierarchy.Tests = (\n name = \"add\",\n tests = [ .add1, .add2 ]\n);\n\nconst add1: Test.InputOutput = (\n name = \"add1\",\n inputOutput = (\n input = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP ],\n data = [ Op.STOP, Op.STOP ]\n ),\n output = (\n gas = 314159,\n code = [ Op.ADD, Op.LT, Op.GT, Op.GT ]\n )\n ),\n expectedOutput = (\n gas = 314159,\n code = [ Op.ADD, Op.LT, Op.GT, Op.GT ]\n )\n);\n\nconst add2: Test.InputOutput = (\n name = \"add2\",\n inputOutput = (\n input = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP ],\n data = [ Op.STOP, Op.STOP ]\n ),\n output = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP ]\n )\n ),\n expectedOutput = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP]\n )\n);\n","old_contents":"@0xda7d72d8f4b3c0c1;\n\nusing Test = import \"..\/..\/src\/schema\/test.capnp\";\nusing Op = import \"..\/..\/src\/schema\/opcodes.capnp\";\nusing Hierarchy = import \"..\/..\/src\/schema\/hierarchy.capnp\";\n\nconst all: Hierarchy.Tests = (\n name = \"add\",\n tests = [ .add1, .add2 ]\n);\n\nconst add1: Test.InputOutput = (\n name = \"add1\",\n inputOutput = (\n input = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP ],\n data = [ Op.STOP, Op.STOP ]\n ),\n output = (\n gas = 314159,\n code = [ Op.ADD, Op.LT, Op.GT, Op.GT ]\n )\n ),\n expectedOutput = (\n gas = 314159,\n code = [ Op.ADD, Op.LT, Op.GT, Op.GT ]\n )\n);\n\nconst add2: Test.InputOutput = (\n name = \"add2\",\n inputOutput = (\n input = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP ],\n data = [ Op.STOP, Op.STOP ]\n ),\n output = (\n gas = 314159,\n code = [ Op.STOP, Op.STOP ]\n )\n ),\n expectedOutput = (\n gas = 314158,\n code = [ Op.STOP, Op.GT]\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"ff7803f3cd53a701bae05729041f65c60762aa45","subject":"adding visual & communication structs to the BotTransmission union","message":"adding visual & communication structs to the BotTransmission union\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/protocol.capnp","new_file":"src\/bcprotocol\/protocol.capnp","new_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Control = import \"control.capnp\";\nusing Error = import \"\/core\/error.capnp\";\nusing Info = import \"info.capnp\";\nusing Sensor = import \"sensor.capnp\";\n\nstruct BotTransmission\n{\n union\n {\n\tcatch @0 :Control.CatchAction;\n\tdash @1 :Control.DashAction;\n\tkick @2 :Control.KickAction;\n\tturnBody @3 :Control.TurnBodyAction;\n\tturnHead @4 :Control.TurnHeadAction;\n\tscoreQuery @5 :Info.ScoreQuery;\n\ttimeQuery @6 :Info.TimeQuery;\n }\n}\n\nstruct ClientTransmission\n{\n union\n {\n\tunknownMsg @0 :Error.UnknownMsgError;\n\tmalformedMsg @1 :Error.MalformedMsgError;\n\tscoreResult @2 :Info.ScoreResult;\n\ttimeResult @3 :Info.TimeResult;\n\tcommunication @4 :Sensor.Communication;\n\tvisual @5 :Sensor.Visual;\n }\n}\n","old_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Control = import \"control.capnp\";\nusing Error = import \"\/core\/error.capnp\";\nusing Info = import \"info.capnp\";\n\nstruct BotTransmission\n{\n union\n {\n\tcatch @0 :Control.CatchAction;\n\tdash @1 :Control.DashAction;\n\tkick @2 :Control.KickAction;\n\tturnBody @3 :Control.TurnBodyAction;\n\tturnHead @4 :Control.TurnHeadAction;\n\tscoreQuery @5 :Info.ScoreQuery;\n\ttimeQuery @6 :Info.TimeQuery;\n }\n}\n\nstruct ClientTransmission\n{\n union\n {\n\tunknownMsg @0 :Error.UnknownMsgError;\n\tmalformedMsg @1 :Error.MalformedMsgError;\n\tscoreResult @2 :Info.ScoreResult;\n\ttimeResult @3 :Info.TimeResult;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"c31674fffc600a239c7961527edbb9eab429eb74","subject":"New version in Sandstorm file.","message":"New version in Sandstorm file.\n","repos":"firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii,JC5\/firefly-iii","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 8,\n appMarketingVersion = (defaultText = \"4.7.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.org\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 7,\n appMarketingVersion = (defaultText = \"4.6.13\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.org\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"3f9533c8b634833ead2c26ed23b041c05504cd92","subject":"Schema: add a bit more to the docs","message":"Schema: add a bit more to the docs\n","repos":"zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem","old_file":"filesystem\/filesystem.capnp","new_file":"filesystem\/filesystem.capnp","new_contents":"@0xe91f231103c0780e;\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# We follow the suggested conventions for doing requests\/offers. Any of the\n# interfaces in this file may be requested or offered; use the interface id\n# as the tag, and leave the value null.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n\nusing Util = import \"\/util.capnp\";\n\n# Note to non go users: you can just delete this if you don't want to\n# install the go plugin:\nusing Go = import \"\/go.capnp\";\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\ninterface Node @0x955400781a01b061 {\n # A node in the filesystem. This is either a file or a directory.\n\n stat @0 () -> (info :StatInfo);\n # Report information about the node.\n}\n\nstruct StatInfo {\n union {\n dir @0 :Void;\n file :group {\n size @1 :Int64;\n }\n }\n executable @2 :Bool;\n writable @3 :Bool;\n}\n\ninterface Directory @0xce3039544779e0fc extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 (stream :Entry.Stream) -> (cancel :Util.Handle);\n # List the contents of the directory. Entries are pushed into `stream`.\n # The returned handle may be dropped to request canceling the stream.\n\n struct Entry {\n # Information about a child of a directory.\n name @0 :Text;\n info @1 :StatInfo;\n\n interface Stream {\n # A stream of directories, for use with `list`, above.\n push @0 (entries :List(Entry));\n done @1 ();\n }\n }\n\n walk @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory @0xdffe2836f5c5dffc extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, executable :Bool) -> (file :RwFile);\n # Create a file in the current directory.\n\n mkdir @1 (name :Text) -> (dir :RwDirectory);\n # Create a sub-directory in the current directory.\n\n delete @2 (name :Text);\n # Delete the node in this directory named `name`. If it is a directory,\n # it must be empty.\n}\n\ninterface File @0xaa5b133d60884bbd extends(Node) {\n # A regular file\n\n read @0 (startAt :Int64, amount :UInt64, sink :Util.ByteStream)\n -> (cancel :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # If there are fewer than `amount` bytes, available, data will be read\n # until the end of the file.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n #\n # `read` will not return until all of the data has been written into\n # `sink` (or an error has occurred).\n}\n\ninterface RwFile @0xb4810121539f6e53 extends(File) {\n # A file, with write access.\n\n write @0 (startAt :Int64, cancel :Util.Handle)\n -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`. `-1` denotes the end of the file.\n # `cancel` may be used be the callee to request that streaming be stopped.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n\n setExec @2 (exec :Bool);\n # Set the executable bit to `exec`.\n}\n\n# vim: set ts=2 sw=2 et :\n","old_contents":"@0xe91f231103c0780e;\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# We follow the suggested conventions for doing requests\/offers. Any of the\n# interfaces in this file may be requested or offered; use the interface id\n# as the tag, and leave the value null.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n\nusing Util = import \"\/util.capnp\";\n\n# Note to non go users: you can just delete this if you don't want to\n# install the go plugin:\nusing Go = import \"\/go.capnp\";\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\ninterface Node @0x955400781a01b061 {\n # A node in the filesystem. This is either a file or a directory.\n\n stat @0 () -> (info :StatInfo);\n # Report information about the node.\n}\n\nstruct StatInfo {\n union {\n dir @0 :Void;\n file :group {\n size @1 :Int64;\n }\n }\n executable @2 :Bool;\n writable @3 :Bool;\n}\n\ninterface Directory @0xce3039544779e0fc extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 (stream :Entry.Stream) -> (cancel :Util.Handle);\n # List the contents of the directory. Entries are pushed into `stream`.\n # The returned handle may be dropped to request canceling the stream.\n\n struct Entry {\n # Information about a child of a directory.\n name @0 :Text;\n info @1 :StatInfo;\n\n interface Stream {\n # A stream of directories, for use with `list`, above.\n push @0 (entries :List(Entry));\n done @1 ();\n }\n }\n\n walk @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory @0xdffe2836f5c5dffc extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, executable :Bool) -> (file :RwFile);\n # Create a file in the current directory.\n\n mkdir @1 (name :Text) -> (dir :RwDirectory);\n # Create a sub-directory in the current directory.\n\n delete @2 (name :Text);\n # Delete the node in this directory named `name`. If it is a directory,\n # it must be empty.\n}\n\ninterface File @0xaa5b133d60884bbd extends(Node) {\n # A regular file\n\n read @0 (startAt :Int64, amount :UInt64, sink :Util.ByteStream)\n -> (cancel :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # If there are fewer than `amount` bytes, available, data will be read\n # until the end of the file.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n}\n\ninterface RwFile @0xb4810121539f6e53 extends(File) {\n # A file, with write access.\n\n write @0 (startAt :Int64, cancel :Util.Handle)\n -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`. `-1` denotes the end of the file.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n\n setExec @2 (exec :Bool);\n # Set the executable bit to `exec`.\n}\n\n# vim: set ts=2 sw=2 et :\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"3223f6f11a90f6f073128cff5af5219266ad9266","subject":"add short description","message":"add short description\n\n(and bump to 1.0.4)\n","repos":"jparyani\/filedrop,jparyani\/filedrop,akosel\/filedrop,akosel\/filedrop,akosel\/filedrop,zombiezen\/filedrop,jparyani\/filedrop,zombiezen\/filedrop,zombiezen\/filedrop,akosel\/filedrop,zombiezen\/filedrop","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n@0xf432f4735ec7ac78;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"nn7axgy3y8kvd0m1mtk3cwca34t916p5d7m4j1j2e874nuz3t8y0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"FileDrop\"),\n\n appVersion = 5, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.0.4\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n ( title = (defaultText = \"New Drop\"),\n nounPhrase = (defaultText = \"drop\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"icons\/icon-128.svg\"),\n grain = (svg = embed \"icons\/icon-24.svg\"),\n market = (svg = embed \"icons\/icon-150.svg\"),\n marketBig = (svg = embed \"icons\/icon-300.svg\"),\n ),\n website = \"https:\/\/github.com\/zombiezen\/filedrop\/\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/filedrop\/\",\n license = (openSource = apache2, notices = (defaultText = embed \"LICENSE.all\")),\n categories = [productivity],\n author = (\n contactEmail = \"ross@zombiezen.com\",\n pgpSignature = embed \"pgp-signature\"\n ),\n pgpKeyring = embed \"keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Drag-n-drop file sharing\"),\n screenshots = [(width = 1165, height = 780, png = embed \"screenshot.png\")],\n changeLog = (defaultText = embed \"changelog.md\")\n )\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \"LICENSE.all\",\n packagePath = \"LICENSE\" ),\n ( sourcePath = \".\",\n packagePath = \"filedrop\",\n hidePaths = [\".git\"]\n ),\n ( sourcePath = \"\/\",\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"LICENSE\", \"filedrop\/third_party\/roboto\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"View Files\")\n ),\n # TODO(light): break this apart into creating vs. modifying\n ( name = \"write\",\n title = (defaultText = \"Edit Files\")\n ),\n ( name = \"delete\",\n title = (defaultText = \"Delete Files\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can view\"),\n permissions = [true, false, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can edit\"),\n permissions = [true, true, true]\n )\n ]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\",\n \"\/filedrop\/filedrop\",\n \"-address=[::]:8080\",\n \"-storage=\/var\/files\",\n \"-datadir=\/filedrop\",\n \"-sandstorm_acls\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n@0xf432f4735ec7ac78;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"nn7axgy3y8kvd0m1mtk3cwca34t916p5d7m4j1j2e874nuz3t8y0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"FileDrop\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.0.3\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n ( title = (defaultText = \"New Drop\"),\n nounPhrase = (defaultText = \"drop\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"icons\/icon-128.svg\"),\n grain = (svg = embed \"icons\/icon-24.svg\"),\n market = (svg = embed \"icons\/icon-150.svg\"),\n marketBig = (svg = embed \"icons\/icon-300.svg\"),\n ),\n website = \"https:\/\/github.com\/zombiezen\/filedrop\/\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/filedrop\/\",\n license = (openSource = apache2, notices = (defaultText = embed \"LICENSE.all\")),\n categories = [productivity],\n author = (\n contactEmail = \"ross@zombiezen.com\",\n pgpSignature = embed \"pgp-signature\"\n ),\n pgpKeyring = embed \"keyring\",\n description = (defaultText = embed \"description.md\"),\n screenshots = [(width = 1165, height = 780, png = embed \"screenshot.png\")],\n changeLog = (defaultText = embed \"changelog.md\")\n )\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \"LICENSE.all\",\n packagePath = \"LICENSE\" ),\n ( sourcePath = \".\",\n packagePath = \"filedrop\",\n hidePaths = [\".git\"]\n ),\n ( sourcePath = \"\/\",\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"LICENSE\", \"filedrop\/third_party\/roboto\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"View Files\")\n ),\n # TODO(light): break this apart into creating vs. modifying\n ( name = \"write\",\n title = (defaultText = \"Edit Files\")\n ),\n ( name = \"delete\",\n title = (defaultText = \"Delete Files\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can view\"),\n permissions = [true, false, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can edit\"),\n permissions = [true, true, true]\n )\n ]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\",\n \"\/filedrop\/filedrop\",\n \"-address=[::]:8080\",\n \"-storage=\/var\/files\",\n \"-datadir=\/filedrop\",\n \"-sandstorm_acls\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"6a5fa49c534ff845686f54f9fe289c4aab37bf95","subject":"Add explicit interface tags and note the convention","message":"Add explicit interface tags and note the convention\n","repos":"zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem","old_file":"filesystem.capnp","new_file":"filesystem.capnp","new_contents":"@0xe91f231103c0780e;\n\nusing Go = import \"\/go.capnp\";\nusing Util = import \"\/util.capnp\";\n\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# We follow the suggested conventions for doing requests\/offers. Any of the\n# interfaces in this file may be requested or offered; use the interface id\n# as the tag, and leave the value null.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n\ninterface Node @0x955400781a01b061 {\n # A node in the filesystem. This is either a file or a directory.\n\n type @0 () -> (type :Type);\n # Report the type of the node.\n\n enum Type {\n dir @0;\n file @1;\n }\n\n canWrite @1 () -> (canWrite :Bool);\n # Report whether the node is writable. If it is, it must implement\n # one of the Rw* interfaces below.\n}\n\ninterface Directory @0xce3039544779e0fc extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 () -> (list: List(Entry));\n # List the contents of the directory. TODO: we probably want some way\n # to do pagination\/otherwise not have to transfer all of the entries at\n # once.\n\n struct Entry {\n # A child of a directory.\n name @0 :Text;\n file @1 :Node;\n }\n\n open @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory @0xdffe2836f5c5dffc extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, type :Node.Type) -> (node :Node);\n # Create a node named `name` within the directory. `type`\n # indicates what type of node to create. The returned `node`\n # always implements the writable variant of that type.\n\n delete @1 (name :Text);\n # Delete the node in this directory named `name`.\n}\n\ninterface File @0xaa5b133d60884bbd extends(Node) {\n # A regular file\n\n size @0 () -> (size: UInt64);\n # Return the size of the file.\n\n read @1 (startAt :UInt64, amount :UInt64, sink :Util.ByteStream) ->\n (handle :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n}\n\ninterface RwFile @0xb4810121539f6e53 extends(File) {\n # A file, with write access.\n\n write @0 (startAt :UInt64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n}\n","old_contents":"@0xe91f231103c0780e;\n\nusing Go = import \"\/go.capnp\";\nusing Util = import \"\/util.capnp\";\n\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n#\n# TODO: document how one does a powerbox offer\/request with these.\n\ninterface Node {\n # A node in the filesystem. This is either a file or a directory.\n\n type @0 () -> (type :Type);\n # Report the type of the node.\n\n enum Type {\n dir @0;\n file @1;\n }\n\n canWrite @1 () -> (canWrite :Bool);\n # Report whether the node is writable. If it is, it must implement\n # one of the Rw* interfaces below.\n}\n\ninterface Directory extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 () -> (list: List(Entry));\n # List the contents of the directory. TODO: we probably want some way\n # to do pagination\/otherwise not have to transfer all of the entries at\n # once.\n\n struct Entry {\n # A child of a directory.\n name @0 :Text;\n file @1 :Node;\n }\n\n open @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, type :Node.Type) -> (node :Node);\n # Create a node named `name` within the directory. `type`\n # indicates what type of node to create. The returned `node`\n # always implements the writable variant of that type.\n\n delete @1 (name :Text);\n # Delete the node in this directory named `name`.\n}\n\ninterface File extends(Node) {\n # A regular file\n\n size @0 () -> (size: UInt64);\n # Return the size of the file.\n\n read @1 (startAt :UInt64, amount :UInt64, sink :Util.ByteStream) ->\n (handle :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n}\n\ninterface RwFile extends(File) {\n # A file, with write access.\n\n write @0 (startAt :UInt64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"cf304dc7d69c9b11d6197535c0e9f5f8e51b9a46","subject":"Check in the generics examples from capnproto-c++.","message":"Check in the generics examples from capnproto-c++.\n","repos":"maurer\/capnpc-rust,kali\/capnpc-rust,maurer\/capnpc-rust,tempbottle\/capnproto-rust,placrosse\/capnproto-rust,dwrensha\/capnpc-rust,dwrensha\/capnproto-rust,tempbottle\/capnpc-rust,tempbottle\/capnpc-rust,kali\/capnpc-rust","old_file":"test\/test.capnp","new_file":"test\/test.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\n@0x99d187209d25cee7;\n\nstruct TestPrimList {\n uint8List @0 : List(UInt8);\n int8List @1 : List(Int8);\n uint16List @2 : List(UInt16);\n int16List @3 : List(Int16);\n uint32List @4 : List(UInt32);\n int32List @5 : List(Int32);\n uint64List @6 : List(UInt64);\n int64List @7 : List(Int64);\n float32List @8 : List(Float32);\n boolList @9 : List(Bool);\n voidList @10 : List(Void);\n}\n\nstruct TestStructList {\n structList @0 : List(TestPrimList);\n}\n\nstruct TestBlob {\n textField @0 : Text;\n dataField @1 : Data;\n}\n\nstruct TestBigStruct {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uint8Field @6 : UInt8;\n uint16Field @7 : UInt16;\n uint32Field @8 : UInt32;\n uint64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n\n structField @12 : Inner;\n anotherStructField @13 : Inner;\n\n struct Inner {\n uint32Field @0 : UInt32;\n uint64Field @1 : UInt64;\n float32Field @2 : Float32;\n float64Field @3 : Float64;\n boolFieldA @4 : Bool;\n boolFieldB @5 : Bool;\n boolFieldC @6 : Bool;\n boolFieldD @7 : Bool;\n }\n}\n\nenum AnEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n}\n\nstruct TestComplexList {\n enumList @0 : List(AnEnum);\n textList @1 : List(Text);\n dataList @2 : List(Data);\n primListList @3 : List(List(Int32));\n primListListList @4 : List(List(List(Int16)));\n enumListList @5 : List(List(AnEnum));\n textListList @6 : List(List(Text));\n dataListList @7 : List(List(Data));\n structListList @8 : List(List(TestBigStruct));\n}\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 :Void = void;\n boolField @1 :Bool = true;\n int8Field @2 :Int8 = -123;\n int16Field @3 :Int16 = -12345;\n int32Field @4 :Int32 = -12345678;\n int64Field @5 :Int64 = -123456789012345;\n uint8Field @6 :UInt8 = 234;\n uint16Field @7 :UInt16 = 45678;\n uint32Field @8 :UInt32 = 3456789012;\n uint64Field @9 :UInt64 = 12345678901234567890;\n float32Field @10 :Float32 = 1234.5;\n float64Field @11 :Float64 = -123e45;\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n}\n\nstruct TestUnion {\n union0 :union {\n u0f0s0 @0 :Void;\n u0f0s1 @1 :Bool;\n u0f0s8 @2 :Int8;\n u0f0s16 @3 :Int16;\n u0f0s32 @4 :Int32;\n u0f0s64 @5 :Int64;\n u0f0sp @6 :Text;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n quz @9 : Float64;\n }\n }\n}\n\nstruct TestLists {\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n new3 @5 :TestDefaults;\n}\n\nstruct TestOldUnionVersion {\n union {\n a @0 :Void;\n b @1 :UInt64;\n }\n}\n\nstruct TestNewUnionVersion {\n union {\n a :union {\n a0 @0 :Void;\n a1 @2 :UInt64;\n }\n b @1 :UInt64;\n }\n}\n\nstruct TestGenerics(Foo, Bar) {\n foo @0 :Foo;\n rev @1 :TestGenerics(Bar, Foo);\n\n struct Inner {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n\n struct Inner2(Baz) {\n bar @0 :Bar;\n baz @1 :Baz;\n innerBound @2 :Inner;\n innerUnbound @3 :TestGenerics.Inner;\n\n struct DeepNest(Qux) {\n foo @0 :Foo;\n bar @1 :Bar;\n baz @2 :Baz;\n qux @3 :Qux;\n }\n }\n\n interface Interface(Qux) {\n call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));\n }\n\n annotation ann(struct) :Foo;\n\n using AliasFoo = Foo;\n using AliasInner = Inner;\n using AliasInner2 = Inner2;\n using AliasInner2Text = Inner2(Text);\n using AliasRev = TestGenerics(Bar, Foo);\n\n struct UseAliases {\n foo @0 :AliasFoo;\n inner @1 :AliasInner;\n inner2 @2 :AliasInner2;\n inner2Bind @3 :AliasInner2(Text);\n inner2Text @4 :AliasInner2Text;\n revFoo @5 :AliasRev.AliasFoo;\n }\n}\n\nstruct TestGenericsWrapper(Foo, Bar) {\n value @0 :TestGenerics(Foo, Bar);\n}\n\nstruct TestGenericsWrapper2 {\n value @0 :TestGenericsWrapper(Text, TestAllTypes);\n}\n\ninterface TestImplicitMethodParams {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\ninterface TestImplicitMethodParamsInGeneric(V) {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\nstruct TestUseGenerics $TestGenerics(Text, Data).ann(\"foo\") {\n basic @0 :TestGenerics(TestAllTypes, TestAnyPointer);\n inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner;\n inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text);\n unspecified @3 :TestGenerics;\n unspecifiedInner @4 :TestGenerics.Inner2(Text);\n wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer);\n cap @18 :TestGenerics(TestInterface, Text);\n\n# Currently broken:\n# genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data);\n\n default @5 :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner =\n (foo = (int16Field = 123), bar = \"text\");\n defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123)));\n defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) =\n (value = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultWrapper2 @10 :TestGenericsWrapper2 =\n (value = (value = (foo = \"text\", rev = (foo = (int16Field = 321)))));\n\n aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123);\n aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner\n = (foo = (int16Field = 123));\n aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2\n = (innerBound = (foo = (int16Field = 123)));\n aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32))\n = (baz = [12, 34], innerBound = (foo = (int16Field = 123)));\n aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text\n = (baz = \"text\", innerBound = (foo = (int16Field = 123)));\n aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = \"text\";\n\n useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = (\n foo = (int16Field = 123),\n inner = (foo = (int16Field = 123)),\n inner2 = (innerBound = (foo = (int16Field = 123))),\n inner2Bind = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n inner2Text = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n revFoo = [12, 34, 56]);\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n}\n\nconst globalInt :UInt32 = 12345;\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x : Text);\n bar @1 () -> ();\n baz @2 (s : TestBigStruct);\n bazz @3 (s : TestBigStruct) -> (r : TestBigStruct);\n}\n\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestBigStruct -> ();\n grault @2 () -> TestBigStruct;\n}\n\ninterface EmptyInterface {}\n\nstruct TestKeywords {\n struct As {}\n struct Box {}\n struct Break {}\n struct Continue {}\n struct Crate {}\n struct Else {}\n struct Enum {}\n struct Extern {}\n # ...\n struct Struct{}\n struct Super{}\n struct True{}\n struct Trait{}\n struct Type{}\n struct Unsafe{}\n struct Use{}\n struct While{}\n}\n\nstruct GenericOnce(Foo) {\n genericField @0 : Foo;\n}\n\nstruct BrandOnce {\n brandedField @0 : GenericOnce(TestAllTypes);\n}\n\nstruct GenericTwice(Foo,Bar) {\n fooField @0 : Foo;\n barField @1 : Bar;\n}\n\nstruct BrandTwice {\n bazField @0 : GenericTwice(Text, TestBlob);\n}\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\n@0x99d187209d25cee7;\n\nstruct TestPrimList {\n uint8List @0 : List(UInt8);\n int8List @1 : List(Int8);\n uint16List @2 : List(UInt16);\n int16List @3 : List(Int16);\n uint32List @4 : List(UInt32);\n int32List @5 : List(Int32);\n uint64List @6 : List(UInt64);\n int64List @7 : List(Int64);\n float32List @8 : List(Float32);\n boolList @9 : List(Bool);\n voidList @10 : List(Void);\n}\n\nstruct TestStructList {\n structList @0 : List(TestPrimList);\n}\n\nstruct TestBlob {\n textField @0 : Text;\n dataField @1 : Data;\n}\n\nstruct TestBigStruct {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uint8Field @6 : UInt8;\n uint16Field @7 : UInt16;\n uint32Field @8 : UInt32;\n uint64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n\n structField @12 : Inner;\n anotherStructField @13 : Inner;\n\n struct Inner {\n uint32Field @0 : UInt32;\n uint64Field @1 : UInt64;\n float32Field @2 : Float32;\n float64Field @3 : Float64;\n boolFieldA @4 : Bool;\n boolFieldB @5 : Bool;\n boolFieldC @6 : Bool;\n boolFieldD @7 : Bool;\n }\n}\n\nenum AnEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n}\n\nstruct TestComplexList {\n enumList @0 : List(AnEnum);\n textList @1 : List(Text);\n dataList @2 : List(Data);\n primListList @3 : List(List(Int32));\n primListListList @4 : List(List(List(Int16)));\n enumListList @5 : List(List(AnEnum));\n textListList @6 : List(List(Text));\n dataListList @7 : List(List(Data));\n structListList @8 : List(List(TestBigStruct));\n}\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 :Void = void;\n boolField @1 :Bool = true;\n int8Field @2 :Int8 = -123;\n int16Field @3 :Int16 = -12345;\n int32Field @4 :Int32 = -12345678;\n int64Field @5 :Int64 = -123456789012345;\n uint8Field @6 :UInt8 = 234;\n uint16Field @7 :UInt16 = 45678;\n uint32Field @8 :UInt32 = 3456789012;\n uint64Field @9 :UInt64 = 12345678901234567890;\n float32Field @10 :Float32 = 1234.5;\n float64Field @11 :Float64 = -123e45;\n}\n\nstruct TestEmptyStruct {\n\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n}\n\nstruct TestUnion {\n union0 :union {\n u0f0s0 @0 :Void;\n u0f0s1 @1 :Bool;\n u0f0s8 @2 :Int8;\n u0f0s16 @3 :Int16;\n u0f0s32 @4 :Int32;\n u0f0s64 @5 :Int64;\n u0f0sp @6 :Text;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n quz @9 : Float64;\n }\n }\n}\n\nstruct TestLists {\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n new3 @5 :TestDefaults;\n}\n\nstruct TestOldUnionVersion {\n union {\n a @0 :Void;\n b @1 :UInt64;\n }\n}\n\nstruct TestNewUnionVersion {\n union {\n a :union {\n a0 @0 :Void;\n a1 @2 :UInt64;\n }\n b @1 :UInt64;\n }\n}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n}\n\nconst globalInt :UInt32 = 12345;\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x : Text);\n bar @1 () -> ();\n baz @2 (s : TestBigStruct);\n bazz @3 (s : TestBigStruct) -> (r : TestBigStruct);\n}\n\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestBigStruct -> ();\n grault @2 () -> TestBigStruct;\n}\n\ninterface EmptyInterface {}\n\nstruct TestKeywords {\n struct As {}\n struct Box {}\n struct Break {}\n struct Continue {}\n struct Crate {}\n struct Else {}\n struct Enum {}\n struct Extern {}\n # ...\n struct Struct{}\n struct Super{}\n struct True{}\n struct Trait{}\n struct Type{}\n struct Unsafe{}\n struct Use{}\n struct While{}\n}\n\nstruct GenericOnce(Foo) {\n genericField @0 : Foo;\n}\n\nstruct BrandOnce {\n brandedField @0 : GenericOnce(TestAllTypes);\n}\n\nstruct GenericTwice(Foo,Bar) {\n fooField @0 : Foo;\n barField @1 : Bar;\n}\n\nstruct BrandTwice {\n bazField @0 : GenericTwice(Text, TestBlob);\n}\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f99e74ce9a020734fdab6918227a5ea366d57457","subject":"trun ooff quota limit","message":"trun ooff quota limit\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"gce-config.capnp","new_file":"gce-config.capnp","new_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n isQuotaEnabled = false,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","old_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9f05cdb245c205cd0ee23199b35270d6003fb9b9","subject":"Add more comments to the schema","message":"Add more comments to the schema\n","repos":"zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem","old_file":"filesystem.capnp","new_file":"filesystem.capnp","new_contents":"@0xe91f231103c0780e;\n\nusing Go = import \"\/go.capnp\";\nusing Util = import \"\/util.capnp\";\n\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\n# This file specifies a schema that sandstorm grains may use to share files\n# and directories with one another.\n#\n# NOTE: this is *unstable*. Backwards-incompatible changes may be made to this\n# schema until we settle on a final-ish design.\n#\n# TODO: document how one does a powerbox offer\/request with these.\n\ninterface Node {\n # A node in the filesystem. This is either a file or a directory.\n\n type @0 () -> (type :Type);\n # Report the type of the node.\n\n enum Type {\n dir @0;\n file @1;\n }\n\n canWrite @1 () -> (canWrite :Bool);\n # Report whether the node is writable. If it is, it must implement\n # one of the Rw* interfaces below.\n}\n\ninterface Directory extends(Node) {\n # A (possibly read-only) directory.\n\n list @0 () -> (list: List(Entry));\n # List the contents of the directory. TODO: we probably want some way\n # to do pagination\/otherwise not have to transfer all of the entries at\n # once.\n\n struct Entry {\n # A child of a directory.\n name @0 :Text;\n file @1 :Node;\n }\n\n open @1 (name :Text) -> (node :Node);\n # Open a file in this directory.\n}\n\ninterface RwDirectory extends(Directory) {\n # A directory, with write access.\n\n create @0 (name :Text, type :Node.Type) -> (node :Node);\n # Create a node named `name` within the directory. `type`\n # indicates what type of node to create. The returned `node`\n # always implements the writable variant of that type.\n\n delete @1 (name :Text);\n # Delete the node in this directory named `name`.\n}\n\ninterface File extends(Node) {\n # A regular file\n\n size @0 () -> (size: UInt64);\n # Return the size of the file.\n\n read @1 (startAt :UInt64, amount :UInt64, sink :Util.ByteStream) ->\n (handle :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n}\n\ninterface RwFile extends(File) {\n # A file, with write access.\n\n write @0 (startAt :UInt64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n}\n","old_contents":"@0xe91f231103c0780e;\n\nusing Go = import \"\/go.capnp\";\nusing Util = import \"\/util.capnp\";\n\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\ninterface Node {\n type @0 () -> (type :Type);\n enum Type {\n dir @0;\n file @1;\n }\n\n canWrite @1 () -> (canWrite :Bool);\n}\n\ninterface Directory extends(Node) {\n list @0 () -> (list: List(Entry));\n struct Entry {\n name @0 :Text;\n file @1 :Node;\n }\n\n open @1 (name :Text) -> (node :Node);\n}\n\ninterface RwDirectory extends(Directory) {\n create @0 (name :Text, type :Node.Type) -> (node :Node);\n # Create a node named `name` within the directory. `type`\n # indicates what type of node to create. The returned `node`\n # always implements the writable variant of that type.\n\n delete @1 (name :Text);\n # Delete the node in this directory named `name`.\n}\n\ninterface File extends(Node) {\n size @0 () -> (size: UInt64);\n # Return the size of the file.\n\n read @1 (startAt :UInt64, amount :UInt64, sink :Util.ByteStream) ->\n (handle :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n}\n\ninterface RwFile extends(File) {\n write @0 (startAt :UInt64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f99a6f02988bb66b9139ad37e55563aeb6d81257","subject":"updating the error message names to follow the naming convention","message":"updating the error message names to follow the naming convention\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/csprotocol\/command.capnp","new_file":"src\/csprotocol\/command.capnp","new_contents":"@0xc7bd906a94321b78;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/src\/core\/entity.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Rule = import \"\/src\/core\/rule.capnp\";\n\nstruct VersionMismatchError { }\nstruct NoSuchTeamError { }\nstruct TeamFullError { }\nstruct UniformTakenError { }\nstruct GoalieTakenError { }\nstruct GameInPlayOnError { }\n\nstruct InitRequest\n{\n version @0 :Metadata.Version;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct InitReply\n{\n union\n {\n\tresult @0 :InitResult;\n\terror @1 :InitError;\n }\n}\n\nstruct InitResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct InitError\n{\n union\n {\n\tversionMismatch @0 :VersionMismatchError;\n\tnoSuchTeam @1 :NoSuchTeamError;\n\tteamFull @2 :TeamFullError;\n\tuniformTaken @3 :UniformTakenError;\n\tgoalieTaken @4 :GoalieTakenError;\n }\n}\n\nstruct ReconnectRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ReconnectReply\n{\n union\n {\n\tresult @0 :ReconnectResult;\n\terror @1 :ReconnectError;\n }\n}\n\nstruct ReconnectResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct ReconnectError\n{\n union\n {\n\tnoSuchTeam @0 :NoSuchTeamError;\n\tteamFull @1 :TeamFullError;\n\tuniformTaken @2 :UniformTakenError;\n\tgameInPlayOn @3 :GameInPlayOnError;\n }\n}\n\nstruct ByeRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ByeReply\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n","old_contents":"@0xc7bd906a94321b78;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/src\/core\/entity.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Rule = import \"\/src\/core\/rule.capnp\";\n\nstruct ErrorVersionMismatch { }\nstruct ErrorNoSuchTeam { }\nstruct ErrorTeamFull { }\nstruct ErrorUniformTaken { }\nstruct ErrorGoalieTaken { }\nstruct ErrorGameInPlayOn { }\n\nstruct InitRequest\n{\n version @0 :Metadata.Version;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct InitReply\n{\n union\n {\n\tresult @0 :InitResult;\n\terror @1 :InitError;\n }\n}\n\nstruct InitResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct InitError\n{\n union\n {\n\tversionMismatch @0 :ErrorVersionMismatch;\n\tnoSuchTeam @1 :ErrorNoSuchTeam;\n\tteamFull @2 :ErrorTeamFull;\n\tuniformTaken @3 :ErrorUniformTaken;\n\tgoalieTaken @4 :ErrorGoalieTaken;\n }\n}\n\nstruct ReconnectRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ReconnectReply\n{\n union\n {\n\tresult @0 :ReconnectResult;\n\terror @1 :ReconnectError;\n }\n}\n\nstruct ReconnectResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct ReconnectError\n{\n union\n {\n\tnoSuchTeam @0 :ErrorNoSuchTeam;\n\tteamFull @1 :ErrorTeamFull;\n\tuniformTaken @2 :ErrorUniformTaken;\n\tgameInPlayOn @3 :ErrorGameInPlayOn;\n }\n}\n\nstruct ByeRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ByeReply\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"9d35b2209c954f91c6a54a7ca90409be58faf0ac","subject":".sandstorm: use correct app ID","message":".sandstorm: use correct app ID\n","repos":"zombiezen\/sandpass,zombiezen\/sandpass,zombiezen\/sandpass","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"KeePass\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.0.0\"),\n\n actions = [\n ( nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\")\n ),\n ( name = \"write\",\n title = (defaultText = \"Write to database\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true]\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","old_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"61gh7gnns305cknp20v2ekvdex48g4d3rv6wghuzk6huzx5qmp7h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"KeePass\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.0.0\"),\n\n actions = [\n ( nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\")\n ),\n ( name = \"write\",\n title = (defaultText = \"Write to database\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true]\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9d6357b63daf824a6161f607886c7d654f4c22cd","subject":"release v0.10.2","message":"release v0.10.2\n","repos":"mnutt\/davros,mnutt\/davros,mnutt\/davros,mnutt\/davros","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"8aspz4sfjnp8u89000mh2v1xrdyx97ytn8hq71mdzv4p4d8n0n3h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 102, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10.2\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Shared Directory\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PORT\", value = \"8000\"),\n (key = \"STORAGE_PATH\", value = \"\/var\/davros\/data\"),\n (key = \"TEMP_STORAGE_PATH\", value = \"\/var\/davros\/tmp\"),\n (key = \"TMPDIR\", value = \"\/var\/davros\/tmp\"),\n ]\n);\n","old_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"8aspz4sfjnp8u89000mh2v1xrdyx97ytn8hq71mdzv4p4d8n0n3h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 101, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Shared Directory\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PORT\", value = \"8000\"),\n (key = \"STORAGE_PATH\", value = \"\/var\/davros\/data\"),\n (key = \"TEMP_STORAGE_PATH\", value = \"\/var\/davros\/tmp\"),\n (key = \"TMPDIR\", value = \"\/var\/davros\/tmp\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"abaf9dd7a2a50f33de2128cc9ecb2f8ffd87e125","subject":"cleanup, yay","message":"cleanup, yay\n","repos":"rustyrazorblade\/killranswers,rustyrazorblade\/killranswers","old_file":"killranswers.capnp","new_file":"killranswers.capnp","new_contents":"@0xce4c7cd66480f6f2;\n\ninterface KillrAnswers {\n ask @0 (text :Text, category :Text, user :Text) -> (question: Question);\n createCategory @1 (text :Text, parent :Text) -> (category: Category);\n getRootCategory @2 () -> (category: Category);\n registerUser @3 (user_id :Text) -> ();\n getChildCategories @4 (parent :Text) -> ( categories:List(Category));\n answer @5 (question : Text, user : Text, text : Text) -> (answer: Answer);\n getAnswers @6 (question: Text) -> (answers: List(Answer) );\n}\n\nstruct Question {\n id @0 : Text;\n text @1 : Text;\n category @2 : Text;\n}\n\n\nstruct Category {\n id @0 : Text;\n name @1: Text;\n}\n\nstruct Answer {\n id @0 : Text;\n question @1 : Text;\n user @2 : Text;\n text @3 : Text;\n}\n","old_contents":"@0xce4c7cd66480f6f2;\n\ninterface KillrAnswers {\n ask @0 (text :Text, category :Text, user :Text) -> (question: Question);\n createCategory @1 (text :Text, parent :Text) -> (category: Category);\n getRootCategory @2 () -> (category: Category);\n registerUser @3 (user_id :Text) -> ();\n getChildCategories @4 (parent :Text) -> ( categories:List(Category));\n answer @5 (question : Text, user : Text, text : Text) -> (answer: Answer);\n getAnswers @6 (question: Text) -> (answers: List(Answer) );\n}\n\nstruct Question {\n id @0 : Text;\n text @1 : Text;\n category @2 : Text;\n}\n\nstruct QuestionList {\n questions @0 : List(Question);\n}\n\nstruct Category {\n id @0 : Text;\n name @1: Text;\n}\n\nstruct Answer {\n id @0 : Text;\n question @1 : Text;\n user @2 : Text;\n text @3 : Text;\n}\n\nstruct AnswerList {\n answers @0 : List(Answer);\n total @1 : Int16;\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"4a2fa1f13f4d9fcc616ea36438189b20ed3e2987","subject":"smaller description","message":"smaller description\n","repos":"subesokun\/Rocket.Chat,qnib\/Rocket.Chat,wtsarchive\/Rocket.Chat,pkgodara\/Rocket.Chat,AlecTroemel\/Rocket.Chat,jbsavoy18\/rocketchat-1,org100h1\/Rocket.Panda,mitar\/Rocket.Chat,NMandapaty\/Rocket.Chat,jonathanhartman\/Rocket.Chat,NMandapaty\/Rocket.Chat,xasx\/Rocket.Chat,mhurwi\/Rocket.Chat,ut7\/Rocket.Chat,Sing-Li\/Rocket.Chat,mrinaldhar\/Rocket.Chat,mwharrison\/Rocket.Chat,qnib\/Rocket.Chat,linnovate\/hi,ImpressiveSetOfIntelligentStudents\/chat,amaapp\/ama,ut7\/Rocket.Chat,tntobias\/Rocket.Chat,flaviogrossi\/Rocket.Chat,klatys\/Rocket.Chat,AimenJoe\/Rocket.Chat,pachox\/Rocket.Chat,Sing-Li\/Rocket.Chat,fduraibi\/Rocket.Chat,haoyixin\/Rocket.Chat,Flitterkill\/Rocket.Chat,xboston\/Rocket.Chat,Gudii\/Rocket.Chat,klatys\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,karlprieb\/Rocket.Chat,ziedmahdi\/Rocket.Chat,mccambridge\/Rocket.Chat,amaapp\/ama,acaronmd\/Rocket.Chat,AimenJoe\/Rocket.Chat,inoxth\/Rocket.Chat,mhurwi\/Rocket.Chat,cdwv\/Rocket.Chat,cnash\/Rocket.Chat,inoxth\/Rocket.Chat,4thParty\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,wicked539\/Rocket.Chat,Achaikos\/Rocket.Chat,karlprieb\/Rocket.Chat,JamesHGreen\/Rocket_API,ImpressiveSetOfIntelligentStudents\/chat,wicked539\/Rocket.Chat,JamesHGreen\/Rocket.Chat,JamesHGreen\/Rocket.Chat,mwharrison\/Rocket.Chat,bt\/Rocket.Chat,ahmadassaf\/Rocket.Chat,OtkurBiz\/Rocket.Chat,VoiSmart\/Rocket.Chat,ahmadassaf\/Rocket.Chat,ImpressiveSetOfIntelligentStudents\/chat,Flitterkill\/Rocket.Chat,galrotem1993\/Rocket.Chat,igorstajic\/Rocket.Chat,acaronmd\/Rocket.Chat,jbsavoy18\/rocketchat-1,steedos\/chat,LeonardOliveros\/Rocket.Chat,jbsavoy18\/rocketchat-1,liuliming2008\/Rocket.Chat,capensisma\/Rocket.Chat,lukaroski\/traden,fduraibi\/Rocket.Chat,matthewshirley\/Rocket.Chat,4thParty\/Rocket.Chat,org100h1\/Rocket.Panda,amaapp\/ama,fatihwk\/Rocket.Chat,Gyubin\/Rocket.Chat,tlongren\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,Movile\/Rocket.Chat,TribeMedia\/Rocket.Chat,jonathanhartman\/Rocket.Chat,inoio\/Rocket.Chat,amaapp\/ama,ndarilek\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,acaronmd\/Rocket.Chat,mwharrison\/Rocket.Chat,tntobias\/Rocket.Chat,Dianoga\/Rocket.Chat,fatihwk\/Rocket.Chat,k0nsl\/Rocket.Chat,marzieh312\/Rocket.Chat,inoxth\/Rocket.Chat,Flitterkill\/Rocket.Chat,pkgodara\/Rocket.Chat,abhishekshukla0302\/trico,ahmadassaf\/Rocket.Chat,wicked539\/Rocket.Chat,tlongren\/Rocket.Chat,danielbressan\/Rocket.Chat,Gyubin\/Rocket.Chat,Sing-Li\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,NMandapaty\/Rocket.Chat,timkinnane\/Rocket.Chat,danielbressan\/Rocket.Chat,ealbers\/Rocket.Chat,danielbressan\/Rocket.Chat,marzieh312\/Rocket.Chat,fatihwk\/Rocket.Chat,nishimaki10\/Rocket.Chat,litewhatever\/Rocket.Chat,flaviogrossi\/Rocket.Chat,mrinaldhar\/Rocket.Chat,mwharrison\/Rocket.Chat,Gyubin\/Rocket.Chat,intelradoux\/Rocket.Chat,cdwv\/Rocket.Chat,pitamar\/Rocket.Chat,pachox\/Rocket.Chat,litewhatever\/Rocket.Chat,cdwv\/Rocket.Chat,Dianoga\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,xasx\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,AimenJoe\/Rocket.Chat,k0nsl\/Rocket.Chat,cnash\/Rocket.Chat,mrinaldhar\/Rocket.Chat,cnash\/Rocket.Chat,Gudii\/Rocket.Chat,jonathanhartman\/Rocket.Chat,mitar\/Rocket.Chat,yuyixg\/Rocket.Chat,JamesHGreen\/Rocket_API,cdwv\/Rocket.Chat,marzieh312\/Rocket.Chat,haoyixin\/Rocket.Chat,jonathanhartman\/Rocket.Chat,inoio\/Rocket.Chat,steedos\/chat,ut7\/Rocket.Chat,ealbers\/Rocket.Chat,wtsarchive\/Rocket.Chat,tlongren\/Rocket.Chat,JamesHGreen\/Rocket_API,mrsimpson\/Rocket.Chat,org100h1\/Rocket.Panda,nishimaki10\/Rocket.Chat,ziedmahdi\/Rocket.Chat,Sing-Li\/Rocket.Chat,AlecTroemel\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,timkinnane\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,JamesHGreen\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,wtsarchive\/Rocket.Chat,ndarilek\/Rocket.Chat,bt\/Rocket.Chat,wtsarchive\/Rocket.Chat,mrsimpson\/Rocket.Chat,galrotem1993\/Rocket.Chat,Flitterkill\/Rocket.Chat,alexbrazier\/Rocket.Chat,haoyixin\/Rocket.Chat,ImpressiveSetOfIntelligentStudents\/chat,Deepakkothandan\/Rocket.Chat,OtkurBiz\/Rocket.Chat,k0nsl\/Rocket.Chat,inoxth\/Rocket.Chat,k0nsl\/Rocket.Chat,lukaroski\/traden,galrotem1993\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,igorstajic\/Rocket.Chat,LearnersGuild\/Rocket.Chat,4thParty\/Rocket.Chat,linnovate\/hi,fduraibi\/Rocket.Chat,abhishekshukla0302\/trico,karlprieb\/Rocket.Chat,OtkurBiz\/Rocket.Chat,Achaikos\/Rocket.Chat,litewhatever\/Rocket.Chat,intelradoux\/Rocket.Chat,steedos\/chat,qnib\/Rocket.Chat,pitamar\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,subesokun\/Rocket.Chat,4thParty\/Rocket.Chat,timkinnane\/Rocket.Chat,Gudii\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,abduljanjua\/TheHub,pachox\/Rocket.Chat,fatihwk\/Rocket.Chat,Dianoga\/Rocket.Chat,flaviogrossi\/Rocket.Chat,mhurwi\/Rocket.Chat,mccambridge\/Rocket.Chat,AlecTroemel\/Rocket.Chat,mitar\/Rocket.Chat,matthewshirley\/Rocket.Chat,Movile\/Rocket.Chat,pitamar\/Rocket.Chat,LearnersGuild\/echo-chat,LearnersGuild\/echo-chat,LearnersGuild\/Rocket.Chat,qnib\/Rocket.Chat,mccambridge\/Rocket.Chat,Achaikos\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,pitamar\/Rocket.Chat,PavelVanecek\/Rocket.Chat,OtkurBiz\/Rocket.Chat,liuliming2008\/Rocket.Chat,VoiSmart\/Rocket.Chat,liuliming2008\/Rocket.Chat,AimenJoe\/Rocket.Chat,liuliming2008\/Rocket.Chat,marzieh312\/Rocket.Chat,danielbressan\/Rocket.Chat,NMandapaty\/Rocket.Chat,xasx\/Rocket.Chat,ahmadassaf\/Rocket.Chat,capensisma\/Rocket.Chat,Movile\/Rocket.Chat,nishimaki10\/Rocket.Chat,ggazzo\/Rocket.Chat,Achaikos\/Rocket.Chat,Gyubin\/Rocket.Chat,cnash\/Rocket.Chat,abduljanjua\/TheHub,LearnersGuild\/Rocket.Chat,ut7\/Rocket.Chat,pachox\/Rocket.Chat,abduljanjua\/TheHub,matthewshirley\/Rocket.Chat,igorstajic\/Rocket.Chat,pkgodara\/Rocket.Chat,timkinnane\/Rocket.Chat,xboston\/Rocket.Chat,yuyixg\/Rocket.Chat,bt\/Rocket.Chat,ziedmahdi\/Rocket.Chat,alexbrazier\/Rocket.Chat,steedos\/chat,BorntraegerMarc\/Rocket.Chat,galrotem1993\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,xboston\/Rocket.Chat,ziedmahdi\/Rocket.Chat,TribeMedia\/Rocket.Chat,subesokun\/Rocket.Chat,lukaroski\/traden,pkgodara\/Rocket.Chat,Dianoga\/Rocket.Chat,LearnersGuild\/echo-chat,trt15-ssci-organization\/Rocket.Chat,intelradoux\/Rocket.Chat,intelradoux\/Rocket.Chat,subesokun\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ndarilek\/Rocket.Chat,alexbrazier\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,mitar\/Rocket.Chat,igorstajic\/Rocket.Chat,mhurwi\/Rocket.Chat,klatys\/Rocket.Chat,ealbers\/Rocket.Chat,nishimaki10\/Rocket.Chat,abduljanjua\/TheHub,mccambridge\/Rocket.Chat,xasx\/Rocket.Chat,AlecTroemel\/Rocket.Chat,jbsavoy18\/rocketchat-1,tlongren\/Rocket.Chat,inoio\/Rocket.Chat,karlprieb\/Rocket.Chat,TribeMedia\/Rocket.Chat,flaviogrossi\/Rocket.Chat,PavelVanecek\/Rocket.Chat,PavelVanecek\/Rocket.Chat,yuyixg\/Rocket.Chat,ggazzo\/Rocket.Chat,ndarilek\/Rocket.Chat,yuyixg\/Rocket.Chat,klatys\/Rocket.Chat,acaronmd\/Rocket.Chat,mrsimpson\/Rocket.Chat,tntobias\/Rocket.Chat,org100h1\/Rocket.Panda,lukaroski\/traden,mrsimpson\/Rocket.Chat,LearnersGuild\/echo-chat,litewhatever\/Rocket.Chat,JamesHGreen\/Rocket_API,capensisma\/Rocket.Chat,PavelVanecek\/Rocket.Chat,tntobias\/Rocket.Chat,fduraibi\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,VoiSmart\/Rocket.Chat,mrinaldhar\/Rocket.Chat,haoyixin\/Rocket.Chat,ggazzo\/Rocket.Chat,xboston\/Rocket.Chat,matthewshirley\/Rocket.Chat,Movile\/Rocket.Chat,wicked539\/Rocket.Chat,JamesHGreen\/Rocket.Chat,bt\/Rocket.Chat,abhishekshukla0302\/trico,alexbrazier\/Rocket.Chat,ealbers\/Rocket.Chat,LearnersGuild\/Rocket.Chat,abhishekshukla0302\/trico,TribeMedia\/Rocket.Chat,ggazzo\/Rocket.Chat,Gudii\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.6\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = MIT),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Messaging App\"),\n\n screenshots = [\n (width = 1024, height = 733, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.6\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = MIT),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"..\/README.md\"),\n shortDescription = (defaultText = \"Messaging App\"),\n\n screenshots = [\n (width = 1024, height = 733, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"10eab45aaa2c83dcb04cd9697fd81432c61e4523","subject":"Add golang annotation to capnp spec file (#3089)","message":"Add golang annotation to capnp spec file (#3089)\n\nThis allows golang users to generate golang structures based on the spec\r\nfile if needed.","repos":"TileDB-Inc\/TileDB,TileDB-Inc\/TileDB,TileDB-Inc\/TileDB,TileDB-Inc\/TileDB","old_file":"tiledb\/sm\/serialization\/tiledb-rest.capnp","new_file":"tiledb\/sm\/serialization\/tiledb-rest.capnp","new_contents":"@0xb57d9224b587d87f;\n\nusing Json = import \"\/capnp\/compat\/json.capnp\";\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"tiledb::sm::serialization::capnp\");\nusing Go = import \"\/go.capnp\";\n$Go.package(\"capnp_models\");\n$Go.import(\"capnp_models\");\n\nstruct DomainArray {\n int8 @0 :List(Int8);\n uint8 @1 :List(UInt8);\n int16 @2 :List(Int16);\n uint16 @3 :List(UInt16);\n int32 @4 :List(Int32);\n uint32 @5 :List(UInt32);\n int64 @6 :List(Int64);\n uint64 @7 :List(UInt64);\n float32 @8 :List(Float32);\n float64 @9 :List(Float64);\n}\n\nstruct KV {\n key @0 :Text;\n value @1 :Text;\n}\n\nstruct Config {\n# Represents a config object\n entries @0 :List(KV);\n # list of key-value settings\n}\n\nstruct Array {\n endTimestamp @0 :UInt64;\n # ending timestamp array was opened\n\n queryType @1 :Text;\n # Array opened for query type\n\n uri @2 :Text;\n # Array uri\n\n startTimestamp @3 :UInt64;\n # starting timestamp array was opened\n\n arraySchemaLatest @4 :ArraySchema;\n # latest array schema\n\n arraySchemasAll @5 :Map(Text, ArraySchema);\n # map of all Array Schemas\n\n nonEmptyDomain @6 :NonEmptyDomainList;\n # non empty domain\n\n arrayMetadata @7 :ArrayMetadata;\n # array metadata\n}\n\nstruct ArraySchema {\n# ArraySchema during creation or retrieval\n arrayType @0 :Text;\n # Type of array\n\n attributes @1 :List(Attribute);\n # Attributes of array\n\n capacity @2 :UInt64;\n # Capacity of array\n\n cellOrder @3 :Text;\n # Order of cells\n\n coordsFilterPipeline @4 :FilterPipeline;\n # Type of compression for coordinates (enum)\n\n domain @5 :Domain;\n # Domain of array\n\n offsetFilterPipeline @6 :FilterPipeline;\n # Compression type of cell variable offsets (enum)\n\n tileOrder @7 :Text;\n # Tile order setting of array\n\n uri @8 :Text;\n # URI of schema\n\n version @9 :List(Int32);\n # file format version\n\n allowsDuplicates @10 :Bool;\n # True if the array allows coordinate duplicates.\n # Applicable only to sparse arrays.\n\n validityFilterPipeline @11 :FilterPipeline;\n # Type of compression for validity buffers (enum)\n\n name @12 :Text;\n # name of array schema\n\n timestampRange @13 :List(UInt64);\n # Timestamp range of array schema\n}\n\nstruct ArraySchemaEvolution {\n# Evolution of array schema\n attributesToDrop @0 :List(Text);\n # Attribute names to be dropped\n\n attributesToAdd @1 :List(Attribute);\n # Attributes to be added \n\n timestampRange @2 :List(UInt64);\n # Timestamp range of array schema\n}\n\nstruct Attribute {\n# Attribute of array\n cellValNum @0 :UInt32;\n # Attribute number of values per cell\n\n name @1 :Text;\n # Attribute name\n\n type @2 :Text;\n # TileDB attribute datatype\n\n filterPipeline @3 :FilterPipeline;\n # TileDB FilterPipeline for Attribute\n\n fillValue @4 :Data;\n # Default fill value\n\n nullable @5 :Bool;\n # Is attribute nullable\n\n fillValueValidity @6 :Bool;\n # Default validity fill value for nullable attributes\n}\n\nstruct AttributeBufferHeader {\n# Represents an attribute buffer header information\n\n name @0 :Text;\n # Attribute name\n\n fixedLenBufferSizeInBytes @1 :UInt64;\n # Number of bytes in the fixed-length attribute data buffer\n\n varLenBufferSizeInBytes @2 :UInt64;\n # Number of bytes in the var-length attribute data buffer\n\n validityLenBufferSizeInBytes @3 :UInt64;\n # Number of bytes in the validity data buffer\n\n originalFixedLenBufferSizeInBytes @4 :UInt64;\n # Original user set number of bytes in the fixed-length attribute data buffer\n\n originalVarLenBufferSizeInBytes @5 :UInt64;\n # Original user set number of bytes in the var-length attribute data buffer\n\n originalValidityLenBufferSizeInBytes @6 :UInt64;\n # Original user set number of bytes in the validity data buffer\n}\n\nstruct Dimension {\n# Dimension of array\n\n name @0 :Text;\n # Dimension name\n\n nullTileExtent @1 :Bool;\n # Is tile extent null\n\n type @2 :Text;\n # Datatype for Dimension\n\n tileExtent :union {\n int8 @3 :Int8;\n uint8 @4 :UInt8;\n int16 @5 :Int16;\n uint16 @6 :UInt16;\n int32 @7 :Int32;\n uint32 @8 :UInt32;\n int64 @9 :Int64;\n uint64 @10 :UInt64;\n float32 @11 :Float32;\n float64 @12 :Float64;\n }\n # Extent of tile\n\n domain @13 :DomainArray;\n # extent of domain\n\n filterPipeline @14 :FilterPipeline;\n # TileDB FilterPipeline for Dimension\n}\n\nstruct Domain {\n# Domain of array\n cellOrder @0 :Text;\n # Tile Order\n\n dimensions @1 :List(Dimension);\n # Array of dimensions\n\n tileOrder @2 :Text;\n # Tile Order\n\n type @3 :Text;\n # Datatype of domain\n}\n\nstruct Error {\n code @0 :Int64;\n message @1 :Text;\n}\n\nstruct Filter {\n type @0 :Text;\n # filter type\n\n data :union {\n text @1 :Text;\n bytes @2 :Data;\n int8 @3 :Int8;\n uint8 @4 :UInt8;\n int16 @5 :Int16;\n uint16 @6 :UInt16;\n int32 @7 :Int32;\n uint32 @8 :UInt32;\n int64 @9 :Int64;\n uint64 @10 :UInt64;\n float32 @11 :Float32;\n float64 @12 :Float64;\n }\n # filter data\n}\n\nstruct FilterPipeline {\n filters @0 :List(Filter);\n}\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n\nstruct MapUInt32 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :UInt32;\n }\n}\n\nstruct MapInt64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :Int64;\n }\n}\n\nstruct MapUInt64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :UInt64;\n }\n}\n\nstruct MapFloat64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :Float64;\n }\n}\n\nstruct Stats {\n# Stats struct\n\n timers @0 :MapFloat64;\n # timer\n\n counters @1 :MapUInt64;\n # counters\n}\n\nstruct Writer {\n # Write struct\n checkCoordDups @0 :Bool;\n\n checkCoordOOB @1 :Bool;\n\n dedupCoords @2 :Bool;\n\n subarray @3 :DomainArray;\n # Old-style (single-range) subarray for dense writes\n\n subarrayRanges @4 :Subarray;\n # The query subarray\/ranges object, new style range object\n\n stats @5 :Stats;\n # Stats object\n}\n\nstruct SubarrayRanges {\n # A set of 1D ranges for a subarray\n\n type @0 :Text;\n # Datatype of the ranges\n\n hasDefaultRange @1:Bool;\n # True if the range is the default range\n\n buffer @2 :Data;\n # The bytes of the ranges\n\n bufferSizes @3 :List(UInt64);\n # The list of sizes per range\n\n bufferStartSizes @4 :List(UInt64);\n # The list of start sizes per range\n}\n\nstruct Subarray {\n # A Subarray\n\n layout @0 :Text;\n # The layout of the subarray\n\n ranges @1 :List(SubarrayRanges);\n # List of 1D ranges, one per dimension\n\n stats @2 :Stats;\n # Stats object\n\n relevantFragments @3 :List(UInt32);\n # Relevant fragments\n}\n\nstruct SubarrayPartitioner {\n # The subarray partitioner\n\n struct PartitionInfo {\n subarray @0 :Subarray;\n start @1 :UInt64;\n end @2 :UInt64;\n splitMultiRange @3 :Bool;\n }\n\n struct State {\n start @0 :UInt64;\n end @1 :UInt64;\n singleRange @2 :List(Subarray);\n multiRange @3 :List(Subarray);\n }\n\n subarray @0 :Subarray;\n # The subarray the partitioner will iterate on to produce partitions.\n\n budget @1 :List(AttributeBufferSize);\n # Result size budget (in bytes) for all attributes.\n\n current @2 :PartitionInfo;\n # The current partition info\n\n state @3 :State;\n # The state information for the remaining partitions to be produced\n\n memoryBudget @4 :UInt64;\n # The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes\n\n memoryBudgetVar @5 :UInt64;\n # The memory budget for the var-sized attributes\n\n memoryBudgetValidity @6 :UInt64;\n # The memory budget for the validity buffers\n\n stats @7 :Stats;\n # Stats object\n}\n\nstruct ReadState {\n overflowed @0 :Bool;\n # `True` if the query produced results that could not fit in some buffer.\n\n unsplittable @1 :Bool;\n # True if the current subarray partition is unsplittable.\n\n initialized @2 :Bool;\n # True if the reader has been initialized\n\n subarrayPartitioner @3 :SubarrayPartitioner;\n # The subarray partitioner\n}\n\nstruct ConditionClause {\n # A clause within a condition\n\n fieldName @0 :Text;\n # The name of the field this clause applies to\n\n value @1 :Data;\n # The comparison value\n\n op @2 :Text;\n # The comparison operation\n}\n\nstruct Condition {\n # The query condition\n\n clauses @0 :List(ConditionClause);\n # All clauses in this condition\n\n clauseCombinationOps @1 :List(Text);\n # The operation that combines each condition\n}\n\nstruct QueryReader {\n # Read struct (can't be called reader due to class name conflict)\n\n layout @0 :Text;\n # The layout of the cells in the result of the subarray\n\n subarray @1 :Subarray;\n # The query subarray.\n\n readState @2 :ReadState;\n # Read state of reader\n\n condition @3 :Condition;\n # The query condition\n\n stats @4 :Stats;\n # Stats object\n}\n\nstruct ResultCellSlab {\n# Result cell slab\n\n fragIdx @0 :UInt32;\n # Fragment index\n\n tileIdx @1 :UInt64;\n # Tile index\n\n start @2 :UInt64;\n # Start of the cell slab\n\n length @3 :UInt64;\n # Length of the cell slab\n}\n\nstruct FragmentIndex {\n# Tile\/cell index for a fragment\n\n tileIdx @0 :UInt64;\n # Tile index\n\n cellIdx @1 :UInt64;\n # Cell index\n}\n\nstruct ReadStateIndex {\n resultCellSlab @0 :List(ResultCellSlab);\n # Result cell slab.\n\n fragTileIdx @1 :List(FragmentIndex);\n # Tile\/cell index for each fragments.\n\n doneAddingResultTiles @2 :Bool;\n # Is the reader done adding result tiles.\n}\n\nstruct ReaderIndex {\n # Reader struct for indexed readers.\n\n layout @0 :Text;\n # The layout of the cells in the result of the subarray\n\n subarray @1 :Subarray;\n # The query subarray.\n\n readState @2 :ReadStateIndex;\n # Read state of reader\n\n condition @3 :Condition;\n # The query condition\n\n stats @4 :Stats;\n # Stats object\n}\n\nstruct Query {\n attributeBufferHeaders @0 :List(AttributeBufferHeader);\n # list of attribute buffer headers\n\n layout @1 :Text;\n # query write layout\n\n status @2 :Text;\n # query status\n\n type @3 :Text;\n # Type of query\n\n writer @4 :Writer;\n # writer contains data needed for continuation of global write order queries\n\n reader @5 :QueryReader;\n # reader contains data needed for continuation of incomplete reads\n\n array @6 :Array;\n # Represents an open array\n\n totalFixedLengthBufferBytes @7: UInt64;\n # Total number of bytes in fixed size attribute buffers\n\n totalVarLenBufferBytes @8: UInt64;\n # Total number of bytes in variable size attribute buffers\n\n totalValidityBufferBytes @9: UInt64;\n # Total number of bytes in validity buffers\n\n varOffsetsMode @10 :Text;\n # This field is not longer used, it is replaced by the config\n\n varOffsetsAddExtraElement @11 :Bool;\n # This field is not longer used, it is replaced by the config\n\n varOffsetsBitsize @12 :Int32;\n # This field is not longer used, it is replaced by the config\n\n config @13 :Config;\n # Config set on query\n\n stats @14 :Stats;\n # Stats object\n\n readerIndex @15 :ReaderIndex;\n # readerIndex contains data needed for continuation of incomplete sparse reads with index readers\n\n denseReader @16 :QueryReader;\n # denseReader contains data needed for continuation of incomplete dense reads with dense reader\n}\n\nstruct NonEmptyDomain {\n # object representing a non-empty domain\n\n nonEmptyDomain @0 :DomainArray;\n # Non-empty domain of array\n\n isEmpty @1 :Bool;\n # Is non-empty domain really empty?\n\n sizes @2 :List(UInt64);\n # Number of elements in DomainArray for var length\n}\n\nstruct NonEmptyDomainList {\n # object representing non-empty domain for heterogeneous or string dimensions\n nonEmptyDomains @0 :List(NonEmptyDomain);\n}\n\nstruct AttributeBufferSize {\n # object representing a buffer size of an attribute\n\n attribute @0: Text;\n # name of attribute\n\n offsetBytes @1: UInt64;\n # size (in bytes) of offset buffer\n\n dataBytes @2: UInt64;\n # size (in bytes) of data buffer\n\n validityBytes @3: UInt64;\n # size (in bytes) of data buffer\n}\n\nstruct MaxBufferSizes {\n maxBufferSizes @0 :List(AttributeBufferSize);\n # a list of max buffer sizes, one per attribute\n}\n\nstruct ArrayMetadata {\n # object representing array metadata\n\n struct MetadataEntry {\n key @0 :Text;\n type @1 :Text;\n valueNum @2 :UInt32;\n value @3 :Data;\n del @4 :Bool;\n }\n\n entries @0 :List(MetadataEntry);\n # list of metadata values\n}\n\nstruct EstimatedResultSize {\n # object representing estimated\n struct ResultSize {\n # Result size \n sizeFixed @0 :Float64;\n sizeVar @1 :Float64;\n sizeValidity @2 :Float64;\n }\n \n struct MemorySize {\n # Memory Size\n sizeFixed @0 :UInt64;\n sizeVar @1 :UInt64;\n sizeValidity @2 :UInt64;\n }\n\n resultSizes @0 :Map(Text, ResultSize);\n memorySizes @1 :Map(Text, MemorySize);\n}\n\nstruct GroupMetadata {\n config @0 :Config;\n # Config\n\n metadata @1 :ArrayMetadata;\n # metadata attached to group\n}\n\nstruct GroupMember {\n uri @0 :Text;\n # URI of group Member\n\n type @1 :Text;\n # type of Member, group or array\n\n relative @2 :Bool;\n # is member URI relative to group\n\n name @3 :Text;\n # name of member, optional\n}\n\nstruct Group {\n # Group\n\n struct GroupDetails {\n members @0 :List(GroupMember);\n # list of Members in group\n\n metadata @1 :ArrayMetadata;\n # metadata attached to group\n }\n\n config @0 :Config;\n # Config\n\n group @1 :GroupDetails $Json.name(\"group\");\n}\n\nstruct GroupUpdate {\n struct GroupUpdateDetails {\n membersToRemove @0 :List(Text) $Json.name(\"members_to_remove\");\n # members to remove\n\n membersToAdd @1 :List(GroupMember) $Json.name(\"members_to_add\");\n # members to add\n }\n\n config @0 :Config;\n # Config\n\n groupUpdate @1 :GroupUpdateDetails $Json.name(\"group_changes\");\n # group update details\n}\n\nstruct GroupCreate {\n # Create group details\n\n struct GroupCreateDetails {\n # details of a group\n\n uri @0 :Text;\n # URI where group should be created\n }\n\n config @0 :Config;\n # Config\n\n groupDetails @1 :GroupCreateDetails $Json.name(\"group_details\");\n}","old_contents":"@0xb57d9224b587d87f;\n\nusing Json = import \"\/capnp\/compat\/json.capnp\";\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"tiledb::sm::serialization::capnp\");\n\nstruct DomainArray {\n int8 @0 :List(Int8);\n uint8 @1 :List(UInt8);\n int16 @2 :List(Int16);\n uint16 @3 :List(UInt16);\n int32 @4 :List(Int32);\n uint32 @5 :List(UInt32);\n int64 @6 :List(Int64);\n uint64 @7 :List(UInt64);\n float32 @8 :List(Float32);\n float64 @9 :List(Float64);\n}\n\nstruct KV {\n key @0 :Text;\n value @1 :Text;\n}\n\nstruct Config {\n# Represents a config object\n entries @0 :List(KV);\n # list of key-value settings\n}\n\nstruct Array {\n endTimestamp @0 :UInt64;\n # ending timestamp array was opened\n\n queryType @1 :Text;\n # Array opened for query type\n\n uri @2 :Text;\n # Array uri\n\n startTimestamp @3 :UInt64;\n # starting timestamp array was opened\n\n arraySchemaLatest @4 :ArraySchema;\n # latest array schema\n\n arraySchemasAll @5 :Map(Text, ArraySchema);\n # map of all Array Schemas\n\n nonEmptyDomain @6 :NonEmptyDomainList;\n # non empty domain\n\n arrayMetadata @7 :ArrayMetadata;\n # array metadata\n}\n\nstruct ArraySchema {\n# ArraySchema during creation or retrieval\n arrayType @0 :Text;\n # Type of array\n\n attributes @1 :List(Attribute);\n # Attributes of array\n\n capacity @2 :UInt64;\n # Capacity of array\n\n cellOrder @3 :Text;\n # Order of cells\n\n coordsFilterPipeline @4 :FilterPipeline;\n # Type of compression for coordinates (enum)\n\n domain @5 :Domain;\n # Domain of array\n\n offsetFilterPipeline @6 :FilterPipeline;\n # Compression type of cell variable offsets (enum)\n\n tileOrder @7 :Text;\n # Tile order setting of array\n\n uri @8 :Text;\n # URI of schema\n\n version @9 :List(Int32);\n # file format version\n\n allowsDuplicates @10 :Bool;\n # True if the array allows coordinate duplicates.\n # Applicable only to sparse arrays.\n\n validityFilterPipeline @11 :FilterPipeline;\n # Type of compression for validity buffers (enum)\n\n name @12 :Text;\n # name of array schema\n\n timestampRange @13 :List(UInt64);\n # Timestamp range of array schema\n}\n\nstruct ArraySchemaEvolution {\n# Evolution of array schema\n attributesToDrop @0 :List(Text);\n # Attribute names to be dropped\n\n attributesToAdd @1 :List(Attribute);\n # Attributes to be added \n\n timestampRange @2 :List(UInt64);\n # Timestamp range of array schema\n}\n\nstruct Attribute {\n# Attribute of array\n cellValNum @0 :UInt32;\n # Attribute number of values per cell\n\n name @1 :Text;\n # Attribute name\n\n type @2 :Text;\n # TileDB attribute datatype\n\n filterPipeline @3 :FilterPipeline;\n # TileDB FilterPipeline for Attribute\n\n fillValue @4 :Data;\n # Default fill value\n\n nullable @5 :Bool;\n # Is attribute nullable\n\n fillValueValidity @6 :Bool;\n # Default validity fill value for nullable attributes\n}\n\nstruct AttributeBufferHeader {\n# Represents an attribute buffer header information\n\n name @0 :Text;\n # Attribute name\n\n fixedLenBufferSizeInBytes @1 :UInt64;\n # Number of bytes in the fixed-length attribute data buffer\n\n varLenBufferSizeInBytes @2 :UInt64;\n # Number of bytes in the var-length attribute data buffer\n\n validityLenBufferSizeInBytes @3 :UInt64;\n # Number of bytes in the validity data buffer\n\n originalFixedLenBufferSizeInBytes @4 :UInt64;\n # Original user set number of bytes in the fixed-length attribute data buffer\n\n originalVarLenBufferSizeInBytes @5 :UInt64;\n # Original user set number of bytes in the var-length attribute data buffer\n\n originalValidityLenBufferSizeInBytes @6 :UInt64;\n # Original user set number of bytes in the validity data buffer\n}\n\nstruct Dimension {\n# Dimension of array\n\n name @0 :Text;\n # Dimension name\n\n nullTileExtent @1 :Bool;\n # Is tile extent null\n\n type @2 :Text;\n # Datatype for Dimension\n\n tileExtent :union {\n int8 @3 :Int8;\n uint8 @4 :UInt8;\n int16 @5 :Int16;\n uint16 @6 :UInt16;\n int32 @7 :Int32;\n uint32 @8 :UInt32;\n int64 @9 :Int64;\n uint64 @10 :UInt64;\n float32 @11 :Float32;\n float64 @12 :Float64;\n }\n # Extent of tile\n\n domain @13 :DomainArray;\n # extent of domain\n\n filterPipeline @14 :FilterPipeline;\n # TileDB FilterPipeline for Dimension\n}\n\nstruct Domain {\n# Domain of array\n cellOrder @0 :Text;\n # Tile Order\n\n dimensions @1 :List(Dimension);\n # Array of dimensions\n\n tileOrder @2 :Text;\n # Tile Order\n\n type @3 :Text;\n # Datatype of domain\n}\n\nstruct Error {\n code @0 :Int64;\n message @1 :Text;\n}\n\nstruct Filter {\n type @0 :Text;\n # filter type\n\n data :union {\n text @1 :Text;\n bytes @2 :Data;\n int8 @3 :Int8;\n uint8 @4 :UInt8;\n int16 @5 :Int16;\n uint16 @6 :UInt16;\n int32 @7 :Int32;\n uint32 @8 :UInt32;\n int64 @9 :Int64;\n uint64 @10 :UInt64;\n float32 @11 :Float32;\n float64 @12 :Float64;\n }\n # filter data\n}\n\nstruct FilterPipeline {\n filters @0 :List(Filter);\n}\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n\nstruct MapUInt32 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :UInt32;\n }\n}\n\nstruct MapInt64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :Int64;\n }\n}\n\nstruct MapUInt64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :UInt64;\n }\n}\n\nstruct MapFloat64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :Float64;\n }\n}\n\nstruct Stats {\n# Stats struct\n\n timers @0 :MapFloat64;\n # timer\n\n counters @1 :MapUInt64;\n # counters\n}\n\nstruct Writer {\n # Write struct\n checkCoordDups @0 :Bool;\n\n checkCoordOOB @1 :Bool;\n\n dedupCoords @2 :Bool;\n\n subarray @3 :DomainArray;\n # Old-style (single-range) subarray for dense writes\n\n subarrayRanges @4 :Subarray;\n # The query subarray\/ranges object, new style range object\n\n stats @5 :Stats;\n # Stats object\n}\n\nstruct SubarrayRanges {\n # A set of 1D ranges for a subarray\n\n type @0 :Text;\n # Datatype of the ranges\n\n hasDefaultRange @1:Bool;\n # True if the range is the default range\n\n buffer @2 :Data;\n # The bytes of the ranges\n\n bufferSizes @3 :List(UInt64);\n # The list of sizes per range\n\n bufferStartSizes @4 :List(UInt64);\n # The list of start sizes per range\n}\n\nstruct Subarray {\n # A Subarray\n\n layout @0 :Text;\n # The layout of the subarray\n\n ranges @1 :List(SubarrayRanges);\n # List of 1D ranges, one per dimension\n\n stats @2 :Stats;\n # Stats object\n\n relevantFragments @3 :List(UInt32);\n # Relevant fragments\n}\n\nstruct SubarrayPartitioner {\n # The subarray partitioner\n\n struct PartitionInfo {\n subarray @0 :Subarray;\n start @1 :UInt64;\n end @2 :UInt64;\n splitMultiRange @3 :Bool;\n }\n\n struct State {\n start @0 :UInt64;\n end @1 :UInt64;\n singleRange @2 :List(Subarray);\n multiRange @3 :List(Subarray);\n }\n\n subarray @0 :Subarray;\n # The subarray the partitioner will iterate on to produce partitions.\n\n budget @1 :List(AttributeBufferSize);\n # Result size budget (in bytes) for all attributes.\n\n current @2 :PartitionInfo;\n # The current partition info\n\n state @3 :State;\n # The state information for the remaining partitions to be produced\n\n memoryBudget @4 :UInt64;\n # The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes\n\n memoryBudgetVar @5 :UInt64;\n # The memory budget for the var-sized attributes\n\n memoryBudgetValidity @6 :UInt64;\n # The memory budget for the validity buffers\n\n stats @7 :Stats;\n # Stats object\n}\n\nstruct ReadState {\n overflowed @0 :Bool;\n # `True` if the query produced results that could not fit in some buffer.\n\n unsplittable @1 :Bool;\n # True if the current subarray partition is unsplittable.\n\n initialized @2 :Bool;\n # True if the reader has been initialized\n\n subarrayPartitioner @3 :SubarrayPartitioner;\n # The subarray partitioner\n}\n\nstruct ConditionClause {\n # A clause within a condition\n\n fieldName @0 :Text;\n # The name of the field this clause applies to\n\n value @1 :Data;\n # The comparison value\n\n op @2 :Text;\n # The comparison operation\n}\n\nstruct Condition {\n # The query condition\n\n clauses @0 :List(ConditionClause);\n # All clauses in this condition\n\n clauseCombinationOps @1 :List(Text);\n # The operation that combines each condition\n}\n\nstruct QueryReader {\n # Read struct (can't be called reader due to class name conflict)\n\n layout @0 :Text;\n # The layout of the cells in the result of the subarray\n\n subarray @1 :Subarray;\n # The query subarray.\n\n readState @2 :ReadState;\n # Read state of reader\n\n condition @3 :Condition;\n # The query condition\n\n stats @4 :Stats;\n # Stats object\n}\n\nstruct ResultCellSlab {\n# Result cell slab\n\n fragIdx @0 :UInt32;\n # Fragment index\n\n tileIdx @1 :UInt64;\n # Tile index\n\n start @2 :UInt64;\n # Start of the cell slab\n\n length @3 :UInt64;\n # Length of the cell slab\n}\n\nstruct FragmentIndex {\n# Tile\/cell index for a fragment\n\n tileIdx @0 :UInt64;\n # Tile index\n\n cellIdx @1 :UInt64;\n # Cell index\n}\n\nstruct ReadStateIndex {\n resultCellSlab @0 :List(ResultCellSlab);\n # Result cell slab.\n\n fragTileIdx @1 :List(FragmentIndex);\n # Tile\/cell index for each fragments.\n\n doneAddingResultTiles @2 :Bool;\n # Is the reader done adding result tiles.\n}\n\nstruct ReaderIndex {\n # Reader struct for indexed readers.\n\n layout @0 :Text;\n # The layout of the cells in the result of the subarray\n\n subarray @1 :Subarray;\n # The query subarray.\n\n readState @2 :ReadStateIndex;\n # Read state of reader\n\n condition @3 :Condition;\n # The query condition\n\n stats @4 :Stats;\n # Stats object\n}\n\nstruct Query {\n attributeBufferHeaders @0 :List(AttributeBufferHeader);\n # list of attribute buffer headers\n\n layout @1 :Text;\n # query write layout\n\n status @2 :Text;\n # query status\n\n type @3 :Text;\n # Type of query\n\n writer @4 :Writer;\n # writer contains data needed for continuation of global write order queries\n\n reader @5 :QueryReader;\n # reader contains data needed for continuation of incomplete reads\n\n array @6 :Array;\n # Represents an open array\n\n totalFixedLengthBufferBytes @7: UInt64;\n # Total number of bytes in fixed size attribute buffers\n\n totalVarLenBufferBytes @8: UInt64;\n # Total number of bytes in variable size attribute buffers\n\n totalValidityBufferBytes @9: UInt64;\n # Total number of bytes in validity buffers\n\n varOffsetsMode @10 :Text;\n # This field is not longer used, it is replaced by the config\n\n varOffsetsAddExtraElement @11 :Bool;\n # This field is not longer used, it is replaced by the config\n\n varOffsetsBitsize @12 :Int32;\n # This field is not longer used, it is replaced by the config\n\n config @13 :Config;\n # Config set on query\n\n stats @14 :Stats;\n # Stats object\n\n readerIndex @15 :ReaderIndex;\n # readerIndex contains data needed for continuation of incomplete sparse reads with index readers\n\n denseReader @16 :QueryReader;\n # denseReader contains data needed for continuation of incomplete dense reads with dense reader\n}\n\nstruct NonEmptyDomain {\n # object representing a non-empty domain\n\n nonEmptyDomain @0 :DomainArray;\n # Non-empty domain of array\n\n isEmpty @1 :Bool;\n # Is non-empty domain really empty?\n\n sizes @2 :List(UInt64);\n # Number of elements in DomainArray for var length\n}\n\nstruct NonEmptyDomainList {\n # object representing non-empty domain for heterogeneous or string dimensions\n nonEmptyDomains @0 :List(NonEmptyDomain);\n}\n\nstruct AttributeBufferSize {\n # object representing a buffer size of an attribute\n\n attribute @0: Text;\n # name of attribute\n\n offsetBytes @1: UInt64;\n # size (in bytes) of offset buffer\n\n dataBytes @2: UInt64;\n # size (in bytes) of data buffer\n\n validityBytes @3: UInt64;\n # size (in bytes) of data buffer\n}\n\nstruct MaxBufferSizes {\n maxBufferSizes @0 :List(AttributeBufferSize);\n # a list of max buffer sizes, one per attribute\n}\n\nstruct ArrayMetadata {\n # object representing array metadata\n\n struct MetadataEntry {\n key @0 :Text;\n type @1 :Text;\n valueNum @2 :UInt32;\n value @3 :Data;\n del @4 :Bool;\n }\n\n entries @0 :List(MetadataEntry);\n # list of metadata values\n}\n\nstruct EstimatedResultSize {\n # object representing estimated\n struct ResultSize {\n # Result size \n sizeFixed @0 :Float64;\n sizeVar @1 :Float64;\n sizeValidity @2 :Float64;\n }\n \n struct MemorySize {\n # Memory Size\n sizeFixed @0 :UInt64;\n sizeVar @1 :UInt64;\n sizeValidity @2 :UInt64;\n }\n\n resultSizes @0 :Map(Text, ResultSize);\n memorySizes @1 :Map(Text, MemorySize);\n}\n\nstruct GroupMetadata {\n config @0 :Config;\n # Config\n\n metadata @1 :ArrayMetadata;\n # metadata attached to group\n}\n\nstruct GroupMember {\n uri @0 :Text;\n # URI of group Member\n\n type @1 :Text;\n # type of Member, group or array\n\n relative @2 :Bool;\n # is member URI relative to group\n\n name @3 :Text;\n # name of member, optional\n}\n\nstruct Group {\n # Group\n\n struct GroupDetails {\n members @0 :List(GroupMember);\n # list of Members in group\n\n metadata @1 :ArrayMetadata;\n # metadata attached to group\n }\n\n config @0 :Config;\n # Config\n\n group @1 :GroupDetails $Json.name(\"group\");\n}\n\nstruct GroupUpdate {\n struct GroupUpdateDetails {\n membersToRemove @0 :List(Text) $Json.name(\"members_to_remove\");\n # members to remove\n\n membersToAdd @1 :List(GroupMember) $Json.name(\"members_to_add\");\n # members to add\n }\n\n config @0 :Config;\n # Config\n\n groupUpdate @1 :GroupUpdateDetails $Json.name(\"group_changes\");\n # group update detials\n}\n\nstruct GroupCreate {\n # Create group details\n\n struct GroupCreateDetails {\n # details of a group\n\n uri @0 :Text;\n # URI where group should be created\n }\n\n config @0 :Config;\n # Config\n\n groupDetails @1 :GroupCreateDetails $Json.name(\"group_details\");\n}","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"792c66aae00b466b909cad494376590ed50199f1","subject":"Minor fixes to comments in rpc.capnp","message":"Minor fixes to comments in rpc.capnp\n\nRemove a reference to Main, add a comment about the legality of acceptFromThirdParty, and fix a few typos and one pervasive grammatical error.","repos":"nagyistoce\/capnproto,ligzy\/capnproto,maurer\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,geofft\/capnproto,a-richardson\/capnproto,hntrmrrs\/capnproto,ocdtrekkie\/capnproto,martindale\/capnproto,jparyani\/capnproto,MarPiRK\/capnproto,ocdtrekkie\/capnproto,johnkdoe\/capnproto,rcrowder\/capnproto,bryce-gibson\/capnproto,bryce-gibson\/capnproto,a-richardson\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,khklau\/capnproto,mologie\/capnproto,maurer\/capnproto,mologie\/capnproto,jparyani\/capnproto,geofft\/capnproto,modulexcite\/capnproto,pjulien\/capnproto,maurer\/capnproto,mrdomino\/capnproto,Fraser999\/capnproto,ocdtrekkie\/capnproto,modulexcite\/capnproto,martindale\/capnproto,vladon\/capnproto,vladon\/capnproto,nagyistoce\/capnproto,bryce-gibson\/capnproto,nagyistoce\/capnproto,joliss\/capnproto,hntrmrrs\/capnproto,jparyani\/capnproto,joliss\/capnproto,MarPiRK\/capnproto,bsn069\/capnproto,ligzy\/capnproto,bsn069\/capnproto,khklau\/capnproto,kamalmarhubi\/capnproto,bsn069\/capnproto,Fraser999\/capnproto,MarPiRK\/capnproto,khklau\/capnproto,mrdomino\/capnproto,kamalmarhubi\/capnproto,mologie\/capnproto,Fraser999\/capnproto,mrdomino\/capnproto,kamalmarhubi\/capnproto,pjulien\/capnproto,a-richardson\/capnproto,vladon\/capnproto,rcrowder\/capnproto,zarvox\/capnproto,geofft\/capnproto,hntrmrrs\/capnproto,johnkdoe\/capnproto,zarvox\/capnproto,martindale\/capnproto,modulexcite\/capnproto,zarvox\/capnproto,pjulien\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message which replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages which (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This was never implemented, therefore it has been\n # reduted to AnyPointer.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface which has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface which\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability which may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface which has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities which may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` which, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` which had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, which eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # which eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise which is known to resolve back to a\n # capability hoste by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise which is known to resolve to a third-party\n # capability which the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `ReleaseEmbargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `ReleaseEmbargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Main`, so that\n # initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `serverError`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"1ea02d49087bfce2071caec80fe7c884413aea3a","subject":"hide project .git directory","message":"hide project .git directory\n","repos":"neynah\/hacker-slides,jacksingleton\/hacker-slides,paulproteus\/hacker-slides,Eynaliyev\/hacker-slides,paulproteus\/hacker-slides,FFrancieli\/hacker-slides,jlopezr\/hacker-slides,jacksingleton\/hacker-slides,jlopezr\/hacker-slides,jlopezr\/hacker-slides,neynah\/hacker-slides,FFrancieli\/hacker-slides,cben\/hacker-slides,Eynaliyev\/hacker-slides,neynah\/hacker-slides,jacksingleton\/hacker-slides,nicolastrres\/hacker-slides,Eynaliyev\/hacker-slides,jacksingleton\/hacker-slides,jlopezr\/hacker-slides,cben\/hacker-slides,nicolastrres\/hacker-slides,FFrancieli\/hacker-slides,cben\/hacker-slides,nicolastrres\/hacker-slides,jacksingleton\/hacker-slides,paulproteus\/hacker-slides,paulproteus\/hacker-slides,nicolastrres\/hacker-slides,Eynaliyev\/hacker-slides,FFrancieli\/hacker-slides,neynah\/hacker-slides,cben\/hacker-slides","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New HackerSlides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New HackerSlides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"3e5a0e4d32f8bda01578c14771cf1aabefee63fd","subject":"bump version","message":"bump version\n","repos":"jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 5, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.4.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n # For all vagrant-spk apps, we don't care about the Vagrant\n # VM state, so we ignore it here.\n \"opt\/app\/.sandstorm\/.vagrant\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\n \"usr\/lib\/python3.4\", # include all of the Python runtime\n \"usr\/lib\/python3\", # include pure-Python packages from Debian\n \"usr\/local\/lib\/python3.4\", # include python packages from pip\n \"opt\/app\/static\",\n ],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.3.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n # For all vagrant-spk apps, we don't care about the Vagrant\n # VM state, so we ignore it here.\n \"opt\/app\/.sandstorm\/.vagrant\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\n \"usr\/lib\/python3.4\", # include all of the Python runtime\n \"usr\/lib\/python3\", # include pure-Python packages from Debian\n \"usr\/local\/lib\/python3.4\", # include python packages from pip\n \"opt\/app\/static\",\n ],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"b719968df5577af6dd69eb32f6c2e2a43a322e87","subject":"Release v0.10.0-rc1","message":"Release v0.10.0-rc1\n","repos":"ahmadassaf\/libreboard,Serubin\/wekan,Zyko0\/wekan,johnleeming\/wekan,mario-orlicky\/wekan,araczkowski\/paczka.pro,mario-orlicky\/wekan,gelojavonitalla\/wekan,wekan\/wekan,AlexanderS\/wekan,floatinghotpot\/wekan,felipecosta07\/js,AdrianoCahete\/wekan,nztqa\/wekan,GhassenRjab\/wekan,Zyko0\/wekan,oliver4u\/WEKAN_runpartner,atFriendly\/wekan,mario-orlicky\/wekan,GhassenRjab\/wekan,oliver4u\/WEKAN_runpartner,ddanssaert\/wekan,ddanssaert\/wekan,libreboard\/libreboard,gelojavonitalla\/wekan,oliver4u\/sap-wekan,ddanssaert\/wekan,atFriendly\/wekan,oliver4u\/sap-wekan,libreboard\/libreboard,wekan\/wekan,Xperterra\/wekan,pro-to-tip\/wekan,jtickle\/wekan,wykeith\/cp2m,jtickle\/wekan,felipecosta07\/js,johnleeming\/wekan,nztqa\/wekan,nztqa\/wekan,wekan\/wekan,Xperterra\/wekan,johnleeming\/wekan,floatinghotpot\/wekan,GhassenRjab\/wekan,ahmadassaf\/libreboard,FSFTN\/Wekan,pro-to-tip\/wekan,AlexanderS\/wekan,Serubin\/wekan,ahmadassaf\/libreboard,AdrianoCahete\/wekan,johnleeming\/wekan,wykeith\/cp2m,oliver4u\/WEKAN_runpartner,wekan\/wekan,araczkowski\/paczka.pro,araczkowski\/paczka.pro,oliver4u\/sap-wekan,Serubin\/wekan,jtickle\/wekan,wekan\/wekan,FSFTN\/Wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 7,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10.0-RC1\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"Changelog.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 6,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.9.0\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"History.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f9f4747a6afe97c1ea21098cd9de838821b8ea2f","subject":"Release v0.10-RC2","message":"Release v0.10-RC2\n","repos":"jtickle\/wekan,araczkowski\/paczka.pro,gelojavonitalla\/wekan,floatinghotpot\/wekan,pro-to-tip\/wekan,oliver4u\/WEKAN_runpartner,wekan\/wekan,GhassenRjab\/wekan,felipecosta07\/js,gelojavonitalla\/wekan,AdrianoCahete\/wekan,AlexanderS\/wekan,floatinghotpot\/wekan,oliver4u\/sap-wekan,mario-orlicky\/wekan,atFriendly\/wekan,FSFTN\/Wekan,johnleeming\/wekan,Serubin\/wekan,Xperterra\/wekan,libreboard\/libreboard,wykeith\/cp2m,ddanssaert\/wekan,oliver4u\/sap-wekan,mario-orlicky\/wekan,araczkowski\/paczka.pro,wekan\/wekan,pro-to-tip\/wekan,wekan\/wekan,Serubin\/wekan,nztqa\/wekan,wekan\/wekan,johnleeming\/wekan,AlexanderS\/wekan,felipecosta07\/js,johnleeming\/wekan,GhassenRjab\/wekan,ddanssaert\/wekan,johnleeming\/wekan,wykeith\/cp2m,AdrianoCahete\/wekan,ddanssaert\/wekan,nztqa\/wekan,libreboard\/libreboard,oliver4u\/WEKAN_runpartner,atFriendly\/wekan,nztqa\/wekan,ahmadassaf\/libreboard,araczkowski\/paczka.pro,GhassenRjab\/wekan,oliver4u\/WEKAN_runpartner,mario-orlicky\/wekan,jtickle\/wekan,FSFTN\/Wekan,ahmadassaf\/libreboard,ahmadassaf\/libreboard,Xperterra\/wekan,jtickle\/wekan,Zyko0\/wekan,oliver4u\/sap-wekan,Serubin\/wekan,wekan\/wekan,Zyko0\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 7,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10-RC2\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"Changelog.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 7,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10.0-RC1\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"Changelog.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"bb63c66fd9d55de5502063d8888002fe9c10debf","subject":"Update Sandstorm package for App Market","message":"Update Sandstorm package for App Market\n","repos":"jparyani\/Telescope,jparyani\/Telescope","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x82984481f49bd8f5;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5h13ka55xn93gpenjc29f5kxqpjf5gk4drgx949q4dx7gk968smh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 2, # Increment this for every release.\n\n appTitle = (defaultText = \"Telescope\"),\n\n appMarketingVersion = (defaultText = \"0.14.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Telescope\"),\n nounPhrase = (defaultText = \"telescope\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (\n dpi1x = embed \"app-graphics\/telescope-128.png\",\n dpi2x = embed \"app-graphics\/telescope-256.png\"\n )),\n grain = (png = (\n dpi1x = embed \"app-graphics\/telescope-24.png\",\n dpi2x = embed \"app-graphics\/telescope-48.png\"\n )),\n market = (png = (\n dpi1x = embed \"app-graphics\/telescope-150.png\",\n dpi2x = embed \"app-graphics\/telescope-300.png\"\n )),\n ),\n\n website = \"http:\/\/www.telescopeapp.org\/\",\n codeUrl = \"https:\/\/github.com\/jparyani\/Telescope\",\n license = (openSource = mit),\n categories = [social],\n\n author = (\n contactEmail = \"jparyani@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Sacha Greif & Tom Coleman\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 354, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"History.md\"),\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"admin\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x82984481f49bd8f5;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5h13ka55xn93gpenjc29f5kxqpjf5gk4drgx949q4dx7gk968smh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Telescope\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"admin\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"d3886971ff14dbc2367d55be50b3d63211ac4032","subject":"trun ooff quota limit","message":"trun ooff quota limit\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"gce-config.capnp","new_file":"gce-config.capnp","new_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n isQuotaEnabled = false,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","old_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9a13ac50426444aa789a61791f8d3f10b3ea3c79","subject":"Bump version to 0.67.0-develop","message":"Bump version to 0.67.0-develop\n","repos":"pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat,flaviogrossi\/Rocket.Chat,VoiSmart\/Rocket.Chat,inoio\/Rocket.Chat,VoiSmart\/Rocket.Chat,Sing-Li\/Rocket.Chat,flaviogrossi\/Rocket.Chat,pkgodara\/Rocket.Chat,inoio\/Rocket.Chat,flaviogrossi\/Rocket.Chat,4thParty\/Rocket.Chat,subesokun\/Rocket.Chat,Sing-Li\/Rocket.Chat,Sing-Li\/Rocket.Chat,subesokun\/Rocket.Chat,VoiSmart\/Rocket.Chat,inoio\/Rocket.Chat,subesokun\/Rocket.Chat,pkgodara\/Rocket.Chat,flaviogrossi\/Rocket.Chat,subesokun\/Rocket.Chat,4thParty\/Rocket.Chat,Sing-Li\/Rocket.Chat,pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 79, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.67.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"HOME\", value = \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 78, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.67.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"HOME\", value = \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"9b700fa7d235a7f36171c2600c230a4db44f05ff","subject":"Cut appVersion 2","message":"Cut appVersion 2\n","repos":"awans\/giftr-sandstorm,awans\/giftr-sandstorm,awans\/giftr-sandstorm,awans\/giftr-sandstorm","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xfe5a8e784886dc05;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"tr3w5p7ajsf61nf2e6dkfv8tdjes0qsm5w6ew0frd4qwnacwur90\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Giftr\"),\n\n appVersion = 2, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.0.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Giftr Group\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"..\/sandstorm-assets\/appGrid.svg\"),\n grain = (svg = embed \"..\/sandstorm-assets\/grain.svg\"),\n market = (svg = embed \"..\/sandstorm-assets\/market.svg\")\n ),\n\n website = \"https:\/\/awans.org\/giftr.html\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/awans\/giftr-sandstorm\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"andrew.wansley@gmail.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"..\/sandstorm-assets\/identity-proof-signed.txt\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"A\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"..\/sandstorm-assets\/keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"..\/sandstorm-assets\/appstore-description.md\"),\n # The app's description description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Gift lists\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 571, height = 350, jpeg = embed \"..\/sandstorm-assets\/screenshot_desktop.png\"),\n (width = 312, height = 563, png = embed \"..\/sandstorm-assets\/screenshot_mobile.png\"),\n ],\n changeLog = (defaultText = embed \"..\/sandstorm-assets\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xfe5a8e784886dc05;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"tr3w5p7ajsf61nf2e6dkfv8tdjes0qsm5w6ew0frd4qwnacwur90\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Giftr\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Giftr Group\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"..\/sandstorm-assets\/appGrid.svg\"),\n grain = (svg = embed \"..\/sandstorm-assets\/grain.svg\"),\n market = (svg = embed \"..\/sandstorm-assets\/market.svg\")\n ),\n\n website = \"https:\/\/awans.org\/giftr.html\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/awans\/giftr-sandstorm\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"andrew.wansley@gmail.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"..\/sandstorm-assets\/identity-proof-signed.txt\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"A\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"..\/sandstorm-assets\/keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"..\/sandstorm-assets\/appstore-description.md\"),\n # The app's description description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Gift lists\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 571, height = 350, jpeg = embed \"..\/sandstorm-assets\/screenshot_desktop.png\"),\n (width = 312, height = 563, png = embed \"..\/sandstorm-assets\/screenshot_mobile.png\"),\n ],\n changeLog = (defaultText = embed \"..\/sandstorm-assets\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a3c6f1dd1b502d636678590194af133307656dc7","subject":"typo: 'use' instead of 'user'","message":"typo: 'use' instead of 'user'\n","repos":"a-richardson\/capnproto,artillery\/capnproto,bryce-gibson\/capnproto,bryce-gibson\/capnproto,zarvox\/capnproto,khklau\/capnproto,ligzy\/capnproto,modulexcite\/capnproto,ligzy\/capnproto,johnkdoe\/capnproto,bsn069\/capnproto,mologie\/capnproto,rcrowder\/capnproto,geofft\/capnproto,bsn069\/capnproto,hntrmrrs\/capnproto,martindale\/capnproto,martindale\/capnproto,maurer\/capnproto,jparyani\/capnproto,mrdomino\/capnproto,joliss\/capnproto,a-richardson\/capnproto,artillery\/capnproto,modulexcite\/capnproto,martindale\/capnproto,geofft\/capnproto,vladon\/capnproto,ocdtrekkie\/capnproto,maurer\/capnproto,rcrowder\/capnproto,johnkdoe\/capnproto,kamalmarhubi\/capnproto,MarPiRK\/capnproto,mologie\/capnproto,a-richardson\/capnproto,mrdomino\/capnproto,mologie\/capnproto,kamalmarhubi\/capnproto,ocdtrekkie\/capnproto,nagyistoce\/capnproto,Fraser999\/capnproto,Fraser999\/capnproto,Fraser999\/capnproto,nagyistoce\/capnproto,MarPiRK\/capnproto,zarvox\/capnproto,geofft\/capnproto,pjulien\/capnproto,zarvox\/capnproto,ligzy\/capnproto,jparyani\/capnproto,modulexcite\/capnproto,mrdomino\/capnproto,bsn069\/capnproto,hntrmrrs\/capnproto,artillery\/capnproto,khklau\/capnproto,pjulien\/capnproto,ocdtrekkie\/capnproto,kamalmarhubi\/capnproto,vladon\/capnproto,bryce-gibson\/capnproto,rcrowder\/capnproto,jparyani\/capnproto,maurer\/capnproto,hntrmrrs\/capnproto,joliss\/capnproto,khklau\/capnproto,johnkdoe\/capnproto,vladon\/capnproto,joliss\/capnproto,MarPiRK\/capnproto,pjulien\/capnproto,nagyistoce\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should\n # reply with a `Return` with `unsupportedPipelineOp` set.\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident.\n\n isPermanent @2 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @3 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should\n # reply with a `Return` with `unsupportedPipelineOp` set.\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident.\n\n isPermanent @2 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @3 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"acd4a47a3912ea57e08a8a9ab1e14de5c9f9d12f","subject":"Added category \"communications\" to metadata","message":"Added category \"communications\" to metadata\n\nCommunications seems to a better fit than productivity since this is primarily a chat app. (See specifications of categories here: https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp)","repos":"steedos\/chat,litewhatever\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,pkgodara\/Rocket.Chat,fatihwk\/Rocket.Chat,tntobias\/Rocket.Chat,Movile\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,inoio\/Rocket.Chat,xboston\/Rocket.Chat,xasx\/Rocket.Chat,cdwv\/Rocket.Chat,JamesHGreen\/Rocket_API,wicked539\/Rocket.Chat,ndarilek\/Rocket.Chat,yuyixg\/Rocket.Chat,Achaikos\/Rocket.Chat,LearnersGuild\/echo-chat,abduljanjua\/TheHub,ggazzo\/Rocket.Chat,ealbers\/Rocket.Chat,timkinnane\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,VoiSmart\/Rocket.Chat,karlprieb\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,Sing-Li\/Rocket.Chat,JamesHGreen\/Rocket_API,mccambridge\/Rocket.Chat,danielbressan\/Rocket.Chat,AimenJoe\/Rocket.Chat,NMandapaty\/Rocket.Chat,klatys\/Rocket.Chat,Gudii\/Rocket.Chat,tntobias\/Rocket.Chat,4thParty\/Rocket.Chat,LearnersGuild\/Rocket.Chat,ealbers\/Rocket.Chat,org100h1\/Rocket.Panda,acaronmd\/Rocket.Chat,wicked539\/Rocket.Chat,fduraibi\/Rocket.Chat,LearnersGuild\/echo-chat,mwharrison\/Rocket.Chat,haoyixin\/Rocket.Chat,xboston\/Rocket.Chat,Dianoga\/Rocket.Chat,Dianoga\/Rocket.Chat,jbsavoy18\/rocketchat-1,pitamar\/Rocket.Chat,Gyubin\/Rocket.Chat,nishimaki10\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,Achaikos\/Rocket.Chat,alexbrazier\/Rocket.Chat,Dianoga\/Rocket.Chat,fatihwk\/Rocket.Chat,ndarilek\/Rocket.Chat,ziedmahdi\/Rocket.Chat,haoyixin\/Rocket.Chat,LearnersGuild\/Rocket.Chat,OtkurBiz\/Rocket.Chat,acaronmd\/Rocket.Chat,karlprieb\/Rocket.Chat,TribeMedia\/Rocket.Chat,acaronmd\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,AlecTroemel\/Rocket.Chat,mhurwi\/Rocket.Chat,intelradoux\/Rocket.Chat,linnovate\/hi,xasx\/Rocket.Chat,amaapp\/ama,LearnersGuild\/Rocket.Chat,haoyixin\/Rocket.Chat,ndarilek\/Rocket.Chat,timkinnane\/Rocket.Chat,marzieh312\/Rocket.Chat,mitar\/Rocket.Chat,mccambridge\/Rocket.Chat,OtkurBiz\/Rocket.Chat,AimenJoe\/Rocket.Chat,ealbers\/Rocket.Chat,jbsavoy18\/rocketchat-1,Movile\/Rocket.Chat,haoyixin\/Rocket.Chat,jonathanhartman\/Rocket.Chat,4thParty\/Rocket.Chat,alexbrazier\/Rocket.Chat,LearnersGuild\/echo-chat,marzieh312\/Rocket.Chat,timkinnane\/Rocket.Chat,Gyubin\/Rocket.Chat,flaviogrossi\/Rocket.Chat,cnash\/Rocket.Chat,mwharrison\/Rocket.Chat,matthewshirley\/Rocket.Chat,ziedmahdi\/Rocket.Chat,mwharrison\/Rocket.Chat,steedos\/chat,marzieh312\/Rocket.Chat,pachox\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,steedos\/chat,lukaroski\/traden,danielbressan\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ndarilek\/Rocket.Chat,NMandapaty\/Rocket.Chat,litewhatever\/Rocket.Chat,nishimaki10\/Rocket.Chat,TribeMedia\/Rocket.Chat,fduraibi\/Rocket.Chat,xasx\/Rocket.Chat,mitar\/Rocket.Chat,pachox\/Rocket.Chat,liuliming2008\/Rocket.Chat,klatys\/Rocket.Chat,Gudii\/Rocket.Chat,qnib\/Rocket.Chat,ahmadassaf\/Rocket.Chat,Sing-Li\/Rocket.Chat,ahmadassaf\/Rocket.Chat,org100h1\/Rocket.Panda,PavelVanecek\/Rocket.Chat,Gudii\/Rocket.Chat,Gyubin\/Rocket.Chat,marzieh312\/Rocket.Chat,Movile\/Rocket.Chat,flaviogrossi\/Rocket.Chat,pkgodara\/Rocket.Chat,AlecTroemel\/Rocket.Chat,flaviogrossi\/Rocket.Chat,abduljanjua\/TheHub,jbsavoy18\/rocketchat-1,LeonardOliveros\/Rocket.Chat,ggazzo\/Rocket.Chat,PavelVanecek\/Rocket.Chat,bt\/Rocket.Chat,qnib\/Rocket.Chat,LearnersGuild\/echo-chat,cnash\/Rocket.Chat,liuliming2008\/Rocket.Chat,ggazzo\/Rocket.Chat,flaviogrossi\/Rocket.Chat,matthewshirley\/Rocket.Chat,tlongren\/Rocket.Chat,pkgodara\/Rocket.Chat,alexbrazier\/Rocket.Chat,galrotem1993\/Rocket.Chat,mrsimpson\/Rocket.Chat,ut7\/Rocket.Chat,k0nsl\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,cnash\/Rocket.Chat,nishimaki10\/Rocket.Chat,wicked539\/Rocket.Chat,mrinaldhar\/Rocket.Chat,k0nsl\/Rocket.Chat,galrotem1993\/Rocket.Chat,igorstajic\/Rocket.Chat,Sing-Li\/Rocket.Chat,wtsarchive\/Rocket.Chat,cdwv\/Rocket.Chat,karlprieb\/Rocket.Chat,xboston\/Rocket.Chat,pkgodara\/Rocket.Chat,mrsimpson\/Rocket.Chat,yuyixg\/Rocket.Chat,subesokun\/Rocket.Chat,igorstajic\/Rocket.Chat,mccambridge\/Rocket.Chat,mhurwi\/Rocket.Chat,qnib\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,JamesHGreen\/Rocket.Chat,liuliming2008\/Rocket.Chat,ImpressiveSetOfIntelligentStudents\/chat,cdwv\/Rocket.Chat,AlecTroemel\/Rocket.Chat,jbsavoy18\/rocketchat-1,lukaroski\/traden,AimenJoe\/Rocket.Chat,abhishekshukla0302\/trico,mrinaldhar\/Rocket.Chat,mrsimpson\/Rocket.Chat,OtkurBiz\/Rocket.Chat,wtsarchive\/Rocket.Chat,abhishekshukla0302\/trico,abhishekshukla0302\/trico,Gudii\/Rocket.Chat,inoxth\/Rocket.Chat,tlongren\/Rocket.Chat,karlprieb\/Rocket.Chat,fatihwk\/Rocket.Chat,mrinaldhar\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,bt\/Rocket.Chat,JamesHGreen\/Rocket_API,matthewshirley\/Rocket.Chat,Flitterkill\/Rocket.Chat,NMandapaty\/Rocket.Chat,OtkurBiz\/Rocket.Chat,linnovate\/hi,ggazzo\/Rocket.Chat,inoxth\/Rocket.Chat,mhurwi\/Rocket.Chat,AlecTroemel\/Rocket.Chat,qnib\/Rocket.Chat,PavelVanecek\/Rocket.Chat,Flitterkill\/Rocket.Chat,capensisma\/Rocket.Chat,JamesHGreen\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,org100h1\/Rocket.Panda,snaiperskaya96\/Rocket.Chat,wicked539\/Rocket.Chat,bt\/Rocket.Chat,litewhatever\/Rocket.Chat,inoxth\/Rocket.Chat,klatys\/Rocket.Chat,litewhatever\/Rocket.Chat,pachox\/Rocket.Chat,wtsarchive\/Rocket.Chat,igorstajic\/Rocket.Chat,lukaroski\/traden,ealbers\/Rocket.Chat,acaronmd\/Rocket.Chat,fatihwk\/Rocket.Chat,yuyixg\/Rocket.Chat,mwharrison\/Rocket.Chat,inoio\/Rocket.Chat,nishimaki10\/Rocket.Chat,Flitterkill\/Rocket.Chat,wtsarchive\/Rocket.Chat,AimenJoe\/Rocket.Chat,Movile\/Rocket.Chat,capensisma\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,cnash\/Rocket.Chat,fduraibi\/Rocket.Chat,mccambridge\/Rocket.Chat,ahmadassaf\/Rocket.Chat,jonathanhartman\/Rocket.Chat,xasx\/Rocket.Chat,ut7\/Rocket.Chat,lukaroski\/traden,subesokun\/Rocket.Chat,ImpressiveSetOfIntelligentStudents\/chat,JamesHGreen\/Rocket.Chat,ahmadassaf\/Rocket.Chat,intelradoux\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,tlongren\/Rocket.Chat,galrotem1993\/Rocket.Chat,JamesHGreen\/Rocket.Chat,pitamar\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,Achaikos\/Rocket.Chat,VoiSmart\/Rocket.Chat,intelradoux\/Rocket.Chat,xboston\/Rocket.Chat,amaapp\/ama,igorstajic\/Rocket.Chat,JamesHGreen\/Rocket_API,tlongren\/Rocket.Chat,ut7\/Rocket.Chat,matthewshirley\/Rocket.Chat,ut7\/Rocket.Chat,Flitterkill\/Rocket.Chat,mitar\/Rocket.Chat,yuyixg\/Rocket.Chat,jonathanhartman\/Rocket.Chat,Gyubin\/Rocket.Chat,mitar\/Rocket.Chat,amaapp\/ama,alexbrazier\/Rocket.Chat,Dianoga\/Rocket.Chat,ziedmahdi\/Rocket.Chat,fduraibi\/Rocket.Chat,PavelVanecek\/Rocket.Chat,danielbressan\/Rocket.Chat,Sing-Li\/Rocket.Chat,abduljanjua\/TheHub,LearnersGuild\/Rocket.Chat,subesokun\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,inoio\/Rocket.Chat,ziedmahdi\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,bt\/Rocket.Chat,org100h1\/Rocket.Panda,VoiSmart\/Rocket.Chat,4thParty\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,subesokun\/Rocket.Chat,jonathanhartman\/Rocket.Chat,abhishekshukla0302\/trico,Deepakkothandan\/Rocket.Chat,mhurwi\/Rocket.Chat,TribeMedia\/Rocket.Chat,pitamar\/Rocket.Chat,galrotem1993\/Rocket.Chat,mrinaldhar\/Rocket.Chat,tntobias\/Rocket.Chat,ImpressiveSetOfIntelligentStudents\/chat,k0nsl\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,TribeMedia\/Rocket.Chat,amaapp\/ama,klatys\/Rocket.Chat,4thParty\/Rocket.Chat,inoxth\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,cdwv\/Rocket.Chat,mrsimpson\/Rocket.Chat,steedos\/chat,ImpressiveSetOfIntelligentStudents\/chat,tntobias\/Rocket.Chat,NMandapaty\/Rocket.Chat,pitamar\/Rocket.Chat,intelradoux\/Rocket.Chat,pachox\/Rocket.Chat,k0nsl\/Rocket.Chat,capensisma\/Rocket.Chat,Achaikos\/Rocket.Chat,abduljanjua\/TheHub,liuliming2008\/Rocket.Chat,timkinnane\/Rocket.Chat,danielbressan\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.6\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.6\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"3b4622a9acb842f16fd3b1aea90bbf5debcc5041","subject":"Add API config.","message":"Add API config.\n","repos":"JC5\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii,firefly-iii\/firefly-iii","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 19,\n appMarketingVersion = (defaultText = \"4.7.9\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.org\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1290, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1290, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1290, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n apiPath = \"\/api\/v1\/\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 19,\n appMarketingVersion = (defaultText = \"4.7.9\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.org\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1290, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1290, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1290, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"047924cb35eca0c76cecb631eff00f8c9072620b","subject":"Squashed 'cereal\/' changes from 3d90c7877..90e48c549","message":"Squashed 'cereal\/' changes from 3d90c7877..90e48c549\n\n90e48c549 add ir pwr field\n101facee1 added safety model to health packet\nfe09e4c07 distinguish between ignition_line and ignition_can\n\ngit-subtree-dir: cereal\ngit-subtree-split: 90e48c549c505383a7242cfddd32984cd5c268b8\n","repos":"vntarasov\/openpilot,vntarasov\/openpilot,vntarasov\/openpilot,vntarasov\/openpilot","old_file":"log.capnp","new_file":"log.capnp","new_contents":"using Cxx = import \".\/include\/c++.capnp\";\n$Cxx.namespace(\"cereal\");\n\nusing Java = import \".\/include\/java.capnp\";\n$Java.package(\"ai.comma.openpilot.cereal\");\n$Java.outerClassname(\"Log\");\n\nusing Car = import \"car.capnp\";\n\n@0xf3b1f17e25a4285b;\n\nconst logVersion :Int32 = 1;\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n\nstruct InitData {\n kernelArgs @0 :List(Text);\n kernelVersion @15 :Text;\n\n gctx @1 :Text;\n dongleId @2 :Text;\n\n deviceType @3 :DeviceType;\n version @4 :Text;\n gitCommit @10 :Text;\n gitBranch @11 :Text;\n gitRemote @13 :Text;\n\n androidBuildInfo @5 :AndroidBuildInfo;\n androidSensors @6 :List(AndroidSensor);\n androidProperties @16 :Map(Text, Text);\n chffrAndroidExtra @7 :ChffrAndroidExtra;\n iosBuildInfo @14 :IosBuildInfo;\n\n pandaInfo @8 :PandaInfo;\n\n dirty @9 :Bool;\n passive @12 :Bool;\n params @17 :Map(Text, Text);\n\n enum DeviceType {\n unknown @0;\n neo @1;\n chffrAndroid @2;\n chffrIos @3;\n }\n\n struct AndroidBuildInfo {\n board @0 :Text;\n bootloader @1 :Text;\n brand @2 :Text;\n device @3 :Text;\n display @4 :Text;\n fingerprint @5 :Text;\n hardware @6 :Text;\n host @7 :Text;\n id @8 :Text;\n manufacturer @9 :Text;\n model @10 :Text;\n product @11 :Text;\n radioVersion @12 :Text;\n serial @13 :Text;\n supportedAbis @14 :List(Text);\n tags @15 :Text;\n time @16 :Int64;\n type @17 :Text;\n user @18 :Text;\n\n versionCodename @19 :Text;\n versionRelease @20 :Text;\n versionSdk @21 :Int32;\n versionSecurityPatch @22 :Text;\n }\n\n struct AndroidSensor {\n id @0 :Int32;\n name @1 :Text;\n vendor @2 :Text;\n version @3 :Int32;\n handle @4 :Int32;\n type @5 :Int32;\n maxRange @6 :Float32;\n resolution @7 :Float32;\n power @8 :Float32;\n minDelay @9 :Int32;\n fifoReservedEventCount @10 :UInt32;\n fifoMaxEventCount @11 :UInt32;\n stringType @12 :Text;\n maxDelay @13 :Int32;\n }\n\n struct ChffrAndroidExtra {\n allCameraCharacteristics @0 :Map(Text, Text);\n }\n\n struct IosBuildInfo {\n appVersion @0 :Text;\n appBuild @1 :UInt32;\n osVersion @2 :Text;\n deviceModel @3 :Text;\n }\n\n struct PandaInfo {\n hasPanda @0 :Bool;\n dongleId @1 :Text;\n stVersion @2 :Text;\n espVersion @3 :Text;\n }\n}\n\nstruct FrameData {\n frameId @0 :UInt32;\n encodeId @1 :UInt32; # DEPRECATED\n timestampEof @2 :UInt64;\n frameLength @3 :Int32;\n integLines @4 :Int32;\n globalGain @5 :Int32;\n lensPos @11 :Int32;\n lensSag @12 :Float32;\n lensErr @13 :Float32;\n lensTruePos @14 :Float32;\n image @6 :Data;\n\n frameType @7 :FrameType;\n timestampSof @8 :UInt64;\n transform @10 :List(Float32);\n\n androidCaptureResult @9 :AndroidCaptureResult;\n\n enum FrameType {\n unknown @0;\n neo @1;\n chffrAndroid @2;\n }\n\n struct AndroidCaptureResult {\n sensitivity @0 :Int32;\n frameDuration @1 :Int64;\n exposureTime @2 :Int64;\n rollingShutterSkew @3 :UInt64;\n colorCorrectionTransform @4 :List(Int32);\n colorCorrectionGains @5 :List(Float32);\n displayRotation @6 :Int8;\n }\n}\n\nstruct Thumbnail {\n frameId @0 :UInt32;\n timestampEof @1 :UInt64;\n thumbnail @2 :Data;\n}\n\nstruct GPSNMEAData {\n timestamp @0 :Int64;\n localWallTime @1 :UInt64;\n nmea @2 :Text;\n}\n\n# android sensor_event_t\nstruct SensorEventData {\n version @0 :Int32;\n sensor @1 :Int32;\n type @2 :Int32;\n timestamp @3 :Int64;\n uncalibratedDEPRECATED @10 :Bool;\n\n union {\n acceleration @4 :SensorVec;\n magnetic @5 :SensorVec;\n orientation @6 :SensorVec;\n gyro @7 :SensorVec;\n pressure @9 :SensorVec;\n magneticUncalibrated @11 :SensorVec;\n gyroUncalibrated @12 :SensorVec;\n proximity @13: Float32;\n light @14: Float32;\n }\n source @8 :SensorSource;\n\n struct SensorVec {\n v @0 :List(Float32);\n status @1 :Int8;\n }\n\n enum SensorSource {\n android @0;\n iOS @1;\n fiber @2;\n velodyne @3; # Velodyne IMU\n bno055 @4; # Bosch accelerometer\n lsm6ds3 @5; # accelerometer (c2)\n bmp280 @6; # barometer (c2)\n mmc3416x @7; # magnetometer (c2)\n }\n}\n\n# android struct GpsLocation\nstruct GpsLocationData {\n # Contains GpsLocationFlags bits.\n flags @0 :UInt16;\n\n # Represents latitude in degrees.\n latitude @1 :Float64;\n\n # Represents longitude in degrees.\n longitude @2 :Float64;\n\n # Represents altitude in meters above the WGS 84 reference ellipsoid.\n altitude @3 :Float64;\n\n # Represents speed in meters per second.\n speed @4 :Float32;\n\n # Represents heading in degrees.\n bearing @5 :Float32;\n\n # Represents expected accuracy in meters. (presumably 1 sigma?)\n accuracy @6 :Float32;\n\n # Timestamp for the location fix.\n # Milliseconds since January 1, 1970.\n timestamp @7 :Int64;\n\n source @8 :SensorSource;\n\n # Represents NED velocity in m\/s.\n vNED @9 :List(Float32);\n\n # Represents expected vertical accuracy in meters. (presumably 1 sigma?)\n verticalAccuracy @10 :Float32;\n\n # Represents bearing accuracy in degrees. (presumably 1 sigma?)\n bearingAccuracy @11 :Float32;\n\n # Represents velocity accuracy in m\/s. (presumably 1 sigma?)\n speedAccuracy @12 :Float32;\n\n enum SensorSource {\n android @0;\n iOS @1;\n car @2;\n velodyne @3; # Velodyne IMU\n fusion @4;\n external @5;\n ublox @6;\n trimble @7;\n }\n}\n\nstruct CanData {\n address @0 :UInt32;\n busTime @1 :UInt16;\n dat @2 :Data;\n src @3 :UInt8;\n}\n\nstruct ThermalData {\n cpu0 @0 :UInt16;\n cpu1 @1 :UInt16;\n cpu2 @2 :UInt16;\n cpu3 @3 :UInt16;\n mem @4 :UInt16;\n gpu @5 :UInt16;\n bat @6 :UInt32;\n\n # not thermal\n freeSpace @7 :Float32;\n batteryPercent @8 :Int16;\n batteryStatus @9 :Text;\n batteryCurrent @15 :Int32;\n batteryVoltage @16 :Int32;\n usbOnline @12 :Bool;\n\n fanSpeed @10 :UInt16;\n started @11 :Bool;\n startedTs @13 :UInt64;\n\n thermalStatus @14 :ThermalStatus;\n chargingError @17 :Bool;\n chargingDisabled @18 :Bool;\n\n enum ThermalStatus {\n green @0; # all processes run\n yellow @1; # critical processes run (kill uploader), engage still allowed\n red @2; # no engage, will disengage\n danger @3; # immediate process shutdown\n }\n}\n\nstruct HealthData {\n # from can health\n voltage @0 :UInt32;\n current @1 :UInt32;\n ignitionLine @2 :Bool;\n controlsAllowed @3 :Bool;\n gasInterceptorDetected @4 :Bool;\n startedSignalDetectedDeprecated @5 :Bool;\n hasGps @6 :Bool;\n canSendErrs @7 :UInt32;\n canFwdErrs @8 :UInt32;\n gmlanSendErrs @9 :UInt32;\n hwType @10 :HwType;\n fanSpeedRpm @11 :UInt16;\n usbPowerMode @12 :UsbPowerMode;\n ignitionCan @13 :Bool;\n safetyModel @14 :Car.CarParams.SafetyModel;\n\n enum HwType {\n unknown @0;\n whitePanda @1;\n greyPanda @2;\n blackPanda @3;\n pedal @4;\n uno @5;\n }\n\n enum UsbPowerMode {\n none @0;\n client @1;\n cdp @2;\n dcp @3;\n }\n}\n\nstruct LiveUI {\n rearViewCam @0 :Bool;\n alertText1 @1 :Text;\n alertText2 @2 :Text;\n awarenessStatus @3 :Float32;\n}\n\nstruct RadarState @0x9a185389d6fdd05f {\n canMonoTimes @10 :List(UInt64);\n mdMonoTime @6 :UInt64;\n ftMonoTimeDEPRECATED @7 :UInt64;\n controlsStateMonoTime @11 :UInt64;\n radarErrors @12 :List(Car.RadarData.Error);\n\n # all deprecated\n warpMatrixDEPRECATED @0 :List(Float32);\n angleOffsetDEPRECATED @1 :Float32;\n calStatusDEPRECATED @2 :Int8;\n calCycleDEPRECATED @8 :Int32;\n calPercDEPRECATED @9 :Int8;\n\n leadOne @3 :LeadData;\n leadTwo @4 :LeadData;\n cumLagMs @5 :Float32;\n\n struct LeadData {\n dRel @0 :Float32;\n yRel @1 :Float32;\n vRel @2 :Float32;\n aRel @3 :Float32;\n vLead @4 :Float32;\n aLeadDEPRECATED @5 :Float32;\n dPath @6 :Float32;\n vLat @7 :Float32;\n vLeadK @8 :Float32;\n aLeadK @9 :Float32;\n fcw @10 :Bool;\n status @11 :Bool;\n aLeadTau @12 :Float32;\n modelProb @13 :Float32;\n radar @14 :Bool;\n }\n}\n\nstruct LiveCalibrationData {\n # deprecated\n warpMatrix @0 :List(Float32);\n # camera_frame_from_model_frame\n warpMatrix2 @5 :List(Float32);\n warpMatrixBig @6 :List(Float32);\n calStatus @1 :Int8;\n calCycle @2 :Int32;\n calPerc @3 :Int8;\n\n # view_frame_from_road_frame\n # ui's is inversed needs new\n extrinsicMatrix @4 :List(Float32);\n # the direction of travel vector in device frame\n rpyCalib @7 :List(Float32);\n}\n\nstruct LiveTracks {\n trackId @0 :Int32;\n dRel @1 :Float32;\n yRel @2 :Float32;\n vRel @3 :Float32;\n aRel @4 :Float32;\n timeStamp @5 :Float32;\n status @6 :Float32;\n currentTime @7 :Float32;\n stationary @8 :Bool;\n oncoming @9 :Bool;\n}\n\nstruct ControlsState @0x97ff69c53601abf1 {\n canMonoTimeDEPRECATED @16 :UInt64;\n canMonoTimes @21 :List(UInt64);\n radarStateMonoTimeDEPRECATED @17 :UInt64;\n mdMonoTimeDEPRECATED @18 :UInt64;\n planMonoTime @28 :UInt64;\n pathPlanMonoTime @50 :UInt64;\n\n state @31 :OpenpilotState;\n vEgo @0 :Float32;\n vEgoRaw @32 :Float32;\n aEgoDEPRECATED @1 :Float32;\n longControlState @30 :LongControlState;\n vPid @2 :Float32;\n vTargetLead @3 :Float32;\n upAccelCmd @4 :Float32;\n uiAccelCmd @5 :Float32;\n ufAccelCmd @33 :Float32;\n yActualDEPRECATED @6 :Float32;\n yDesDEPRECATED @7 :Float32;\n upSteerDEPRECATED @8 :Float32;\n uiSteerDEPRECATED @9 :Float32;\n ufSteerDEPRECATED @34 :Float32;\n aTargetMinDEPRECATED @10 :Float32;\n aTargetMaxDEPRECATED @11 :Float32;\n aTarget @35 :Float32;\n jerkFactor @12 :Float32;\n angleSteers @13 :Float32; # Steering angle in degrees.\n angleSteersDes @29 :Float32;\n curvature @37 :Float32; # path curvature from vehicle model\n hudLeadDEPRECATED @14 :Int32;\n cumLagMs @15 :Float32;\n startMonoTime @48 :UInt64;\n mapValid @49 :Bool;\n forceDecel @51 :Bool;\n\n enabled @19 :Bool;\n active @36 :Bool;\n steerOverride @20 :Bool;\n\n vCruise @22 :Float32;\n\n rearViewCam @23 :Bool;\n alertText1 @24 :Text;\n alertText2 @25 :Text;\n alertStatus @38 :AlertStatus;\n alertSize @39 :AlertSize;\n alertBlinkingRate @42 :Float32;\n alertType @44 :Text;\n alertSoundDEPRECATED @45 :Text;\n alertSound @56 :Car.CarControl.HUDControl.AudibleAlert;\n awarenessStatus @26 :Float32;\n angleModelBiasDEPRECATED @27 :Float32;\n gpsPlannerActive @40 :Bool;\n engageable @41 :Bool; # can OP be engaged?\n driverMonitoringOn @43 :Bool;\n\n # maps\n vCurvature @46 :Float32;\n decelForTurn @47 :Bool;\n\n decelForModel @54 :Bool;\n\n lateralControlState :union {\n indiState @52 :LateralINDIState;\n pidState @53 :LateralPIDState;\n lqrState @55 :LateralLQRState;\n }\n\n enum OpenpilotState @0xdbe58b96d2d1ac61 {\n disabled @0;\n preEnabled @1;\n enabled @2;\n softDisabling @3;\n }\n\n enum LongControlState {\n off @0;\n pid @1;\n stopping @2;\n starting @3;\n }\n\n enum AlertStatus {\n normal @0; # low priority alert for user's convenience\n userPrompt @1; # mid piority alert that might require user intervention\n critical @2; # high priority alert that needs immediate user intervention\n }\n\n enum AlertSize {\n none @0; # don't display the alert\n small @1; # small box\n mid @2; # mid screen\n full @3; # full screen\n }\n\n struct LateralINDIState {\n active @0 :Bool;\n steerAngle @1 :Float32;\n steerRate @2 :Float32;\n steerAccel @3 :Float32;\n rateSetPoint @4 :Float32;\n accelSetPoint @5 :Float32;\n accelError @6 :Float32;\n delayedOutput @7 :Float32;\n delta @8 :Float32;\n output @9 :Float32;\n }\n\n struct LateralPIDState {\n active @0 :Bool;\n steerAngle @1 :Float32;\n steerRate @2 :Float32;\n angleError @3 :Float32;\n p @4 :Float32;\n i @5 :Float32;\n f @6 :Float32;\n output @7 :Float32;\n saturated @8 :Bool;\n }\n\n struct LateralLQRState {\n active @0 :Bool;\n steerAngle @1 :Float32;\n i @2 :Float32;\n output @3 :Float32;\n lqrOutput @4 :Float32;\n }\n\n\n}\n\nstruct LiveEventData {\n name @0 :Text;\n value @1 :Int32;\n}\n\nstruct ModelData {\n frameId @0 :UInt32;\n timestampEof @9 :UInt64;\n\n path @1 :PathData;\n leftLane @2 :PathData;\n rightLane @3 :PathData;\n lead @4 :LeadData;\n freePath @6 :List(Float32);\n\n settings @5 :ModelSettings;\n leadFuture @7 :LeadData;\n speed @8 :List(Float32);\n\n struct PathData {\n points @0 :List(Float32);\n prob @1 :Float32;\n std @2 :Float32;\n stds @3 :List(Float32);\n poly @4 :List(Float32);\n }\n\n struct LeadData {\n dist @0 :Float32;\n prob @1 :Float32;\n std @2 :Float32;\n relVel @3 :Float32;\n relVelStd @4 :Float32;\n relY @5 :Float32;\n relYStd @6 :Float32;\n relA @7 :Float32;\n relAStd @8 :Float32;\n }\n\n struct ModelSettings {\n bigBoxX @0 :UInt16;\n bigBoxY @1 :UInt16;\n bigBoxWidth @2 :UInt16;\n bigBoxHeight @3 :UInt16;\n boxProjection @4 :List(Float32);\n yuvCorrection @5 :List(Float32);\n inputTransform @6 :List(Float32);\n }\n}\n\nstruct CalibrationFeatures {\n frameId @0 :UInt32;\n\n p0 @1 :List(Float32);\n p1 @2 :List(Float32);\n status @3 :List(Int8);\n}\n\nstruct EncodeIndex {\n # picture from camera\n frameId @0 :UInt32;\n type @1 :Type;\n # index of encoder from start of route\n encodeId @2 :UInt32;\n # minute long segment this frame is in\n segmentNum @3 :Int32;\n # index into camera file in segment in presentation order\n segmentId @4 :UInt32;\n # index into camera file in segment in encode order\n segmentIdEncode @5 :UInt32;\n\n enum Type {\n bigBoxLossless @0; # rcamera.mkv\n fullHEVC @1; # fcamera.hevc\n bigBoxHEVC @2; # bcamera.hevc\n chffrAndroidH264 @3; # acamera\n fullLosslessClip @4; # prcamera.mkv\n front @5; # dcamera.hevc\n }\n}\n\nstruct AndroidLogEntry {\n id @0 :UInt8;\n ts @1 :UInt64;\n priority @2 :UInt8;\n pid @3 :Int32;\n tid @4 :Int32;\n tag @5 :Text;\n message @6 :Text;\n}\n\nstruct LogRotate {\n segmentNum @0 :Int32;\n path @1 :Text;\n}\n\nstruct Plan {\n mdMonoTime @9 :UInt64;\n radarStateMonoTime @10 :UInt64;\n commIssue @31 :Bool;\n\n eventsDEPRECATED @13 :List(Car.CarEvent);\n\n # lateral, 3rd order polynomial\n lateralValidDEPRECATED @0 :Bool;\n dPolyDEPRECATED @1 :List(Float32);\n laneWidthDEPRECATED @11 :Float32;\n\n # longitudinal\n longitudinalValidDEPRECATED @2 :Bool;\n vCruise @16 :Float32;\n aCruise @17 :Float32;\n vTarget @3 :Float32;\n vTargetFuture @14 :Float32;\n vMax @20 :Float32;\n aTargetMinDEPRECATED @4 :Float32;\n aTargetMaxDEPRECATED @5 :Float32;\n aTarget @18 :Float32;\n\n vStart @26 :Float32;\n aStart @27 :Float32;\n\n jerkFactor @6 :Float32;\n hasLead @7 :Bool;\n hasLeftLaneDEPRECATED @23 :Bool;\n hasRightLaneDEPRECATED @24 :Bool;\n fcw @8 :Bool;\n longitudinalPlanSource @15 :LongitudinalPlanSource;\n\n # gps trajectory in car frame\n gpsTrajectory @12 :GpsTrajectory;\n\n gpsPlannerActive @19 :Bool;\n\n # maps\n vCurvature @21 :Float32;\n decelForTurn @22 :Bool;\n mapValid @25 :Bool;\n radarValid @28 :Bool;\n radarCanError @30 :Bool;\n\n processingDelay @29 :Float32;\n\n\n struct GpsTrajectory {\n x @0 :List(Float32);\n y @1 :List(Float32);\n }\n\n enum LongitudinalPlanSource {\n cruise @0;\n mpc1 @1;\n mpc2 @2;\n mpc3 @3;\n model @4;\n }\n}\n\nstruct PathPlan {\n laneWidth @0 :Float32;\n\n dPoly @1 :List(Float32);\n cPoly @2 :List(Float32);\n cProb @3 :Float32;\n lPoly @4 :List(Float32);\n lProb @5 :Float32;\n rPoly @6 :List(Float32);\n rProb @7 :Float32;\n\n angleSteers @8 :Float32; # deg\n rateSteers @13 :Float32; # deg\/s\n mpcSolutionValid @9 :Bool;\n paramsValid @10 :Bool;\n modelValidDEPRECATED @12 :Bool;\n angleOffset @11 :Float32;\n sensorValid @14 :Bool;\n commIssue @15 :Bool;\n posenetValid @16 :Bool;\n desire @17 :Desire;\n laneChangeState @18 :LaneChangeState;\n laneChangeDirection @19 :LaneChangeDirection;\n\n enum Desire {\n none @0;\n turnLeft @1;\n turnRight @2;\n laneChangeLeft @3;\n laneChangeRight @4;\n keepLeft @5;\n keepRight @6;\n }\n\n enum LaneChangeState {\n off @0;\n preLaneChange @1;\n laneChangeStarting @2;\n laneChangeFinishing @3;\n }\n\n enum LaneChangeDirection {\n none @0;\n left @1;\n right @2;\n }\n}\n\nstruct LiveLocationData {\n status @0 :UInt8;\n\n # 3D fix\n lat @1 :Float64;\n lon @2 :Float64;\n alt @3 :Float32; # m\n\n # speed\n speed @4 :Float32; # m\/s\n\n # NED velocity components\n vNED @5 :List(Float32);\n\n # roll, pitch, heading (x,y,z)\n roll @6 :Float32; # WRT to center of earth?\n pitch @7 :Float32; # WRT to center of earth?\n heading @8 :Float32; # WRT to north?\n\n # what are these?\n wanderAngle @9 :Float32;\n trackAngle @10 :Float32;\n\n # car frame -- https:\/\/upload.wikimedia.org\/wikipedia\/commons\/f\/f5\/RPY_angles_of_cars.png\n\n # gyro, in car frame, deg\/s\n gyro @11 :List(Float32);\n\n # accel, in car frame, m\/s^2\n accel @12 :List(Float32);\n\n accuracy @13 :Accuracy;\n\n source @14 :SensorSource;\n # if we are fixing a location in the past\n fixMonoTime @15 :UInt64;\n\n gpsWeek @16 :Int32;\n timeOfWeek @17 :Float64;\n\n positionECEF @18 :List(Float64);\n poseQuatECEF @19 :List(Float32);\n pitchCalibration @20 :Float32;\n yawCalibration @21 :Float32;\n imuFrame @22 :List(Float32);\n\n struct Accuracy {\n pNEDError @0 :List(Float32);\n vNEDError @1 :List(Float32);\n rollError @2 :Float32;\n pitchError @3 :Float32;\n headingError @4 :Float32;\n ellipsoidSemiMajorError @5 :Float32;\n ellipsoidSemiMinorError @6 :Float32;\n ellipsoidOrientationError @7 :Float32;\n }\n\n enum SensorSource {\n applanix @0;\n kalman @1;\n orbslam @2;\n timing @3;\n dummy @4;\n }\n}\n\nstruct EthernetPacket {\n pkt @0 :Data;\n ts @1 :Float32;\n}\n\nstruct NavUpdate {\n isNavigating @0 :Bool;\n curSegment @1 :Int32;\n segments @2 :List(Segment);\n\n struct LatLng {\n lat @0 :Float64;\n lng @1 :Float64;\n }\n\n struct Segment {\n from @0 :LatLng;\n to @1 :LatLng;\n updateTime @2 :Int32;\n distance @3 :Int32;\n crossTime @4 :Int32;\n exitNo @5 :Int32;\n instruction @6 :Instruction;\n\n parts @7 :List(LatLng);\n\n enum Instruction {\n turnLeft @0;\n turnRight @1;\n keepLeft @2;\n keepRight @3;\n straight @4;\n roundaboutExitNumber @5;\n roundaboutExit @6;\n roundaboutTurnLeft @7;\n unkn8 @8;\n roundaboutStraight @9;\n unkn10 @10;\n roundaboutTurnRight @11;\n unkn12 @12;\n roundaboutUturn @13;\n unkn14 @14;\n arrive @15;\n exitLeft @16;\n exitRight @17;\n unkn18 @18;\n uturn @19;\n # ...\n }\n }\n}\n\nstruct NavStatus {\n isNavigating @0 :Bool;\n currentAddress @1 :Address;\n\n struct Address {\n title @0 :Text;\n lat @1 :Float64;\n lng @2 :Float64;\n house @3 :Text;\n address @4 :Text;\n street @5 :Text;\n city @6 :Text;\n state @7 :Text;\n country @8 :Text;\n }\n}\n\nstruct CellInfo {\n timestamp @0 :UInt64;\n repr @1 :Text; # android toString() for now\n}\n\nstruct WifiScan {\n bssid @0 :Text;\n ssid @1 :Text;\n capabilities @2 :Text;\n frequency @3 :Int32;\n level @4 :Int32;\n timestamp @5 :Int64;\n\n centerFreq0 @6 :Int32;\n centerFreq1 @7 :Int32;\n channelWidth @8 :ChannelWidth;\n operatorFriendlyName @9 :Text;\n venueName @10 :Text;\n is80211mcResponder @11 :Bool;\n passpoint @12 :Bool;\n\n distanceCm @13 :Int32;\n distanceSdCm @14 :Int32;\n\n enum ChannelWidth {\n w20Mhz @0;\n w40Mhz @1;\n w80Mhz @2;\n w160Mhz @3;\n w80Plus80Mhz @4;\n }\n}\n\nstruct AndroidGnss {\n union {\n measurements @0 :Measurements;\n navigationMessage @1 :NavigationMessage;\n }\n\n struct Measurements {\n clock @0 :Clock;\n measurements @1 :List(Measurement);\n\n struct Clock {\n timeNanos @0 :Int64;\n hardwareClockDiscontinuityCount @1 :Int32;\n\n hasTimeUncertaintyNanos @2 :Bool;\n timeUncertaintyNanos @3 :Float64;\n\n hasLeapSecond @4 :Bool;\n leapSecond @5 :Int32;\n\n hasFullBiasNanos @6 :Bool;\n fullBiasNanos @7 :Int64;\n\n hasBiasNanos @8 :Bool;\n biasNanos @9 :Float64;\n\n hasBiasUncertaintyNanos @10 :Bool;\n biasUncertaintyNanos @11 :Float64;\n\n hasDriftNanosPerSecond @12 :Bool;\n driftNanosPerSecond @13 :Float64;\n\n hasDriftUncertaintyNanosPerSecond @14 :Bool;\n driftUncertaintyNanosPerSecond @15 :Float64;\n }\n\n struct Measurement {\n svId @0 :Int32;\n constellation @1 :Constellation;\n\n timeOffsetNanos @2 :Float64;\n state @3 :Int32;\n receivedSvTimeNanos @4 :Int64;\n receivedSvTimeUncertaintyNanos @5 :Int64;\n cn0DbHz @6 :Float64;\n pseudorangeRateMetersPerSecond @7 :Float64;\n pseudorangeRateUncertaintyMetersPerSecond @8 :Float64;\n accumulatedDeltaRangeState @9 :Int32;\n accumulatedDeltaRangeMeters @10 :Float64;\n accumulatedDeltaRangeUncertaintyMeters @11 :Float64;\n\n hasCarrierFrequencyHz @12 :Bool;\n carrierFrequencyHz @13 :Float32;\n hasCarrierCycles @14 :Bool;\n carrierCycles @15 :Int64;\n hasCarrierPhase @16 :Bool;\n carrierPhase @17 :Float64;\n hasCarrierPhaseUncertainty @18 :Bool;\n carrierPhaseUncertainty @19 :Float64;\n hasSnrInDb @20 :Bool;\n snrInDb @21 :Float64;\n\n multipathIndicator @22 :MultipathIndicator;\n\n enum Constellation {\n unknown @0;\n gps @1;\n sbas @2;\n glonass @3;\n qzss @4;\n beidou @5;\n galileo @6;\n }\n\n enum State {\n unknown @0;\n codeLock @1;\n bitSync @2;\n subframeSync @3;\n towDecoded @4;\n msecAmbiguous @5;\n symbolSync @6;\n gloStringSync @7;\n gloTodDecoded @8;\n bdsD2BitSync @9;\n bdsD2SubframeSync @10;\n galE1bcCodeLock @11;\n galE1c2ndCodeLock @12;\n galE1bPageSync @13;\n sbasSync @14;\n }\n\n enum MultipathIndicator {\n unknown @0;\n detected @1;\n notDetected @2;\n }\n }\n }\n\n struct NavigationMessage {\n type @0 :Int32;\n svId @1 :Int32;\n messageId @2 :Int32;\n submessageId @3 :Int32;\n data @4 :Data;\n status @5 :Status;\n\n enum Status {\n unknown @0;\n parityPassed @1;\n parityRebuilt @2;\n }\n }\n}\n\nstruct QcomGnss {\n logTs @0 :UInt64;\n union {\n measurementReport @1 :MeasurementReport;\n clockReport @2 :ClockReport;\n drMeasurementReport @3 :DrMeasurementReport;\n drSvPoly @4 :DrSvPolyReport;\n rawLog @5 :Data;\n }\n\n enum MeasurementSource @0xd71a12b6faada7ee {\n gps @0;\n glonass @1;\n beidou @2;\n }\n\n enum SVObservationState @0xe81e829a0d6c83e9 {\n idle @0;\n search @1;\n searchVerify @2;\n bitEdge @3;\n trackVerify @4;\n track @5;\n restart @6;\n dpo @7;\n glo10msBe @8;\n glo10msAt @9;\n }\n\n struct MeasurementStatus @0xe501010e1bcae83b {\n subMillisecondIsValid @0 :Bool;\n subBitTimeIsKnown @1 :Bool;\n satelliteTimeIsKnown @2 :Bool;\n bitEdgeConfirmedFromSignal @3 :Bool;\n measuredVelocity @4 :Bool;\n fineOrCoarseVelocity @5 :Bool;\n lockPointValid @6 :Bool;\n lockPointPositive @7 :Bool;\n lastUpdateFromDifference @8 :Bool;\n lastUpdateFromVelocityDifference @9 :Bool;\n strongIndicationOfCrossCorelation @10 :Bool;\n tentativeMeasurement @11 :Bool;\n measurementNotUsable @12 :Bool;\n sirCheckIsNeeded @13 :Bool;\n probationMode @14 :Bool;\n\n glonassMeanderBitEdgeValid @15 :Bool;\n glonassTimeMarkValid @16 :Bool;\n\n gpsRoundRobinRxDiversity @17 :Bool;\n gpsRxDiversity @18 :Bool;\n gpsLowBandwidthRxDiversityCombined @19 :Bool;\n gpsHighBandwidthNu4 @20 :Bool;\n gpsHighBandwidthNu8 @21 :Bool;\n gpsHighBandwidthUniform @22 :Bool;\n multipathIndicator @23 :Bool;\n\n imdJammingIndicator @24 :Bool;\n lteB13TxJammingIndicator @25 :Bool;\n freshMeasurementIndicator @26 :Bool;\n\n multipathEstimateIsValid @27 :Bool;\n directionIsValid @28 :Bool;\n }\n\n struct MeasurementReport {\n source @0 :MeasurementSource;\n\n fCount @1 :UInt32;\n\n gpsWeek @2 :UInt16;\n glonassCycleNumber @3 :UInt8;\n glonassNumberOfDays @4 :UInt16;\n\n milliseconds @5 :UInt32;\n timeBias @6 :Float32;\n clockTimeUncertainty @7 :Float32;\n clockFrequencyBias @8 :Float32;\n clockFrequencyUncertainty @9 :Float32;\n\n sv @10 :List(SV);\n\n struct SV {\n svId @0 :UInt8;\n observationState @2 :SVObservationState;\n observations @3 :UInt8;\n goodObservations @4 :UInt8;\n gpsParityErrorCount @5 :UInt16;\n glonassFrequencyIndex @1 :Int8;\n glonassHemmingErrorCount @6 :UInt8;\n filterStages @7 :UInt8;\n carrierNoise @8 :UInt16;\n latency @9 :Int16;\n predetectInterval @10 :UInt8;\n postdetections @11 :UInt16;\n\n unfilteredMeasurementIntegral @12 :UInt32;\n unfilteredMeasurementFraction @13 :Float32;\n unfilteredTimeUncertainty @14 :Float32;\n unfilteredSpeed @15 :Float32;\n unfilteredSpeedUncertainty @16 :Float32;\n measurementStatus @17 :MeasurementStatus;\n multipathEstimate @18 :UInt32;\n azimuth @19 :Float32;\n elevation @20 :Float32;\n carrierPhaseCyclesIntegral @21 :Int32;\n carrierPhaseCyclesFraction @22 :UInt16;\n fineSpeed @23 :Float32;\n fineSpeedUncertainty @24 :Float32;\n cycleSlipCount @25 :UInt8;\n }\n\n }\n\n struct ClockReport {\n hasFCount @0 :Bool;\n fCount @1 :UInt32;\n\n hasGpsWeek @2 :Bool;\n gpsWeek @3 :UInt16;\n hasGpsMilliseconds @4 :Bool;\n gpsMilliseconds @5 :UInt32;\n gpsTimeBias @6 :Float32;\n gpsClockTimeUncertainty @7 :Float32;\n gpsClockSource @8 :UInt8;\n\n hasGlonassYear @9 :Bool;\n glonassYear @10 :UInt8;\n hasGlonassDay @11 :Bool;\n glonassDay @12 :UInt16;\n hasGlonassMilliseconds @13 :Bool;\n glonassMilliseconds @14 :UInt32;\n glonassTimeBias @15 :Float32;\n glonassClockTimeUncertainty @16 :Float32;\n glonassClockSource @17 :UInt8;\n\n bdsWeek @18 :UInt16;\n bdsMilliseconds @19 :UInt32;\n bdsTimeBias @20 :Float32;\n bdsClockTimeUncertainty @21 :Float32;\n bdsClockSource @22 :UInt8;\n\n galWeek @23 :UInt16;\n galMilliseconds @24 :UInt32;\n galTimeBias @25 :Float32;\n galClockTimeUncertainty @26 :Float32;\n galClockSource @27 :UInt8;\n\n clockFrequencyBias @28 :Float32;\n clockFrequencyUncertainty @29 :Float32;\n frequencySource @30 :UInt8;\n gpsLeapSeconds @31 :UInt8;\n gpsLeapSecondsUncertainty @32 :UInt8;\n gpsLeapSecondsSource @33 :UInt8;\n\n gpsToGlonassTimeBiasMilliseconds @34 :Float32;\n gpsToGlonassTimeBiasMillisecondsUncertainty @35 :Float32;\n gpsToBdsTimeBiasMilliseconds @36 :Float32;\n gpsToBdsTimeBiasMillisecondsUncertainty @37 :Float32;\n bdsToGloTimeBiasMilliseconds @38 :Float32;\n bdsToGloTimeBiasMillisecondsUncertainty @39 :Float32;\n gpsToGalTimeBiasMilliseconds @40 :Float32;\n gpsToGalTimeBiasMillisecondsUncertainty @41 :Float32;\n galToGloTimeBiasMilliseconds @42 :Float32;\n galToGloTimeBiasMillisecondsUncertainty @43 :Float32;\n galToBdsTimeBiasMilliseconds @44 :Float32;\n galToBdsTimeBiasMillisecondsUncertainty @45 :Float32;\n\n hasRtcTime @46 :Bool;\n systemRtcTime @47 :UInt32;\n fCountOffset @48 :UInt32;\n lpmRtcCount @49 :UInt32;\n clockResets @50 :UInt32;\n }\n\n struct DrMeasurementReport {\n\n reason @0 :UInt8;\n seqNum @1 :UInt8;\n seqMax @2 :UInt8;\n rfLoss @3 :UInt16;\n\n systemRtcValid @4 :Bool;\n fCount @5 :UInt32;\n clockResets @6 :UInt32;\n systemRtcTime @7 :UInt64;\n\n gpsLeapSeconds @8 :UInt8;\n gpsLeapSecondsUncertainty @9 :UInt8;\n gpsToGlonassTimeBiasMilliseconds @10 :Float32;\n gpsToGlonassTimeBiasMillisecondsUncertainty @11 :Float32;\n\n gpsWeek @12 :UInt16;\n gpsMilliseconds @13 :UInt32;\n gpsTimeBiasMs @14 :UInt32;\n gpsClockTimeUncertaintyMs @15 :UInt32;\n gpsClockSource @16 :UInt8;\n\n glonassClockSource @17 :UInt8;\n glonassYear @18 :UInt8;\n glonassDay @19 :UInt16;\n glonassMilliseconds @20 :UInt32;\n glonassTimeBias @21 :Float32;\n glonassClockTimeUncertainty @22 :Float32;\n\n clockFrequencyBias @23 :Float32;\n clockFrequencyUncertainty @24 :Float32;\n frequencySource @25 :UInt8;\n\n source @26 :MeasurementSource;\n\n sv @27 :List(SV);\n\n struct SV {\n svId @0 :UInt8;\n glonassFrequencyIndex @1 :Int8;\n observationState @2 :SVObservationState;\n observations @3 :UInt8;\n goodObservations @4 :UInt8;\n filterStages @5 :UInt8;\n predetectInterval @6 :UInt8;\n cycleSlipCount @7 :UInt8;\n postdetections @8 :UInt16;\n\n measurementStatus @9 :MeasurementStatus;\n\n carrierNoise @10 :UInt16;\n rfLoss @11 :UInt16;\n latency @12 :Int16;\n\n filteredMeasurementFraction @13 :Float32;\n filteredMeasurementIntegral @14 :UInt32;\n filteredTimeUncertainty @15 :Float32;\n filteredSpeed @16 :Float32;\n filteredSpeedUncertainty @17 :Float32;\n\n unfilteredMeasurementFraction @18 :Float32;\n unfilteredMeasurementIntegral @19 :UInt32;\n unfilteredTimeUncertainty @20 :Float32;\n unfilteredSpeed @21 :Float32;\n unfilteredSpeedUncertainty @22 :Float32;\n\n multipathEstimate @23 :UInt32;\n azimuth @24 :Float32;\n elevation @25 :Float32;\n dopplerAcceleration @26 :Float32;\n fineSpeed @27 :Float32;\n fineSpeedUncertainty @28 :Float32;\n\n carrierPhase @29 :Float64;\n fCount @30 :UInt32;\n\n parityErrorCount @31 :UInt16;\n goodParity @32 :Bool;\n }\n }\n\n struct DrSvPolyReport {\n svId @0 :UInt16;\n frequencyIndex @1 :Int8;\n\n hasPosition @2 :Bool;\n hasIono @3 :Bool;\n hasTropo @4 :Bool;\n hasElevation @5 :Bool;\n polyFromXtra @6 :Bool;\n hasSbasIono @7 :Bool;\n\n iode @8 :UInt16;\n t0 @9 :Float64;\n xyz0 @10 :List(Float64);\n xyzN @11 :List(Float64);\n other @12 :List(Float32);\n\n positionUncertainty @13 :Float32;\n ionoDelay @14 :Float32;\n ionoDot @15 :Float32;\n sbasIonoDelay @16 :Float32;\n sbasIonoDot @17 :Float32;\n tropoDelay @18 :Float32;\n elevation @19 :Float32;\n elevationDot @20 :Float32;\n elevationUncertainty @21 :Float32;\n\n velocityCoeff @22 :List(Float64);\n\n }\n}\n\nstruct LidarPts {\n r @0 :List(UInt16); # uint16 m*500.0\n theta @1 :List(UInt16); # uint16 deg*100.0\n reflect @2 :List(UInt8); # uint8 0-255\n\n # For storing out of file.\n idx @3 :UInt64;\n\n # For storing in file\n pkt @4 :Data;\n}\n\nstruct ProcLog {\n cpuTimes @0 :List(CPUTimes);\n mem @1 :Mem;\n procs @2 :List(Process);\n\n struct Process {\n pid @0 :Int32;\n name @1 :Text;\n state @2 :UInt8;\n ppid @3 :Int32;\n\n cpuUser @4 :Float32;\n cpuSystem @5 :Float32;\n cpuChildrenUser @6 :Float32;\n cpuChildrenSystem @7 :Float32;\n priority @8 :Int64;\n nice @9 :Int32;\n numThreads @10 :Int32;\n startTime @11 :Float64;\n\n memVms @12 :UInt64;\n memRss @13 :UInt64;\n\n processor @14 :Int32;\n\n cmdline @15 :List(Text);\n exe @16 :Text;\n }\n\n struct CPUTimes {\n cpuNum @0 :Int64;\n user @1 :Float32;\n nice @2 :Float32;\n system @3 :Float32;\n idle @4 :Float32;\n iowait @5 :Float32;\n irq @6 :Float32;\n softirq @7 :Float32;\n }\n\n struct Mem {\n total @0 :UInt64;\n free @1 :UInt64;\n available @2 :UInt64;\n buffers @3 :UInt64;\n cached @4 :UInt64;\n active @5 :UInt64;\n inactive @6 :UInt64;\n shared @7 :UInt64;\n }\n\n}\n\nstruct UbloxGnss {\n union {\n measurementReport @0 :MeasurementReport;\n ephemeris @1 :Ephemeris;\n ionoData @2 :IonoData;\n }\n\n struct MeasurementReport {\n #received time of week in gps time in seconds and gps week\n rcvTow @0 :Float64;\n gpsWeek @1 :UInt16;\n # leap seconds in seconds\n leapSeconds @2 :UInt16;\n # receiver status\n receiverStatus @3 :ReceiverStatus;\n # num of measurements to follow\n numMeas @4 :UInt8;\n measurements @5 :List(Measurement);\n\n struct ReceiverStatus {\n # leap seconds have been determined\n leapSecValid @0 :Bool;\n # Clock reset applied\n clkReset @1 :Bool;\n }\n\n struct Measurement {\n svId @0 :UInt8;\n trackingStatus @1 :TrackingStatus;\n # pseudorange in meters\n pseudorange @2 :Float64;\n # carrier phase measurement in cycles\n carrierCycles @3 :Float64;\n # doppler measurement in Hz\n doppler @4 :Float32;\n # GNSS id, 0 is gps\n gnssId @5 :UInt8;\n glonassFrequencyIndex @6 :UInt8;\n # carrier phase locktime counter in ms\n locktime @7 :UInt16;\n # Carrier-to-noise density ratio (signal strength) in dBHz\n cno @8 :UInt8;\n # pseudorange standard deviation in meters\n pseudorangeStdev @9 :Float32;\n # carrier phase standard deviation in cycles\n carrierPhaseStdev @10 :Float32;\n # doppler standard deviation in Hz\n dopplerStdev @11 :Float32;\n sigId @12 :UInt8;\n\n struct TrackingStatus {\n # pseudorange valid\n pseudorangeValid @0 :Bool;\n # carrier phase valid\n carrierPhaseValid @1 :Bool;\n # half cycle valid\n halfCycleValid @2 :Bool;\n # half sycle subtracted from phase\n halfCycleSubtracted @3 :Bool;\n }\n }\n }\n\n struct Ephemeris {\n # This is according to the rinex (2?) format\n svId @0 :UInt16;\n year @1 :UInt16;\n month @2 :UInt16;\n day @3 :UInt16;\n hour @4 :UInt16;\n minute @5 :UInt16;\n second @6 :Float32;\n af0 @7 :Float64;\n af1 @8 :Float64;\n af2 @9 :Float64;\n\n iode @10 :Float64;\n crs @11 :Float64;\n deltaN @12 :Float64;\n m0 @13 :Float64;\n\n cuc @14 :Float64;\n ecc @15 :Float64;\n cus @16 :Float64;\n a @17 :Float64; # note that this is not the root!!\n\n toe @18 :Float64;\n cic @19 :Float64;\n omega0 @20 :Float64;\n cis @21 :Float64;\n\n i0 @22 :Float64;\n crc @23 :Float64;\n omega @24 :Float64;\n omegaDot @25 :Float64;\n\n iDot @26 :Float64;\n codesL2 @27 :Float64;\n gpsWeek @28 :Float64;\n l2 @29 :Float64;\n\n svAcc @30 :Float64;\n svHealth @31 :Float64;\n tgd @32 :Float64;\n iodc @33 :Float64;\n\n transmissionTime @34 :Float64;\n fitInterval @35 :Float64;\n\n toc @36 :Float64;\n\n ionoCoeffsValid @37 :Bool;\n ionoAlpha @38 :List(Float64);\n ionoBeta @39 :List(Float64);\n\n }\n\n struct IonoData {\n svHealth @0 :UInt32;\n tow @1 :Float64;\n gpsWeek @2 :Float64;\n\n ionoAlpha @3 :List(Float64);\n ionoBeta @4 :List(Float64);\n\n healthValid @5 :Bool;\n ionoCoeffsValid @6 :Bool;\n }\n}\n\n\nstruct Clocks {\n bootTimeNanos @0 :UInt64;\n monotonicNanos @1 :UInt64;\n monotonicRawNanos @2 :UInt64;\n wallTimeNanos @3 :UInt64;\n modemUptimeMillis @4 :UInt64;\n}\n\nstruct LiveMpcData {\n x @0 :List(Float32);\n y @1 :List(Float32);\n psi @2 :List(Float32);\n delta @3 :List(Float32);\n qpIterations @4 :UInt32;\n calculationTime @5 :UInt64;\n cost @6 :Float64;\n}\n\nstruct LiveLongitudinalMpcData {\n xEgo @0 :List(Float32);\n vEgo @1 :List(Float32);\n aEgo @2 :List(Float32);\n xLead @3 :List(Float32);\n vLead @4 :List(Float32);\n aLead @5 :List(Float32);\n aLeadTau @6 :Float32; # lead accel time constant\n qpIterations @7 :UInt32;\n mpcId @8 :UInt32;\n calculationTime @9 :UInt64;\n cost @10 :Float64;\n}\n\n\nstruct ECEFPointDEPRECATED @0xe10e21168db0c7f7 {\n x @0 :Float32;\n y @1 :Float32;\n z @2 :Float32;\n}\n\nstruct ECEFPoint @0xc25bbbd524983447 {\n x @0 :Float64;\n y @1 :Float64;\n z @2 :Float64;\n}\n\nstruct GPSPlannerPoints {\n curPosDEPRECATED @0 :ECEFPointDEPRECATED;\n pointsDEPRECATED @1 :List(ECEFPointDEPRECATED);\n curPos @6 :ECEFPoint;\n points @7 :List(ECEFPoint);\n valid @2 :Bool;\n trackName @3 :Text;\n speedLimit @4 :Float32;\n accelTarget @5 :Float32;\n}\n\nstruct GPSPlannerPlan {\n valid @0 :Bool;\n poly @1 :List(Float32);\n trackName @2 :Text;\n speed @3 :Float32;\n acceleration @4 :Float32;\n pointsDEPRECATED @5 :List(ECEFPointDEPRECATED);\n points @6 :List(ECEFPoint);\n xLookahead @7 :Float32;\n}\n\nstruct TrafficEvent @0xacfa74a094e62626 {\n type @0 :Type;\n distance @1 :Float32;\n action @2 :Action;\n resuming @3 :Bool;\n\n enum Type {\n stopSign @0;\n lightRed @1;\n lightYellow @2;\n lightGreen @3;\n stopLight @4;\n }\n\n enum Action {\n none @0;\n yield @1;\n stop @2;\n resumeReady @3;\n }\n\n}\n\nstruct OrbslamCorrection {\n correctionMonoTime @0 :UInt64;\n prePositionECEF @1 :List(Float64);\n postPositionECEF @2 :List(Float64);\n prePoseQuatECEF @3 :List(Float32);\n postPoseQuatECEF @4 :List(Float32);\n numInliers @5 :UInt32;\n}\n\nstruct OrbObservation {\n observationMonoTime @0 :UInt64;\n normalizedCoordinates @1 :List(Float32);\n locationECEF @2 :List(Float64);\n matchDistance @3: UInt32;\n}\n\nstruct UiNavigationEvent {\n type @0: Type;\n status @1: Status;\n distanceTo @2: Float32;\n endRoadPointDEPRECATED @3: ECEFPointDEPRECATED;\n endRoadPoint @4: ECEFPoint;\n\n enum Type {\n none @0;\n laneChangeLeft @1;\n laneChangeRight @2;\n mergeLeft @3;\n mergeRight @4;\n turnLeft @5;\n turnRight @6;\n }\n\n enum Status {\n none @0;\n passive @1;\n approaching @2;\n active @3;\n }\n}\n\nstruct UiLayoutState {\n activeApp @0 :App;\n sidebarCollapsed @1 :Bool;\n mapEnabled @2 :Bool;\n\n enum App {\n home @0;\n music @1;\n nav @2;\n }\n}\n\nstruct Joystick {\n # convenient for debug and live tuning\n axes @0: List(Float32);\n buttons @1: List(Bool);\n}\n\nstruct OrbOdometry {\n # timing first\n startMonoTime @0 :UInt64;\n endMonoTime @1 :UInt64;\n\n # fundamental matrix and error\n f @2: List(Float64);\n err @3: Float64;\n\n # number of inlier points\n inliers @4: Int32;\n\n # for debug only\n # indexed by endMonoTime features\n # value is startMonoTime feature match\n # -1 if no match\n matches @5: List(Int16);\n}\n\nstruct OrbFeatures {\n timestampEof @0 :UInt64;\n # transposed arrays of normalized image coordinates\n # len(xs) == len(ys) == len(descriptors) * 32\n xs @1 :List(Float32);\n ys @2 :List(Float32);\n descriptors @3 :Data;\n octaves @4 :List(Int8);\n\n # match index to last OrbFeatures\n # -1 if no match\n timestampLastEof @5 :UInt64;\n matches @6: List(Int16);\n}\n\nstruct OrbFeaturesSummary {\n timestampEof @0 :UInt64;\n timestampLastEof @1 :UInt64;\n\n featureCount @2 :UInt16;\n matchCount @3 :UInt16;\n computeNs @4 :UInt64;\n}\n\nstruct OrbKeyFrame {\n # this is a globally unique id for the KeyFrame\n id @0: UInt64;\n\n # this is the location of the KeyFrame\n pos @1: ECEFPoint;\n\n # these are the features in the world\n # len(dpos) == len(descriptors) * 32\n dpos @2 :List(ECEFPoint);\n descriptors @3 :Data;\n}\n\nstruct DriverMonitoring {\n frameId @0 :UInt32;\n descriptorDEPRECATED @1 :List(Float32);\n stdDEPRECATED @2 :Float32;\n faceOrientation @3 :List(Float32);\n facePosition @4 :List(Float32);\n faceProb @5 :Float32;\n leftEyeProb @6 :Float32;\n rightEyeProb @7 :Float32;\n leftBlinkProb @8 :Float32;\n rightBlinkProb @9 :Float32;\n irPwr @10 :Float32;\n}\n\nstruct Boot {\n wallTimeNanos @0 :UInt64;\n lastKmsg @1 :Data;\n lastPmsg @2 :Data;\n}\n\nstruct LiveParametersData {\n valid @0 :Bool;\n gyroBias @1 :Float32;\n angleOffset @2 :Float32;\n angleOffsetAverage @3 :Float32;\n stiffnessFactor @4 :Float32;\n steerRatio @5 :Float32;\n sensorValid @6 :Bool;\n yawRate @7 :Float32;\n posenetSpeed @8 :Float32;\n posenetValid @9 :Bool;\n}\n\nstruct LiveMapData {\n speedLimitValid @0 :Bool;\n speedLimit @1 :Float32;\n speedAdvisoryValid @12 :Bool;\n speedAdvisory @13 :Float32;\n speedLimitAheadValid @14 :Bool;\n speedLimitAhead @15 :Float32;\n speedLimitAheadDistance @16 :Float32;\n curvatureValid @2 :Bool;\n curvature @3 :Float32;\n wayId @4 :UInt64;\n roadX @5 :List(Float32);\n roadY @6 :List(Float32);\n lastGps @7: GpsLocationData;\n roadCurvatureX @8 :List(Float32);\n roadCurvature @9 :List(Float32);\n distToTurn @10 :Float32;\n mapValid @11 :Bool;\n}\n\nstruct CameraOdometry {\n frameId @4 :UInt32;\n timestampEof @5 :UInt64;\n trans @0 :List(Float32); # m\/s in device frame\n rot @1 :List(Float32); # rad\/s in device frame\n transStd @2 :List(Float32); # std m\/s in device frame\n rotStd @3 :List(Float32); # std rad\/s in device frame\n}\n\nstruct KalmanOdometry {\n trans @0 :List(Float32); # m\/s in device frame\n rot @1 :List(Float32); # rad\/s in device frame\n transStd @2 :List(Float32); # std m\/s in device frame\n rotStd @3 :List(Float32); # std rad\/s in device frame\n}\n\nstruct Event {\n # in nanoseconds?\n logMonoTime @0 :UInt64;\n valid @67 :Bool = true;\n\n union {\n initData @1 :InitData;\n frame @2 :FrameData;\n gpsNMEA @3 :GPSNMEAData;\n sensorEventDEPRECATED @4 :SensorEventData;\n can @5 :List(CanData);\n thermal @6 :ThermalData;\n controlsState @7 :ControlsState;\n liveEventDEPRECATED @8 :List(LiveEventData);\n model @9 :ModelData;\n features @10 :CalibrationFeatures;\n sensorEvents @11 :List(SensorEventData);\n health @12 :HealthData;\n radarState @13 :RadarState;\n liveUIDEPRECATED @14 :LiveUI;\n encodeIdx @15 :EncodeIndex;\n liveTracks @16 :List(LiveTracks);\n sendcan @17 :List(CanData);\n logMessage @18 :Text;\n liveCalibration @19 :LiveCalibrationData;\n androidLogEntry @20 :AndroidLogEntry;\n gpsLocation @21 :GpsLocationData;\n carState @22 :Car.CarState;\n carControl @23 :Car.CarControl;\n plan @24 :Plan;\n liveLocation @25 :LiveLocationData;\n ethernetData @26 :List(EthernetPacket);\n navUpdate @27 :NavUpdate;\n cellInfo @28 :List(CellInfo);\n wifiScan @29 :List(WifiScan);\n androidGnss @30 :AndroidGnss;\n qcomGnss @31 :QcomGnss;\n lidarPts @32 :LidarPts;\n procLog @33 :ProcLog;\n ubloxGnss @34 :UbloxGnss;\n clocks @35 :Clocks;\n liveMpc @36 :LiveMpcData;\n liveLongitudinalMpc @37 :LiveLongitudinalMpcData;\n navStatus @38 :NavStatus;\n ubloxRaw @39 :Data;\n gpsPlannerPoints @40 :GPSPlannerPoints;\n gpsPlannerPlan @41 :GPSPlannerPlan;\n applanixRaw @42 :Data;\n trafficEvents @43 :List(TrafficEvent);\n liveLocationTiming @44 :LiveLocationData;\n orbslamCorrectionDEPRECATED @45 :OrbslamCorrection;\n liveLocationCorrected @46 :LiveLocationData;\n orbObservation @47 :List(OrbObservation);\n gpsLocationExternal @48 :GpsLocationData;\n location @49 :LiveLocationData;\n uiNavigationEvent @50 :UiNavigationEvent;\n liveLocationKalman @51 :LiveLocationData;\n testJoystick @52 :Joystick;\n orbOdometry @53 :OrbOdometry;\n orbFeatures @54 :OrbFeatures;\n applanixLocation @55 :LiveLocationData;\n orbKeyFrame @56 :OrbKeyFrame;\n uiLayoutState @57 :UiLayoutState;\n orbFeaturesSummary @58 :OrbFeaturesSummary;\n driverMonitoring @59 :DriverMonitoring;\n boot @60 :Boot;\n liveParameters @61 :LiveParametersData;\n liveMapData @62 :LiveMapData;\n cameraOdometry @63 :CameraOdometry;\n pathPlan @64 :PathPlan;\n kalmanOdometry @65 :KalmanOdometry;\n thumbnail @66: Thumbnail;\n carEvents @68: List(Car.CarEvent);\n carParams @69: Car.CarParams;\n }\n}\n","old_contents":"using Cxx = import \".\/include\/c++.capnp\";\n$Cxx.namespace(\"cereal\");\n\nusing Java = import \".\/include\/java.capnp\";\n$Java.package(\"ai.comma.openpilot.cereal\");\n$Java.outerClassname(\"Log\");\n\nusing Car = import \"car.capnp\";\n\n@0xf3b1f17e25a4285b;\n\nconst logVersion :Int32 = 1;\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n\nstruct InitData {\n kernelArgs @0 :List(Text);\n kernelVersion @15 :Text;\n\n gctx @1 :Text;\n dongleId @2 :Text;\n\n deviceType @3 :DeviceType;\n version @4 :Text;\n gitCommit @10 :Text;\n gitBranch @11 :Text;\n gitRemote @13 :Text;\n\n androidBuildInfo @5 :AndroidBuildInfo;\n androidSensors @6 :List(AndroidSensor);\n androidProperties @16 :Map(Text, Text);\n chffrAndroidExtra @7 :ChffrAndroidExtra;\n iosBuildInfo @14 :IosBuildInfo;\n\n pandaInfo @8 :PandaInfo;\n\n dirty @9 :Bool;\n passive @12 :Bool;\n params @17 :Map(Text, Text);\n\n enum DeviceType {\n unknown @0;\n neo @1;\n chffrAndroid @2;\n chffrIos @3;\n }\n\n struct AndroidBuildInfo {\n board @0 :Text;\n bootloader @1 :Text;\n brand @2 :Text;\n device @3 :Text;\n display @4 :Text;\n fingerprint @5 :Text;\n hardware @6 :Text;\n host @7 :Text;\n id @8 :Text;\n manufacturer @9 :Text;\n model @10 :Text;\n product @11 :Text;\n radioVersion @12 :Text;\n serial @13 :Text;\n supportedAbis @14 :List(Text);\n tags @15 :Text;\n time @16 :Int64;\n type @17 :Text;\n user @18 :Text;\n\n versionCodename @19 :Text;\n versionRelease @20 :Text;\n versionSdk @21 :Int32;\n versionSecurityPatch @22 :Text;\n }\n\n struct AndroidSensor {\n id @0 :Int32;\n name @1 :Text;\n vendor @2 :Text;\n version @3 :Int32;\n handle @4 :Int32;\n type @5 :Int32;\n maxRange @6 :Float32;\n resolution @7 :Float32;\n power @8 :Float32;\n minDelay @9 :Int32;\n fifoReservedEventCount @10 :UInt32;\n fifoMaxEventCount @11 :UInt32;\n stringType @12 :Text;\n maxDelay @13 :Int32;\n }\n\n struct ChffrAndroidExtra {\n allCameraCharacteristics @0 :Map(Text, Text);\n }\n\n struct IosBuildInfo {\n appVersion @0 :Text;\n appBuild @1 :UInt32;\n osVersion @2 :Text;\n deviceModel @3 :Text;\n }\n\n struct PandaInfo {\n hasPanda @0 :Bool;\n dongleId @1 :Text;\n stVersion @2 :Text;\n espVersion @3 :Text;\n }\n}\n\nstruct FrameData {\n frameId @0 :UInt32;\n encodeId @1 :UInt32; # DEPRECATED\n timestampEof @2 :UInt64;\n frameLength @3 :Int32;\n integLines @4 :Int32;\n globalGain @5 :Int32;\n lensPos @11 :Int32;\n lensSag @12 :Float32;\n lensErr @13 :Float32;\n lensTruePos @14 :Float32;\n image @6 :Data;\n\n frameType @7 :FrameType;\n timestampSof @8 :UInt64;\n transform @10 :List(Float32);\n\n androidCaptureResult @9 :AndroidCaptureResult;\n\n enum FrameType {\n unknown @0;\n neo @1;\n chffrAndroid @2;\n }\n\n struct AndroidCaptureResult {\n sensitivity @0 :Int32;\n frameDuration @1 :Int64;\n exposureTime @2 :Int64;\n rollingShutterSkew @3 :UInt64;\n colorCorrectionTransform @4 :List(Int32);\n colorCorrectionGains @5 :List(Float32);\n displayRotation @6 :Int8;\n }\n}\n\nstruct Thumbnail {\n frameId @0 :UInt32;\n timestampEof @1 :UInt64;\n thumbnail @2 :Data;\n}\n\nstruct GPSNMEAData {\n timestamp @0 :Int64;\n localWallTime @1 :UInt64;\n nmea @2 :Text;\n}\n\n# android sensor_event_t\nstruct SensorEventData {\n version @0 :Int32;\n sensor @1 :Int32;\n type @2 :Int32;\n timestamp @3 :Int64;\n uncalibratedDEPRECATED @10 :Bool;\n\n union {\n acceleration @4 :SensorVec;\n magnetic @5 :SensorVec;\n orientation @6 :SensorVec;\n gyro @7 :SensorVec;\n pressure @9 :SensorVec;\n magneticUncalibrated @11 :SensorVec;\n gyroUncalibrated @12 :SensorVec;\n proximity @13: Float32;\n light @14: Float32;\n }\n source @8 :SensorSource;\n\n struct SensorVec {\n v @0 :List(Float32);\n status @1 :Int8;\n }\n\n enum SensorSource {\n android @0;\n iOS @1;\n fiber @2;\n velodyne @3; # Velodyne IMU\n bno055 @4; # Bosch accelerometer\n lsm6ds3 @5; # accelerometer (c2)\n bmp280 @6; # barometer (c2)\n mmc3416x @7; # magnetometer (c2)\n }\n}\n\n# android struct GpsLocation\nstruct GpsLocationData {\n # Contains GpsLocationFlags bits.\n flags @0 :UInt16;\n\n # Represents latitude in degrees.\n latitude @1 :Float64;\n\n # Represents longitude in degrees.\n longitude @2 :Float64;\n\n # Represents altitude in meters above the WGS 84 reference ellipsoid.\n altitude @3 :Float64;\n\n # Represents speed in meters per second.\n speed @4 :Float32;\n\n # Represents heading in degrees.\n bearing @5 :Float32;\n\n # Represents expected accuracy in meters. (presumably 1 sigma?)\n accuracy @6 :Float32;\n\n # Timestamp for the location fix.\n # Milliseconds since January 1, 1970.\n timestamp @7 :Int64;\n\n source @8 :SensorSource;\n\n # Represents NED velocity in m\/s.\n vNED @9 :List(Float32);\n\n # Represents expected vertical accuracy in meters. (presumably 1 sigma?)\n verticalAccuracy @10 :Float32;\n\n # Represents bearing accuracy in degrees. (presumably 1 sigma?)\n bearingAccuracy @11 :Float32;\n\n # Represents velocity accuracy in m\/s. (presumably 1 sigma?)\n speedAccuracy @12 :Float32;\n\n enum SensorSource {\n android @0;\n iOS @1;\n car @2;\n velodyne @3; # Velodyne IMU\n fusion @4;\n external @5;\n ublox @6;\n trimble @7;\n }\n}\n\nstruct CanData {\n address @0 :UInt32;\n busTime @1 :UInt16;\n dat @2 :Data;\n src @3 :UInt8;\n}\n\nstruct ThermalData {\n cpu0 @0 :UInt16;\n cpu1 @1 :UInt16;\n cpu2 @2 :UInt16;\n cpu3 @3 :UInt16;\n mem @4 :UInt16;\n gpu @5 :UInt16;\n bat @6 :UInt32;\n\n # not thermal\n freeSpace @7 :Float32;\n batteryPercent @8 :Int16;\n batteryStatus @9 :Text;\n batteryCurrent @15 :Int32;\n batteryVoltage @16 :Int32;\n usbOnline @12 :Bool;\n\n fanSpeed @10 :UInt16;\n started @11 :Bool;\n startedTs @13 :UInt64;\n\n thermalStatus @14 :ThermalStatus;\n chargingError @17 :Bool;\n chargingDisabled @18 :Bool;\n\n enum ThermalStatus {\n green @0; # all processes run\n yellow @1; # critical processes run (kill uploader), engage still allowed\n red @2; # no engage, will disengage\n danger @3; # immediate process shutdown\n }\n}\n\nstruct HealthData {\n # from can health\n voltage @0 :UInt32;\n current @1 :UInt32;\n started @2 :Bool;\n controlsAllowed @3 :Bool;\n gasInterceptorDetected @4 :Bool;\n startedSignalDetectedDeprecated @5 :Bool;\n hasGps @6 :Bool;\n canSendErrs @7 :UInt32;\n canFwdErrs @8 :UInt32;\n gmlanSendErrs @9 :UInt32;\n hwType @10 :HwType;\n fanSpeedRpm @11 :UInt16;\n usbPowerMode @12 :UsbPowerMode;\n\n enum HwType {\n unknown @0;\n whitePanda @1;\n greyPanda @2;\n blackPanda @3;\n pedal @4;\n uno @5;\n }\n\n enum UsbPowerMode {\n none @0;\n client @1;\n cdp @2;\n dcp @3;\n }\n}\n\nstruct LiveUI {\n rearViewCam @0 :Bool;\n alertText1 @1 :Text;\n alertText2 @2 :Text;\n awarenessStatus @3 :Float32;\n}\n\nstruct RadarState @0x9a185389d6fdd05f {\n canMonoTimes @10 :List(UInt64);\n mdMonoTime @6 :UInt64;\n ftMonoTimeDEPRECATED @7 :UInt64;\n controlsStateMonoTime @11 :UInt64;\n radarErrors @12 :List(Car.RadarData.Error);\n\n # all deprecated\n warpMatrixDEPRECATED @0 :List(Float32);\n angleOffsetDEPRECATED @1 :Float32;\n calStatusDEPRECATED @2 :Int8;\n calCycleDEPRECATED @8 :Int32;\n calPercDEPRECATED @9 :Int8;\n\n leadOne @3 :LeadData;\n leadTwo @4 :LeadData;\n cumLagMs @5 :Float32;\n\n struct LeadData {\n dRel @0 :Float32;\n yRel @1 :Float32;\n vRel @2 :Float32;\n aRel @3 :Float32;\n vLead @4 :Float32;\n aLeadDEPRECATED @5 :Float32;\n dPath @6 :Float32;\n vLat @7 :Float32;\n vLeadK @8 :Float32;\n aLeadK @9 :Float32;\n fcw @10 :Bool;\n status @11 :Bool;\n aLeadTau @12 :Float32;\n modelProb @13 :Float32;\n radar @14 :Bool;\n }\n}\n\nstruct LiveCalibrationData {\n # deprecated\n warpMatrix @0 :List(Float32);\n # camera_frame_from_model_frame\n warpMatrix2 @5 :List(Float32);\n warpMatrixBig @6 :List(Float32);\n calStatus @1 :Int8;\n calCycle @2 :Int32;\n calPerc @3 :Int8;\n\n # view_frame_from_road_frame\n # ui's is inversed needs new\n extrinsicMatrix @4 :List(Float32);\n # the direction of travel vector in device frame\n rpyCalib @7 :List(Float32);\n}\n\nstruct LiveTracks {\n trackId @0 :Int32;\n dRel @1 :Float32;\n yRel @2 :Float32;\n vRel @3 :Float32;\n aRel @4 :Float32;\n timeStamp @5 :Float32;\n status @6 :Float32;\n currentTime @7 :Float32;\n stationary @8 :Bool;\n oncoming @9 :Bool;\n}\n\nstruct ControlsState @0x97ff69c53601abf1 {\n canMonoTimeDEPRECATED @16 :UInt64;\n canMonoTimes @21 :List(UInt64);\n radarStateMonoTimeDEPRECATED @17 :UInt64;\n mdMonoTimeDEPRECATED @18 :UInt64;\n planMonoTime @28 :UInt64;\n pathPlanMonoTime @50 :UInt64;\n\n state @31 :OpenpilotState;\n vEgo @0 :Float32;\n vEgoRaw @32 :Float32;\n aEgoDEPRECATED @1 :Float32;\n longControlState @30 :LongControlState;\n vPid @2 :Float32;\n vTargetLead @3 :Float32;\n upAccelCmd @4 :Float32;\n uiAccelCmd @5 :Float32;\n ufAccelCmd @33 :Float32;\n yActualDEPRECATED @6 :Float32;\n yDesDEPRECATED @7 :Float32;\n upSteerDEPRECATED @8 :Float32;\n uiSteerDEPRECATED @9 :Float32;\n ufSteerDEPRECATED @34 :Float32;\n aTargetMinDEPRECATED @10 :Float32;\n aTargetMaxDEPRECATED @11 :Float32;\n aTarget @35 :Float32;\n jerkFactor @12 :Float32;\n angleSteers @13 :Float32; # Steering angle in degrees.\n angleSteersDes @29 :Float32;\n curvature @37 :Float32; # path curvature from vehicle model\n hudLeadDEPRECATED @14 :Int32;\n cumLagMs @15 :Float32;\n startMonoTime @48 :UInt64;\n mapValid @49 :Bool;\n forceDecel @51 :Bool;\n\n enabled @19 :Bool;\n active @36 :Bool;\n steerOverride @20 :Bool;\n\n vCruise @22 :Float32;\n\n rearViewCam @23 :Bool;\n alertText1 @24 :Text;\n alertText2 @25 :Text;\n alertStatus @38 :AlertStatus;\n alertSize @39 :AlertSize;\n alertBlinkingRate @42 :Float32;\n alertType @44 :Text;\n alertSoundDEPRECATED @45 :Text;\n alertSound @56 :Car.CarControl.HUDControl.AudibleAlert;\n awarenessStatus @26 :Float32;\n angleModelBiasDEPRECATED @27 :Float32;\n gpsPlannerActive @40 :Bool;\n engageable @41 :Bool; # can OP be engaged?\n driverMonitoringOn @43 :Bool;\n\n # maps\n vCurvature @46 :Float32;\n decelForTurn @47 :Bool;\n\n decelForModel @54 :Bool;\n\n lateralControlState :union {\n indiState @52 :LateralINDIState;\n pidState @53 :LateralPIDState;\n lqrState @55 :LateralLQRState;\n }\n\n enum OpenpilotState @0xdbe58b96d2d1ac61 {\n disabled @0;\n preEnabled @1;\n enabled @2;\n softDisabling @3;\n }\n\n enum LongControlState {\n off @0;\n pid @1;\n stopping @2;\n starting @3;\n }\n\n enum AlertStatus {\n normal @0; # low priority alert for user's convenience\n userPrompt @1; # mid piority alert that might require user intervention\n critical @2; # high priority alert that needs immediate user intervention\n }\n\n enum AlertSize {\n none @0; # don't display the alert\n small @1; # small box\n mid @2; # mid screen\n full @3; # full screen\n }\n\n struct LateralINDIState {\n active @0 :Bool;\n steerAngle @1 :Float32;\n steerRate @2 :Float32;\n steerAccel @3 :Float32;\n rateSetPoint @4 :Float32;\n accelSetPoint @5 :Float32;\n accelError @6 :Float32;\n delayedOutput @7 :Float32;\n delta @8 :Float32;\n output @9 :Float32;\n }\n\n struct LateralPIDState {\n active @0 :Bool;\n steerAngle @1 :Float32;\n steerRate @2 :Float32;\n angleError @3 :Float32;\n p @4 :Float32;\n i @5 :Float32;\n f @6 :Float32;\n output @7 :Float32;\n saturated @8 :Bool;\n }\n\n struct LateralLQRState {\n active @0 :Bool;\n steerAngle @1 :Float32;\n i @2 :Float32;\n output @3 :Float32;\n lqrOutput @4 :Float32;\n }\n\n\n}\n\nstruct LiveEventData {\n name @0 :Text;\n value @1 :Int32;\n}\n\nstruct ModelData {\n frameId @0 :UInt32;\n timestampEof @9 :UInt64;\n\n path @1 :PathData;\n leftLane @2 :PathData;\n rightLane @3 :PathData;\n lead @4 :LeadData;\n freePath @6 :List(Float32);\n\n settings @5 :ModelSettings;\n leadFuture @7 :LeadData;\n speed @8 :List(Float32);\n\n struct PathData {\n points @0 :List(Float32);\n prob @1 :Float32;\n std @2 :Float32;\n stds @3 :List(Float32);\n poly @4 :List(Float32);\n }\n\n struct LeadData {\n dist @0 :Float32;\n prob @1 :Float32;\n std @2 :Float32;\n relVel @3 :Float32;\n relVelStd @4 :Float32;\n relY @5 :Float32;\n relYStd @6 :Float32;\n relA @7 :Float32;\n relAStd @8 :Float32;\n }\n\n struct ModelSettings {\n bigBoxX @0 :UInt16;\n bigBoxY @1 :UInt16;\n bigBoxWidth @2 :UInt16;\n bigBoxHeight @3 :UInt16;\n boxProjection @4 :List(Float32);\n yuvCorrection @5 :List(Float32);\n inputTransform @6 :List(Float32);\n }\n}\n\nstruct CalibrationFeatures {\n frameId @0 :UInt32;\n\n p0 @1 :List(Float32);\n p1 @2 :List(Float32);\n status @3 :List(Int8);\n}\n\nstruct EncodeIndex {\n # picture from camera\n frameId @0 :UInt32;\n type @1 :Type;\n # index of encoder from start of route\n encodeId @2 :UInt32;\n # minute long segment this frame is in\n segmentNum @3 :Int32;\n # index into camera file in segment in presentation order\n segmentId @4 :UInt32;\n # index into camera file in segment in encode order\n segmentIdEncode @5 :UInt32;\n\n enum Type {\n bigBoxLossless @0; # rcamera.mkv\n fullHEVC @1; # fcamera.hevc\n bigBoxHEVC @2; # bcamera.hevc\n chffrAndroidH264 @3; # acamera\n fullLosslessClip @4; # prcamera.mkv\n front @5; # dcamera.hevc\n }\n}\n\nstruct AndroidLogEntry {\n id @0 :UInt8;\n ts @1 :UInt64;\n priority @2 :UInt8;\n pid @3 :Int32;\n tid @4 :Int32;\n tag @5 :Text;\n message @6 :Text;\n}\n\nstruct LogRotate {\n segmentNum @0 :Int32;\n path @1 :Text;\n}\n\nstruct Plan {\n mdMonoTime @9 :UInt64;\n radarStateMonoTime @10 :UInt64;\n commIssue @31 :Bool;\n\n eventsDEPRECATED @13 :List(Car.CarEvent);\n\n # lateral, 3rd order polynomial\n lateralValidDEPRECATED @0 :Bool;\n dPolyDEPRECATED @1 :List(Float32);\n laneWidthDEPRECATED @11 :Float32;\n\n # longitudinal\n longitudinalValidDEPRECATED @2 :Bool;\n vCruise @16 :Float32;\n aCruise @17 :Float32;\n vTarget @3 :Float32;\n vTargetFuture @14 :Float32;\n vMax @20 :Float32;\n aTargetMinDEPRECATED @4 :Float32;\n aTargetMaxDEPRECATED @5 :Float32;\n aTarget @18 :Float32;\n\n vStart @26 :Float32;\n aStart @27 :Float32;\n\n jerkFactor @6 :Float32;\n hasLead @7 :Bool;\n hasLeftLaneDEPRECATED @23 :Bool;\n hasRightLaneDEPRECATED @24 :Bool;\n fcw @8 :Bool;\n longitudinalPlanSource @15 :LongitudinalPlanSource;\n\n # gps trajectory in car frame\n gpsTrajectory @12 :GpsTrajectory;\n\n gpsPlannerActive @19 :Bool;\n\n # maps\n vCurvature @21 :Float32;\n decelForTurn @22 :Bool;\n mapValid @25 :Bool;\n radarValid @28 :Bool;\n radarCanError @30 :Bool;\n\n processingDelay @29 :Float32;\n\n\n struct GpsTrajectory {\n x @0 :List(Float32);\n y @1 :List(Float32);\n }\n\n enum LongitudinalPlanSource {\n cruise @0;\n mpc1 @1;\n mpc2 @2;\n mpc3 @3;\n model @4;\n }\n}\n\nstruct PathPlan {\n laneWidth @0 :Float32;\n\n dPoly @1 :List(Float32);\n cPoly @2 :List(Float32);\n cProb @3 :Float32;\n lPoly @4 :List(Float32);\n lProb @5 :Float32;\n rPoly @6 :List(Float32);\n rProb @7 :Float32;\n\n angleSteers @8 :Float32; # deg\n rateSteers @13 :Float32; # deg\/s\n mpcSolutionValid @9 :Bool;\n paramsValid @10 :Bool;\n modelValidDEPRECATED @12 :Bool;\n angleOffset @11 :Float32;\n sensorValid @14 :Bool;\n commIssue @15 :Bool;\n posenetValid @16 :Bool;\n desire @17 :Desire;\n laneChangeState @18 :LaneChangeState;\n laneChangeDirection @19 :LaneChangeDirection;\n\n enum Desire {\n none @0;\n turnLeft @1;\n turnRight @2;\n laneChangeLeft @3;\n laneChangeRight @4;\n keepLeft @5;\n keepRight @6;\n }\n\n enum LaneChangeState {\n off @0;\n preLaneChange @1;\n laneChangeStarting @2;\n laneChangeFinishing @3;\n }\n\n enum LaneChangeDirection {\n none @0;\n left @1;\n right @2;\n }\n}\n\nstruct LiveLocationData {\n status @0 :UInt8;\n\n # 3D fix\n lat @1 :Float64;\n lon @2 :Float64;\n alt @3 :Float32; # m\n\n # speed\n speed @4 :Float32; # m\/s\n\n # NED velocity components\n vNED @5 :List(Float32);\n\n # roll, pitch, heading (x,y,z)\n roll @6 :Float32; # WRT to center of earth?\n pitch @7 :Float32; # WRT to center of earth?\n heading @8 :Float32; # WRT to north?\n\n # what are these?\n wanderAngle @9 :Float32;\n trackAngle @10 :Float32;\n\n # car frame -- https:\/\/upload.wikimedia.org\/wikipedia\/commons\/f\/f5\/RPY_angles_of_cars.png\n\n # gyro, in car frame, deg\/s\n gyro @11 :List(Float32);\n\n # accel, in car frame, m\/s^2\n accel @12 :List(Float32);\n\n accuracy @13 :Accuracy;\n\n source @14 :SensorSource;\n # if we are fixing a location in the past\n fixMonoTime @15 :UInt64;\n\n gpsWeek @16 :Int32;\n timeOfWeek @17 :Float64;\n\n positionECEF @18 :List(Float64);\n poseQuatECEF @19 :List(Float32);\n pitchCalibration @20 :Float32;\n yawCalibration @21 :Float32;\n imuFrame @22 :List(Float32);\n\n struct Accuracy {\n pNEDError @0 :List(Float32);\n vNEDError @1 :List(Float32);\n rollError @2 :Float32;\n pitchError @3 :Float32;\n headingError @4 :Float32;\n ellipsoidSemiMajorError @5 :Float32;\n ellipsoidSemiMinorError @6 :Float32;\n ellipsoidOrientationError @7 :Float32;\n }\n\n enum SensorSource {\n applanix @0;\n kalman @1;\n orbslam @2;\n timing @3;\n dummy @4;\n }\n}\n\nstruct EthernetPacket {\n pkt @0 :Data;\n ts @1 :Float32;\n}\n\nstruct NavUpdate {\n isNavigating @0 :Bool;\n curSegment @1 :Int32;\n segments @2 :List(Segment);\n\n struct LatLng {\n lat @0 :Float64;\n lng @1 :Float64;\n }\n\n struct Segment {\n from @0 :LatLng;\n to @1 :LatLng;\n updateTime @2 :Int32;\n distance @3 :Int32;\n crossTime @4 :Int32;\n exitNo @5 :Int32;\n instruction @6 :Instruction;\n\n parts @7 :List(LatLng);\n\n enum Instruction {\n turnLeft @0;\n turnRight @1;\n keepLeft @2;\n keepRight @3;\n straight @4;\n roundaboutExitNumber @5;\n roundaboutExit @6;\n roundaboutTurnLeft @7;\n unkn8 @8;\n roundaboutStraight @9;\n unkn10 @10;\n roundaboutTurnRight @11;\n unkn12 @12;\n roundaboutUturn @13;\n unkn14 @14;\n arrive @15;\n exitLeft @16;\n exitRight @17;\n unkn18 @18;\n uturn @19;\n # ...\n }\n }\n}\n\nstruct NavStatus {\n isNavigating @0 :Bool;\n currentAddress @1 :Address;\n\n struct Address {\n title @0 :Text;\n lat @1 :Float64;\n lng @2 :Float64;\n house @3 :Text;\n address @4 :Text;\n street @5 :Text;\n city @6 :Text;\n state @7 :Text;\n country @8 :Text;\n }\n}\n\nstruct CellInfo {\n timestamp @0 :UInt64;\n repr @1 :Text; # android toString() for now\n}\n\nstruct WifiScan {\n bssid @0 :Text;\n ssid @1 :Text;\n capabilities @2 :Text;\n frequency @3 :Int32;\n level @4 :Int32;\n timestamp @5 :Int64;\n\n centerFreq0 @6 :Int32;\n centerFreq1 @7 :Int32;\n channelWidth @8 :ChannelWidth;\n operatorFriendlyName @9 :Text;\n venueName @10 :Text;\n is80211mcResponder @11 :Bool;\n passpoint @12 :Bool;\n\n distanceCm @13 :Int32;\n distanceSdCm @14 :Int32;\n\n enum ChannelWidth {\n w20Mhz @0;\n w40Mhz @1;\n w80Mhz @2;\n w160Mhz @3;\n w80Plus80Mhz @4;\n }\n}\n\nstruct AndroidGnss {\n union {\n measurements @0 :Measurements;\n navigationMessage @1 :NavigationMessage;\n }\n\n struct Measurements {\n clock @0 :Clock;\n measurements @1 :List(Measurement);\n\n struct Clock {\n timeNanos @0 :Int64;\n hardwareClockDiscontinuityCount @1 :Int32;\n\n hasTimeUncertaintyNanos @2 :Bool;\n timeUncertaintyNanos @3 :Float64;\n\n hasLeapSecond @4 :Bool;\n leapSecond @5 :Int32;\n\n hasFullBiasNanos @6 :Bool;\n fullBiasNanos @7 :Int64;\n\n hasBiasNanos @8 :Bool;\n biasNanos @9 :Float64;\n\n hasBiasUncertaintyNanos @10 :Bool;\n biasUncertaintyNanos @11 :Float64;\n\n hasDriftNanosPerSecond @12 :Bool;\n driftNanosPerSecond @13 :Float64;\n\n hasDriftUncertaintyNanosPerSecond @14 :Bool;\n driftUncertaintyNanosPerSecond @15 :Float64;\n }\n\n struct Measurement {\n svId @0 :Int32;\n constellation @1 :Constellation;\n\n timeOffsetNanos @2 :Float64;\n state @3 :Int32;\n receivedSvTimeNanos @4 :Int64;\n receivedSvTimeUncertaintyNanos @5 :Int64;\n cn0DbHz @6 :Float64;\n pseudorangeRateMetersPerSecond @7 :Float64;\n pseudorangeRateUncertaintyMetersPerSecond @8 :Float64;\n accumulatedDeltaRangeState @9 :Int32;\n accumulatedDeltaRangeMeters @10 :Float64;\n accumulatedDeltaRangeUncertaintyMeters @11 :Float64;\n\n hasCarrierFrequencyHz @12 :Bool;\n carrierFrequencyHz @13 :Float32;\n hasCarrierCycles @14 :Bool;\n carrierCycles @15 :Int64;\n hasCarrierPhase @16 :Bool;\n carrierPhase @17 :Float64;\n hasCarrierPhaseUncertainty @18 :Bool;\n carrierPhaseUncertainty @19 :Float64;\n hasSnrInDb @20 :Bool;\n snrInDb @21 :Float64;\n\n multipathIndicator @22 :MultipathIndicator;\n\n enum Constellation {\n unknown @0;\n gps @1;\n sbas @2;\n glonass @3;\n qzss @4;\n beidou @5;\n galileo @6;\n }\n\n enum State {\n unknown @0;\n codeLock @1;\n bitSync @2;\n subframeSync @3;\n towDecoded @4;\n msecAmbiguous @5;\n symbolSync @6;\n gloStringSync @7;\n gloTodDecoded @8;\n bdsD2BitSync @9;\n bdsD2SubframeSync @10;\n galE1bcCodeLock @11;\n galE1c2ndCodeLock @12;\n galE1bPageSync @13;\n sbasSync @14;\n }\n\n enum MultipathIndicator {\n unknown @0;\n detected @1;\n notDetected @2;\n }\n }\n }\n\n struct NavigationMessage {\n type @0 :Int32;\n svId @1 :Int32;\n messageId @2 :Int32;\n submessageId @3 :Int32;\n data @4 :Data;\n status @5 :Status;\n\n enum Status {\n unknown @0;\n parityPassed @1;\n parityRebuilt @2;\n }\n }\n}\n\nstruct QcomGnss {\n logTs @0 :UInt64;\n union {\n measurementReport @1 :MeasurementReport;\n clockReport @2 :ClockReport;\n drMeasurementReport @3 :DrMeasurementReport;\n drSvPoly @4 :DrSvPolyReport;\n rawLog @5 :Data;\n }\n\n enum MeasurementSource @0xd71a12b6faada7ee {\n gps @0;\n glonass @1;\n beidou @2;\n }\n\n enum SVObservationState @0xe81e829a0d6c83e9 {\n idle @0;\n search @1;\n searchVerify @2;\n bitEdge @3;\n trackVerify @4;\n track @5;\n restart @6;\n dpo @7;\n glo10msBe @8;\n glo10msAt @9;\n }\n\n struct MeasurementStatus @0xe501010e1bcae83b {\n subMillisecondIsValid @0 :Bool;\n subBitTimeIsKnown @1 :Bool;\n satelliteTimeIsKnown @2 :Bool;\n bitEdgeConfirmedFromSignal @3 :Bool;\n measuredVelocity @4 :Bool;\n fineOrCoarseVelocity @5 :Bool;\n lockPointValid @6 :Bool;\n lockPointPositive @7 :Bool;\n lastUpdateFromDifference @8 :Bool;\n lastUpdateFromVelocityDifference @9 :Bool;\n strongIndicationOfCrossCorelation @10 :Bool;\n tentativeMeasurement @11 :Bool;\n measurementNotUsable @12 :Bool;\n sirCheckIsNeeded @13 :Bool;\n probationMode @14 :Bool;\n\n glonassMeanderBitEdgeValid @15 :Bool;\n glonassTimeMarkValid @16 :Bool;\n\n gpsRoundRobinRxDiversity @17 :Bool;\n gpsRxDiversity @18 :Bool;\n gpsLowBandwidthRxDiversityCombined @19 :Bool;\n gpsHighBandwidthNu4 @20 :Bool;\n gpsHighBandwidthNu8 @21 :Bool;\n gpsHighBandwidthUniform @22 :Bool;\n multipathIndicator @23 :Bool;\n\n imdJammingIndicator @24 :Bool;\n lteB13TxJammingIndicator @25 :Bool;\n freshMeasurementIndicator @26 :Bool;\n\n multipathEstimateIsValid @27 :Bool;\n directionIsValid @28 :Bool;\n }\n\n struct MeasurementReport {\n source @0 :MeasurementSource;\n\n fCount @1 :UInt32;\n\n gpsWeek @2 :UInt16;\n glonassCycleNumber @3 :UInt8;\n glonassNumberOfDays @4 :UInt16;\n\n milliseconds @5 :UInt32;\n timeBias @6 :Float32;\n clockTimeUncertainty @7 :Float32;\n clockFrequencyBias @8 :Float32;\n clockFrequencyUncertainty @9 :Float32;\n\n sv @10 :List(SV);\n\n struct SV {\n svId @0 :UInt8;\n observationState @2 :SVObservationState;\n observations @3 :UInt8;\n goodObservations @4 :UInt8;\n gpsParityErrorCount @5 :UInt16;\n glonassFrequencyIndex @1 :Int8;\n glonassHemmingErrorCount @6 :UInt8;\n filterStages @7 :UInt8;\n carrierNoise @8 :UInt16;\n latency @9 :Int16;\n predetectInterval @10 :UInt8;\n postdetections @11 :UInt16;\n\n unfilteredMeasurementIntegral @12 :UInt32;\n unfilteredMeasurementFraction @13 :Float32;\n unfilteredTimeUncertainty @14 :Float32;\n unfilteredSpeed @15 :Float32;\n unfilteredSpeedUncertainty @16 :Float32;\n measurementStatus @17 :MeasurementStatus;\n multipathEstimate @18 :UInt32;\n azimuth @19 :Float32;\n elevation @20 :Float32;\n carrierPhaseCyclesIntegral @21 :Int32;\n carrierPhaseCyclesFraction @22 :UInt16;\n fineSpeed @23 :Float32;\n fineSpeedUncertainty @24 :Float32;\n cycleSlipCount @25 :UInt8;\n }\n\n }\n\n struct ClockReport {\n hasFCount @0 :Bool;\n fCount @1 :UInt32;\n\n hasGpsWeek @2 :Bool;\n gpsWeek @3 :UInt16;\n hasGpsMilliseconds @4 :Bool;\n gpsMilliseconds @5 :UInt32;\n gpsTimeBias @6 :Float32;\n gpsClockTimeUncertainty @7 :Float32;\n gpsClockSource @8 :UInt8;\n\n hasGlonassYear @9 :Bool;\n glonassYear @10 :UInt8;\n hasGlonassDay @11 :Bool;\n glonassDay @12 :UInt16;\n hasGlonassMilliseconds @13 :Bool;\n glonassMilliseconds @14 :UInt32;\n glonassTimeBias @15 :Float32;\n glonassClockTimeUncertainty @16 :Float32;\n glonassClockSource @17 :UInt8;\n\n bdsWeek @18 :UInt16;\n bdsMilliseconds @19 :UInt32;\n bdsTimeBias @20 :Float32;\n bdsClockTimeUncertainty @21 :Float32;\n bdsClockSource @22 :UInt8;\n\n galWeek @23 :UInt16;\n galMilliseconds @24 :UInt32;\n galTimeBias @25 :Float32;\n galClockTimeUncertainty @26 :Float32;\n galClockSource @27 :UInt8;\n\n clockFrequencyBias @28 :Float32;\n clockFrequencyUncertainty @29 :Float32;\n frequencySource @30 :UInt8;\n gpsLeapSeconds @31 :UInt8;\n gpsLeapSecondsUncertainty @32 :UInt8;\n gpsLeapSecondsSource @33 :UInt8;\n\n gpsToGlonassTimeBiasMilliseconds @34 :Float32;\n gpsToGlonassTimeBiasMillisecondsUncertainty @35 :Float32;\n gpsToBdsTimeBiasMilliseconds @36 :Float32;\n gpsToBdsTimeBiasMillisecondsUncertainty @37 :Float32;\n bdsToGloTimeBiasMilliseconds @38 :Float32;\n bdsToGloTimeBiasMillisecondsUncertainty @39 :Float32;\n gpsToGalTimeBiasMilliseconds @40 :Float32;\n gpsToGalTimeBiasMillisecondsUncertainty @41 :Float32;\n galToGloTimeBiasMilliseconds @42 :Float32;\n galToGloTimeBiasMillisecondsUncertainty @43 :Float32;\n galToBdsTimeBiasMilliseconds @44 :Float32;\n galToBdsTimeBiasMillisecondsUncertainty @45 :Float32;\n\n hasRtcTime @46 :Bool;\n systemRtcTime @47 :UInt32;\n fCountOffset @48 :UInt32;\n lpmRtcCount @49 :UInt32;\n clockResets @50 :UInt32;\n }\n\n struct DrMeasurementReport {\n\n reason @0 :UInt8;\n seqNum @1 :UInt8;\n seqMax @2 :UInt8;\n rfLoss @3 :UInt16;\n\n systemRtcValid @4 :Bool;\n fCount @5 :UInt32;\n clockResets @6 :UInt32;\n systemRtcTime @7 :UInt64;\n\n gpsLeapSeconds @8 :UInt8;\n gpsLeapSecondsUncertainty @9 :UInt8;\n gpsToGlonassTimeBiasMilliseconds @10 :Float32;\n gpsToGlonassTimeBiasMillisecondsUncertainty @11 :Float32;\n\n gpsWeek @12 :UInt16;\n gpsMilliseconds @13 :UInt32;\n gpsTimeBiasMs @14 :UInt32;\n gpsClockTimeUncertaintyMs @15 :UInt32;\n gpsClockSource @16 :UInt8;\n\n glonassClockSource @17 :UInt8;\n glonassYear @18 :UInt8;\n glonassDay @19 :UInt16;\n glonassMilliseconds @20 :UInt32;\n glonassTimeBias @21 :Float32;\n glonassClockTimeUncertainty @22 :Float32;\n\n clockFrequencyBias @23 :Float32;\n clockFrequencyUncertainty @24 :Float32;\n frequencySource @25 :UInt8;\n\n source @26 :MeasurementSource;\n\n sv @27 :List(SV);\n\n struct SV {\n svId @0 :UInt8;\n glonassFrequencyIndex @1 :Int8;\n observationState @2 :SVObservationState;\n observations @3 :UInt8;\n goodObservations @4 :UInt8;\n filterStages @5 :UInt8;\n predetectInterval @6 :UInt8;\n cycleSlipCount @7 :UInt8;\n postdetections @8 :UInt16;\n\n measurementStatus @9 :MeasurementStatus;\n\n carrierNoise @10 :UInt16;\n rfLoss @11 :UInt16;\n latency @12 :Int16;\n\n filteredMeasurementFraction @13 :Float32;\n filteredMeasurementIntegral @14 :UInt32;\n filteredTimeUncertainty @15 :Float32;\n filteredSpeed @16 :Float32;\n filteredSpeedUncertainty @17 :Float32;\n\n unfilteredMeasurementFraction @18 :Float32;\n unfilteredMeasurementIntegral @19 :UInt32;\n unfilteredTimeUncertainty @20 :Float32;\n unfilteredSpeed @21 :Float32;\n unfilteredSpeedUncertainty @22 :Float32;\n\n multipathEstimate @23 :UInt32;\n azimuth @24 :Float32;\n elevation @25 :Float32;\n dopplerAcceleration @26 :Float32;\n fineSpeed @27 :Float32;\n fineSpeedUncertainty @28 :Float32;\n\n carrierPhase @29 :Float64;\n fCount @30 :UInt32;\n\n parityErrorCount @31 :UInt16;\n goodParity @32 :Bool;\n }\n }\n\n struct DrSvPolyReport {\n svId @0 :UInt16;\n frequencyIndex @1 :Int8;\n\n hasPosition @2 :Bool;\n hasIono @3 :Bool;\n hasTropo @4 :Bool;\n hasElevation @5 :Bool;\n polyFromXtra @6 :Bool;\n hasSbasIono @7 :Bool;\n\n iode @8 :UInt16;\n t0 @9 :Float64;\n xyz0 @10 :List(Float64);\n xyzN @11 :List(Float64);\n other @12 :List(Float32);\n\n positionUncertainty @13 :Float32;\n ionoDelay @14 :Float32;\n ionoDot @15 :Float32;\n sbasIonoDelay @16 :Float32;\n sbasIonoDot @17 :Float32;\n tropoDelay @18 :Float32;\n elevation @19 :Float32;\n elevationDot @20 :Float32;\n elevationUncertainty @21 :Float32;\n\n velocityCoeff @22 :List(Float64);\n\n }\n}\n\nstruct LidarPts {\n r @0 :List(UInt16); # uint16 m*500.0\n theta @1 :List(UInt16); # uint16 deg*100.0\n reflect @2 :List(UInt8); # uint8 0-255\n\n # For storing out of file.\n idx @3 :UInt64;\n\n # For storing in file\n pkt @4 :Data;\n}\n\nstruct ProcLog {\n cpuTimes @0 :List(CPUTimes);\n mem @1 :Mem;\n procs @2 :List(Process);\n\n struct Process {\n pid @0 :Int32;\n name @1 :Text;\n state @2 :UInt8;\n ppid @3 :Int32;\n\n cpuUser @4 :Float32;\n cpuSystem @5 :Float32;\n cpuChildrenUser @6 :Float32;\n cpuChildrenSystem @7 :Float32;\n priority @8 :Int64;\n nice @9 :Int32;\n numThreads @10 :Int32;\n startTime @11 :Float64;\n\n memVms @12 :UInt64;\n memRss @13 :UInt64;\n\n processor @14 :Int32;\n\n cmdline @15 :List(Text);\n exe @16 :Text;\n }\n\n struct CPUTimes {\n cpuNum @0 :Int64;\n user @1 :Float32;\n nice @2 :Float32;\n system @3 :Float32;\n idle @4 :Float32;\n iowait @5 :Float32;\n irq @6 :Float32;\n softirq @7 :Float32;\n }\n\n struct Mem {\n total @0 :UInt64;\n free @1 :UInt64;\n available @2 :UInt64;\n buffers @3 :UInt64;\n cached @4 :UInt64;\n active @5 :UInt64;\n inactive @6 :UInt64;\n shared @7 :UInt64;\n }\n\n}\n\nstruct UbloxGnss {\n union {\n measurementReport @0 :MeasurementReport;\n ephemeris @1 :Ephemeris;\n ionoData @2 :IonoData;\n }\n\n struct MeasurementReport {\n #received time of week in gps time in seconds and gps week\n rcvTow @0 :Float64;\n gpsWeek @1 :UInt16;\n # leap seconds in seconds\n leapSeconds @2 :UInt16;\n # receiver status\n receiverStatus @3 :ReceiverStatus;\n # num of measurements to follow\n numMeas @4 :UInt8;\n measurements @5 :List(Measurement);\n\n struct ReceiverStatus {\n # leap seconds have been determined\n leapSecValid @0 :Bool;\n # Clock reset applied\n clkReset @1 :Bool;\n }\n\n struct Measurement {\n svId @0 :UInt8;\n trackingStatus @1 :TrackingStatus;\n # pseudorange in meters\n pseudorange @2 :Float64;\n # carrier phase measurement in cycles\n carrierCycles @3 :Float64;\n # doppler measurement in Hz\n doppler @4 :Float32;\n # GNSS id, 0 is gps\n gnssId @5 :UInt8;\n glonassFrequencyIndex @6 :UInt8;\n # carrier phase locktime counter in ms\n locktime @7 :UInt16;\n # Carrier-to-noise density ratio (signal strength) in dBHz\n cno @8 :UInt8;\n # pseudorange standard deviation in meters\n pseudorangeStdev @9 :Float32;\n # carrier phase standard deviation in cycles\n carrierPhaseStdev @10 :Float32;\n # doppler standard deviation in Hz\n dopplerStdev @11 :Float32;\n sigId @12 :UInt8;\n\n struct TrackingStatus {\n # pseudorange valid\n pseudorangeValid @0 :Bool;\n # carrier phase valid\n carrierPhaseValid @1 :Bool;\n # half cycle valid\n halfCycleValid @2 :Bool;\n # half sycle subtracted from phase\n halfCycleSubtracted @3 :Bool;\n }\n }\n }\n\n struct Ephemeris {\n # This is according to the rinex (2?) format\n svId @0 :UInt16;\n year @1 :UInt16;\n month @2 :UInt16;\n day @3 :UInt16;\n hour @4 :UInt16;\n minute @5 :UInt16;\n second @6 :Float32;\n af0 @7 :Float64;\n af1 @8 :Float64;\n af2 @9 :Float64;\n\n iode @10 :Float64;\n crs @11 :Float64;\n deltaN @12 :Float64;\n m0 @13 :Float64;\n\n cuc @14 :Float64;\n ecc @15 :Float64;\n cus @16 :Float64;\n a @17 :Float64; # note that this is not the root!!\n\n toe @18 :Float64;\n cic @19 :Float64;\n omega0 @20 :Float64;\n cis @21 :Float64;\n\n i0 @22 :Float64;\n crc @23 :Float64;\n omega @24 :Float64;\n omegaDot @25 :Float64;\n\n iDot @26 :Float64;\n codesL2 @27 :Float64;\n gpsWeek @28 :Float64;\n l2 @29 :Float64;\n\n svAcc @30 :Float64;\n svHealth @31 :Float64;\n tgd @32 :Float64;\n iodc @33 :Float64;\n\n transmissionTime @34 :Float64;\n fitInterval @35 :Float64;\n\n toc @36 :Float64;\n\n ionoCoeffsValid @37 :Bool;\n ionoAlpha @38 :List(Float64);\n ionoBeta @39 :List(Float64);\n\n }\n\n struct IonoData {\n svHealth @0 :UInt32;\n tow @1 :Float64;\n gpsWeek @2 :Float64;\n\n ionoAlpha @3 :List(Float64);\n ionoBeta @4 :List(Float64);\n\n healthValid @5 :Bool;\n ionoCoeffsValid @6 :Bool;\n }\n}\n\n\nstruct Clocks {\n bootTimeNanos @0 :UInt64;\n monotonicNanos @1 :UInt64;\n monotonicRawNanos @2 :UInt64;\n wallTimeNanos @3 :UInt64;\n modemUptimeMillis @4 :UInt64;\n}\n\nstruct LiveMpcData {\n x @0 :List(Float32);\n y @1 :List(Float32);\n psi @2 :List(Float32);\n delta @3 :List(Float32);\n qpIterations @4 :UInt32;\n calculationTime @5 :UInt64;\n cost @6 :Float64;\n}\n\nstruct LiveLongitudinalMpcData {\n xEgo @0 :List(Float32);\n vEgo @1 :List(Float32);\n aEgo @2 :List(Float32);\n xLead @3 :List(Float32);\n vLead @4 :List(Float32);\n aLead @5 :List(Float32);\n aLeadTau @6 :Float32; # lead accel time constant\n qpIterations @7 :UInt32;\n mpcId @8 :UInt32;\n calculationTime @9 :UInt64;\n cost @10 :Float64;\n}\n\n\nstruct ECEFPointDEPRECATED @0xe10e21168db0c7f7 {\n x @0 :Float32;\n y @1 :Float32;\n z @2 :Float32;\n}\n\nstruct ECEFPoint @0xc25bbbd524983447 {\n x @0 :Float64;\n y @1 :Float64;\n z @2 :Float64;\n}\n\nstruct GPSPlannerPoints {\n curPosDEPRECATED @0 :ECEFPointDEPRECATED;\n pointsDEPRECATED @1 :List(ECEFPointDEPRECATED);\n curPos @6 :ECEFPoint;\n points @7 :List(ECEFPoint);\n valid @2 :Bool;\n trackName @3 :Text;\n speedLimit @4 :Float32;\n accelTarget @5 :Float32;\n}\n\nstruct GPSPlannerPlan {\n valid @0 :Bool;\n poly @1 :List(Float32);\n trackName @2 :Text;\n speed @3 :Float32;\n acceleration @4 :Float32;\n pointsDEPRECATED @5 :List(ECEFPointDEPRECATED);\n points @6 :List(ECEFPoint);\n xLookahead @7 :Float32;\n}\n\nstruct TrafficEvent @0xacfa74a094e62626 {\n type @0 :Type;\n distance @1 :Float32;\n action @2 :Action;\n resuming @3 :Bool;\n\n enum Type {\n stopSign @0;\n lightRed @1;\n lightYellow @2;\n lightGreen @3;\n stopLight @4;\n }\n\n enum Action {\n none @0;\n yield @1;\n stop @2;\n resumeReady @3;\n }\n\n}\n\nstruct OrbslamCorrection {\n correctionMonoTime @0 :UInt64;\n prePositionECEF @1 :List(Float64);\n postPositionECEF @2 :List(Float64);\n prePoseQuatECEF @3 :List(Float32);\n postPoseQuatECEF @4 :List(Float32);\n numInliers @5 :UInt32;\n}\n\nstruct OrbObservation {\n observationMonoTime @0 :UInt64;\n normalizedCoordinates @1 :List(Float32);\n locationECEF @2 :List(Float64);\n matchDistance @3: UInt32;\n}\n\nstruct UiNavigationEvent {\n type @0: Type;\n status @1: Status;\n distanceTo @2: Float32;\n endRoadPointDEPRECATED @3: ECEFPointDEPRECATED;\n endRoadPoint @4: ECEFPoint;\n\n enum Type {\n none @0;\n laneChangeLeft @1;\n laneChangeRight @2;\n mergeLeft @3;\n mergeRight @4;\n turnLeft @5;\n turnRight @6;\n }\n\n enum Status {\n none @0;\n passive @1;\n approaching @2;\n active @3;\n }\n}\n\nstruct UiLayoutState {\n activeApp @0 :App;\n sidebarCollapsed @1 :Bool;\n mapEnabled @2 :Bool;\n\n enum App {\n home @0;\n music @1;\n nav @2;\n }\n}\n\nstruct Joystick {\n # convenient for debug and live tuning\n axes @0: List(Float32);\n buttons @1: List(Bool);\n}\n\nstruct OrbOdometry {\n # timing first\n startMonoTime @0 :UInt64;\n endMonoTime @1 :UInt64;\n\n # fundamental matrix and error\n f @2: List(Float64);\n err @3: Float64;\n\n # number of inlier points\n inliers @4: Int32;\n\n # for debug only\n # indexed by endMonoTime features\n # value is startMonoTime feature match\n # -1 if no match\n matches @5: List(Int16);\n}\n\nstruct OrbFeatures {\n timestampEof @0 :UInt64;\n # transposed arrays of normalized image coordinates\n # len(xs) == len(ys) == len(descriptors) * 32\n xs @1 :List(Float32);\n ys @2 :List(Float32);\n descriptors @3 :Data;\n octaves @4 :List(Int8);\n\n # match index to last OrbFeatures\n # -1 if no match\n timestampLastEof @5 :UInt64;\n matches @6: List(Int16);\n}\n\nstruct OrbFeaturesSummary {\n timestampEof @0 :UInt64;\n timestampLastEof @1 :UInt64;\n\n featureCount @2 :UInt16;\n matchCount @3 :UInt16;\n computeNs @4 :UInt64;\n}\n\nstruct OrbKeyFrame {\n # this is a globally unique id for the KeyFrame\n id @0: UInt64;\n\n # this is the location of the KeyFrame\n pos @1: ECEFPoint;\n\n # these are the features in the world\n # len(dpos) == len(descriptors) * 32\n dpos @2 :List(ECEFPoint);\n descriptors @3 :Data;\n}\n\nstruct DriverMonitoring {\n frameId @0 :UInt32;\n descriptorDEPRECATED @1 :List(Float32);\n stdDEPRECATED @2 :Float32;\n faceOrientation @3 :List(Float32);\n facePosition @4 :List(Float32);\n faceProb @5 :Float32;\n leftEyeProb @6 :Float32;\n rightEyeProb @7 :Float32;\n leftBlinkProb @8 :Float32;\n rightBlinkProb @9 :Float32;\n}\n\nstruct Boot {\n wallTimeNanos @0 :UInt64;\n lastKmsg @1 :Data;\n lastPmsg @2 :Data;\n}\n\nstruct LiveParametersData {\n valid @0 :Bool;\n gyroBias @1 :Float32;\n angleOffset @2 :Float32;\n angleOffsetAverage @3 :Float32;\n stiffnessFactor @4 :Float32;\n steerRatio @5 :Float32;\n sensorValid @6 :Bool;\n yawRate @7 :Float32;\n posenetSpeed @8 :Float32;\n posenetValid @9 :Bool;\n}\n\nstruct LiveMapData {\n speedLimitValid @0 :Bool;\n speedLimit @1 :Float32;\n speedAdvisoryValid @12 :Bool;\n speedAdvisory @13 :Float32;\n speedLimitAheadValid @14 :Bool;\n speedLimitAhead @15 :Float32;\n speedLimitAheadDistance @16 :Float32;\n curvatureValid @2 :Bool;\n curvature @3 :Float32;\n wayId @4 :UInt64;\n roadX @5 :List(Float32);\n roadY @6 :List(Float32);\n lastGps @7: GpsLocationData;\n roadCurvatureX @8 :List(Float32);\n roadCurvature @9 :List(Float32);\n distToTurn @10 :Float32;\n mapValid @11 :Bool;\n}\n\nstruct CameraOdometry {\n frameId @4 :UInt32;\n timestampEof @5 :UInt64;\n trans @0 :List(Float32); # m\/s in device frame\n rot @1 :List(Float32); # rad\/s in device frame\n transStd @2 :List(Float32); # std m\/s in device frame\n rotStd @3 :List(Float32); # std rad\/s in device frame\n}\n\nstruct KalmanOdometry {\n trans @0 :List(Float32); # m\/s in device frame\n rot @1 :List(Float32); # rad\/s in device frame\n transStd @2 :List(Float32); # std m\/s in device frame\n rotStd @3 :List(Float32); # std rad\/s in device frame\n}\n\nstruct Event {\n # in nanoseconds?\n logMonoTime @0 :UInt64;\n valid @67 :Bool = true;\n\n union {\n initData @1 :InitData;\n frame @2 :FrameData;\n gpsNMEA @3 :GPSNMEAData;\n sensorEventDEPRECATED @4 :SensorEventData;\n can @5 :List(CanData);\n thermal @6 :ThermalData;\n controlsState @7 :ControlsState;\n liveEventDEPRECATED @8 :List(LiveEventData);\n model @9 :ModelData;\n features @10 :CalibrationFeatures;\n sensorEvents @11 :List(SensorEventData);\n health @12 :HealthData;\n radarState @13 :RadarState;\n liveUIDEPRECATED @14 :LiveUI;\n encodeIdx @15 :EncodeIndex;\n liveTracks @16 :List(LiveTracks);\n sendcan @17 :List(CanData);\n logMessage @18 :Text;\n liveCalibration @19 :LiveCalibrationData;\n androidLogEntry @20 :AndroidLogEntry;\n gpsLocation @21 :GpsLocationData;\n carState @22 :Car.CarState;\n carControl @23 :Car.CarControl;\n plan @24 :Plan;\n liveLocation @25 :LiveLocationData;\n ethernetData @26 :List(EthernetPacket);\n navUpdate @27 :NavUpdate;\n cellInfo @28 :List(CellInfo);\n wifiScan @29 :List(WifiScan);\n androidGnss @30 :AndroidGnss;\n qcomGnss @31 :QcomGnss;\n lidarPts @32 :LidarPts;\n procLog @33 :ProcLog;\n ubloxGnss @34 :UbloxGnss;\n clocks @35 :Clocks;\n liveMpc @36 :LiveMpcData;\n liveLongitudinalMpc @37 :LiveLongitudinalMpcData;\n navStatus @38 :NavStatus;\n ubloxRaw @39 :Data;\n gpsPlannerPoints @40 :GPSPlannerPoints;\n gpsPlannerPlan @41 :GPSPlannerPlan;\n applanixRaw @42 :Data;\n trafficEvents @43 :List(TrafficEvent);\n liveLocationTiming @44 :LiveLocationData;\n orbslamCorrectionDEPRECATED @45 :OrbslamCorrection;\n liveLocationCorrected @46 :LiveLocationData;\n orbObservation @47 :List(OrbObservation);\n gpsLocationExternal @48 :GpsLocationData;\n location @49 :LiveLocationData;\n uiNavigationEvent @50 :UiNavigationEvent;\n liveLocationKalman @51 :LiveLocationData;\n testJoystick @52 :Joystick;\n orbOdometry @53 :OrbOdometry;\n orbFeatures @54 :OrbFeatures;\n applanixLocation @55 :LiveLocationData;\n orbKeyFrame @56 :OrbKeyFrame;\n uiLayoutState @57 :UiLayoutState;\n orbFeaturesSummary @58 :OrbFeaturesSummary;\n driverMonitoring @59 :DriverMonitoring;\n boot @60 :Boot;\n liveParameters @61 :LiveParametersData;\n liveMapData @62 :LiveMapData;\n cameraOdometry @63 :CameraOdometry;\n pathPlan @64 :PathPlan;\n kalmanOdometry @65 :KalmanOdometry;\n thumbnail @66: Thumbnail;\n carEvents @68: List(Car.CarEvent);\n carParams @69: Car.CarParams;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"2cb6195591153dc6b6c2c62a8df7aab90eb012b7","subject":"Release v0.10.0-rc4","message":"Release v0.10.0-rc4\n","repos":"GhassenRjab\/wekan,wykeith\/cp2m,ddanssaert\/wekan,mario-orlicky\/wekan,AdrianoCahete\/wekan,GhassenRjab\/wekan,Serubin\/wekan,oliver4u\/WEKAN_runpartner,wykeith\/cp2m,AdrianoCahete\/wekan,araczkowski\/paczka.pro,johnleeming\/wekan,GhassenRjab\/wekan,felipecosta07\/js,wekan\/wekan,mario-orlicky\/wekan,AlexanderS\/wekan,jtickle\/wekan,jtickle\/wekan,nztqa\/wekan,atFriendly\/wekan,oliver4u\/WEKAN_runpartner,wekan\/wekan,nztqa\/wekan,mario-orlicky\/wekan,araczkowski\/paczka.pro,johnleeming\/wekan,pro-to-tip\/wekan,FSFTN\/Wekan,johnleeming\/wekan,ahmadassaf\/libreboard,oliver4u\/sap-wekan,Serubin\/wekan,felipecosta07\/js,johnleeming\/wekan,wekan\/wekan,jtickle\/wekan,nztqa\/wekan,oliver4u\/sap-wekan,gelojavonitalla\/wekan,floatinghotpot\/wekan,wekan\/wekan,ahmadassaf\/libreboard,floatinghotpot\/wekan,araczkowski\/paczka.pro,ddanssaert\/wekan,ahmadassaf\/libreboard,Serubin\/wekan,wekan\/wekan,pro-to-tip\/wekan,libreboard\/libreboard,atFriendly\/wekan,Xperterra\/wekan,Xperterra\/wekan,AlexanderS\/wekan,oliver4u\/sap-wekan,libreboard\/libreboard,gelojavonitalla\/wekan,oliver4u\/WEKAN_runpartner,ddanssaert\/wekan,FSFTN\/Wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 8,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10-rc4\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 7,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10-rc3\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"b9c40e4366d2bacc586e2b1faf58d15686013a4d","subject":"Define 'Disembargo' RPC message for optimistically enforcing E-order across promise resolution.","message":"Define 'Disembargo' RPC message for optimistically enforcing E-order across promise resolution.\n","repos":"hntrmrrs\/capnproto,martindale\/capnproto,mrdomino\/capnproto,mologie\/capnproto,modulexcite\/capnproto,martindale\/capnproto,khklau\/capnproto,pjulien\/capnproto,maurer\/capnproto,artillery\/capnproto,johnkdoe\/capnproto,khklau\/capnproto,mrdomino\/capnproto,maurer\/capnproto,nagyistoce\/capnproto,vladon\/capnproto,bryce-gibson\/capnproto,MarPiRK\/capnproto,MarPiRK\/capnproto,kamalmarhubi\/capnproto,joliss\/capnproto,vladon\/capnproto,kamalmarhubi\/capnproto,hntrmrrs\/capnproto,martindale\/capnproto,zarvox\/capnproto,rcrowder\/capnproto,Fraser999\/capnproto,bryce-gibson\/capnproto,geofft\/capnproto,artillery\/capnproto,a-richardson\/capnproto,pjulien\/capnproto,rcrowder\/capnproto,mologie\/capnproto,bryce-gibson\/capnproto,artillery\/capnproto,bsn069\/capnproto,johnkdoe\/capnproto,geofft\/capnproto,zarvox\/capnproto,modulexcite\/capnproto,a-richardson\/capnproto,hntrmrrs\/capnproto,bsn069\/capnproto,jparyani\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,mologie\/capnproto,nagyistoce\/capnproto,ocdtrekkie\/capnproto,ocdtrekkie\/capnproto,mrdomino\/capnproto,geofft\/capnproto,bsn069\/capnproto,pjulien\/capnproto,ligzy\/capnproto,ocdtrekkie\/capnproto,vladon\/capnproto,MarPiRK\/capnproto,Fraser999\/capnproto,maurer\/capnproto,modulexcite\/capnproto,kamalmarhubi\/capnproto,jparyani\/capnproto,zarvox\/capnproto,nagyistoce\/capnproto,a-richardson\/capnproto,ligzy\/capnproto,jparyani\/capnproto,joliss\/capnproto,Fraser999\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,khklau\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n params @5 :Object;\n # The params struct. The fields of this struct correspond to the parameters of the method.\n #\n # The params may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n\n sendReturnTo :union {\n # Where should the return message be sent?\n\n caller @6 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @7 :QuestionId;\n # **(level 1)**\n #\n # This is actually an echo of a call originally made by the receiver, with the given question\n # ID. The result of this call should directly resolve the original call, without ever sending\n # a `Return` over the wire.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # - The `Call` for bar'() has `sendReturnTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A does *not* send a `Return` message to Vat B. Instead, it\n # directly returns the result to Alice.\n # - Vat A then sends a `Finish` message for bar().\n # - Vat B, on receiving the `Finish`, sends a corresponding `Finish` for bar'().\n # - Neither bar() nor bar'() ever see a `Return` message sent over the wire.\n\n thirdParty @8 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains a `redirect` to Vat C. When Vat A sends an `Accept` to Vat C,\n # it receives back a `Return` containing the call's actual result. Vat C never sends a `Return`\n # to Vat B, although `Finish` messages must still be sent corresponding to every `Call` as well\n # as the `Accept`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the params to which the callee continues to hold references. Any\n # other capabilities from the params are implicitly released.\n\n union {\n results @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `results` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n\n redirect @6 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The call has been redirected to another vat, and the result should be obtained by connecting\n # to that vat directly. An `Accept` message sent to the vat will return the result. See\n # `Call.sendReturnTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n #\n # TODO(soon): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller hasn't yet finished processing the response.\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the results to which the callee continues to hold references. Any\n # other capabilities from the results that need to be released are implicitly released along\n # with the result itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, which eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n\n target :union {\n # What is to be disembargoed.\n\n exportedCap @0 :ExportId;\n # An exported capability.\n\n promisedAnswer @1 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @2 :EmbargoId;\n # The sender is requesting a disembargo on a promise which is known to resolve back to a\n # capability hoste by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @3 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @4 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise which is known to resolve to a third-party\n # capability which the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @5 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the results of an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `ReleaseEmbargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `ReleaseEmbargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = Object;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = Object;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = Object;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n params @5 :Object;\n # The params struct. The fields of this struct correspond to the parameters of the method.\n #\n # The params may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n\n sendReturnTo :union {\n # Where should the return message be sent?\n\n caller @6 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @7 :QuestionId;\n # **(level 1)**\n #\n # This is actually an echo of a call originally made by the receiver, with the given question\n # ID. The result of this call should directly resolve the original call, without ever sending\n # a `Return` over the wire.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # - The `Call` for bar'() has `sendReturnTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A does *not* send a `Return` message to Vat B. Instead, it\n # directly returns the result to Alice.\n # - Vat A then sends a `Finish` message for bar().\n # - Vat B, on receiving the `Finish`, sends a corresponding `Finish` for bar'().\n # - Neither bar() nor bar'() ever see a `Return` message sent over the wire.\n\n thirdParty @8 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains a `redirect` to Vat C. When Vat A sends an `Accept` to Vat C,\n # it receives back a `Return` containing the call's actual result. Vat C never sends a `Return`\n # to Vat B, although `Finish` messages must still be sent corresponding to every `Call` as well\n # as the `Accept`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the params to which the callee continues to hold references. Any\n # other capabilities from the params are implicitly released.\n\n union {\n results @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `results` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n\n redirect @6 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The call has been redirected to another vat, and the result should be obtained by connecting\n # to that vat directly. An `Accept` message sent to the vat will return the result. See\n # `Call.sendReturnTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n #\n # TODO(soon): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller hasn't yet finished processing the response.\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the results to which the callee continues to hold references. Any\n # other capabilities from the results that need to be released are implicitly released along\n # with the result itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the results of an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = Object;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = Object;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = Object;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"14023a03905e2deb3240a880253254d07ba74fd5","subject":"clean up comment","message":"clean up comment\n","repos":"dwrensha\/capnproto-rust","old_file":"capnpc\/rust.capnp","new_file":"capnpc\/rust.capnp","new_contents":"@0x83b3c14c3c8dd083;\n\nannotation name @0xc2fe4c6d100166d0 (field, struct, enum, enumerant, union, group) :Text;\n# Rename something in the generated code. The value that you specify in this\n# annotation should follow capnp capitalization conventions. So, for example,\n# a struct should use CamelCase capitalization like `StructFoo`, even though\n# that will get translated to a `struct_foo` module in the generated Rust code.\n#\n# TODO: support annoting more kinds of things with this.\n","old_contents":"@0x83b3c14c3c8dd083;\n\nannotation name @0xc2fe4c6d100166d0 (field, struct, enum, enumerant, union, group) :Text;\n# Rename something in the generated code. The value that you specify in this\n# annotion must follow capnp capitalization conventions. So, for example,\n# a struct could be named `StructFoo`, even though that will get translated\n# to a `struct_foo` module in the generated Rust code.\n#\n# TODO: support annoting more kinds of things with this.\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"9cf1ce27ca6e7b1127b0fb2d81e0d406ed368829","subject":"better short description","message":"better short description\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"6bc62592323206b7119251d9742b20fe4577e825","subject":"don't need to set SANDSTORM environment variable","message":"don't need to set SANDSTORM environment variable\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 5, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.1.0\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/sandstorm-io\/collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n (width = 1096, height = 545, png = embed \"screenshots\/screenshot-1.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/collections-server\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 5, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.1.0\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/sandstorm-io\/collections-app\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n shortDescription = (defaultText = \"Grain list sharing\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n (width = 1096, height = 545, png = embed \"screenshots\/screenshot-1.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"085f2be93e1f41706b03b927ddaf23051756ccf1","subject":"add new fields appTitle and appMarketingVersion","message":"add new fields appTitle and appMarketingVersion\n","repos":"neynah\/hacker-slides,jacksingleton\/hacker-slides,neynah\/hacker-slides,paulproteus\/hacker-slides,nicolastrres\/hacker-slides,Eynaliyev\/hacker-slides,nicolastrres\/hacker-slides,Eynaliyev\/hacker-slides,jacksingleton\/hacker-slides,FFrancieli\/hacker-slides,jacksingleton\/hacker-slides,nicolastrres\/hacker-slides,paulproteus\/hacker-slides,FFrancieli\/hacker-slides,paulproteus\/hacker-slides,FFrancieli\/hacker-slides,jacksingleton\/hacker-slides,neynah\/hacker-slides,paulproteus\/hacker-slides,neynah\/hacker-slides,jacksingleton\/hacker-slides,FFrancieli\/hacker-slides,Eynaliyev\/hacker-slides,Eynaliyev\/hacker-slides,nicolastrres\/hacker-slides","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New HackerSlides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f0a13e64603d60111bdd6405a293b05526a6ac7a","subject":"Bump to v10","message":"Bump to v10\n","repos":"neynah\/GhostSS,neynah\/GhostSS,neynah\/GhostSS,jparyani\/GhostSS,jparyani\/GhostSS,jparyani\/GhostSS","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Ghost\"),\n\n appVersion = 10, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.2.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge-old\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 9, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"29a876efbc81e7d7f6347bf356bbf5e3e8efac89","subject":"Make sure to always include \"extras\" directory","message":"Make sure to always include \"extras\" directory\n","repos":"jparyani\/lets-chat,jparyani\/lets-chat,jparyani\/lets-chat","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.4.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"media\", \"templates\", \"extras\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.4.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"media\", \"templates\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"ddf9eacdfe49160fe31937203c092b28e059bfd5","subject":"Going to need to bump app version.","message":"Going to need to bump app version.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 6, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"reader\"),\n permissions = [false],\n verbPhrase = (defaultText = \"can read\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 5, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"reader\"),\n permissions = [false],\n verbPhrase = (defaultText = \"can read\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"a49d46ca7295d9d94546c9433b0e92a4a04fdb81","subject":"More RPC doc tweaks.","message":"More RPC doc tweaks.\n","repos":"martindale\/capnproto,kamalmarhubi\/capnproto,bsn069\/capnproto,a-richardson\/capnproto,vladon\/capnproto,khklau\/capnproto,bsn069\/capnproto,kamalmarhubi\/capnproto,pjulien\/capnproto,rcrowder\/capnproto,joliss\/capnproto,MarPiRK\/capnproto,mologie\/capnproto,bsn069\/capnproto,joliss\/capnproto,jparyani\/capnproto,martindale\/capnproto,modulexcite\/capnproto,zarvox\/capnproto,nagyistoce\/capnproto,ocdtrekkie\/capnproto,kamalmarhubi\/capnproto,maurer\/capnproto,maurer\/capnproto,vladon\/capnproto,ocdtrekkie\/capnproto,nagyistoce\/capnproto,Fraser999\/capnproto,khklau\/capnproto,khklau\/capnproto,bryce-gibson\/capnproto,maurer\/capnproto,rcrowder\/capnproto,artillery\/capnproto,modulexcite\/capnproto,MarPiRK\/capnproto,martindale\/capnproto,zarvox\/capnproto,hntrmrrs\/capnproto,joliss\/capnproto,hntrmrrs\/capnproto,bryce-gibson\/capnproto,hntrmrrs\/capnproto,geofft\/capnproto,mologie\/capnproto,jparyani\/capnproto,a-richardson\/capnproto,artillery\/capnproto,jparyani\/capnproto,rcrowder\/capnproto,artillery\/capnproto,ligzy\/capnproto,ocdtrekkie\/capnproto,Fraser999\/capnproto,johnkdoe\/capnproto,zarvox\/capnproto,pjulien\/capnproto,modulexcite\/capnproto,ligzy\/capnproto,MarPiRK\/capnproto,geofft\/capnproto,Fraser999\/capnproto,mrdomino\/capnproto,nagyistoce\/capnproto,vladon\/capnproto,mrdomino\/capnproto,mrdomino\/capnproto,a-richardson\/capnproto,pjulien\/capnproto,bryce-gibson\/capnproto,mologie\/capnproto,geofft\/capnproto,johnkdoe\/capnproto,johnkdoe\/capnproto,ligzy\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. Comments in this file indicate which level requires the corresponding\n# feature to be implemented -- if unspecified, the feature must be implemented at level 1.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction, but interactions between\n# three or more parties are supported only via proxying of objects. E.g. if Alice wants to send\n# Bob a capability pointing to Carol, Alice must host a local proxy of Carol and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support \"join\" or \"eq\" across capabilities received from different vats, although they\n# should be supported on capabilities received from the same vat.\n#\n# * **Level 2:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 3:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, \"Level 2\" is irrelevant and\n# \"Level 3\" is much easier than usual to implement. When such an implementation is actually run\n# inside a container, the contained app effectively gets to make full use of the container's\n# network at level 3. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a ReleaseAnswer\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `ReleaseAnswer`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 1 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n resolve @2 :Resolve; # Resolve a previously-sent promise.\n\n release @3 :Release; # Release a capability so that the remote object can be deallocated.\n releaseAnswer @4 :ReleaseAnswer; # Release a returned answer \/ cancel a call.\n\n restore @5 :Restore; # Restore a persistent capability from a previous connection.\n\n # Level 2 features -----------------------------------------------\n\n provide @6 :Provide; # Provide a capability to a third party.\n accept @7 :Accept; # Accept a capability provided by a third party.\n\n # Level 3 features -----------------------------------------------\n\n join @8 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\nstruct Call {\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching ReleaseAnswer has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `ReleaseAnswer` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a ReleaseAnswer message\n # before the call had completed.\n }\n}\n\nstruct Resolve {\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct ReleaseAnswer {\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\nstruct Restore {\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this restore message, which will eventually receive a Return\n # message containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Provide {\n # **Level 2 feature**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a ReleaseAnswer message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **Level 2 feature**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\nstruct Join {\n # **Level 3 feature**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `ReleaseAnswer`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `ReleaseAnswer` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **Level 2 feature**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n\n sturdyRef @6 :SturdyRef;\n # If non-null, this is a SturdyRef that can be used to store this capability persistently and\n # restore access to in in the future (using a `Restore` message). If null, this capability will\n # be lost if the connection dies. Generally, application interfaces should define when a client\n # can expect a capability to be persistent (and therefore have a SturdyRef attached). However,\n # application protocols should never embed SturdyRefs directly, as various infrastructure like\n # transports, gateways, and sandboxes may need to be aware of SturdyRefs being passed over the\n # wire in order to transform them into different namespaces.\n}\n\nstruct PromisedAnswer {\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list? Of course, if we wanted to get arbitrarily\n # complicated, the ideal would be for the caller to be able to upload a script to run that\n # derives the capability given the former answer, but that's probably unreasonable.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **Level 2 feature**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 3 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to authenticate vats in three-party introductions.\n# - How to implement `Join`.\n# - How to store capabilities long-term without holding a connection open.\n#\n# Three-party interactions\n# ------------------------\n#\n# **Level 2 feature**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **Level 3 feature**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n#\n# Persistent references\n# ---------------------\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n\nusing SturdyRef = Object;\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n\nusing ProvisionId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **Level 2 feature**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 1 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 3 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 1 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 2 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. Comments in this file indicate which level requires the corresponding\n# feature to be implemented -- if unspecified, the feature must be implemented at level 1.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction, but interactions between\n# three or more parties are supported only via proxying of objects. E.g. if Alice wants to send\n# Bob a capability pointing to Carol, Alice must host a local proxy of Carol and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support \"join\" or \"eq\" across capabilities received from different vats, although they\n# should be supported on capabilities received from the same vat.\n#\n# * **Level 2:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 3:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, \"Level 2\" is irrelevant and\n# \"Level 3\" is much easier than usual to implement. When such an implementation is actually run\n# inside a container, the contained app effectively gets to make full use of the container's\n# network at level 3. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a ReleaseAnswer\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `ReleaseAnswer`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 1 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n resolve @2 :Resolve; # Resolve a previously-sent promise.\n\n release @3 :Release; # Release a capability so that the remote object can be deallocated.\n releaseAnswer @4 :ReleaseAnswer; # Release a returned answer \/ cancel a call.\n\n restore @5 :Restore; # Restore a persistent capability from a previous connection.\n\n # Level 2 features -----------------------------------------------\n\n provide @6 :Provide; # Provide a capability to a third party.\n accept @7 :Accept; # Accept a capability provided by a third party.\n\n # Level 3 features -----------------------------------------------\n\n join @8 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\nstruct Call {\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching ReleaseAnswer has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `ReleaseAnswer` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a ReleaseAnswer message\n # before the call had completed.\n }\n}\n\nstruct Resolve {\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct ReleaseAnswer {\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\nstruct Restore {\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this restore message, which will eventually receive a Return\n # message containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Provide {\n # **Level 2 feature**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a ReleaseAnswer message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **Level 2 feature**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\nstruct Join {\n # **Level 3 feature**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `ReleaseAnswer`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `ReleaseAnswer` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n\n sturdyRef @6 :SturdyRef;\n # If non-null, this is a SturdyRef that can be used to store this capability persistently and\n # restore access to in in the future (using a `Restore` message). If null, this capability will\n # be lost if the connection dies. Generally, application interfaces should define when a client\n # can expect a capability to be persistent (and therefore have a SturdyRef attached). However,\n # application protocols should never embed SturdyRefs directly, as various infrastructure like\n # transports, gateways, and sandboxes may need to be aware of SturdyRefs being passed over the\n # wire in order to transform them into different namespaces.\n}\n\nstruct PromisedAnswer {\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list? Of course, if we wanted to get arbitrarily\n # complicated, the ideal would be for the caller to be able to upload a script to run that\n # derives the capability given the former answer, but that's probably unreasonable.\n}\n\nstruct ThirdPartyCapDescriptor {\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 3 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to authenticate vats in three-party introductions.\n# - How to implement `Join`.\n# - How to store capabilities long-term without holding a connection open.\n#\n# Three-party interactions\n# ------------------------\n#\n# **Level 2 feature**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **Level 3 feature**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n#\n# Persistent references\n# ---------------------\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n\nusing SturdyRef = Object;\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n\nusing ProvisionId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **Level 2 feature**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 1 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 3 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 1 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 2 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f9375ab34dfd51149a3fd2074e8cb7e3804e475d","subject":"Fix typo","message":"Fix typo","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstrap interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the object ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstrap interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"47600af946f8901c53a8316fe1c42aa70f9e6dcf","subject":"Default values for Node struct.","message":"Default values for Node struct.\n","repos":"emallson\/capngraph,emallson\/capngraph","old_file":"schemas\/ctvm.capnp","new_file":"schemas\/ctvm.capnp","new_contents":"# extension of graph.capnp to a case with additional node data.\n@0xaed9fb729c576ca5;\n\nstruct WeightedDirectedGraph {\n tag @0 : Text;\n numNodes @1 : UInt32;\n\n struct Edge {\n from @0 : UInt32;\n to @1 : UInt32;\n weight @2 : Float32;\n }\n\n struct Node {\n cost @0 : Float32 = 1;\n benefit @1 : Float32 = 1;\n }\n\n edges @2 : List(Edge);\n nodes @3 : List(Node);\n}\n","old_contents":"# extension of graph.capnp to a case with additional node data.\n@0xaed9fb729c576ca5;\n\nstruct WeightedDirectedGraph {\n tag @0 : Text;\n numNodes @1 : UInt32;\n\n struct Edge {\n from @0 : UInt32;\n to @1 : UInt32;\n weight @2 : Float32;\n }\n\n struct Node {\n cost @0 : Float32;\n benefit @1 : Float32;\n }\n\n edges @2 : List(Edge);\n nodes @3 : List(Node);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"74284cb9cb80b0b6049b44704bf2faa5cca33e2d","subject":"update sandstorm tags","message":"update sandstorm tags\n","repos":"marzieh312\/Rocket.Chat,AlecTroemel\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ziedmahdi\/Rocket.Chat,marzieh312\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,abduljanjua\/TheHub,subesokun\/Rocket.Chat,alexbrazier\/Rocket.Chat,yuyixg\/Rocket.Chat,pkgodara\/Rocket.Chat,alexbrazier\/Rocket.Chat,Dianoga\/Rocket.Chat,LearnersGuild\/Rocket.Chat,haoyixin\/Rocket.Chat,pkgodara\/Rocket.Chat,TribeMedia\/Rocket.Chat,jbsavoy18\/rocketchat-1,PavelVanecek\/Rocket.Chat,mccambridge\/Rocket.Chat,Dianoga\/Rocket.Chat,wtsarchive\/Rocket.Chat,LearnersGuild\/echo-chat,klatys\/Rocket.Chat,4thParty\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,pachox\/Rocket.Chat,wtsarchive\/Rocket.Chat,danielbressan\/Rocket.Chat,Sing-Li\/Rocket.Chat,karlprieb\/Rocket.Chat,abhishekshukla0302\/trico,mrinaldhar\/Rocket.Chat,yuyixg\/Rocket.Chat,4thParty\/Rocket.Chat,galrotem1993\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,Dianoga\/Rocket.Chat,qnib\/Rocket.Chat,karlprieb\/Rocket.Chat,xboston\/Rocket.Chat,galrotem1993\/Rocket.Chat,mwharrison\/Rocket.Chat,VoiSmart\/Rocket.Chat,Gyubin\/Rocket.Chat,fatihwk\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,intelradoux\/Rocket.Chat,ziedmahdi\/Rocket.Chat,OtkurBiz\/Rocket.Chat,JamesHGreen\/Rocket_API,klatys\/Rocket.Chat,igorstajic\/Rocket.Chat,xasx\/Rocket.Chat,ealbers\/Rocket.Chat,yuyixg\/Rocket.Chat,timkinnane\/Rocket.Chat,pitamar\/Rocket.Chat,OtkurBiz\/Rocket.Chat,litewhatever\/Rocket.Chat,subesokun\/Rocket.Chat,inoio\/Rocket.Chat,jbsavoy18\/rocketchat-1,intelradoux\/Rocket.Chat,NMandapaty\/Rocket.Chat,mrsimpson\/Rocket.Chat,ahmadassaf\/Rocket.Chat,nishimaki10\/Rocket.Chat,acaronmd\/Rocket.Chat,karlprieb\/Rocket.Chat,alexbrazier\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,ggazzo\/Rocket.Chat,matthewshirley\/Rocket.Chat,amaapp\/ama,JamesHGreen\/Rocket.Chat,AimenJoe\/Rocket.Chat,steedos\/chat,JamesHGreen\/Rocket_API,igorstajic\/Rocket.Chat,tlongren\/Rocket.Chat,steedos\/chat,igorstajic\/Rocket.Chat,mwharrison\/Rocket.Chat,xasx\/Rocket.Chat,NMandapaty\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,4thParty\/Rocket.Chat,ggazzo\/Rocket.Chat,Sing-Li\/Rocket.Chat,LearnersGuild\/echo-chat,PavelVanecek\/Rocket.Chat,acaronmd\/Rocket.Chat,JamesHGreen\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,haoyixin\/Rocket.Chat,liuliming2008\/Rocket.Chat,inoxth\/Rocket.Chat,qnib\/Rocket.Chat,Flitterkill\/Rocket.Chat,mccambridge\/Rocket.Chat,flaviogrossi\/Rocket.Chat,Gudii\/Rocket.Chat,org100h1\/Rocket.Panda,tlongren\/Rocket.Chat,PavelVanecek\/Rocket.Chat,ziedmahdi\/Rocket.Chat,capensisma\/Rocket.Chat,pachox\/Rocket.Chat,xboston\/Rocket.Chat,JamesHGreen\/Rocket.Chat,pkgodara\/Rocket.Chat,k0nsl\/Rocket.Chat,amaapp\/ama,LearnersGuild\/Rocket.Chat,danielbressan\/Rocket.Chat,fatihwk\/Rocket.Chat,klatys\/Rocket.Chat,tlongren\/Rocket.Chat,tntobias\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,acaronmd\/Rocket.Chat,litewhatever\/Rocket.Chat,litewhatever\/Rocket.Chat,karlprieb\/Rocket.Chat,danielbressan\/Rocket.Chat,fatihwk\/Rocket.Chat,Achaikos\/Rocket.Chat,ealbers\/Rocket.Chat,litewhatever\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,danielbressan\/Rocket.Chat,abhishekshukla0302\/trico,jbsavoy18\/rocketchat-1,intelradoux\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,cdwv\/Rocket.Chat,cnash\/Rocket.Chat,Achaikos\/Rocket.Chat,ahmadassaf\/Rocket.Chat,fduraibi\/Rocket.Chat,liuliming2008\/Rocket.Chat,ut7\/Rocket.Chat,Movile\/Rocket.Chat,VoiSmart\/Rocket.Chat,fatihwk\/Rocket.Chat,ggazzo\/Rocket.Chat,intelradoux\/Rocket.Chat,TribeMedia\/Rocket.Chat,Dianoga\/Rocket.Chat,pachox\/Rocket.Chat,NMandapaty\/Rocket.Chat,xasx\/Rocket.Chat,AlecTroemel\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,pitamar\/Rocket.Chat,org100h1\/Rocket.Panda,Movile\/Rocket.Chat,JamesHGreen\/Rocket.Chat,LearnersGuild\/Rocket.Chat,AimenJoe\/Rocket.Chat,flaviogrossi\/Rocket.Chat,xboston\/Rocket.Chat,bt\/Rocket.Chat,capensisma\/Rocket.Chat,wicked539\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,AlecTroemel\/Rocket.Chat,nishimaki10\/Rocket.Chat,steedos\/chat,fduraibi\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,Gyubin\/Rocket.Chat,AimenJoe\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,capensisma\/Rocket.Chat,ealbers\/Rocket.Chat,subesokun\/Rocket.Chat,liuliming2008\/Rocket.Chat,VoiSmart\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,igorstajic\/Rocket.Chat,subesokun\/Rocket.Chat,abhishekshukla0302\/trico,ut7\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,fduraibi\/Rocket.Chat,flaviogrossi\/Rocket.Chat,bt\/Rocket.Chat,haoyixin\/Rocket.Chat,Movile\/Rocket.Chat,OtkurBiz\/Rocket.Chat,wicked539\/Rocket.Chat,wicked539\/Rocket.Chat,liuliming2008\/Rocket.Chat,nishimaki10\/Rocket.Chat,mccambridge\/Rocket.Chat,pitamar\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,cnash\/Rocket.Chat,ut7\/Rocket.Chat,ealbers\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,timkinnane\/Rocket.Chat,mwharrison\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,Flitterkill\/Rocket.Chat,LearnersGuild\/echo-chat,matthewshirley\/Rocket.Chat,galrotem1993\/Rocket.Chat,abduljanjua\/TheHub,inoxth\/Rocket.Chat,acaronmd\/Rocket.Chat,wtsarchive\/Rocket.Chat,mrinaldhar\/Rocket.Chat,yuyixg\/Rocket.Chat,ahmadassaf\/Rocket.Chat,galrotem1993\/Rocket.Chat,cdwv\/Rocket.Chat,cnash\/Rocket.Chat,marzieh312\/Rocket.Chat,Movile\/Rocket.Chat,steedos\/chat,k0nsl\/Rocket.Chat,k0nsl\/Rocket.Chat,klatys\/Rocket.Chat,mrsimpson\/Rocket.Chat,JamesHGreen\/Rocket_API,bt\/Rocket.Chat,tntobias\/Rocket.Chat,abhishekshukla0302\/trico,tntobias\/Rocket.Chat,abduljanjua\/TheHub,BorntraegerMarc\/Rocket.Chat,cnash\/Rocket.Chat,jbsavoy18\/rocketchat-1,abduljanjua\/TheHub,LeonardOliveros\/Rocket.Chat,ahmadassaf\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,inoxth\/Rocket.Chat,k0nsl\/Rocket.Chat,nishimaki10\/Rocket.Chat,amaapp\/ama,org100h1\/Rocket.Panda,inoio\/Rocket.Chat,pitamar\/Rocket.Chat,inoxth\/Rocket.Chat,cdwv\/Rocket.Chat,xboston\/Rocket.Chat,qnib\/Rocket.Chat,wicked539\/Rocket.Chat,TribeMedia\/Rocket.Chat,4thParty\/Rocket.Chat,ut7\/Rocket.Chat,mrinaldhar\/Rocket.Chat,Gudii\/Rocket.Chat,mrsimpson\/Rocket.Chat,Sing-Li\/Rocket.Chat,AimenJoe\/Rocket.Chat,flaviogrossi\/Rocket.Chat,timkinnane\/Rocket.Chat,inoio\/Rocket.Chat,mccambridge\/Rocket.Chat,amaapp\/ama,Achaikos\/Rocket.Chat,Achaikos\/Rocket.Chat,bt\/Rocket.Chat,matthewshirley\/Rocket.Chat,LearnersGuild\/Rocket.Chat,Flitterkill\/Rocket.Chat,mwharrison\/Rocket.Chat,haoyixin\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,alexbrazier\/Rocket.Chat,NMandapaty\/Rocket.Chat,marzieh312\/Rocket.Chat,ggazzo\/Rocket.Chat,qnib\/Rocket.Chat,timkinnane\/Rocket.Chat,pachox\/Rocket.Chat,Gyubin\/Rocket.Chat,TribeMedia\/Rocket.Chat,wtsarchive\/Rocket.Chat,tntobias\/Rocket.Chat,PavelVanecek\/Rocket.Chat,cdwv\/Rocket.Chat,matthewshirley\/Rocket.Chat,ziedmahdi\/Rocket.Chat,linnovate\/hi,Gyubin\/Rocket.Chat,Sing-Li\/Rocket.Chat,LearnersGuild\/echo-chat,pkgodara\/Rocket.Chat,Gudii\/Rocket.Chat,linnovate\/hi,mrsimpson\/Rocket.Chat,org100h1\/Rocket.Panda,fduraibi\/Rocket.Chat,Flitterkill\/Rocket.Chat,xasx\/Rocket.Chat,Gudii\/Rocket.Chat,OtkurBiz\/Rocket.Chat,tlongren\/Rocket.Chat,JamesHGreen\/Rocket_API","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.8.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, devtools, social],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 3, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.8.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a4c1fb18412c734a2a94e37d7216634ac1d203e5","subject":"Version 4","message":"Version 4\n","repos":"dwrensha\/acronymy,neynah\/acronymy","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/release\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/release\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","old_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/release\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/target\/release\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"212b84149a19a77be47067c2ff9aaea6e7f1e727","subject":"release v0.10.3","message":"release v0.10.3\n","repos":"mnutt\/davros,mnutt\/davros,mnutt\/davros,mnutt\/davros","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"8aspz4sfjnp8u89000mh2v1xrdyx97ytn8hq71mdzv4p4d8n0n3h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 103, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10.3\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Shared Directory\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PORT\", value = \"8000\"),\n (key = \"STORAGE_PATH\", value = \"\/var\/davros\/data\"),\n (key = \"TEMP_STORAGE_PATH\", value = \"\/var\/davros\/tmp\"),\n (key = \"TMPDIR\", value = \"\/var\/davros\/tmp\"),\n ]\n);\n","old_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"8aspz4sfjnp8u89000mh2v1xrdyx97ytn8hq71mdzv4p4d8n0n3h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 102, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10.2\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Shared Directory\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PORT\", value = \"8000\"),\n (key = \"STORAGE_PATH\", value = \"\/var\/davros\/data\"),\n (key = \"TEMP_STORAGE_PATH\", value = \"\/var\/davros\/tmp\"),\n (key = \"TMPDIR\", value = \"\/var\/davros\/tmp\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"779c8b6753734b928d689029d88708c4f6ab3b70","subject":"Remove upstream author.","message":"Remove upstream author.\n","repos":"firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 1,\n appMarketingVersion = (defaultText = \"4.6.9.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.github.io\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 1,\n appMarketingVersion = (defaultText = \"4.6.9.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.github.io\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n upstreamAuthor = \"James Cole\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"c9bcf29cc39b834995154d67bc1875bd5d28ce4c","subject":"GetResult struct def","message":"GetResult struct def\n","repos":"rustyrazorblade\/PunisherDB,rustyrazorblade\/PunisherDB","old_file":"ramp.capnp","new_file":"ramp.capnp","new_contents":"@0xbcc55cbe2b79513a;\n\ninterface RampInterface {\n prepare @0 (key:Text, value:Text, dependencies:List(Text), timestamp:Int64);\n commit @1 (timestamp:Int64);\n get @2 (key:Text) -> (value:Text, timestamp:Int64, dependencies:List(Text));\n getVersion @3 (key:Text, timestamp:Int64) -> (value:Text, timestamp:Int64, dependencies:List(Text));\n}\n\nstruct GetResult {\n union {\n none @0 : Void;\n version @1 : Version;\n }\n}\n\nstruct Version {\n value @0: Text;\n timestamp @1: Int64;\n dependencies @2: List(Text);\n}\n","old_contents":"@0xbcc55cbe2b79513a;\n\ninterface RampInterface {\n prepare @0 (key:Text, value:Text, dependencies:List(Text), timestamp:Int64);\n commit @1 (timestamp:Int64);\n get @2 (key:Text) -> (value:Text, timestamp:Int64, dependencies:List(Text));\n getVersion @3 (key:Text, timestamp:Int64) -> (value:Text, timestamp:Int64, dependencies:List(Text));\n}\n\nstruct Version {\n value @0: Text;\n timestamp @1: Int64;\n dependencies @2: List(Text);\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"d6f3cecd9ae6c753f4ad6f1d1422d2ca37fa8288","subject":"calculator.capnp style adjusting","message":"calculator.capnp style adjusting\n\np.s. thanks @cstrahan for vim syntax highlighting\n","repos":"a-richardson\/capnproto,ocdtrekkie\/capnproto,khklau\/capnproto,modulexcite\/capnproto,hntrmrrs\/capnproto,johnkdoe\/capnproto,johnkdoe\/capnproto,vladon\/capnproto,modulexcite\/capnproto,pjulien\/capnproto,maurer\/capnproto,MarPiRK\/capnproto,mrdomino\/capnproto,martindale\/capnproto,pjulien\/capnproto,rcrowder\/capnproto,Fraser999\/capnproto,khklau\/capnproto,jparyani\/capnproto,kamalmarhubi\/capnproto,nagyistoce\/capnproto,mologie\/capnproto,geofft\/capnproto,kamalmarhubi\/capnproto,nagyistoce\/capnproto,zarvox\/capnproto,MarPiRK\/capnproto,joliss\/capnproto,geofft\/capnproto,hntrmrrs\/capnproto,zarvox\/capnproto,johnkdoe\/capnproto,a-richardson\/capnproto,jparyani\/capnproto,maurer\/capnproto,mrdomino\/capnproto,bsn069\/capnproto,ocdtrekkie\/capnproto,jparyani\/capnproto,kamalmarhubi\/capnproto,Fraser999\/capnproto,hntrmrrs\/capnproto,pjulien\/capnproto,a-richardson\/capnproto,modulexcite\/capnproto,vladon\/capnproto,maurer\/capnproto,vladon\/capnproto,ocdtrekkie\/capnproto,mologie\/capnproto,bsn069\/capnproto,MarPiRK\/capnproto,bryce-gibson\/capnproto,zarvox\/capnproto,mrdomino\/capnproto,joliss\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,bryce-gibson\/capnproto,khklau\/capnproto,martindale\/capnproto,nagyistoce\/capnproto,joliss\/capnproto,mologie\/capnproto,bryce-gibson\/capnproto,artillery\/capnproto,Fraser999\/capnproto,artillery\/capnproto,ligzy\/capnproto,rcrowder\/capnproto,geofft\/capnproto,bsn069\/capnproto,martindale\/capnproto,ligzy\/capnproto,artillery\/capnproto","old_file":"c++\/samples\/calculator.capnp","new_file":"c++\/samples\/calculator.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0x85150b117366d14b;\n\ninterface Calculator {\n # A \"simple\" mathematical calculator, callable via RPC.\n #\n # But, to show off Cap'n Proto, we add some twists:\n #\n # - You can use the result from one call as the input to the next\n # without a network round trip. To accomplish this, evaluate()\n # returns a `Value` object wrapping the actual numeric value.\n # This object may be used in a subsequent expression. With\n # promise pipelining, the Value can actually be used before\n # the evaluate() call that creates it returns!\n #\n # - You can define new functions, and then call them. This again\n # shows off pipelining, but it also gives the client the\n # opportunity to define a function on the client side and have\n # the server call back to it.\n #\n # - The basic arithmetic operators are exposed as Functions, and\n # you have to call getOperator() to obtain them from the server.\n # This again demonstrates pipelining -- using getOperator() to\n # get each operator and then using them in evaluate() still\n # only takes one network round trip.\n\n evaluate @0 (expression :Expression) -> (value :Value);\n # Evaluate the given expression and return the result. The\n # result is returned wrapped in a Value interface so that you\n # may pass it back to the server in a pipelined request. To\n # actually get the numeric value, you must call read() on the\n # Value -- but again, this can be pipelined so that it incurs\n # no additional latency.\n\n struct Expression {\n # A numeric expression.\n\n union {\n literal @0 :Float64;\n # A literal numeric value.\n\n previousResult @1 :Value;\n # A value that was (or, will be) returned by a previous\n # evaluate().\n\n parameter @2 :UInt32;\n # A parameter to the function (only valid in function bodies;\n # see defFunction).\n\n call :group {\n # Call a function on a list of parameters.\n function @3 :Function;\n params @4 :List(Expression);\n }\n }\n }\n\n interface Value {\n # Wraps a numeric value in an RPC object. This allows the value\n # to be used in subsequent evaluate() requests without the client\n # waiting for the evaluate() that returns the Value to finish.\n\n read @0 () -> (value :Float64);\n # Read back the raw numeric value.\n }\n\n defFunction @1 (paramCount :Int32, body :Expression)\n -> (func :Function);\n # Define a function that takes `paramCount` parameters and returns the\n # evaluation of `body` after substituting these parameters.\n\n interface Function {\n # An algebraic function. Can be called directly, or can be used inside\n # an Expression.\n #\n # A client can create a Function that runs on the server side using\n # `defFunction()` or `getOperator()`. Alternatively, a client can\n # implement a Function on the client side and the server will call back\n # to it. However, a function defined on the client side will require a\n # network round trip whenever the server needs to call it, whereas\n # functions defined on the server and then passed back to it are called\n # locally.\n\n call @0 (params :List(Float64)) -> (value :Float64);\n # Call the function on the given parameters.\n }\n\n getOperator @2 (op :Operator) -> (func :Function);\n # Get a Function representing an arithmetic operator, which can then be\n # used in Expressions.\n\n enum Operator {\n add @0;\n subtract @1;\n multiply @2;\n divide @3;\n }\n}\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0x85150b117366d14b;\n\ninterface Calculator {\n # A \"simple\" mathematical calculator, callable via RPC.\n #\n # But, to show off Cap'n Proto, we add some twists:\n #\n # - You can use the result from one call as the input to the next\n # without a network round trip. To accomplish this, evaluate()\n # returns a `Value` object wrapping the actual numeric value.\n # This object may be used in a subsequent expression. With\n # promise pipelining, the Value can actually be used before\n # the evaluate() call that creates it returns!\n #\n # - You can define new functions, and then call them. This again\n # shows off pipelining, but it also gives the client the\n # opportunity to define a function on the client side and have\n # the server call back to it.\n #\n # - The basic arithmetic operators are exposed as Functions, and\n # you have to call getOperator() to obtain them from the server.\n # This again demonstrates pipelining -- using getOperator() to\n # get each operator and then using them in evaluate() still\n # only takes one network round trip.\n\n evaluate @0 (expression: Expression) -> (value: Value);\n # Evaluate the given expression and return the result. The\n # result is returned wrapped in a Value interface so that you\n # may pass it back to the server in a pipelined request. To\n # actually get the numeric value, you must call read() on the\n # Value -- but again, this can be pipelined so that it incurs\n # no additional latency.\n\n struct Expression {\n # A numeric expression.\n\n union {\n literal @0 :Float64;\n # A literal numeric value.\n\n previousResult @1 :Value;\n # A value that was (or, will be) returned by a previous\n # evaluate().\n\n parameter @2 :UInt32;\n # A parameter to the function (only valid in function bodies;\n # see defFunction).\n\n call :group {\n # Call a function on a list of parameters.\n function @3 :Function;\n params @4 :List(Expression);\n }\n }\n }\n\n interface Value {\n # Wraps a numeric value in an RPC object. This allows the value\n # to be used in subsequent evaluate() requests without the client\n # waiting for the evaluate() that returns the Value to finish.\n\n read @0 () -> (value :Float64);\n # Read back the raw numeric value.\n }\n\n defFunction @1 (paramCount :Int32, body :Expression)\n -> (func :Function);\n # Define a function that takes `paramCount` parameters and returns the\n # evaluation of `body` after substituting these parameters.\n\n interface Function {\n # An algebraic function. Can be called directly, or can be used inside\n # an Expression.\n #\n # A client can create a Function that runs on the server side using\n # `defFunction()` or `getOperator()`. Alternatively, a client can\n # implement a Function on the client side and the server will call back\n # to it. However, a function defined on the client side will require a\n # network round trip whenever the server needs to call it, whereas\n # functions defined on the server and then passed back to it are called\n # locally.\n\n call @0 (params :List(Float64)) -> (value: Float64);\n # Call the function on the given parameters.\n }\n\n getOperator @2 (op: Operator) -> (func: Function);\n # Get a Function representing an arithmetic operator, which can then be\n # used in Expressions.\n\n enum Operator {\n add @0;\n subtract @1;\n multiply @2;\n divide @3;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"7b82a6ac0c66b66aba45a8b04b6501cbad6cef1f","subject":"Fix next ID","message":"Fix next ID\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"nupic\/encoders\/adaptivescalar.capnp","new_file":"nupic\/encoders\/adaptivescalar.capnp","new_contents":"@0xf11485b8c813b489;\n\nusing import \"\/nupic\/movingaverage.capnp\".MovingAverageProto;\n\n# Next ID: 10\nstruct AdaptiveScalarEncoderProto {\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n name @5 :Text;\n verbosity @6 :UInt8;\n clipInput @7 :Bool;\n recordNum @8 :UInt32;\n slidingWindow @9 :MovingAverageProto;\n}\n","old_contents":"@0xf11485b8c813b489;\n\nusing import \"\/nupic\/movingaverage.capnp\".MovingAverageProto;\n\n# Next ID: 8\nstruct AdaptiveScalarEncoderProto {\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n name @5 :Text;\n verbosity @6 :UInt8;\n clipInput @7 :Bool;\n recordNum @8 :UInt32;\n slidingWindow @9 :MovingAverageProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"409730a9d42a4600b1ff4409e322d92d45b20767","subject":"adding in the unknown and malformed message structs to the protocol union","message":"adding in the unknown and malformed message structs to the protocol union\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/csprotocol\/protocol.capnp","new_file":"src\/csprotocol\/protocol.capnp","new_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Error = import \"\/src\/core\/error.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\n\nstruct TransmissionHeader\n{\n wantReliable @0 :Bool;\n wantOrdering @1 :Bool;\n unusedA @2 :Bool;\n unusedB @3 :Bool;\n unusedC @4 :Bool;\n unusedD @5 :Bool;\n unusedE @6 :Bool;\n unusedF @7 :Bool;\n channel @8 :Metadata.channelId;\n sequence @9 :Metadata.SequenceNumber;\n}\n\nstruct ClientTransmission\n{\n header @0 :TransmissionHeader\n union\n {\n\tinit @1 :Command.InitRequest;\n\treconnect @2 :Command.ReconnectRequest;\n\tbye @3 :Command.ByeRequest;\n }\n}\n\nstruct ServerTransmission\n{\n header @0 :TransmissionHeader\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tinit @3 :Command.InitReply;\n\treconnect @4 :Command.ReconnectReply;\n\tbye @5 :Command.ByeReply;\n }\n}\n","old_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\n\nstruct TransmissionHeader\n{\n wantReliable @0 :Bool;\n wantOrdering @1 :Bool;\n channel @1 :Metadata.channelId;\n sequence @2 :Metadata.SequenceNumber;\n}\n\nstruct ClientTransmission\n{\n header @0 :TransmissionHeader\n union\n {\n\tinit @1 :Command.InitRequest;\n\treconnect @2 :Command.ReconnectRequest;\n\tbye @3 :Command.ByeRequest;\n }\n}\n\nstruct ServerTransmission\n{\n header @0 :TransmissionHeader\n union\n {\n\tinit @1 :Command.InitReply;\n\treconnect @2 :Command.ReconnectReply;\n\tbye @3 :Command.ByeReply;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"11a7ea37d677d9afd22fe8232b26f49cb2281f2e","subject":".sandstorm: remove redundant appGrid line","message":".sandstorm: remove redundant appGrid line\n","repos":"zombiezen\/sandpass,zombiezen\/sandpass,zombiezen\/sandpass","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.2.2\"),\n\n actions = [\n ( title = (defaultText = \"New database\"),\n nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/icons\/appGrid.svg\"),\n grain = (svg = embed \"..\/icons\/grain.svg\"),\n market = (svg = embed \"..\/icons\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n (width = 698, height = 704, png = embed \"screenshot-list.png\"),\n (width = 791, height = 704, png = embed \"screenshot-edit.png\"),\n ],\n changeLog = (defaultText = embed \"..\/CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/js\",\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\"),\n obsolete = true, # implied by sharing\n ),\n ( name = \"write\",\n title = (defaultText = \"Make changes to database\"),\n ),\n ( name = \"init\",\n title = (defaultText = \"Create, delete, and rekey the database\"),\n ),\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false, false],\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true, false],\n ),\n ( title = (defaultText = \"manager\"),\n verbPhrase = (defaultText = \"can read, write, and manage\"),\n description = (defaultText = \"A manager can not only edit the database, but also delete it.\"),\n permissions = [true, true, true],\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","old_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.2.2\"),\n\n actions = [\n ( title = (defaultText = \"New database\"),\n nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/icons\/appGrid.svg\"),\n appGrid = (svg = embed \"..\/icons\/appGrid.svg\"),\n grain = (svg = embed \"..\/icons\/grain.svg\"),\n market = (svg = embed \"..\/icons\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n (width = 698, height = 704, png = embed \"screenshot-list.png\"),\n (width = 791, height = 704, png = embed \"screenshot-edit.png\"),\n ],\n changeLog = (defaultText = embed \"..\/CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/js\",\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\"),\n obsolete = true, # implied by sharing\n ),\n ( name = \"write\",\n title = (defaultText = \"Make changes to database\"),\n ),\n ( name = \"init\",\n title = (defaultText = \"Create, delete, and rekey the database\"),\n ),\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false, false],\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true, false],\n ),\n ( title = (defaultText = \"manager\"),\n verbPhrase = (defaultText = \"can read, write, and manage\"),\n description = (defaultText = \"A manager can not only edit the database, but also delete it.\"),\n permissions = [true, true, true],\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"c15fd950746d3e396edd5c909b9f5ed822ff66a0","subject":"add nounPhrase to sandstorm package definition","message":"add nounPhrase to sandstorm package definition\n","repos":"strawlab\/neuron-catalog,strawlab\/neuron-catalog,strawlab\/neuron-catalog","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xe102d2c131b69f04;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u1pa4174jqhvn93fkgr6u07mfgpk53dtgvfqqz9hec0pxk6c8nuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Neuron Catalog\"),\n\n appVersion = 1, # Increment this for every release.\n\n # Keep in sync with ..\/lib\/version.js\n appMarketingVersion = (defaultText = \"0.6.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Neuron Catalog\"),\n nounPhrase = (defaultText = \"catalog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n # marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/strawlab.org\/neuron-catalog\",\n\n codeUrl = \"https:\/\/github.com\/strawlab\/neuron-catalog\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = agpl3),\n\n categories = [science, productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"strawman@astraw.com\",\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Andrew Straw\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Record keeping\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 823, height = 478, png = embed \"screenshots\/binary-data.png\"),\n (width = 822, height = 703, png = embed \"screenshots\/neuron-types.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"read\"), (name = \"write\"), (name = \"admin\")],\n roles = [(title = (defaultText = \"reader\"),\n permissions = [true, false, false]),\n (title = (defaultText = \"writer\"),\n permissions = [true, true, false]),\n (title = (defaultText = \"admin\"),\n permissions = [true, true, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/node\", \"\/start.js\", \"-p\", \"8000\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xe102d2c131b69f04;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u1pa4174jqhvn93fkgr6u07mfgpk53dtgvfqqz9hec0pxk6c8nuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Neuron Catalog\"),\n\n appVersion = 1, # Increment this for every release.\n\n # Keep in sync with ..\/lib\/version.js\n appMarketingVersion = (defaultText = \"0.6.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Neuron Catalog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n # marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/strawlab.org\/neuron-catalog\",\n\n codeUrl = \"https:\/\/github.com\/strawlab\/neuron-catalog\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = agpl3),\n\n categories = [science, productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"strawman@astraw.com\",\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Andrew Straw\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Record keeping\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 823, height = 478, png = embed \"screenshots\/binary-data.png\"),\n (width = 822, height = 703, png = embed \"screenshots\/neuron-types.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"read\"), (name = \"write\"), (name = \"admin\")],\n roles = [(title = (defaultText = \"reader\"),\n permissions = [true, false, false]),\n (title = (defaultText = \"writer\"),\n permissions = [true, true, false]),\n (title = (defaultText = \"admin\"),\n permissions = [true, true, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/node\", \"\/start.js\", \"-p\", \"8000\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"f17691e7dcf4a1b31b92fe5a13af1f1a0da4181d","subject":"fixing ordinals for the Bye message","message":"fixing ordinals for the Bye message\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/command.capnp","new_file":"src\/bcprotocol\/command.capnp","new_contents":"@0xc7bd906a94321b78;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/src\/core\/entity.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Rule = import \"\/src\/core\/rule.capnp\";\n\nstruct ErrorVersionMismatch { }\nstruct ErrorNoSuchTeam { }\nstruct ErrorTeamFull { }\nstruct ErrorUniformTaken { }\nstruct ErrorGoalieTaken { }\nstruct ErrorGameInPlayOn { }\n\nstruct InitRequest\n{\n version @0 :Metadata.Version;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct InitReply\n{\n union\n {\n\tresult @0 :InitResult;\n\terror @1 :InitError;\n }\n}\n\nstruct InitResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct InitError\n{\n union\n {\n\tversionMismatch @0 :ErrorVersionMismatch;\n\tnoSuchTeam @1 :ErrorNoSuchTeam;\n\tteamFull @2 :ErrorTeamFull;\n\tuniformTaken @3 :ErrorUniformTaken;\n\tgoalieTaken @4 :ErrorGoalieTaken;\n }\n}\n\nstruct ReconnectRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ReconnectReply\n{\n union\n {\n\tresult @0 :ReconnectResult;\n\terror @1 :ReconnectError;\n }\n}\n\nstruct ReconnectResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct ReconnectError\n{\n union\n {\n\tnoSuchTeam @0 :ErrorNoSuchTeam;\n\tteamFull @1 :ErrorTeamFull;\n\tuniformTaken @2 :ErrorUniformTaken;\n\tgameInPlayOn @3 :ErrorGameInPlayOn;\n }\n}\n\nstruct ByeRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ByeReply\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n","old_contents":"@0xc7bd906a94321b78;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/src\/core\/entity.capnp\";\nusing Metadata = import \"\/src\/core\/metadata.capnp\";\nusing Rule = import \"\/src\/core\/rule.capnp\";\n\nstruct ErrorVersionMismatch { }\nstruct ErrorNoSuchTeam { }\nstruct ErrorTeamFull { }\nstruct ErrorUniformTaken { }\nstruct ErrorGoalieTaken { }\nstruct ErrorGameInPlayOn { }\n\nstruct InitRequest\n{\n version @0 :Metadata.Version;\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct InitReply\n{\n union\n {\n\tresult @0 :InitResult;\n\terror @1 :InitError;\n }\n}\n\nstruct InitResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct InitError\n{\n union\n {\n\tversionMismatch @0 :ErrorVersionMismatch;\n\tnoSuchTeam @1 :ErrorNoSuchTeam;\n\tteamFull @2 :ErrorTeamFull;\n\tuniformTaken @3 :ErrorUniformTaken;\n\tgoalieTaken @4 :ErrorGoalieTaken;\n }\n}\n\nstruct ReconnectRequest\n{\n teamName @0 :Text;\n uniform @1 :Entity.UniformNumber;\n}\n\nstruct ReconnectReply\n{\n union\n {\n\tresult @0 :ReconnectResult;\n\terror @1 :ReconnectError;\n }\n}\n\nstruct ReconnectResult\n{\n side @0 :Entity.Side;\n playMode @1 :Rule.PlayMode;\n}\n\nstruct ReconnectError\n{\n union\n {\n\tnoSuchTeam @0 :ErrorNoSuchTeam;\n\tteamFull @1 :ErrorTeamFull;\n\tuniformTaken @2 :ErrorUniformTaken;\n\tgameInPlayOn @3 :ErrorGameInPlayOn;\n }\n}\n\nstruct ByeRequest\n{\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n}\n\nstruct ByeReply\n{\n teamName @1 :Text;\n uniform @2 :Entity.UniformNumber;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"a52a5d4125792e20a7e02a107bca3eb481351cf2","subject":"Add admin property to sandstorm-pkgdef","message":"Add admin property to sandstorm-pkgdef\n","repos":"neynah\/Telescope,jparyani\/Telescope,jparyani\/Telescope,neynah\/Telescope","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x82984481f49bd8f5;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5h13ka55xn93gpenjc29f5kxqpjf5gk4drgx949q4dx7gk968smh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Telescope\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"admin\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x82984481f49bd8f5;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5h13ka55xn93gpenjc29f5kxqpjf5gk4drgx949q4dx7gk968smh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Telescope\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"0ed3f92d45fb5c83a8c33611f1e955d3db2bd009","subject":"OnFieldEntity is redundant","message":"OnFieldEntity is redundant\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/core\/entity.capnp","new_file":"src\/core\/entity.capnp","new_contents":"@0xc98f2d65bc9a57fc;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing Field = import \"field.capnp\";\nusing Physics = import \"\/core\/physics.capnp\";\n\nenum PlayerType\n{\n outfield @0;\n goalie @1;\n}\n\nenum UniformNumber\n{\n one @0;\n two @1;\n three @2;\n four @3;\n five @4;\n six @5;\n seven @6;\n eight @7;\n nine @8;\n ten @9;\n eleven @10;\n}\n\nstruct PlayerId\n{\n side @0 :Field.Side;\n uniform @1 :UniformNumber;\n type @2 :PlayerType;\n}\n\nstruct Player\n{\n id @0 :PlayerId;\n}\n\nenum ParticipantType\n{\n player @0;\n coach @1;\n referee @2;\n trainer @3;\n}\n\nstruct Ball {}\n","old_contents":"@0xc98f2d65bc9a57fc;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing Field = import \"field.capnp\";\nusing Physics = import \"\/core\/physics.capnp\";\n\nenum PlayerType\n{\n outfield @0;\n goalie @1;\n}\n\nenum UniformNumber\n{\n one @0;\n two @1;\n three @2;\n four @3;\n five @4;\n six @5;\n seven @6;\n eight @7;\n nine @8;\n ten @9;\n eleven @10;\n}\n\nstruct PlayerId\n{\n side @0 :Field.Side;\n uniform @1 :UniformNumber;\n type @2 :PlayerType;\n}\n\nstruct Player\n{\n id @0 :PlayerId;\n}\n\nenum ParticipantType\n{\n player @0;\n coach @1;\n referee @2;\n trainer @3;\n}\n\nstruct Ball {}\n\nstruct OnFieldEntity\n{\n union\n {\n\tplayer @0 :Player;\n\tball @1 :Ball;\n\tgoal @2 :Field.Goal;\n\tline @3 :Field.Line;\n\tflag @4 :Field.Flag;\n\tspot @5 :Field.Spot;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"ee37057d0ee8a015426e1acd477b4026a5755b5e","subject":"Update rpc.capnp","message":"Update rpc.capnp","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstrap interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to designate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAnswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnected` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the object ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstrap interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the object ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f05213a430bf2d2abaa490a7adcc5be36dc7fd4f","subject":"put a fragement of an aircraft schema into the test.capnp file, to provide for tested struct and union testing","message":"put a fragement of an aircraft schema into the test.capnp file, to provide for tested struct and union testing\n","repos":"zombiezen\/go-capnproto2,zombiezen\/go-capnproto,zombiezen\/go-capnproto,zombiezen\/go-capnproto2,hodduc\/go-capnproto2,hodduc\/go-capnproto2,tpukep\/caps","old_file":"test.capnp","new_file":"test.capnp","new_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"capn_test\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test loc must be last because we use it to count\n # the number of elements in the Airport enum!!\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n }\n}\n\n\n\n","old_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"4ca159823a46c8a5850fbc007d816de53cded151","subject":"fixed categories keywords","message":"fixed categories keywords\n","repos":"intelradoux\/Rocket.Chat,xasx\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,intelradoux\/Rocket.Chat,wicked539\/Rocket.Chat,karlprieb\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,k0nsl\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,jbsavoy18\/rocketchat-1,JamesHGreen\/Rocket_API,marzieh312\/Rocket.Chat,OtkurBiz\/Rocket.Chat,amaapp\/ama,liuliming2008\/Rocket.Chat,alexbrazier\/Rocket.Chat,cnash\/Rocket.Chat,wicked539\/Rocket.Chat,abhishekshukla0302\/trico,BorntraegerMarc\/Rocket.Chat,JamesHGreen\/Rocket.Chat,Achaikos\/Rocket.Chat,JamesHGreen\/Rocket_API,ggazzo\/Rocket.Chat,timkinnane\/Rocket.Chat,ggazzo\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,ut7\/Rocket.Chat,litewhatever\/Rocket.Chat,wtsarchive\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,Flitterkill\/Rocket.Chat,subesokun\/Rocket.Chat,marzieh312\/Rocket.Chat,org100h1\/Rocket.Panda,Achaikos\/Rocket.Chat,liuliming2008\/Rocket.Chat,xboston\/Rocket.Chat,mccambridge\/Rocket.Chat,LearnersGuild\/Rocket.Chat,PavelVanecek\/Rocket.Chat,xasx\/Rocket.Chat,Flitterkill\/Rocket.Chat,NMandapaty\/Rocket.Chat,flaviogrossi\/Rocket.Chat,danielbressan\/Rocket.Chat,subesokun\/Rocket.Chat,Flitterkill\/Rocket.Chat,pkgodara\/Rocket.Chat,tlongren\/Rocket.Chat,igorstajic\/Rocket.Chat,AimenJoe\/Rocket.Chat,Achaikos\/Rocket.Chat,pkgodara\/Rocket.Chat,nishimaki10\/Rocket.Chat,galrotem1993\/Rocket.Chat,litewhatever\/Rocket.Chat,danielbressan\/Rocket.Chat,Dianoga\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,matthewshirley\/Rocket.Chat,klatys\/Rocket.Chat,danielbressan\/Rocket.Chat,ut7\/Rocket.Chat,yuyixg\/Rocket.Chat,AlecTroemel\/Rocket.Chat,pkgodara\/Rocket.Chat,igorstajic\/Rocket.Chat,TribeMedia\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,xboston\/Rocket.Chat,VoiSmart\/Rocket.Chat,Flitterkill\/Rocket.Chat,Sing-Li\/Rocket.Chat,danielbressan\/Rocket.Chat,ealbers\/Rocket.Chat,liuliming2008\/Rocket.Chat,inoio\/Rocket.Chat,Gudii\/Rocket.Chat,Gyubin\/Rocket.Chat,Movile\/Rocket.Chat,AlecTroemel\/Rocket.Chat,mrinaldhar\/Rocket.Chat,LearnersGuild\/Rocket.Chat,cdwv\/Rocket.Chat,yuyixg\/Rocket.Chat,nishimaki10\/Rocket.Chat,mccambridge\/Rocket.Chat,nishimaki10\/Rocket.Chat,alexbrazier\/Rocket.Chat,OtkurBiz\/Rocket.Chat,Dianoga\/Rocket.Chat,4thParty\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,bt\/Rocket.Chat,fduraibi\/Rocket.Chat,tntobias\/Rocket.Chat,pitamar\/Rocket.Chat,ahmadassaf\/Rocket.Chat,timkinnane\/Rocket.Chat,mccambridge\/Rocket.Chat,tlongren\/Rocket.Chat,cdwv\/Rocket.Chat,inoxth\/Rocket.Chat,alexbrazier\/Rocket.Chat,ggazzo\/Rocket.Chat,karlprieb\/Rocket.Chat,wicked539\/Rocket.Chat,4thParty\/Rocket.Chat,JamesHGreen\/Rocket_API,ziedmahdi\/Rocket.Chat,capensisma\/Rocket.Chat,haoyixin\/Rocket.Chat,flaviogrossi\/Rocket.Chat,cnash\/Rocket.Chat,jbsavoy18\/rocketchat-1,matthewshirley\/Rocket.Chat,steedos\/chat,Gyubin\/Rocket.Chat,inoxth\/Rocket.Chat,inoxth\/Rocket.Chat,JamesHGreen\/Rocket_API,snaiperskaya96\/Rocket.Chat,abduljanjua\/TheHub,mrsimpson\/Rocket.Chat,haoyixin\/Rocket.Chat,litewhatever\/Rocket.Chat,marzieh312\/Rocket.Chat,Sing-Li\/Rocket.Chat,ealbers\/Rocket.Chat,acaronmd\/Rocket.Chat,TribeMedia\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,4thParty\/Rocket.Chat,JamesHGreen\/Rocket.Chat,mwharrison\/Rocket.Chat,steedos\/chat,mrsimpson\/Rocket.Chat,acaronmd\/Rocket.Chat,steedos\/chat,qnib\/Rocket.Chat,AlecTroemel\/Rocket.Chat,qnib\/Rocket.Chat,wicked539\/Rocket.Chat,galrotem1993\/Rocket.Chat,haoyixin\/Rocket.Chat,linnovate\/hi,org100h1\/Rocket.Panda,karlprieb\/Rocket.Chat,timkinnane\/Rocket.Chat,matthewshirley\/Rocket.Chat,abduljanjua\/TheHub,ziedmahdi\/Rocket.Chat,pitamar\/Rocket.Chat,TribeMedia\/Rocket.Chat,ealbers\/Rocket.Chat,mwharrison\/Rocket.Chat,ut7\/Rocket.Chat,fduraibi\/Rocket.Chat,4thParty\/Rocket.Chat,nishimaki10\/Rocket.Chat,galrotem1993\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,tntobias\/Rocket.Chat,mwharrison\/Rocket.Chat,acaronmd\/Rocket.Chat,alexbrazier\/Rocket.Chat,PavelVanecek\/Rocket.Chat,Movile\/Rocket.Chat,flaviogrossi\/Rocket.Chat,TribeMedia\/Rocket.Chat,subesokun\/Rocket.Chat,bt\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,wtsarchive\/Rocket.Chat,VoiSmart\/Rocket.Chat,VoiSmart\/Rocket.Chat,pachox\/Rocket.Chat,Gudii\/Rocket.Chat,matthewshirley\/Rocket.Chat,cdwv\/Rocket.Chat,timkinnane\/Rocket.Chat,mwharrison\/Rocket.Chat,mccambridge\/Rocket.Chat,JamesHGreen\/Rocket.Chat,fatihwk\/Rocket.Chat,yuyixg\/Rocket.Chat,mrsimpson\/Rocket.Chat,Gyubin\/Rocket.Chat,tntobias\/Rocket.Chat,NMandapaty\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,fatihwk\/Rocket.Chat,PavelVanecek\/Rocket.Chat,jbsavoy18\/rocketchat-1,intelradoux\/Rocket.Chat,Sing-Li\/Rocket.Chat,Gyubin\/Rocket.Chat,NMandapaty\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,Movile\/Rocket.Chat,yuyixg\/Rocket.Chat,ziedmahdi\/Rocket.Chat,ziedmahdi\/Rocket.Chat,intelradoux\/Rocket.Chat,bt\/Rocket.Chat,LearnersGuild\/echo-chat,tlongren\/Rocket.Chat,AimenJoe\/Rocket.Chat,inoxth\/Rocket.Chat,xasx\/Rocket.Chat,AimenJoe\/Rocket.Chat,cnash\/Rocket.Chat,jbsavoy18\/rocketchat-1,trt15-ssci-organization\/Rocket.Chat,cnash\/Rocket.Chat,Gudii\/Rocket.Chat,pachox\/Rocket.Chat,LearnersGuild\/echo-chat,fatihwk\/Rocket.Chat,fatihwk\/Rocket.Chat,Sing-Li\/Rocket.Chat,org100h1\/Rocket.Panda,Gudii\/Rocket.Chat,pkgodara\/Rocket.Chat,AimenJoe\/Rocket.Chat,k0nsl\/Rocket.Chat,amaapp\/ama,amaapp\/ama,k0nsl\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ealbers\/Rocket.Chat,OtkurBiz\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ggazzo\/Rocket.Chat,amaapp\/ama,wtsarchive\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ut7\/Rocket.Chat,subesokun\/Rocket.Chat,galrotem1993\/Rocket.Chat,ahmadassaf\/Rocket.Chat,xboston\/Rocket.Chat,haoyixin\/Rocket.Chat,PavelVanecek\/Rocket.Chat,linnovate\/hi,pachox\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,inoio\/Rocket.Chat,igorstajic\/Rocket.Chat,inoio\/Rocket.Chat,pitamar\/Rocket.Chat,qnib\/Rocket.Chat,LearnersGuild\/echo-chat,k0nsl\/Rocket.Chat,Dianoga\/Rocket.Chat,LearnersGuild\/Rocket.Chat,klatys\/Rocket.Chat,qnib\/Rocket.Chat,marzieh312\/Rocket.Chat,OtkurBiz\/Rocket.Chat,abhishekshukla0302\/trico,abduljanjua\/TheHub,abduljanjua\/TheHub,fduraibi\/Rocket.Chat,karlprieb\/Rocket.Chat,org100h1\/Rocket.Panda,ahmadassaf\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,tntobias\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,AlecTroemel\/Rocket.Chat,klatys\/Rocket.Chat,bt\/Rocket.Chat,wtsarchive\/Rocket.Chat,igorstajic\/Rocket.Chat,JamesHGreen\/Rocket.Chat,liuliming2008\/Rocket.Chat,Achaikos\/Rocket.Chat,abhishekshukla0302\/trico,LearnersGuild\/echo-chat,pachox\/Rocket.Chat,xboston\/Rocket.Chat,mrsimpson\/Rocket.Chat,klatys\/Rocket.Chat,flaviogrossi\/Rocket.Chat,abhishekshukla0302\/trico,Movile\/Rocket.Chat,LearnersGuild\/Rocket.Chat,steedos\/chat,cdwv\/Rocket.Chat,pitamar\/Rocket.Chat,litewhatever\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,ahmadassaf\/Rocket.Chat,tlongren\/Rocket.Chat,acaronmd\/Rocket.Chat,capensisma\/Rocket.Chat,Dianoga\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,fduraibi\/Rocket.Chat,NMandapaty\/Rocket.Chat,xasx\/Rocket.Chat,capensisma\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.8.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, devTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.8.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, devtools, social],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"44c4e7ac06dee08a7e6d6706b790df1a2657b3e1","subject":"Add shortDescription","message":"Add shortDescription\n\nSo that we can link to the Etherpad manifest as an example without the caveat that it's missing a thing.","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 11, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.7\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 11, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.7\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"0c2fa6b72d4e2dfb53163578f7e55932b6cc5aed","subject":"Tweak a comment.","message":"Tweak a comment.\n","repos":"khklau\/capnproto,mologie\/capnproto,martindale\/capnproto,bsn069\/capnproto,rcrowder\/capnproto,maurer\/capnproto,bsn069\/capnproto,hntrmrrs\/capnproto,vladon\/capnproto,a-richardson\/capnproto,geofft\/capnproto,mologie\/capnproto,nagyistoce\/capnproto,ocdtrekkie\/capnproto,modulexcite\/capnproto,joliss\/capnproto,ligzy\/capnproto,artillery\/capnproto,Fraser999\/capnproto,pjulien\/capnproto,bryce-gibson\/capnproto,zarvox\/capnproto,a-richardson\/capnproto,maurer\/capnproto,joliss\/capnproto,MarPiRK\/capnproto,johnkdoe\/capnproto,jparyani\/capnproto,ligzy\/capnproto,Fraser999\/capnproto,khklau\/capnproto,kamalmarhubi\/capnproto,mrdomino\/capnproto,ocdtrekkie\/capnproto,pjulien\/capnproto,Fraser999\/capnproto,a-richardson\/capnproto,bsn069\/capnproto,artillery\/capnproto,kamalmarhubi\/capnproto,johnkdoe\/capnproto,geofft\/capnproto,hntrmrrs\/capnproto,geofft\/capnproto,modulexcite\/capnproto,rcrowder\/capnproto,vladon\/capnproto,jparyani\/capnproto,MarPiRK\/capnproto,modulexcite\/capnproto,ligzy\/capnproto,nagyistoce\/capnproto,artillery\/capnproto,pjulien\/capnproto,joliss\/capnproto,MarPiRK\/capnproto,zarvox\/capnproto,mologie\/capnproto,khklau\/capnproto,bryce-gibson\/capnproto,ocdtrekkie\/capnproto,jparyani\/capnproto,hntrmrrs\/capnproto,rcrowder\/capnproto,mrdomino\/capnproto,martindale\/capnproto,bryce-gibson\/capnproto,vladon\/capnproto,nagyistoce\/capnproto,mrdomino\/capnproto,johnkdoe\/capnproto,martindale\/capnproto,zarvox\/capnproto,kamalmarhubi\/capnproto,maurer\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n #\n # TODO(soon): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller hasn't yet finished processing the response.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the answer to a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = Object;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = Object;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n #\n # TODO(soon): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller hasn't yet finished processing the response.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the answer to a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = Object;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = Object;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"86659c06e7b59d89a6c3b913541b0c03fb9afbf3","subject":"fixed blocked settings","message":"fixed blocked settings\n","repos":"nishimaki10\/Rocket.Chat,pitamar\/Rocket.Chat,yuyixg\/Rocket.Chat,nishimaki10\/Rocket.Chat,JamesHGreen\/Rocket_API,Deepakkothandan\/Rocket.Chat,Sing-Li\/Rocket.Chat,flaviogrossi\/Rocket.Chat,yuyixg\/Rocket.Chat,bt\/Rocket.Chat,LearnersGuild\/echo-chat,Kiran-Rao\/Rocket.Chat,mccambridge\/Rocket.Chat,intelradoux\/Rocket.Chat,JamesHGreen\/Rocket.Chat,OtkurBiz\/Rocket.Chat,liuliming2008\/Rocket.Chat,pkgodara\/Rocket.Chat,igorstajic\/Rocket.Chat,ziedmahdi\/Rocket.Chat,Achaikos\/Rocket.Chat,danielbressan\/Rocket.Chat,litewhatever\/Rocket.Chat,intelradoux\/Rocket.Chat,xboston\/Rocket.Chat,karlprieb\/Rocket.Chat,Sing-Li\/Rocket.Chat,ahmadassaf\/Rocket.Chat,PavelVanecek\/Rocket.Chat,yuyixg\/Rocket.Chat,mrinaldhar\/Rocket.Chat,intelradoux\/Rocket.Chat,ggazzo\/Rocket.Chat,Flitterkill\/Rocket.Chat,JamesHGreen\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,jbsavoy18\/rocketchat-1,pkgodara\/Rocket.Chat,fduraibi\/Rocket.Chat,JamesHGreen\/Rocket_API,matthewshirley\/Rocket.Chat,pachox\/Rocket.Chat,karlprieb\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,LearnersGuild\/Rocket.Chat,fduraibi\/Rocket.Chat,amaapp\/ama,ealbers\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,VoiSmart\/Rocket.Chat,k0nsl\/Rocket.Chat,wtsarchive\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Flitterkill\/Rocket.Chat,tntobias\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,acaronmd\/Rocket.Chat,mwharrison\/Rocket.Chat,PavelVanecek\/Rocket.Chat,AlecTroemel\/Rocket.Chat,matthewshirley\/Rocket.Chat,fduraibi\/Rocket.Chat,wicked539\/Rocket.Chat,org100h1\/Rocket.Panda,AlecTroemel\/Rocket.Chat,OtkurBiz\/Rocket.Chat,Movile\/Rocket.Chat,NMandapaty\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,AimenJoe\/Rocket.Chat,ziedmahdi\/Rocket.Chat,Gyubin\/Rocket.Chat,fatihwk\/Rocket.Chat,alexbrazier\/Rocket.Chat,acaronmd\/Rocket.Chat,Sing-Li\/Rocket.Chat,Flitterkill\/Rocket.Chat,jbsavoy18\/rocketchat-1,fatihwk\/Rocket.Chat,Gyubin\/Rocket.Chat,fatihwk\/Rocket.Chat,timkinnane\/Rocket.Chat,JamesHGreen\/Rocket_API,danielbressan\/Rocket.Chat,matthewshirley\/Rocket.Chat,abhishekshukla0302\/trico,haoyixin\/Rocket.Chat,Gudii\/Rocket.Chat,ggazzo\/Rocket.Chat,mwharrison\/Rocket.Chat,Gudii\/Rocket.Chat,k0nsl\/Rocket.Chat,pachox\/Rocket.Chat,alexbrazier\/Rocket.Chat,nishimaki10\/Rocket.Chat,cnash\/Rocket.Chat,subesokun\/Rocket.Chat,tntobias\/Rocket.Chat,4thParty\/Rocket.Chat,steedos\/chat,danielbressan\/Rocket.Chat,xboston\/Rocket.Chat,mrsimpson\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,Achaikos\/Rocket.Chat,ahmadassaf\/Rocket.Chat,marzieh312\/Rocket.Chat,Dianoga\/Rocket.Chat,timkinnane\/Rocket.Chat,org100h1\/Rocket.Panda,wtsarchive\/Rocket.Chat,NMandapaty\/Rocket.Chat,litewhatever\/Rocket.Chat,k0nsl\/Rocket.Chat,LearnersGuild\/Rocket.Chat,subesokun\/Rocket.Chat,PavelVanecek\/Rocket.Chat,VoiSmart\/Rocket.Chat,ggazzo\/Rocket.Chat,pitamar\/Rocket.Chat,mrsimpson\/Rocket.Chat,org100h1\/Rocket.Panda,ziedmahdi\/Rocket.Chat,steedos\/chat,intelradoux\/Rocket.Chat,inoxth\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,xboston\/Rocket.Chat,flaviogrossi\/Rocket.Chat,Movile\/Rocket.Chat,wicked539\/Rocket.Chat,LearnersGuild\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,galrotem1993\/Rocket.Chat,acaronmd\/Rocket.Chat,abduljanjua\/TheHub,alexbrazier\/Rocket.Chat,igorstajic\/Rocket.Chat,LearnersGuild\/Rocket.Chat,amaapp\/ama,xasx\/Rocket.Chat,mrsimpson\/Rocket.Chat,flaviogrossi\/Rocket.Chat,ealbers\/Rocket.Chat,tntobias\/Rocket.Chat,xboston\/Rocket.Chat,4thParty\/Rocket.Chat,amaapp\/ama,litewhatever\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,linnovate\/hi,inoio\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,cnash\/Rocket.Chat,timkinnane\/Rocket.Chat,marzieh312\/Rocket.Chat,klatys\/Rocket.Chat,pitamar\/Rocket.Chat,fduraibi\/Rocket.Chat,abhishekshukla0302\/trico,wicked539\/Rocket.Chat,haoyixin\/Rocket.Chat,mccambridge\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,Gudii\/Rocket.Chat,JamesHGreen\/Rocket.Chat,wtsarchive\/Rocket.Chat,JamesHGreen\/Rocket_API,amaapp\/ama,tntobias\/Rocket.Chat,karlprieb\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,k0nsl\/Rocket.Chat,mccambridge\/Rocket.Chat,danielbressan\/Rocket.Chat,igorstajic\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,Gyubin\/Rocket.Chat,org100h1\/Rocket.Panda,flaviogrossi\/Rocket.Chat,pitamar\/Rocket.Chat,liuliming2008\/Rocket.Chat,marzieh312\/Rocket.Chat,4thParty\/Rocket.Chat,ahmadassaf\/Rocket.Chat,inoxth\/Rocket.Chat,steedos\/chat,Gudii\/Rocket.Chat,mwharrison\/Rocket.Chat,pkgodara\/Rocket.Chat,jbsavoy18\/rocketchat-1,igorstajic\/Rocket.Chat,JamesHGreen\/Rocket.Chat,4thParty\/Rocket.Chat,OtkurBiz\/Rocket.Chat,inoio\/Rocket.Chat,Gyubin\/Rocket.Chat,AimenJoe\/Rocket.Chat,timkinnane\/Rocket.Chat,cnash\/Rocket.Chat,AimenJoe\/Rocket.Chat,subesokun\/Rocket.Chat,pachox\/Rocket.Chat,haoyixin\/Rocket.Chat,Achaikos\/Rocket.Chat,LearnersGuild\/echo-chat,trt15-ssci-organization\/Rocket.Chat,marzieh312\/Rocket.Chat,AlecTroemel\/Rocket.Chat,NMandapaty\/Rocket.Chat,klatys\/Rocket.Chat,Dianoga\/Rocket.Chat,abhishekshukla0302\/trico,fatihwk\/Rocket.Chat,jbsavoy18\/rocketchat-1,matthewshirley\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,mwharrison\/Rocket.Chat,cnash\/Rocket.Chat,ziedmahdi\/Rocket.Chat,bt\/Rocket.Chat,Movile\/Rocket.Chat,ahmadassaf\/Rocket.Chat,steedos\/chat,xasx\/Rocket.Chat,Flitterkill\/Rocket.Chat,AimenJoe\/Rocket.Chat,Dianoga\/Rocket.Chat,Achaikos\/Rocket.Chat,xasx\/Rocket.Chat,ealbers\/Rocket.Chat,liuliming2008\/Rocket.Chat,galrotem1993\/Rocket.Chat,pkgodara\/Rocket.Chat,inoxth\/Rocket.Chat,nishimaki10\/Rocket.Chat,ealbers\/Rocket.Chat,wtsarchive\/Rocket.Chat,mrinaldhar\/Rocket.Chat,alexbrazier\/Rocket.Chat,subesokun\/Rocket.Chat,capensisma\/Rocket.Chat,ggazzo\/Rocket.Chat,Sing-Li\/Rocket.Chat,mrsimpson\/Rocket.Chat,Movile\/Rocket.Chat,galrotem1993\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,liuliming2008\/Rocket.Chat,galrotem1993\/Rocket.Chat,linnovate\/hi,snaiperskaya96\/Rocket.Chat,PavelVanecek\/Rocket.Chat,mrinaldhar\/Rocket.Chat,litewhatever\/Rocket.Chat,klatys\/Rocket.Chat,xasx\/Rocket.Chat,LearnersGuild\/echo-chat,klatys\/Rocket.Chat,abhishekshukla0302\/trico,OtkurBiz\/Rocket.Chat,LearnersGuild\/echo-chat,mrinaldhar\/Rocket.Chat,abduljanjua\/TheHub,karlprieb\/Rocket.Chat,VoiSmart\/Rocket.Chat,capensisma\/Rocket.Chat,abduljanjua\/TheHub,Dianoga\/Rocket.Chat,mccambridge\/Rocket.Chat,abduljanjua\/TheHub,pachox\/Rocket.Chat,bt\/Rocket.Chat,bt\/Rocket.Chat,acaronmd\/Rocket.Chat,yuyixg\/Rocket.Chat,wicked539\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,inoio\/Rocket.Chat,haoyixin\/Rocket.Chat,capensisma\/Rocket.Chat,NMandapaty\/Rocket.Chat,inoxth\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 14, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.18.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, developerTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"Statistics_opt_out\", value = \"true\"),\n (key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n (key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 14, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.18.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, developerTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"Statistics_opt_out\", value = \"true\")\n (key = \"Accounts_AllowUserAvatarChange\", value = \"false\")\n (key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"3e6e810e5ee0980571fdc8fdb2040936bb585403","subject":"Add EventList type","message":"Add EventList type\n","repos":"ternaris\/marv-robotics,ternaris\/marv-robotics","old_file":"code\/marv-api\/marv_detail\/types.capnp","new_file":"code\/marv-api\/marv_detail\/types.capnp","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"5326ffc796afd45135ff630c30118ded9556eaaa","subject":"Flesh out pipelining a little more, so that it can be extended later.","message":"Flesh out pipelining a little more, so that it can be extended later.\n","repos":"hntrmrrs\/capnproto,rcrowder\/capnproto,Fraser999\/capnproto,bsn069\/capnproto,rcrowder\/capnproto,kamalmarhubi\/capnproto,artillery\/capnproto,zarvox\/capnproto,ocdtrekkie\/capnproto,zarvox\/capnproto,modulexcite\/capnproto,joliss\/capnproto,mrdomino\/capnproto,mologie\/capnproto,kamalmarhubi\/capnproto,maurer\/capnproto,maurer\/capnproto,geofft\/capnproto,pjulien\/capnproto,bryce-gibson\/capnproto,khklau\/capnproto,johnkdoe\/capnproto,MarPiRK\/capnproto,Fraser999\/capnproto,modulexcite\/capnproto,MarPiRK\/capnproto,hntrmrrs\/capnproto,mologie\/capnproto,ocdtrekkie\/capnproto,a-richardson\/capnproto,martindale\/capnproto,a-richardson\/capnproto,joliss\/capnproto,zarvox\/capnproto,khklau\/capnproto,ligzy\/capnproto,pjulien\/capnproto,rcrowder\/capnproto,mrdomino\/capnproto,joliss\/capnproto,bsn069\/capnproto,nagyistoce\/capnproto,artillery\/capnproto,hntrmrrs\/capnproto,vladon\/capnproto,martindale\/capnproto,geofft\/capnproto,MarPiRK\/capnproto,bsn069\/capnproto,ocdtrekkie\/capnproto,modulexcite\/capnproto,vladon\/capnproto,ligzy\/capnproto,Fraser999\/capnproto,nagyistoce\/capnproto,johnkdoe\/capnproto,kamalmarhubi\/capnproto,martindale\/capnproto,jparyani\/capnproto,mrdomino\/capnproto,johnkdoe\/capnproto,geofft\/capnproto,pjulien\/capnproto,nagyistoce\/capnproto,maurer\/capnproto,vladon\/capnproto,ligzy\/capnproto,bryce-gibson\/capnproto,jparyani\/capnproto,artillery\/capnproto,a-richardson\/capnproto,khklau\/capnproto,bryce-gibson\/capnproto,jparyani\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 0 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n finish @2 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @3 :Resolve; # Resolve a previously-sent promise.\n release @4 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @5 :Save; # Save a capability persistently.\n restore @6 :Restore; # Restore a persistent capability from a previous connection.\n delete @7 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @8 :Provide; # Provide a capability to a third party.\n accept @9 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @10 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Level 0 implementations may want to respond to a `Resolve` by sending an appropriate `Release`\n # message, otherwise the object will stick around until the connection is closed even though\n # it will never be used.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(PathPart);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n\n struct PathPart {\n union {\n noop @0 :Void;\n # Dummy. Ignore this part. This field is only here so that we can define PathPart to be\n # a union which we might extend in the future. If an RPC implementation receives a PathPart\n # of a type it doesn't recognize, it should reply with a `Return` with `unsupportedPipelineOp`\n # set.\n\n pointerIndex @1 :UInt16;\n # Index of a pointer in the pointer section of a struct. Only valid when addressing a\n # struct.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based \/ point-free language where `PathPart`\n # specifies one \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 0 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n finish @2 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @3 :Resolve; # Resolve a previously-sent promise.\n release @4 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @5 :Save; # Save a capability persistently.\n restore @6 :Restore; # Restore a persistent capability from a previous connection.\n delete @7 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @8 :Provide; # Provide a capability to a third party.\n accept @9 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @10 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Level 0 implementations may want to respond to a `Resolve` by sending an appropriate `Release`\n # message, otherwise the object will stick around until the connection is closed even though\n # it will never be used.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list? Of course, if we wanted to get arbitrarily\n # complicated, the ideal would be for the caller to be able to upload a script to run that\n # derives the capability given the former answer, but that's probably unreasonable.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"975e2e42beb8c14140df796d58a03a477ee2d399","subject":"filesystem.capnp: tabs -> spaces","message":"filesystem.capnp: tabs -> spaces\n","repos":"zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem,zenhack\/sandstorm-filesystem","old_file":"filesystem.capnp","new_file":"filesystem.capnp","new_contents":"@0xe91f231103c0780e;\n\nusing Go = import \"\/go.capnp\";\nusing Util = import \"\/util.capnp\";\n\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\ninterface Node {\n type @0 () -> (type :Type);\n enum Type {\n dir @0;\n file @1;\n }\n\n canWrite @1 () -> (canWrite :Bool);\n}\n\ninterface Directory extends(Node) {\n list @0 () -> (list: List(Entry));\n struct Entry {\n name @0 :Text;\n file @1 :Node;\n }\n\n open @1 (name :Text) -> (node :Node);\n}\n\ninterface RwDirectory extends(Directory) {\n create @0 (name :Text, type :Node.Type) -> (node :Node);\n # Create a node named `name` within the directory. `type`\n # indicates what type of node to create. The returned `node`\n # always implements the writable variant of that type.\n\n delete @1 (name :Text);\n # Delete the node in this directory named `name`.\n}\n\ninterface File extends(Node) {\n size @0 () -> (size: UInt64);\n # Return the size of the file.\n\n read @1 (startAt :UInt64, amount :UInt64, sink :Util.ByteStream) ->\n (handle :Util.Handle);\n # Read `amount` bytes from the file into `sink`, starting at position\n # `startAt`. As a special case, if `amount` is 0, data will be read\n # until the end of the file is reached.\n #\n # Dropping the returned handle can be used to request that the transfer\n # be canceled.\n}\n\ninterface RwFile extends(File) {\n write @0 (startAt :UInt64) -> (sink :Util.ByteStream);\n # Return a ByteStream that can be used to write data to the file.\n # Writing starts at offset `startAt`.\n\n truncate @1 (size :UInt64);\n # Truncate the file to `size` bytes.\n}\n","old_contents":"@0xe91f231103c0780e;\n\nusing Go = import \"\/go.capnp\";\nusing Util = import \"\/util.capnp\";\n\n$Go.package(\"filesystem\");\n$Go.import(\"zenhack.net\/go\/sandstorm-filesystem\");\n\ninterface Node {\n\ttype @0 () -> (type :Type);\n\tenum Type {\n\t\tdir @0;\n\t\tfile @1;\n\t}\n\n\tcanWrite @1 () -> (canWrite :Bool);\n}\n\ninterface Directory extends(Node) {\n list @0 () -> (list: List(Entry));\n struct Entry {\n name @0 :Text;\n file @1 :Node;\n }\n\n\topen @1 (name :Text) -> (node :Node);\n}\n\ninterface RwDirectory extends(Directory) {\n create @0 (name :Text, type :Node.Type) -> (node :Node);\n\t# Create a node named `name` within the directory. `type`\n\t# indicates what type of node to create. The returned `node`\n\t# always implements the writable variant of that type.\n\n\tdelete @1 (name :Text);\n\t# Delete the node in this directory named `name`.\n}\n\ninterface File extends(Node) {\n size @0 () -> (size: UInt64);\n\t# Return the size of the file.\n\n read @1 (startAt :UInt64, amount :UInt64, sink :Util.ByteStream) ->\n\t\t(handle :Util.Handle);\n\t# Read `amount` bytes from the file into `sink`, starting at position\n\t# `startAt`. As a special case, if `amount` is 0, data will be read\n\t# until the end of the file is reached.\n\t#\n\t# Dropping the returned handle can be used to request that the transfer\n\t# be canceled.\n}\n\ninterface RwFile extends(File) {\n write @0 (startAt :UInt64) -> (sink :Util.ByteStream);\n\t# Return a ByteStream that can be used to write data to the file.\n\t# Writing starts at offset `startAt`.\n\n truncate @1 (size :UInt64);\n\t# Truncate the file to `size` bytes.\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"d54568d3ee65f5725ea09368c9c471df2efe783b","subject":"Updated Sandstorm Config to latest Standards","message":"Updated Sandstorm Config to latest Standards\n\nSigned-off-by: JJ <14e793d896ddc8ca6911747228e86464cf420065@jambor.pro>\n","repos":"JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2016.02.26 beta\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork notebook\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n marketBig = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"jan@jambor.pro\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Twostairs\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Notetaking\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n # Used for integrating permissions and roles into the Sandstorm shell\n # and for sandstorm-http-bridge to pass to your app.\n # Uncomment this block and adjust the permissions and roles to make\n # sense for your app.\n # For more information, see high-level documentation at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # and advanced details in the \"BridgeConfig\" section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n viewInfo = (\n # For details on the viewInfo field, consult \"ViewInfo\" in\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n permissions = [\n # Permissions which a user may or may not possess. A user's current\n # permissions are passed to the app as a comma-separated list of `name`\n # fields in the X-Sandstorm-Permissions header with each request.\n #\n # IMPORTANT: only ever append to this list! Reordering or removing fields\n # will change behavior and permissions for existing grains! To deprecate a\n # permission, or for more information, see \"PermissionDef\" in\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n (\n name = \"admin\",\n # Name of the permission, used as an identifier for the permission in cases where string\n # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n\n title = (defaultText = \"admin\"),\n # Display name of the permission, e.g. to display in a checklist of permissions\n # that may be assigned when sharing.\n\n description = (defaultText = \"Is the owner.\")\n # Prose describing what this role means, suitable for a tool tip or similar help text.\n ),\n (\n name = \"write\",\n title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")\n ),\n (\n name = \"read\",\n title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\")\n )\n ],\n roles = [\n # Roles are logical collections of permissions. For instance, your app may have\n # a \"viewer\" role and an \"editor\" role\n (\n title = (defaultText = \"Owner\"),\n # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n\n permissions = [true, true, true],\n # An array indicating which permissions this role carries.\n # It should be the same length as the permissions array in\n # viewInfo, and the order of the lists must match.\n\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n # Brief explanatory text to show in the sharing UI indicating\n # what a user assigned this role will be able to do with the grain.\n\n description = (defaultText = \"Owners may view and edit all notes and change settings.\"),\n # Prose describing what this role means, suitable for a tool tip or similar help text.\n ),\n (\n title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\"),\n description = (defaultText = \"User may view and edit all notes.\")\n ),\n (\n title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"),\n description = (defaultText = \"Users may view all notes.\")\n )\n ]\n )\n # Apps can export an API to the world. The API is to be used primarily by Javascript\n # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # this string, if specified.\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2016.02.02 beta\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"9e80e4f383549981a852ba8566e77954e935604b","subject":"Make the calculator schema more usable.","message":"Make the calculator schema more usable.\n\nThis is a backwards-compatible change on the wire level, but getting rid\nof the extra nesting makes things generally more pleasant.\n","repos":"zenhack\/haskell-capnp","old_file":"examples\/calculator.capnp","new_file":"examples\/calculator.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0x85150b117366d14b;\n\ninterface Calculator {\n # A \"simple\" mathematical calculator, callable via RPC.\n #\n # But, to show off Cap'n Proto, we add some twists:\n #\n # - You can use the result from one call as the input to the next\n # without a network round trip. To accomplish this, evaluate()\n # returns a `Value` object wrapping the actual numeric value.\n # This object may be used in a subsequent expression. With\n # promise pipelining, the Value can actually be used before\n # the evaluate() call that creates it returns!\n #\n # - You can define new functions, and then call them. This again\n # shows off pipelining, but it also gives the client the\n # opportunity to define a function on the client side and have\n # the server call back to it.\n #\n # - The basic arithmetic operators are exposed as Functions, and\n # you have to call getOperator() to obtain them from the server.\n # This again demonstrates pipelining -- using getOperator() to\n # get each operator and then using them in evaluate() still\n # only takes one network round trip.\n\n evaluate @0 (expression :Expression) -> (value :Value);\n # Evaluate the given expression and return the result. The\n # result is returned wrapped in a Value interface so that you\n # may pass it back to the server in a pipelined request. To\n # actually get the numeric value, you must call read() on the\n # Value -- but again, this can be pipelined so that it incurs\n # no additional latency.\n\n\n defFunction @1 (paramCount :Int32, body :Expression)\n -> (func :Function);\n # Define a function that takes `paramCount` parameters and returns the\n # evaluation of `body` after substituting these parameters.\n\n getOperator @2 (op :Operator) -> (func :Function);\n # Get a Function representing an arithmetic operator, which can then be\n # used in Expressions.\n}\n\nstruct Expression @0xd438d7caf5548d15 {\n # A numeric expression.\n\n union {\n literal @0 :Float64;\n # A literal numeric value.\n\n previousResult @1 :Value;\n # A value that was (or, will be) returned by a previous\n # evaluate().\n\n parameter @2 :UInt32;\n # A parameter to the function (only valid in function bodies;\n # see defFunction).\n\n call :group {\n # Call a function on a list of parameters.\n function @3 :Function;\n params @4 :List(Expression);\n }\n }\n}\n\ninterface Value @0xc3e69d34d3ee48d2 {\n # Wraps a numeric value in an RPC object. This allows the value\n # to be used in subsequent evaluate() requests without the client\n # waiting for the evaluate() that returns the Value to finish.\n\n read @0 () -> (value :Float64);\n # Read back the raw numeric value.\n}\n\ninterface Function @0xede83a3d96840394 {\n # An algebraic function. Can be called directly, or can be used inside\n # an Expression.\n #\n # A client can create a Function that runs on the server side using\n # `defFunction()` or `getOperator()`. Alternatively, a client can\n # implement a Function on the client side and the server will call back\n # to it. However, a function defined on the client side will require a\n # network round trip whenever the server needs to call it, whereas\n # functions defined on the server and then passed back to it are called\n # locally.\n\n call @0 (params :List(Float64)) -> (value :Float64);\n # Call the function on the given parameters.\n}\n\nenum Operator @0x8793407861e6dfe6 {\n add @0;\n subtract @1;\n multiply @2;\n divide @3;\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0x85150b117366d14b;\n\ninterface Calculator {\n # A \"simple\" mathematical calculator, callable via RPC.\n #\n # But, to show off Cap'n Proto, we add some twists:\n #\n # - You can use the result from one call as the input to the next\n # without a network round trip. To accomplish this, evaluate()\n # returns a `Value` object wrapping the actual numeric value.\n # This object may be used in a subsequent expression. With\n # promise pipelining, the Value can actually be used before\n # the evaluate() call that creates it returns!\n #\n # - You can define new functions, and then call them. This again\n # shows off pipelining, but it also gives the client the\n # opportunity to define a function on the client side and have\n # the server call back to it.\n #\n # - The basic arithmetic operators are exposed as Functions, and\n # you have to call getOperator() to obtain them from the server.\n # This again demonstrates pipelining -- using getOperator() to\n # get each operator and then using them in evaluate() still\n # only takes one network round trip.\n\n evaluate @0 (expression :Expression) -> (value :Value);\n # Evaluate the given expression and return the result. The\n # result is returned wrapped in a Value interface so that you\n # may pass it back to the server in a pipelined request. To\n # actually get the numeric value, you must call read() on the\n # Value -- but again, this can be pipelined so that it incurs\n # no additional latency.\n\n struct Expression {\n # A numeric expression.\n\n union {\n literal @0 :Float64;\n # A literal numeric value.\n\n previousResult @1 :Value;\n # A value that was (or, will be) returned by a previous\n # evaluate().\n\n parameter @2 :UInt32;\n # A parameter to the function (only valid in function bodies;\n # see defFunction).\n\n call :group {\n # Call a function on a list of parameters.\n function @3 :Function;\n params @4 :List(Expression);\n }\n }\n }\n\n interface Value {\n # Wraps a numeric value in an RPC object. This allows the value\n # to be used in subsequent evaluate() requests without the client\n # waiting for the evaluate() that returns the Value to finish.\n\n read @0 () -> (value :Float64);\n # Read back the raw numeric value.\n }\n\n defFunction @1 (paramCount :Int32, body :Expression)\n -> (func :Function);\n # Define a function that takes `paramCount` parameters and returns the\n # evaluation of `body` after substituting these parameters.\n\n interface Function {\n # An algebraic function. Can be called directly, or can be used inside\n # an Expression.\n #\n # A client can create a Function that runs on the server side using\n # `defFunction()` or `getOperator()`. Alternatively, a client can\n # implement a Function on the client side and the server will call back\n # to it. However, a function defined on the client side will require a\n # network round trip whenever the server needs to call it, whereas\n # functions defined on the server and then passed back to it are called\n # locally.\n\n call @0 (params :List(Float64)) -> (value :Float64);\n # Call the function on the given parameters.\n }\n\n getOperator @2 (op :Operator) -> (func :Function);\n # Get a Function representing an arithmetic operator, which can then be\n # used in Expressions.\n\n enum Operator {\n add @0;\n subtract @1;\n multiply @2;\n divide @3;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"de3c23b2d793fe916aeb43a7b059688e04c19b9d","subject":"Regenerated schema ID (not sure if this is useful, but it does not hurt)","message":"Regenerated schema ID (not sure if this is useful, but it does not hurt)\n","repos":"niekbouman\/commelec-api,niekbouman\/commelec-api,niekbouman\/commelec-api,niekbouman\/commelec-api","old_file":"src\/schema.capnp","new_file":"src\/schema.capnp","new_contents":"# The MIT License (MIT)\n# \n# Copyright (c) 2015 Andrey Bernstein and Niek J. Bouman\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n# \n@0xdb1b4800e80dbd2d;\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"msg\");\n#\n# COMMELEC message format v1.0\n#\n# Specified in Cap'n Proto's schema language (Requires Cap'n Proto v0.5\n# [ http:\/\/kentonv.github.io\/capnproto\/language.html ] \n#\n# Copyright (c) 2015 by Andrey Bernstein & Niek J. Bouman\n#\n# EPFL - Swiss Federal Institute of Technology Lausanne\n\n#=====================================================\n# Top-Level \"Message\" Type, Request and Advertisement \n#=====================================================\n\nstruct Message {\n agentId @0 :UInt32;\n union {\n request @1 :Request;\n advertisement @2 :Advertisement;\n }\n}\n\nstruct Request {\n setpoint @0 :List(Float64);\n}\n\nstruct Advertisement {\n pQProfile @0 :SetExpr;\n beliefFunction @1 :SetExpr;\n costFunction @2 :RealExpr;\n implementedSetpoint @3 :List(Float64);\n}\n\n#==============================================\n# Definition of RealExpr and its child structs\n#==============================================\n\nstruct RealExpr {\n name @0 :Text;\n union {\n real @1 :Float64;\n polynomial @2 :Polynomial;\n unaryOperation @3 :UnaryOperation;\n binaryOperation @4 :BinaryOperation;\n listOperation @5 :ListOperation;\n caseDistinction @6 :CaseDistinction(RealExpr);\n reference @7 :Text;\n }\n}\n\nstruct UnaryOperation {\n arg @0 :RealExpr;\n operation :union {\n negate @1 :Void;\n abs @2 :Void;\n sign @3 :Void;\n multInv @4 :Void;\n square @5 :Void;\n sqrt @6 :Void;\n sin @7 :Void;\n cos @8 :Void;\n tan @9 :Void;\n exp @10 :Void;\n ln @11 :Void;\n log10 @12 :Void;\n round @13 :Void;\n floor @14 :Void;\n ceil @15 :Void;\n }\n}\n\nstruct BinaryOperation {\n argA @0 :RealExpr;\n argB @1 :RealExpr;\n operation :union {\n sum @2 :Void;\n prod @3 :Void;\n pow @4 :Void;\n min @5 :Void;\n max @6 :Void;\n lessEqThan @7 :Void; # expression yields a boolean\n greaterThan @8 :Void; # expression yields a boolean\n }\n}\n\nstruct ListOperation {\n args @0 :List(RealExpr);\n operation :union {\n sum @1 :Void;\n prod @2 :Void;\n }\n}\n\nstruct Polynomial {\n variables @0 :List(Text);\n maxVarDegree @1 :UInt8; \n coefficients @2 :List(SparseCoeff);\n}\n\nstruct SparseCoeff {\n offset @0 :UInt32;\n value @1 :Float64;\n}\n\nstruct CaseDistinction(CaseType) {\n variables @0 :List(Text);\n cases @1 :List(ExprCase(CaseType)); \n}\n\nstruct ExprCase(CaseType) {\n # Representation of a single case for use in CaseDistinction\n # (order of evaluation follows List ordering)\n set @0 :SetExpr;\n expression @1 :CaseType;\n}\n\n#=============================================\n# Definition of SetExpr and its child structs\n#=============================================\n\nstruct SetExpr {\n name @0 :Text;\n union {\n singleton @1 :List(RealExpr); # dimension of the point equals the length of the list \n ball @2 :Ball;\n rectangle @3 :List(BoundaryPair);\n convexPolytope @4 :ConvexPolytope;\n intersection @5 :List(SetExpr);\n caseDistinction @6 :CaseDistinction(SetExpr);\n reference @7 :Text;\n }\n}\n\nstruct Ball {\n center @0 :List(RealExpr);\n radius @1 :RealExpr;\n}\n\nstruct BoundaryPair {\n boundA @0 :RealExpr; # the \"interpreter\" is responsible for sorting \n boundB @1 :RealExpr; # the bounds, i.e., which bound is min and max \n}\n\nstruct ConvexPolytope {\n # A convex polytope formed by linear constraints\n # In case of a polygon, i.e., a two-dimensional polytope, the\n # length of the inner list of field 'a' will be equal to two. \n a @0 :List(List(RealExpr));\n b @1 :List(RealExpr);\n}\n","old_contents":"@0xcadbcdbd64e38f8a;\n\n# The MIT License (MIT)\n# \n# Copyright (c) 2015 Andrey Bernstein and Niek J. Bouman\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n# \n\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"msg\");\n#\n# COMMELEC message format v1.0\n#\n# Specified in Cap'n Proto's schema language (Requires Cap'n Proto v0.5\n# [ http:\/\/kentonv.github.io\/capnproto\/language.html ] \n#\n# Copyright (c) 2015 by Andrey Bernstein & Niek J. Bouman\n#\n# EPFL - Swiss Federal Institute of Technology Lausanne\n\n#=====================================================\n# Top-Level \"Message\" Type, Request and Advertisement \n#=====================================================\n\nstruct Message {\n agentId @0 :UInt32;\n union {\n request @1 :Request;\n advertisement @2 :Advertisement;\n }\n}\n\nstruct Request {\n setpoint @0 :List(Float64);\n}\n\nstruct Advertisement {\n pQProfile @0 :SetExpr;\n beliefFunction @1 :SetExpr;\n costFunction @2 :RealExpr;\n implementedSetpoint @3 :List(Float64);\n}\n\n#==============================================\n# Definition of RealExpr and its child structs\n#==============================================\n\nstruct RealExpr {\n name @0 :Text;\n union {\n real @1 :Float64;\n polynomial @2 :Polynomial;\n unaryOperation @3 :UnaryOperation;\n binaryOperation @4 :BinaryOperation;\n listOperation @5 :ListOperation;\n caseDistinction @6 :CaseDistinction(RealExpr);\n reference @7 :Text;\n }\n}\n\nstruct UnaryOperation {\n arg @0 :RealExpr;\n operation :union {\n negate @1 :Void;\n abs @2 :Void;\n sign @3 :Void;\n multInv @4 :Void;\n square @5 :Void;\n sqrt @6 :Void;\n sin @7 :Void;\n cos @8 :Void;\n tan @9 :Void;\n exp @10 :Void;\n ln @11 :Void;\n log10 @12 :Void;\n round @13 :Void;\n floor @14 :Void;\n ceil @15 :Void;\n }\n}\n\nstruct BinaryOperation {\n argA @0 :RealExpr;\n argB @1 :RealExpr;\n operation :union {\n sum @2 :Void;\n prod @3 :Void;\n pow @4 :Void;\n min @5 :Void;\n max @6 :Void;\n lessEqThan @7 :Void; # expression yields a boolean\n greaterThan @8 :Void; # expression yields a boolean\n }\n}\n\nstruct ListOperation {\n args @0 :List(RealExpr);\n operation :union {\n sum @1 :Void;\n prod @2 :Void;\n }\n}\n\nstruct Polynomial {\n variables @0 :List(Text);\n maxVarDegree @1 :UInt8; \n coefficients @2 :List(SparseCoeff);\n}\n\nstruct SparseCoeff {\n offset @0 :UInt32;\n value @1 :Float64;\n}\n\nstruct CaseDistinction(CaseType) {\n variables @0 :List(Text);\n cases @1 :List(ExprCase(CaseType)); \n}\n\nstruct ExprCase(CaseType) {\n # Representation of a single case for use in CaseDistinction\n # (order of evaluation follows List ordering)\n set @0 :SetExpr;\n expression @1 :CaseType;\n}\n\n#=============================================\n# Definition of SetExpr and its child structs\n#=============================================\n\nstruct SetExpr {\n name @0 :Text;\n union {\n singleton @1 :List(RealExpr); # dimension of the point equals the length of the list \n ball @2 :Ball;\n rectangle @3 :List(BoundaryPair);\n convexPolytope @4 :ConvexPolytope;\n intersection @5 :List(SetExpr);\n caseDistinction @6 :CaseDistinction(SetExpr);\n reference @7 :Text;\n }\n}\n\nstruct Ball {\n center @0 :List(RealExpr);\n radius @1 :RealExpr;\n}\n\nstruct BoundaryPair {\n boundA @0 :RealExpr; # the \"interpreter\" is responsible for sorting \n boundB @1 :RealExpr; # the bounds, i.e., which bound is min and max \n}\n\nstruct ConvexPolytope {\n # A convex polytope formed by linear constraints\n # In case of a polygon, i.e., a two-dimensional polytope, the\n # length of the inner list of field 'a' will be equal to two. \n a @0 :List(List(RealExpr));\n b @1 :List(RealExpr);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"7b917f1d1dfff9b317e92e6c874ec77fc1f6f417","subject":"for now we still need an action title","message":"for now we still need an action title\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.0\"),\n\n actions = [\n ( title = (defaultText = \"new collection\"),\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"http:\/\/example.com\",\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.0\"),\n\n actions = [\n ( nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"http:\/\/example.com\",\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"60d95cf8ed36c54927a51f20891fda2fe960f790","subject":"Remove capnp file","message":"Remove capnp file\n","repos":"exonum\/exonum,alekseysidorov\/exonum,alekseysidorov\/exonum,exonum\/exonum,alekseysidorov\/exonum,alekseysidorov\/exonum,exonum\/exonum,exonum\/exonum","old_file":"protocol.capnp","new_file":"protocol.capnp","new_contents":"","old_contents":"@0x8f2371dbd372cf8c;\n\nstruct Connect {\n ip @0 : UInt32; # TODO: supporting IP V6\n port @1 : UInt16;\n time @2 : UInt64;\n}\n\nstruct Propose {\n height @0 : UInt64;\n round @1 : UInt32;\n time @2 : UInt64;\n prevHash @3 : Data;\n}\n\nstruct Prevote {\n height @0 : UInt64;\n round @1 : UInt64;\n blockHash @2 : Data;\n}\n\nstruct Precommit {\n height @0 : UInt64;\n round @1 : UInt64;\n blockHash @2 : Data;\n}\n\nstruct Commit {\n height @0 : UInt64;\n blockHash @1 : Data;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"dbbdebf313a7d6d625c7a574560db125557836eb","subject":"Bump sandstorm app version","message":"Bump sandstorm app version\n","repos":"FSFTN\/Wekan,TribeMedia\/wekan,johnleeming\/wekan,ggalancs\/wekan,araczkowski\/paczka.pro,mechiles\/wekan,araczkowski\/paczka.pro,oliver4u\/sap-wekan,evdevgit\/wekan,johnleeming\/wekan,wykeith\/cp2m,jtickle\/wekan,wekan\/wekan,gelojavonitalla\/wekan,ketanbhatt\/wekan,libreboard\/libreboard,iu2fish\/wekan,nixoz\/wekan,bitIO\/wekan,AdrianoCahete\/wekan,assarbad\/wekan,floatinghotpot\/wekan,felipecosta07\/js,ahmadassaf\/libreboard,rpiza\/wekan,assarbad\/wekan,oliver4u\/sap-wekan,fisle\/wekan,oliver4u\/WEKAN_runpartner,ggalancs\/wekan,christmo\/wekan,ddanssaert\/wekan,mruse\/wekan,atFriendly\/wekan,Serubin\/wekan,araczkowski\/paczka.pro,Serubin\/wekan,Serubin\/wekan,RyanTech\/wekan,umeshrs\/wekan,Zyko0\/wekan,jimmiebtlr\/wekan,samtechie\/wekan,christmo\/wekan,AlexanderS\/wekan,atFriendly\/wekan,nztqa\/wekan,mechiles\/wekan,GhassenRjab\/wekan,FSFTN\/Wekan,ddanssaert\/wekan,chrootsu\/wekan,ddanssaert\/wekan,TribeMedia\/wekan,jimmiebtlr\/wekan,wekan\/wekan,pro-to-tip\/wekan,wekan\/wekan,wekan\/wekan,xuxingfan\/wekan,rpiza\/wekan,umeshrs\/wekan,nztqa\/wekan,felipecosta07\/js,iu2fish\/wekan,gelojavonitalla\/wekan,ketanbhatt\/wekan,ndarilek\/wekan,nixoz\/wekan,libreboard\/libreboard,mario-orlicky\/wekan,oliver4u\/WEKAN_runpartner,ndarilek\/wekan,Xperterra\/wekan,mario-orlicky\/wekan,MickyBlue\/wekan,GhassenRjab\/wekan,floatinghotpot\/wekan,samtechie\/wekan,johnleeming\/wekan,AlexanderS\/wekan,mruse\/wekan,fisle\/wekan,Zyko0\/wekan,xuxingfan\/wekan,nztqa\/wekan,oliver4u\/sap-wekan,wangdeshui\/wekan,ahmadassaf\/libreboard,mario-orlicky\/wekan,pro-to-tip\/wekan,wykeith\/cp2m,RyanTech\/wekan,GhassenRjab\/wekan,jtickle\/wekan,jtickle\/wekan,evdevgit\/wekan,Xperterra\/wekan,wangdeshui\/wekan,oliver4u\/WEKAN_runpartner,AdrianoCahete\/wekan,chrootsu\/wekan,bitIO\/wekan,johnleeming\/wekan,MickyBlue\/wekan,ahmadassaf\/libreboard,wekan\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 6,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.9.0\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"History.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 5,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.9.0\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"History.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"2483c515ef9a73ec92ceb7325d2ed4ac9bf09f8d","subject":"Always include the static assets of the app (excluding node_modules)","message":"Always include the static assets of the app (excluding node_modules)\n","repos":"jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n # For this app, we exclude a node_modules directory that\n # is only used at build time.\n \"opt\/app\/static\/node_modules\",\n # For all vagrant-spk apps, we don't care about the Vagrant\n # VM state, so we ignore it here.\n \"opt\/app\/.sandstorm\/.vagrant\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/static\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"ebf7734ecbe65e8a0ea261835c4864fb1da29369","subject":"Add const test.","message":"Add const test.\n\nNot perfect. But it works.\n\nThe SUT should not read the message for the decode test, but rather\nprint the decoded string using the const value from the schema.\n\nLikewise, it should set the msg field of the SimpleTest struct to that\nof the const value explicitly, rather sending a default (empty) struct\nvalue.\n","repos":"kaos\/capnp_test","old_file":"test.capnp","new_file":"test.capnp","new_contents":"# Copyright 2013 Andreas Stenius \n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n@0xa510a585dee47e0b;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp_test\");\n\n\n########################################\n## List with all available tests\n########################################\n\nconst allTests :List(Text) = \n[\n \"simpleTest\",\n \"textListTypeTest\",\n \"uInt8DefaultValueTest\",\n \"constTest\"\n];\n\n\n########################################\n## Define test data\n########################################\n\nconst simpleTestType :Text = \"SimpleTest\";\nconst simpleTest :SimpleTest = (int = 1234567890, msg = \"a short message...\");\n\nconst textListTypeTestType :Text = \"ListTest\";\nconst textListTypeTest :ListTest = (textList = [\"foo\", \"bar\", \"baz\"]);\n\nconst uInt8DefaultValueTestType :Text = \"TestDefaults\";\nconst uInt8DefaultValueTest :TestDefaults = (uInt8Field = 0);\n\nconst constTestType :Text = \"SimpleTest\";\nconst constTestValue :Text = \"A const text test value.\";\nconst constTest :SimpleTest = (msg = .constTestValue);\n\n########################################\n## Types used by tests\n########################################\n\nstruct SimpleTest {\n int @0 :Int32;\n msg @1 :Text;\n}\n\nstruct ListTest {\n# union {\n textList @0 :List(Text);\n# nextList @1 :...;\n# }\n}\n\n\n## Types copied from capnproto\/c++\/src\/test.capnp\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = \"bar\";\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n","old_contents":"# Copyright 2013 Andreas Stenius \n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n@0xa510a585dee47e0b;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp_test\");\n\n\n########################################\n## List with all available tests\n########################################\n\nconst allTests :List(Text) = \n[\n \"simpleTest\",\n \"textListTypeTest\",\n \"uInt8DefaultValueTest\"\n];\n\n\n########################################\n## Define test data\n########################################\n\nconst simpleTestType :Text = \"SimpleTest\";\nconst simpleTest :SimpleTest = (int = 1234567890, msg = \"a short message...\");\n\nconst textListTypeTestType :Text = \"ListTest\";\nconst textListTypeTest :ListTest = (textList = [\"foo\", \"bar\", \"baz\"]);\n\nconst uInt8DefaultValueTestType :Text = \"TestDefaults\";\nconst uInt8DefaultValueTest :TestDefaults = (uInt8Field = 0);\n\n\n########################################\n## Types used by tests\n########################################\n\nstruct SimpleTest {\n int @0 :Int32;\n msg @1 :Text;\n}\n\nstruct ListTest {\n# union {\n textList @0 :List(Text);\n# nextList @1 :...;\n# }\n}\n\n\n## Types copied from capnproto\/c++\/src\/test.capnp\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = \"bar\";\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"a9995f399786fc1571d0f8da5e42fcdc0a5eb355","subject":"Jack <3 Chandni: Added icons for app.","message":"Jack <3 Chandni: Added icons for app.\n","repos":"sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5yvm5asuzk62p6s8jw0p33w2ktsn189ne0c9j2pvww5gq84exmf0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n #author = (\n # contactEmail = \"hackerslides@jacksingleton.com\",\n # pgpSignature = embed \"pgp-signature\",\n #),\n\n #pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n #screenshots = [\n # (width = 448, height = 343, png = embed \"screenshot.png\")\n #],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5yvm5asuzk62p6s8jw0p33w2ktsn189ne0c9j2pvww5gq84exmf0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"83e899feecf11de5c1adec8a33d5589e8c166fcf","subject":"turn off stats report for Sandstorm deployments","message":"turn off stats report for Sandstorm deployments\n","repos":"marzieh312\/Rocket.Chat,liuliming2008\/Rocket.Chat,mrinaldhar\/Rocket.Chat,PavelVanecek\/Rocket.Chat,Flitterkill\/Rocket.Chat,pkgodara\/Rocket.Chat,acaronmd\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,LearnersGuild\/echo-chat,pitamar\/Rocket.Chat,ziedmahdi\/Rocket.Chat,Sing-Li\/Rocket.Chat,org100h1\/Rocket.Panda,litewhatever\/Rocket.Chat,ggazzo\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ahmadassaf\/Rocket.Chat,tntobias\/Rocket.Chat,Gudii\/Rocket.Chat,JamesHGreen\/Rocket.Chat,org100h1\/Rocket.Panda,JamesHGreen\/Rocket.Chat,inoxth\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ahmadassaf\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,mccambridge\/Rocket.Chat,LearnersGuild\/echo-chat,linnovate\/hi,Sing-Li\/Rocket.Chat,xasx\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ziedmahdi\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,danielbressan\/Rocket.Chat,pkgodara\/Rocket.Chat,Gyubin\/Rocket.Chat,fduraibi\/Rocket.Chat,danielbressan\/Rocket.Chat,flaviogrossi\/Rocket.Chat,inoio\/Rocket.Chat,flaviogrossi\/Rocket.Chat,fatihwk\/Rocket.Chat,steedos\/chat,Movile\/Rocket.Chat,timkinnane\/Rocket.Chat,mwharrison\/Rocket.Chat,nishimaki10\/Rocket.Chat,yuyixg\/Rocket.Chat,galrotem1993\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,mrsimpson\/Rocket.Chat,litewhatever\/Rocket.Chat,yuyixg\/Rocket.Chat,VoiSmart\/Rocket.Chat,timkinnane\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,LearnersGuild\/Rocket.Chat,haoyixin\/Rocket.Chat,litewhatever\/Rocket.Chat,PavelVanecek\/Rocket.Chat,ggazzo\/Rocket.Chat,fduraibi\/Rocket.Chat,karlprieb\/Rocket.Chat,inoio\/Rocket.Chat,mccambridge\/Rocket.Chat,Movile\/Rocket.Chat,jbsavoy18\/rocketchat-1,galrotem1993\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,steedos\/chat,alexbrazier\/Rocket.Chat,k0nsl\/Rocket.Chat,k0nsl\/Rocket.Chat,AimenJoe\/Rocket.Chat,Flitterkill\/Rocket.Chat,Achaikos\/Rocket.Chat,inoxth\/Rocket.Chat,timkinnane\/Rocket.Chat,pitamar\/Rocket.Chat,alexbrazier\/Rocket.Chat,PavelVanecek\/Rocket.Chat,alexbrazier\/Rocket.Chat,NMandapaty\/Rocket.Chat,inoxth\/Rocket.Chat,AlecTroemel\/Rocket.Chat,pitamar\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,ahmadassaf\/Rocket.Chat,LearnersGuild\/Rocket.Chat,AimenJoe\/Rocket.Chat,marzieh312\/Rocket.Chat,mwharrison\/Rocket.Chat,amaapp\/ama,wicked539\/Rocket.Chat,OtkurBiz\/Rocket.Chat,LearnersGuild\/echo-chat,galrotem1993\/Rocket.Chat,ealbers\/Rocket.Chat,VoiSmart\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,liuliming2008\/Rocket.Chat,NMandapaty\/Rocket.Chat,capensisma\/Rocket.Chat,bt\/Rocket.Chat,acaronmd\/Rocket.Chat,intelradoux\/Rocket.Chat,Sing-Li\/Rocket.Chat,mrsimpson\/Rocket.Chat,xboston\/Rocket.Chat,linnovate\/hi,subesokun\/Rocket.Chat,JamesHGreen\/Rocket_API,org100h1\/Rocket.Panda,abhishekshukla0302\/trico,Kiran-Rao\/Rocket.Chat,k0nsl\/Rocket.Chat,nishimaki10\/Rocket.Chat,k0nsl\/Rocket.Chat,klatys\/Rocket.Chat,JamesHGreen\/Rocket.Chat,LearnersGuild\/Rocket.Chat,igorstajic\/Rocket.Chat,amaapp\/ama,haoyixin\/Rocket.Chat,pachox\/Rocket.Chat,xboston\/Rocket.Chat,JamesHGreen\/Rocket_API,tntobias\/Rocket.Chat,ealbers\/Rocket.Chat,xboston\/Rocket.Chat,fatihwk\/Rocket.Chat,ahmadassaf\/Rocket.Chat,abhishekshukla0302\/trico,Gudii\/Rocket.Chat,wtsarchive\/Rocket.Chat,Gyubin\/Rocket.Chat,matthewshirley\/Rocket.Chat,intelradoux\/Rocket.Chat,galrotem1993\/Rocket.Chat,mccambridge\/Rocket.Chat,timkinnane\/Rocket.Chat,abduljanjua\/TheHub,BorntraegerMarc\/Rocket.Chat,NMandapaty\/Rocket.Chat,nishimaki10\/Rocket.Chat,ggazzo\/Rocket.Chat,wtsarchive\/Rocket.Chat,liuliming2008\/Rocket.Chat,Dianoga\/Rocket.Chat,alexbrazier\/Rocket.Chat,AimenJoe\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,karlprieb\/Rocket.Chat,Dianoga\/Rocket.Chat,klatys\/Rocket.Chat,wtsarchive\/Rocket.Chat,marzieh312\/Rocket.Chat,Dianoga\/Rocket.Chat,mrinaldhar\/Rocket.Chat,LearnersGuild\/echo-chat,bt\/Rocket.Chat,mrsimpson\/Rocket.Chat,bt\/Rocket.Chat,subesokun\/Rocket.Chat,ealbers\/Rocket.Chat,jbsavoy18\/rocketchat-1,ealbers\/Rocket.Chat,pachox\/Rocket.Chat,JamesHGreen\/Rocket_API,matthewshirley\/Rocket.Chat,org100h1\/Rocket.Panda,inoio\/Rocket.Chat,xasx\/Rocket.Chat,fatihwk\/Rocket.Chat,yuyixg\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,Movile\/Rocket.Chat,Flitterkill\/Rocket.Chat,steedos\/chat,nishimaki10\/Rocket.Chat,Dianoga\/Rocket.Chat,mwharrison\/Rocket.Chat,xasx\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,OtkurBiz\/Rocket.Chat,danielbressan\/Rocket.Chat,NMandapaty\/Rocket.Chat,PavelVanecek\/Rocket.Chat,flaviogrossi\/Rocket.Chat,LearnersGuild\/Rocket.Chat,ggazzo\/Rocket.Chat,amaapp\/ama,pkgodara\/Rocket.Chat,xasx\/Rocket.Chat,pachox\/Rocket.Chat,xboston\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,flaviogrossi\/Rocket.Chat,tntobias\/Rocket.Chat,intelradoux\/Rocket.Chat,bt\/Rocket.Chat,VoiSmart\/Rocket.Chat,subesokun\/Rocket.Chat,Flitterkill\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,jbsavoy18\/rocketchat-1,cnash\/Rocket.Chat,matthewshirley\/Rocket.Chat,liuliming2008\/Rocket.Chat,abduljanjua\/TheHub,steedos\/chat,karlprieb\/Rocket.Chat,wicked539\/Rocket.Chat,capensisma\/Rocket.Chat,haoyixin\/Rocket.Chat,Gudii\/Rocket.Chat,jbsavoy18\/rocketchat-1,intelradoux\/Rocket.Chat,mccambridge\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,Movile\/Rocket.Chat,acaronmd\/Rocket.Chat,AlecTroemel\/Rocket.Chat,klatys\/Rocket.Chat,fatihwk\/Rocket.Chat,pachox\/Rocket.Chat,mrinaldhar\/Rocket.Chat,matthewshirley\/Rocket.Chat,ziedmahdi\/Rocket.Chat,Gyubin\/Rocket.Chat,Gyubin\/Rocket.Chat,karlprieb\/Rocket.Chat,abhishekshukla0302\/trico,wicked539\/Rocket.Chat,marzieh312\/Rocket.Chat,capensisma\/Rocket.Chat,AlecTroemel\/Rocket.Chat,acaronmd\/Rocket.Chat,yuyixg\/Rocket.Chat,wicked539\/Rocket.Chat,klatys\/Rocket.Chat,Achaikos\/Rocket.Chat,OtkurBiz\/Rocket.Chat,ziedmahdi\/Rocket.Chat,Gudii\/Rocket.Chat,cnash\/Rocket.Chat,Sing-Li\/Rocket.Chat,Achaikos\/Rocket.Chat,fduraibi\/Rocket.Chat,JamesHGreen\/Rocket.Chat,4thParty\/Rocket.Chat,pitamar\/Rocket.Chat,4thParty\/Rocket.Chat,litewhatever\/Rocket.Chat,pkgodara\/Rocket.Chat,mrsimpson\/Rocket.Chat,inoxth\/Rocket.Chat,cnash\/Rocket.Chat,igorstajic\/Rocket.Chat,AlecTroemel\/Rocket.Chat,AimenJoe\/Rocket.Chat,subesokun\/Rocket.Chat,tntobias\/Rocket.Chat,OtkurBiz\/Rocket.Chat,fduraibi\/Rocket.Chat,4thParty\/Rocket.Chat,haoyixin\/Rocket.Chat,danielbressan\/Rocket.Chat,igorstajic\/Rocket.Chat,abduljanjua\/TheHub,igorstajic\/Rocket.Chat,amaapp\/ama,wtsarchive\/Rocket.Chat,cnash\/Rocket.Chat,4thParty\/Rocket.Chat,Achaikos\/Rocket.Chat,abhishekshukla0302\/trico,JamesHGreen\/Rocket_API,abduljanjua\/TheHub,mwharrison\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 13, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.17.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, developerTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"Statistics_opt_out\", value = \"true\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 13, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.17.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, developerTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"100019906f809675590dbe3bbe3cef4c293e8444","subject":"Update c++.capnp with upstream file","message":"Update c++.capnp with upstream file\n","repos":"rcrowder\/pycapnp,SymbiFlow\/pycapnp,tempbottle\/pycapnp,tempbottle\/pycapnp,tempbottle\/pycapnp,rcrowder\/pycapnp,SymbiFlow\/pycapnp,jparyani\/pycapnp,jparyani\/pycapnp,SymbiFlow\/pycapnp,tempbottle\/pycapnp,jparyani\/pycapnp,SymbiFlow\/pycapnp,rcrowder\/pycapnp,jparyani\/pycapnp,rcrowder\/pycapnp","old_file":"capnp\/c++.capnp","new_file":"capnp\/c++.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xbdf87d7bb8304e81;\n$namespace(\"capnp::annotations\");\n\nannotation namespace(file): Text;\nannotation name(field, enumerant, struct, enum, interface, method, param, group, union): Text;\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xbdf87d7bb8304e81;\n$namespace(\"capnp::annotations\");\n\nannotation namespace(file): Text;\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"188ec7b63db005381c0955440cc283679ed49d9d","subject":"Move up takeFromOtherQuestion return in sendResultsTo.yourself example","message":"Move up takeFromOtherQuestion return in sendResultsTo.yourself example\n\nKenton rightly pointed out that this is an unnecessary round-trip.\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability exported by the sender. This may or may not be a new ID in the sender's export\n # table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `takeFromOtherQuestion` set in place of the results, with the value set to the question ID\n # of bar'().\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability exported by the sender. This may or may not be a new ID in the sender's export\n # table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"180008f58f73d9a177987ba0da064a362db75359","subject":"Bump version to 7","message":"Bump version to 7\n","repos":"jparyani\/lets-chat,jparyani\/lets-chat,jparyani\/lets-chat","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.4.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"media\", \"templates\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 6, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.4.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"media\", \"templates\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"2ffa6dd80d3b2b1dc1450cbfeb2e62a72703e285","subject":"New App ID and Key","message":"New App ID and Key\n\nSee reasons and conversation here https:\/\/groups.google.com\/forum\/#!topic\/sandstorm-dev\/ObdnUs2vyrU and here https:\/\/github.com\/JamborJan\/paperwork\/issues\/13\n","repos":"JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 5, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"5.0.alpha\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0xeec6d6b356022dc7;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mr4ry55gqa4fuvx1tjzww3gapuhuq4rd1yw4csx6cc7sgqpf9jv0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 5, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"5.0.alpha\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"fe3a406fbb1c6a789ee908e21b3f77552b81f11d","subject":"Bump version number(s)","message":"Bump version number(s)\n","repos":"zenhack\/sandstorm-znc,zenhack\/sandstorm-znc,zenhack\/sandstorm-znc,zenhack\/sandstorm-znc,zenhack\/sandstorm-znc","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xa37fef404a0f433f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"fh7mfky3gremre301dsnncny0dwq8tvrf1vf33x56z3j1a69pgn0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"ZNC\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"Alpha 2\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"IRC bouncer\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # XXX: these images aren't the correct size. We ought to find better\n # images.\n # This is just the favicon from wiki.znc.in, converted to a png:\n grain = (png = (dpi1x = embed \"icons\/grain-32x32.png\")),\n # Logo at the top of the github readme:\n appGrid = (png = (dpi1x = embed \"icons\/appGrid-118x63.png\")),\n\n # TODO: fill the rest of these in:\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zenhack\/sandstorm-znc\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/zenhack\/sandstorm-znc\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = apache2),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"ian@zenhack.net\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # NOTE(zenhack): This is a little borderline; we're doing a bit more\n # than just \"packaging\"; we have our own web dashboard etc. and getting\n # znc to use ipNetwork and such isn't totally trivial. That said all of\n # the core logic is from the ZNC folks. I'm going with the reasoning\n # that ZNC is being used as a library for this app, so not specifying\n # upstreamAuthor. But it's debatable.\n #\n #upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"IRC Bouncer\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/opt\/app\/app\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\n # ZNC looks in $HOME for it's configuration.\n (key = \"HOME\", value = \"\/var\"),\n\n (key = \"SANDSTORM_ZNC_PORT\", value = \"8000\"),\n (key = \"SANDSTORM_IP_NETWORK_PORT\", value = \"6667\"),\n (key = \"SANDSTORM_APP_DIR\", value = \"\/opt\/app\"),\n ]\n);\n\n# vim: set ts=2 sw=2 et :\n","old_contents":"@0xa37fef404a0f433f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"fh7mfky3gremre301dsnncny0dwq8tvrf1vf33x56z3j1a69pgn0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"ZNC\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"Alpha 1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"IRC bouncer\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # XXX: these images aren't the correct size. We ought to find better\n # images.\n # This is just the favicon from wiki.znc.in, converted to a png:\n grain = (png = (dpi1x = embed \"icons\/grain-32x32.png\")),\n # Logo at the top of the github readme:\n appGrid = (png = (dpi1x = embed \"icons\/appGrid-118x63.png\")),\n\n # TODO: fill the rest of these in:\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zenhack\/sandstorm-znc\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/zenhack\/sandstorm-znc\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = apache2),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"ian@zenhack.net\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # NOTE(zenhack): This is a little borderline; we're doing a bit more\n # than just \"packaging\"; we have our own web dashboard etc. and getting\n # znc to use ipNetwork and such isn't totally trivial. That said all of\n # the core logic is from the ZNC folks. I'm going with the reasoning\n # that ZNC is being used as a library for this app, so not specifying\n # upstreamAuthor. But it's debatable.\n #\n #upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"IRC Bouncer\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/opt\/app\/app\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\n # ZNC looks in $HOME for it's configuration.\n (key = \"HOME\", value = \"\/var\"),\n\n (key = \"SANDSTORM_ZNC_PORT\", value = \"8000\"),\n (key = \"SANDSTORM_IP_NETWORK_PORT\", value = \"6667\"),\n (key = \"SANDSTORM_APP_DIR\", value = \"\/opt\/app\"),\n ]\n);\n\n# vim: set ts=2 sw=2 et :\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"511d1973eb2050dce7ef24de1429ebf73c7ca282","subject":"Add webhooks-attributes to Sandstorm.","message":"Add webhooks-attributes to Sandstorm.\n\nThanks to xet7 !\n","repos":"wekan\/wekan,wekan\/wekan,wekan\/wekan,GhassenRjab\/wekan,libreboard\/libreboard,wekan\/wekan,wekan\/wekan,GhassenRjab\/wekan,GhassenRjab\/wekan,libreboard\/libreboard","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 119,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.34.0~2018-08-22\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/api\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 119,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.34.0~2018-08-22\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/api\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"dcc374d9c0ae334be1529ab0755db9de44c57b62","subject":"Adding in the visual senses where it's main difference from the original Robocup simulator is the detection of lines where the angle of incidence is reported","message":"Adding in the visual senses where it's main difference from the original Robocup simulator is the detection of lines where the angle of incidence is reported\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/sensor.capnp","new_file":"src\/bcprotocol\/sensor.capnp","new_contents":"@0xe18889eda84ec4fa;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/core\/entity.capnp\";\nusing Field = import \"\/core\/field.capnp\";\nusing Physics = import \"\/core\/physics.capnp\";\n\nstruct Announcement\n{\n time @0 :Physics.Nanoseconds;\n direction@1 :Physics.Degree;\n message @2 :AnyPointer;\n}\n\nstruct Instruction\n{\n time @0 :Physics.Nanoseconds;\n message @1 :AnyPointer;\n}\n\nstruct Judgment\n{\n time @0 :Physics.Nanoseconds;\n}\n\nstruct Communication\n{\n union\n {\n\tannouncement @0 :Announcement;\n\tinstruction @1 :Instruction;\n\tjudgment @2 :Judgment;\n }\n}\n\nstruct PlayerVisual1\n{\n id @0 :Entity.PlayerId;\n direction @1 :Physics.Degree;\n distance @2 :Physics.Millimeter;\n body @3 :Physics.Degree;\n head @4 :Physics.Degree;\n}\n\nstruct PlayerVisual2\n{\n side @0 :Field.Side;\n direction @1 :Physics.Degree;\n distance @2 :Physics.Millimeter;\n}\n\nstruct PlayerVisual3\n{\n direction @0 :Physics.Degree;\n}\n\nstruct BallVisual1\n{\n direction @0 :Physics.Degree;\n distance @1 :Physics.Millimeter;\n}\n\nstruct BallVisual2\n{\n direction @0 :Physics.Degree;\n}\n\nstruct PointVisual1\n{\n id @0 :Field.PointId;\n direction @1 :Physics.Degree;\n distance @2 :Physics.Millimeter;\n}\n\nstruct PointVisual2\n{\n id @0 :Field.PointId;\n direction @1 :Physics.Degree;\n}\n\nstruct LineVisual1\n{\n id @0 :Field.LineId;\n direction @1 :Physics.Degree;\n incidenceAngle @2 :Physics.Degree;\n distance @3 :Physics.Millimeter;\n}\n\nstruct LineVisual2\n{\n id @0 :Field.LineId;\n direction @1 :Physics.Degree;\n incidenceAngle @2 :Physics.Degree;\n}\n\nstruct Visual\n{\n time @0 :Physics.Nanoseconds;\n objectId :union\n {\n\tplayer1 @1 :PlayerVisual1;\n\tplayer2 @2 :PlayerVisual2;\n\tplayer3 @3 :PlayerVisual3;\n\tball1 @4 :BallVisual1;\n\tball2 @5 :BallVisual2;\n\tpoint1 @6 :PointVisual1;\n\tpoint2 @7 :PointVisual2;\n\tline1 @8 :LineVisual1;\n\tline2 @9 :LineVisual2;\n }\n}\n","old_contents":"@0xe18889eda84ec4fa;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Entity = import \"\/core\/entity.capnp\";\nusing Field = import \"\/core\/field.capnp\";\nusing Physics = import \"\/core\/physics.capnp\";\n\nstruct Announcement\n{\n time @0 :Physics.Nanoseconds;\n direction@1 :Physics.Degree;\n message @2 :AnyPointer;\n}\n\nstruct Instruction\n{\n time @0 :Physics.Nanoseconds;\n message @1 :AnyPointer;\n}\n\nstruct Judgment\n{\n time @0 :Physics.Nanoseconds;\n}\n\nstruct Communication\n{\n union\n {\n\tannouncement @0 :Announcement;\n\tinstruction @1 :Instruction;\n\tjudgment @2 :Judgment;\n }\n}\n\nstruct PlayerObservation1\n{\n id @0 :Entity.PlayerId;\n distance @1 :Physics.Millimeter;\n direction @2 :Physics.Degree;\n}\n\nstruct PlayerObservation2\n{\n id @0 :Entity.PlayerId;\n distance @1 :Physics.Millimeter;\n direction @2 :Physics.Degree;\n}\n\nstruct PlayerObservation3\n{\n id @0 :Entity.PlayerId;\n distance @1 :Physics.Millimeter;\n direction @2 :Physics.Degree;\n}\n\nstruct PlayerObservation4\n{\n id @0 :Entity.PlayerId;\n distance @1 :Physics.Millimeter;\n direction @2 :Physics.Degree;\n}\n\nstruct Observation\n{\n time @0 :Physics.Nanoseconds;\n objectId :union\n {\n\tplayer @1 :Entity.PlayerId;\n\tball @2 :Void;\n\tboundaryPoint @3 :Field.BoundaryPointId;\n\tboundaryLine @4 :Field.BoundaryLineId;\n\tgoal @5 :Field.GoalPointId;\n\tgoalBox @6 :Field.GoalBoxPointId;\n\tpenaltyBox @7 :Field.PenaltyBoxPointId;\n\tpenaltyArc @8 :Field.PenaltyArcPointId;\n\tcentreCircle @9 :Field.CentreCirclePointId;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"ab986a9b735ae6096b69d59ae0bb589cb8187003","subject":"fix typo in test.capnp","message":"fix typo in test.capnp\n","repos":"zombiezen\/go-capnproto2,tpukep\/caps,zombiezen\/go-capnproto,hodduc\/go-capnproto2,zombiezen\/go-capnproto,zombiezen\/go-capnproto2,hodduc\/go-capnproto2","old_file":"test.capnp","new_file":"test.capnp","new_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n }\n}\n\n\n","old_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"bec211fac41828b562ff81b1ae879ef45714051d","subject":"add noun phrase","message":"add noun phrase\n","repos":"kentonv\/y,kentonv\/y","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xe2249d9ead63d718;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ap9cdcf994hy3wd5u0cuw50s7frugwz7qv0vzsduqqydrdknetf0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n \n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Game of Y\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Y Game\"),\n nounPhrase = (defaultText = \"game\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/gameofy-128.png\",\n dpi2x = embed \"app-graphics\/gameofy-256.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/gameofy-24.png\",\n dpi2x = embed \"app-graphics\/gameofy-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/gameofy-128.png\",\n dpi2x = embed \"app-graphics\/gameofy-256.png\")),\n ),\n\n website = \"http:\/\/y.hyperbotics.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/y\",\n license = (openSource = agpl3),\n categories = [games],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Hyperbotics\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Board game\"),\n\n screenshots = [\n (width = 448, height = 329, png = embed \"app-graphics\/screenshot.png\")\n ]\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"black\"), (name = \"white\"), (name = \"undo\")],\n roles = [(title = (defaultText = \"black\"),\n permissions = [true, false]),\n (title = (defaultText = \"white\"),\n permissions = [false, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xe2249d9ead63d718;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ap9cdcf994hy3wd5u0cuw50s7frugwz7qv0vzsduqqydrdknetf0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n \n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Game of Y\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Y Game\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/gameofy-128.png\",\n dpi2x = embed \"app-graphics\/gameofy-256.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/gameofy-24.png\",\n dpi2x = embed \"app-graphics\/gameofy-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/gameofy-128.png\",\n dpi2x = embed \"app-graphics\/gameofy-256.png\")),\n ),\n\n website = \"http:\/\/y.hyperbotics.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/y\",\n license = (openSource = agpl3),\n categories = [games],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Hyperbotics\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Board game\"),\n\n screenshots = [\n (width = 448, height = 329, png = embed \"app-graphics\/screenshot.png\")\n ]\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \".meteor-spk\/deps\" ),\n ( sourcePath = \".meteor-spk\/bundle\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"black\"), (name = \"white\"), (name = \"undo\")],\n roles = [(title = (defaultText = \"black\"),\n permissions = [true, false]),\n (title = (defaultText = \"white\"),\n permissions = [false, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"34c4cc28f9b87a57662b68f27d805a84f6318e3e","subject":"Add shortDescription and bump version to v12","message":"Add shortDescription and bump version to v12\n","repos":"jparyani\/GhostSS,jparyani\/GhostSS,jparyani\/GhostSS","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Ghost\"),\n\n appVersion = 12, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.5.8\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n nounPhrase = (defaultText = \"blog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = ( embed \"app-graphics\/ghost-128.svg\")),\n grain = (svg = ( embed \"app-graphics\/ghost-24.svg\")),\n market = (svg = ( embed \"app-graphics\/ghost-150.svg\")),\n ),\n\n website = \"https:\/\/ghost.org\/\",\n codeUrl = \"https:\/\/github.com\/jparyani\/GhostSS\",\n license = (openSource = mit),\n categories = [webPublishing],\n\n author = (\n contactEmail = \"jparyani@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Ghost Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Blogging platform\"),\n\n screenshots = [\n (width = 448, height = 338, png = embed \"sandstorm-screenshot-1.png\"),\n (width = 448, height = 338, png = embed \"sandstorm-screenshot-2.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge-old\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xb4bf81c2da517923;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"mkqyz71cc96e8gmq2h4dhnfm56k90t2055muv33h2ptw1q6h8n4h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Ghost\"),\n\n appVersion = 11, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.5.8\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Ghost Blog or Website\"),\n nounPhrase = (defaultText = \"blog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = ( embed \"app-graphics\/ghost-128.svg\")),\n grain = (svg = ( embed \"app-graphics\/ghost-24.svg\")),\n market = (svg = ( embed \"app-graphics\/ghost-150.svg\")),\n ),\n\n website = \"https:\/\/ghost.org\/\",\n codeUrl = \"https:\/\/github.com\/jparyani\/GhostSS\",\n license = (openSource = mit),\n categories = [webPublishing],\n\n author = (\n contactEmail = \"jparyani@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Ghost Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 338, png = embed \"sandstorm-screenshot-1.png\"),\n (width = 448, height = 338, png = embed \"sandstorm-screenshot-2.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\", packagePath = \"node_modules\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libkj-async-0.6-dev.so\", packagePath = \"usr\/lib\/libkj-async-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnpc-0.6-dev.so\" ),\n ( sourcePath = \"\/usr\/local\/lib\/libcapnp-rpc-0.6-dev.so\", packagePath = \"usr\/lib\/libcapnp-rpc-0.6-dev.so\" ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"themes\", \"core\", \"node_modules\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge-old\", \"8080\", \"--\", \".\/run-ghost.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"011cb516087a50ca3efc7be6168c2a982ecce8e1","subject":"Fix comments about ProvisionId\/RecipientId\/ThirdPartyCapId","message":"Fix comments about ProvisionId\/RecipientId\/ThirdPartyCapId\n\nUsing the `Provide` message's question ID to identify the provision doesn't work because the question ID could be freed up and re-assigned before the recipient tries to receive the provision.","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` message sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c36509095a4f44718df1ebbd0f09aedff5febc39","subject":"Add empty oauth2 settings to Sandstorm.","message":"Add empty oauth2 settings to Sandstorm.\n","repos":"wekan\/wekan,wekan\/wekan,GhassenRjab\/wekan,wekan\/wekan,GhassenRjab\/wekan,wekan\/wekan,GhassenRjab\/wekan,wekan\/wekan,libreboard\/libreboard,libreboard\/libreboard","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 120,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.35.0~2018-08-23\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/api\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"OAUTH2_CLIENT_ID\", value=\"\"),\n (key = \"OAUTH2_SECRET\", value=\"\"),\n (key = \"OAUTH2_SERVER_URL\", value=\"\"),\n (key = \"OAUTH2_AUTH_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_USERINFO_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_TOKEN_ENDPOINT\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 120,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.35.0~2018-08-23\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/api\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c04341f1ea5efe082bf7318cf9eb0e99b9b8374a","subject":"Release v0.9.0-rc2","message":"Release v0.9.0-rc2\n","repos":"oliver4u\/WEKAN_runpartner,jtickle\/wekan,Xperterra\/wekan,pro-to-tip\/wekan,stxh\/wekan,GhassenRjab\/wekan,ketanbhatt\/wekan,nztqa\/wekan,mechiles\/wekan,TribeMedia\/wekan,ahmadassaf\/libreboard,wonderxboy\/wekan,wykeith\/cp2m,bitIO\/wekan,FSFTN\/Wekan,atFriendly\/wekan,libreboard\/libreboard,araczkowski\/paczka.pro,johnleeming\/wekan,Dragnalith\/wekan,ndarilek\/wekan,nixoz\/wekan,wonderxboy\/wekan,AlexanderS\/wekan,Zyko0\/wekan,Serubin\/wekan,ketanbhatt\/wekan,SamuelKlein\/libreboard,oliver4u\/WEKAN_runpartner,umeshrs\/wekan,gelojavonitalla\/wekan,bitIO\/wekan,Dragnalith\/wekan,keremtiryaki\/wekan,MickyBlue\/wekan,floatinghotpot\/wekan,christmo\/wekan,fisle\/wekan,wangdeshui\/wekan,MickyBlue\/wekan,ddanssaert\/wekan,Zyko0\/wekan,rpiza\/wekan,jtickle\/wekan,mruse\/wekan,evdevgit\/wekan,MeteorLyon\/libreboard,RyanTech\/wekan,AdrianoCahete\/wekan,RyanTech\/wekan,zhongqf\/wekan,oliver4u\/sap-wekan,assarbad\/wekan,araczkowski\/paczka.pro,nixoz\/wekan,wangdeshui\/wekan,felipecosta07\/js,wekan\/wekan,ggalancs\/wekan,mario-orlicky\/wekan,johnleeming\/wekan,jimmiebtlr\/wekan,jtickle\/wekan,GhassenRjab\/wekan,jimmiebtlr\/wekan,zhongqf\/wekan,MeteorLyon\/libreboard,Serubin\/wekan,wangjun\/wekan,nztqa\/wekan,xuxingfan\/wekan,rpiza\/wekan,oliver4u\/sap-wekan,wonderxboy\/wekan,fisle\/wekan,araczkowski\/paczka.pro,ndarilek\/wekan,wekan\/wekan,wangjun\/wekan,ddanssaert\/wekan,Serubin\/wekan,coreyaus\/wekan,johnleeming\/wekan,ahmadassaf\/libreboard,umeshrs\/wekan,FSFTN\/Wekan,TribeMedia\/wekan,iu2fish\/wekan,wykeith\/cp2m,libreboard\/libreboard,pro-to-tip\/wekan,AdrianoCahete\/wekan,johnleeming\/wekan,ahmadassaf\/libreboard,nztqa\/wekan,Xperterra\/wekan,chrootsu\/wekan,oliver4u\/WEKAN_runpartner,mechiles\/wekan,stxh\/wekan,atFriendly\/wekan,GhassenRjab\/wekan,chrootsu\/wekan,keremtiryaki\/wekan,floatinghotpot\/wekan,ggalancs\/wekan,iu2fish\/wekan,xuxingfan\/wekan,christmo\/wekan,felipecosta07\/js,wekan\/wekan,evdevgit\/wekan,wekan\/wekan,assarbad\/wekan,gelojavonitalla\/wekan,SamuelKlein\/libreboard,samtechie\/wekan,mario-orlicky\/wekan,wekan\/wekan,AlexanderS\/wekan,oliver4u\/sap-wekan,samtechie\/wekan,coreyaus\/wekan,mario-orlicky\/wekan,ddanssaert\/wekan,mruse\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 5,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.9.0-rc2\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"History.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 5,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.9.0-rc1\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"History.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"adc65a28c95563d7d652312d27e786de4343eb7b","subject":"Added hourOfWeek encoder to date.capnp","message":"Added hourOfWeek encoder to date.capnp\n","repos":"badlogicmanpreet\/nupic,alfonsokim\/nupic,breznak\/nupic,lscheinkman\/nupic,runt18\/nupic,ywcui1990\/nupic,rcrowder\/nupic,pulinagrawal\/nupic,sambitgaan\/nupic,vitaly-krugl\/nupic,scottpurdy\/nupic,vitaly-krugl\/nupic,fergalbyrne\/nupic,EricSB\/nupic,BoltzmannBrain\/nupic,scottpurdy\/nupic,jcasner\/nupic,sambitgaan\/nupic,marionleborgne\/nupic,sambitgaan\/nupic,lscheinkman\/nupic,alfonsokim\/nupic,alfonsokim\/nupic,jcasner\/nupic,cogmission\/nupic,numenta\/nupic,pulinagrawal\/nupic,breznak\/nupic,marionleborgne\/nupic,EricSB\/nupic,EricSB\/nupic,vitaly-krugl\/nupic,arhik\/nupic,rhyolight\/nupic,go-bears\/nupic,marionleborgne\/nupic,numenta-ci\/nupic,cogmission\/nupic,SaganBolliger\/nupic,pulinagrawal\/nupic,fergalbyrne\/nupic,jcasner\/nupic,SaganBolliger\/nupic,runt18\/nupic,numenta-ci\/nupic,arhik\/nupic,neuroidss\/nupic,fergalbyrne\/nupic,rcrowder\/nupic,cogmission\/nupic,breznak\/nupic,runt18\/nupic,neuroidss\/nupic,subutai\/nupic,blueburningcoder\/nupic,subutai\/nupic,BoltzmannBrain\/nupic,lscheinkman\/nupic,ywcui1990\/nupic,go-bears\/nupic,numenta-ci\/nupic,rhyolight\/nupic,blueburningcoder\/nupic,neuroidss\/nupic,rcrowder\/nupic,numenta\/nupic,badlogicmanpreet\/nupic,BoltzmannBrain\/nupic,ywcui1990\/nupic,scottpurdy\/nupic,subutai\/nupic,numenta\/nupic,badlogicmanpreet\/nupic,arhik\/nupic,go-bears\/nupic,blueburningcoder\/nupic,SaganBolliger\/nupic,rhyolight\/nupic","old_file":"src\/nupic\/encoders\/date.capnp","new_file":"src\/nupic\/encoders\/date.capnp","new_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","old_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"df968b21eac5903bd4b7c468e919377dcaa6e668","subject":"Chandni <3: Update default app text to use sandform related terms.","message":"Chandni <3: Update default app text to use sandform related terms.\n","repos":"rosatolen\/sandforms,rosatolen\/sandforms,sandforms\/sandforms,rosatolen\/sandforms,rosatolen\/sandforms,sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5yvm5asuzk62p6s8jw0p33w2ktsn189ne0c9j2pvww5gq84exmf0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5yvm5asuzk62p6s8jw0p33w2ktsn189ne0c9j2pvww5gq84exmf0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Example App\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"814ce24866380f24cc4ea64b27be4da74bc111e6","subject":"Add deeply-nested-generic build failure to test.capnp","message":"Add deeply-nested-generic build failure to test.capnp\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/test.capnp","new_file":"c++\/src\/capnp\/test.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xd508eebdc2dc42b8;\n\nusing Cxx = import \"c++.capnp\";\n\n# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified\n# names for stuff in the capnproto namespace.\n$Cxx.namespace(\"capnproto_test::capnp::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = 0x\"62 61 72\"; # \"bar\"\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n\n # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer\n # in the struct.\n}\n\nstruct TestAnyOthers {\n anyStructField @0 :AnyStruct;\n anyListField @1 :AnyList;\n capabilityField @2 :Capability;\n}\n\nstruct TestOutOfOrder {\n foo @3 :Text;\n bar @2 :Text;\n baz @8 :Text;\n qux @0 :Text;\n quux @6 :Text;\n corge @4 :Text;\n grault @1 :Text;\n garply @7 :Text;\n waldo @5 :Text;\n}\n\nstruct TestUnion {\n union0 @0! :union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1! :union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2! :union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3! :union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnnamedUnion {\n before @0 :Text;\n\n union {\n foo @1 :UInt16;\n bar @3 :UInt32;\n }\n\n middle @2 :UInt16;\n\n after @4 :Text;\n}\n\nstruct TestUnionInUnion {\n # There is no reason to ever do this.\n outer :union {\n inner :union {\n foo @0 :Int32;\n bar @1 :Int32;\n }\n baz @2 :Int32;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n }\n }\n}\n\nstruct TestInterleavedGroups {\n group1 :group {\n foo @0 :UInt32;\n bar @2 :UInt64;\n union {\n qux @4 :UInt16;\n corge :group {\n grault @6 :UInt64;\n garply @8 :UInt16;\n plugh @14 :Text;\n xyzzy @16 :Text;\n }\n\n fred @12 :Text;\n }\n\n waldo @10 :Text;\n }\n\n group2 :group {\n foo @1 :UInt32;\n bar @3 :UInt64;\n union {\n qux @5 :UInt16;\n corge :group {\n grault @7 :UInt64;\n garply @9 :UInt16;\n plugh @15 :Text;\n xyzzy @17 :Text;\n }\n\n fred @13 :Text;\n }\n\n waldo @11 :Text;\n }\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),\n union3 = (u3f0s8 = 55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = (u0f1s0 = void), union1 = (u1f0sp = \"foo\"), union2 = (u2f0s1 = true),\n union3 = (u3f0s32 = 12345678));\n\n unnamed1 @2 :TestUnnamedUnion = (foo = 123);\n unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = \"foo\", after = \"bar\");\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n # Versions of the above which cannot be encoded as primitive lists.\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestFieldZeroIsBit {\n bit @0 :Bool;\n secondBit @1 :Bool = true;\n thirdField @2 :UInt8 = 123;\n}\n\nstruct TestListDefaults {\n lists @0 :TestLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false), (f = true), (f = true)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")],\n int32ListList = [[1, 2, 3], [4, 5], [12341234]],\n textListList = [[\"foo\", \"bar\"], [\"baz\"], [\"qux\", \"corge\"]],\n structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);\n}\n\nstruct TestLateUnion {\n # Test what happens if the unions are not the first ordinals in the struct. At one point this\n # was broken for the dynamic API.\n\n foo @0 :Int32;\n bar @1 :Text;\n baz @2 :Int16;\n\n theUnion @3! :union {\n qux @4 :Text;\n corge @5 :List(Int32);\n grault @6 :Float32;\n }\n\n anotherUnion @7! :union {\n qux @8 :Text;\n corge @9 :List(Int32);\n grault @10 :Float32;\n }\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n}\n\nstruct TestOldUnionVersion {\n union {\n a @0 :Void;\n b @1 :UInt64;\n }\n}\n\nstruct TestNewUnionVersion {\n union {\n a :union {\n a0 @0 :Void;\n a1 @2 :UInt64;\n }\n b @1 :UInt64;\n }\n}\n\nstruct TestStructUnion {\n un @0! :union {\n struct @1 :SomeStruct;\n object @2 :TestAnyPointer;\n }\n\n struct SomeStruct {\n someText @0 :Text;\n moreText @1 :Text;\n }\n}\n\nstruct TestPrintInlineStructs {\n someText @0 :Text;\n\n structList @1 :List(InlineStruct);\n struct InlineStruct {\n int32Field @0 :Int32;\n textField @1 :Text;\n }\n}\n\nstruct TestWholeFloatDefault {\n # At one point, these failed to compile in C++ because it would produce literals like \"123f\",\n # which is not valid; it needs to be \"123.0f\".\n field @0 :Float32 = 123;\n bigField @1 :Float32 = 2e30;\n const constant :Float32 = 456;\n const bigConstant :Float32 = 4e30;\n}\n\nstruct TestGenerics(Foo, Bar) {\n foo @0 :Foo;\n rev @1 :TestGenerics(Bar, Foo);\n\n union {\n uv @2:Void;\n ug :group {\n ugfoo @3:Int32;\n }\n }\n\n struct Inner {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n\n struct Inner2(Baz) {\n bar @0 :Bar;\n baz @1 :Baz;\n innerBound @2 :Inner;\n innerUnbound @3 :TestGenerics.Inner;\n\n struct DeepNest(Qux) {\n foo @0 :Foo;\n bar @1 :Bar;\n baz @2 :Baz;\n qux @3 :Qux;\n\n interface DeepNestInterface(Quux) {\n # At one time this failed to compile.\n call @0 () -> ();\n }\n }\n }\n\n interface Interface(Qux) {\n call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));\n }\n\n annotation ann(struct) :Foo;\n\n using AliasFoo = Foo;\n using AliasInner = Inner;\n using AliasInner2 = Inner2;\n using AliasInner2Text = Inner2(Text);\n using AliasRev = TestGenerics(Bar, Foo);\n\n struct UseAliases {\n foo @0 :AliasFoo;\n inner @1 :AliasInner;\n inner2 @2 :AliasInner2;\n inner2Bind @3 :AliasInner2(Text);\n inner2Text @4 :AliasInner2Text;\n revFoo @5 :AliasRev.AliasFoo;\n }\n}\n\nstruct TestGenericsWrapper(Foo, Bar) {\n value @0 :TestGenerics(Foo, Bar);\n}\n\nstruct TestGenericsWrapper2 {\n value @0 :TestGenericsWrapper(Text, TestAllTypes);\n}\n\ninterface TestImplicitMethodParams {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\ninterface TestImplicitMethodParamsInGeneric(V) {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\nstruct TestGenericsUnion(Foo, Bar) {\n # At one point this failed to compile.\n\n union {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n}\n\nstruct TestUseGenerics $TestGenerics(Text, Data).ann(\"foo\") {\n basic @0 :TestGenerics(TestAllTypes, TestAnyPointer);\n inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner;\n inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text);\n unspecified @3 :TestGenerics;\n unspecifiedInner @4 :TestGenerics.Inner2(Text);\n wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer);\n cap @18 :TestGenerics(TestInterface, Text);\n genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data);\n\n default @5 :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner =\n (foo = (int16Field = 123), bar = \"text\");\n defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123)));\n defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) =\n (value = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultWrapper2 @10 :TestGenericsWrapper2 =\n (value = (value = (foo = \"text\", rev = (foo = (int16Field = 321)))));\n\n aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123);\n aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner\n = (foo = (int16Field = 123));\n aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2\n = (innerBound = (foo = (int16Field = 123)));\n aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32))\n = (baz = [12, 34], innerBound = (foo = (int16Field = 123)));\n aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text\n = (baz = \"text\", innerBound = (foo = (int16Field = 123)));\n aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = \"text\";\n\n useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = (\n foo = (int16Field = 123),\n inner = (foo = (int16Field = 123)),\n inner2 = (innerBound = (foo = (int16Field = 123))),\n inner2Bind = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n inner2Text = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n revFoo = [12, 34, 56]);\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n const textConst :Text = \"foo\";\n const dataConst :Data = \"bar\";\n const structConst :TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n const enumConst :TestEnum = corge;\n\n const voidListConst :List(Void) = [void, void, void, void, void, void];\n const boolListConst :List(Bool) = [true, false, false, true];\n const int8ListConst :List(Int8) = [111, -111];\n const int16ListConst :List(Int16) = [11111, -11111];\n const int32ListConst :List(Int32) = [111111111, -111111111];\n const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];\n const uint8ListConst :List(UInt8) = [111, 222] ;\n const uint16ListConst :List(UInt16) = [33333, 44444];\n const uint32ListConst :List(UInt32) = [3333333333];\n const uint64ListConst :List(UInt64) = [11111111111111111111];\n const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];\n const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];\n const textListConst :List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n const dataListConst :List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n const structListConst :List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n const enumListConst :List(TestEnum) = [foo, garply];\n}\n\nconst globalInt :UInt32 = 12345;\nconst globalText :Text = \"foobar\";\nconst globalStruct :TestAllTypes = (int32Field = 54321);\nconst globalPrintableStruct :TestPrintInlineStructs = (someText = \"foo\");\nconst derivedConstant :TestAllTypes = (\n uInt32Field = .globalInt,\n textField = TestConstants.textConst,\n structField = TestConstants.structConst,\n int16List = TestConstants.int16ListConst,\n structList = TestConstants.structListConst);\n\nconst genericConstant :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n\nconst embeddedData :Data = embed \"testdata\/packed\";\nconst embeddedText :Text = embed \"testdata\/short.txt\";\nconst embeddedStruct :TestAllTypes = embed \"testdata\/binary\";\n\nstruct TestAnyPointerConstants {\n anyKindAsStruct @0 :AnyPointer;\n anyStructAsStruct @1 :AnyStruct;\n anyKindAsList @2 :AnyPointer;\n anyListAsList @3 :AnyList;\n\n}\n\nconst anyPointerConstants :TestAnyPointerConstants = (\n anyKindAsStruct = TestConstants.structConst,\n anyStructAsStruct = TestConstants.structConst,\n anyKindAsList = TestConstants.int32ListConst,\n anyListAsList = TestConstants.int32ListConst,\n);\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x :Text);\n bar @1 () -> ();\n baz @2 (s: TestAllTypes);\n}\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestAllTypes -> ();\n grault @2 () -> TestAllTypes;\n}\n\ninterface TestExtends2 extends(TestExtends) {}\n\ninterface TestPipeline {\n getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);\n testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();\n\n struct Box {\n cap @0 :TestInterface;\n }\n}\n\ninterface TestCallOrder {\n getCallSequence @0 (expected: UInt32) -> (n: UInt32);\n # First call returns 0, next returns 1, ...\n #\n # The input `expected` is ignored but useful for disambiguating debug logs.\n}\n\ninterface TestTailCallee {\n struct TailResult {\n i @0 :UInt32;\n t @1 :Text;\n c @2 :TestCallOrder;\n }\n\n foo @0 (i :Int32, t :Text) -> TailResult;\n}\n\ninterface TestTailCaller {\n foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;\n}\n\ninterface TestHandle {}\n\ninterface TestMoreStuff extends(TestCallOrder) {\n # Catch-all type that contains lots of testing methods.\n\n callFoo @0 (cap :TestInterface) -> (s: Text);\n # Call `cap.foo()`, check the result, and return \"bar\".\n\n callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);\n # Like callFoo but waits for `cap` to resolve first.\n\n neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);\n # Doesn't return. You should cancel it.\n\n hold @3 (cap :TestInterface) -> ();\n # Returns immediately but holds on to the capability.\n\n callHeld @4 () -> (s: Text);\n # Calls the capability previously held using `hold` (and keeps holding it).\n\n getHeld @5 () -> (cap :TestInterface);\n # Returns the capability previously held using `hold` (and keeps holding it).\n\n echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);\n # Just returns the input cap.\n\n expectCancel @7 (cap :TestInterface) -> ();\n # evalLater()-loops forever, holding `cap`. Must be canceled.\n\n methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = \"foo\") -> (d :Text, e :Text = \"bar\");\n\n getHandle @9 () -> (handle :TestHandle);\n # Get a new handle. Tests have an out-of-band way to check the current number of live handles, so\n # this can be used to test garbage collection.\n\n getNull @10 () -> (nullCap :TestMoreStuff);\n # Always returns a null capability.\n\n getEnormousString @11 () -> (str :Text);\n # Attempts to return an 100MB string. Should always fail.\n}\n\ninterface TestMembrane {\n makeThing @0 () -> (thing :Thing);\n callPassThrough @1 (thing :Thing, tailCall :Bool) -> Result;\n callIntercept @2 (thing :Thing, tailCall :Bool) -> Result;\n loopback @3 (thing :Thing) -> (thing :Thing);\n\n interface Thing {\n passThrough @0 () -> Result;\n intercept @1 () -> Result;\n }\n\n struct Result {\n text @0 :Text;\n }\n}\n\nstruct TestContainMembrane {\n cap @0 :TestMembrane.Thing;\n list @1 :List(TestMembrane.Thing);\n}\n\nstruct TestTransferCap {\n list @0 :List(Element);\n struct Element {\n text @0 :Text;\n cap @1 :TestInterface;\n }\n}\n\ninterface TestKeywordMethods {\n delete @0 ();\n class @1 ();\n void @2 ();\n return @3 ();\n}\n\ninterface TestAuthenticatedBootstrap(VatId) {\n getCallerId @0 () -> (caller :VatId);\n}\n\nstruct TestSturdyRef {\n hostId @0 :TestSturdyRefHostId;\n objectId @1 :AnyPointer;\n}\n\nstruct TestSturdyRefHostId {\n host @0 :Text;\n}\n\nstruct TestSturdyRefObjectId {\n tag @0 :Tag;\n enum Tag {\n testInterface @0;\n testExtends @1;\n testPipeline @2;\n testTailCallee @3;\n testTailCaller @4;\n testMoreStuff @5;\n }\n}\n\nstruct TestProvisionId {}\nstruct TestRecipientId {}\nstruct TestThirdPartyCapId {}\nstruct TestJoinResult {}\n\nstruct TestNameAnnotation $Cxx.name(\"RenamedStruct\") {\n union {\n badFieldName @0 :Bool $Cxx.name(\"goodFieldName\");\n bar @1 :Int8;\n }\n\n enum BadlyNamedEnum $Cxx.name(\"RenamedEnum\") {\n foo @0;\n bar @1;\n baz @2 $Cxx.name(\"qux\");\n }\n\n anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name(\"anotherGoodFieldName\");\n\n struct NestedStruct $Cxx.name(\"RenamedNestedStruct\") {\n badNestedFieldName @0 :Bool $Cxx.name(\"goodNestedFieldName\");\n anotherBadNestedFieldName @1 :NestedStruct $Cxx.name(\"anotherGoodNestedFieldName\");\n\n enum DeeplyNestedEnum $Cxx.name(\"RenamedDeeplyNestedEnum\") {\n quux @0;\n corge @1;\n grault @2 $Cxx.name(\"garply\");\n }\n }\n\n badlyNamedUnion :union $Cxx.name(\"renamedUnion\") {\n badlyNamedGroup :group $Cxx.name(\"renamedGroup\") {\n foo @3 :Void;\n bar @4 :Void;\n }\n baz @5 :NestedStruct $Cxx.name(\"qux\");\n }\n}\n\ninterface TestNameAnnotationInterface $Cxx.name(\"RenamedInterface\") {\n badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name(\"renamedParam\")) $Cxx.name(\"renamedMethod\");\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xd508eebdc2dc42b8;\n\nusing Cxx = import \"c++.capnp\";\n\n# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified\n# names for stuff in the capnproto namespace.\n$Cxx.namespace(\"capnproto_test::capnp::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = 0x\"62 61 72\"; # \"bar\"\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n\n # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer\n # in the struct.\n}\n\nstruct TestAnyOthers {\n anyStructField @0 :AnyStruct;\n anyListField @1 :AnyList;\n capabilityField @2 :Capability;\n}\n\nstruct TestOutOfOrder {\n foo @3 :Text;\n bar @2 :Text;\n baz @8 :Text;\n qux @0 :Text;\n quux @6 :Text;\n corge @4 :Text;\n grault @1 :Text;\n garply @7 :Text;\n waldo @5 :Text;\n}\n\nstruct TestUnion {\n union0 @0! :union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1! :union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2! :union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3! :union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnnamedUnion {\n before @0 :Text;\n\n union {\n foo @1 :UInt16;\n bar @3 :UInt32;\n }\n\n middle @2 :UInt16;\n\n after @4 :Text;\n}\n\nstruct TestUnionInUnion {\n # There is no reason to ever do this.\n outer :union {\n inner :union {\n foo @0 :Int32;\n bar @1 :Int32;\n }\n baz @2 :Int32;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n }\n }\n}\n\nstruct TestInterleavedGroups {\n group1 :group {\n foo @0 :UInt32;\n bar @2 :UInt64;\n union {\n qux @4 :UInt16;\n corge :group {\n grault @6 :UInt64;\n garply @8 :UInt16;\n plugh @14 :Text;\n xyzzy @16 :Text;\n }\n\n fred @12 :Text;\n }\n\n waldo @10 :Text;\n }\n\n group2 :group {\n foo @1 :UInt32;\n bar @3 :UInt64;\n union {\n qux @5 :UInt16;\n corge :group {\n grault @7 :UInt64;\n garply @9 :UInt16;\n plugh @15 :Text;\n xyzzy @17 :Text;\n }\n\n fred @13 :Text;\n }\n\n waldo @11 :Text;\n }\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),\n union3 = (u3f0s8 = 55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = (u0f1s0 = void), union1 = (u1f0sp = \"foo\"), union2 = (u2f0s1 = true),\n union3 = (u3f0s32 = 12345678));\n\n unnamed1 @2 :TestUnnamedUnion = (foo = 123);\n unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = \"foo\", after = \"bar\");\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n # Versions of the above which cannot be encoded as primitive lists.\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestFieldZeroIsBit {\n bit @0 :Bool;\n secondBit @1 :Bool = true;\n thirdField @2 :UInt8 = 123;\n}\n\nstruct TestListDefaults {\n lists @0 :TestLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false), (f = true), (f = true)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")],\n int32ListList = [[1, 2, 3], [4, 5], [12341234]],\n textListList = [[\"foo\", \"bar\"], [\"baz\"], [\"qux\", \"corge\"]],\n structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);\n}\n\nstruct TestLateUnion {\n # Test what happens if the unions are not the first ordinals in the struct. At one point this\n # was broken for the dynamic API.\n\n foo @0 :Int32;\n bar @1 :Text;\n baz @2 :Int16;\n\n theUnion @3! :union {\n qux @4 :Text;\n corge @5 :List(Int32);\n grault @6 :Float32;\n }\n\n anotherUnion @7! :union {\n qux @8 :Text;\n corge @9 :List(Int32);\n grault @10 :Float32;\n }\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n}\n\nstruct TestOldUnionVersion {\n union {\n a @0 :Void;\n b @1 :UInt64;\n }\n}\n\nstruct TestNewUnionVersion {\n union {\n a :union {\n a0 @0 :Void;\n a1 @2 :UInt64;\n }\n b @1 :UInt64;\n }\n}\n\nstruct TestStructUnion {\n un @0! :union {\n struct @1 :SomeStruct;\n object @2 :TestAnyPointer;\n }\n\n struct SomeStruct {\n someText @0 :Text;\n moreText @1 :Text;\n }\n}\n\nstruct TestPrintInlineStructs {\n someText @0 :Text;\n\n structList @1 :List(InlineStruct);\n struct InlineStruct {\n int32Field @0 :Int32;\n textField @1 :Text;\n }\n}\n\nstruct TestWholeFloatDefault {\n # At one point, these failed to compile in C++ because it would produce literals like \"123f\",\n # which is not valid; it needs to be \"123.0f\".\n field @0 :Float32 = 123;\n bigField @1 :Float32 = 2e30;\n const constant :Float32 = 456;\n const bigConstant :Float32 = 4e30;\n}\n\nstruct TestGenerics(Foo, Bar) {\n foo @0 :Foo;\n rev @1 :TestGenerics(Bar, Foo);\n\n union {\n uv @2:Void;\n ug :group {\n ugfoo @3:Int32;\n }\n }\n\n struct Inner {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n\n struct Inner2(Baz) {\n bar @0 :Bar;\n baz @1 :Baz;\n innerBound @2 :Inner;\n innerUnbound @3 :TestGenerics.Inner;\n\n struct DeepNest(Qux) {\n foo @0 :Foo;\n bar @1 :Bar;\n baz @2 :Baz;\n qux @3 :Qux;\n }\n }\n\n interface Interface(Qux) {\n call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));\n }\n\n annotation ann(struct) :Foo;\n\n using AliasFoo = Foo;\n using AliasInner = Inner;\n using AliasInner2 = Inner2;\n using AliasInner2Text = Inner2(Text);\n using AliasRev = TestGenerics(Bar, Foo);\n\n struct UseAliases {\n foo @0 :AliasFoo;\n inner @1 :AliasInner;\n inner2 @2 :AliasInner2;\n inner2Bind @3 :AliasInner2(Text);\n inner2Text @4 :AliasInner2Text;\n revFoo @5 :AliasRev.AliasFoo;\n }\n}\n\nstruct TestGenericsWrapper(Foo, Bar) {\n value @0 :TestGenerics(Foo, Bar);\n}\n\nstruct TestGenericsWrapper2 {\n value @0 :TestGenericsWrapper(Text, TestAllTypes);\n}\n\ninterface TestImplicitMethodParams {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\ninterface TestImplicitMethodParamsInGeneric(V) {\n call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);\n}\n\nstruct TestGenericsUnion(Foo, Bar) {\n # At one point this failed to compile.\n\n union {\n foo @0 :Foo;\n bar @1 :Bar;\n }\n}\n\nstruct TestUseGenerics $TestGenerics(Text, Data).ann(\"foo\") {\n basic @0 :TestGenerics(TestAllTypes, TestAnyPointer);\n inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner;\n inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text);\n unspecified @3 :TestGenerics;\n unspecifiedInner @4 :TestGenerics.Inner2(Text);\n wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer);\n cap @18 :TestGenerics(TestInterface, Text);\n genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data);\n\n default @5 :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner =\n (foo = (int16Field = 123), bar = \"text\");\n defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123)));\n defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) =\n (value = (foo = \"text\", rev = (foo = (int16Field = 321))));\n defaultWrapper2 @10 :TestGenericsWrapper2 =\n (value = (value = (foo = \"text\", rev = (foo = (int16Field = 321)))));\n\n aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123);\n aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner\n = (foo = (int16Field = 123));\n aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2\n = (innerBound = (foo = (int16Field = 123)));\n aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32))\n = (baz = [12, 34], innerBound = (foo = (int16Field = 123)));\n aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text\n = (baz = \"text\", innerBound = (foo = (int16Field = 123)));\n aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = \"text\";\n\n useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = (\n foo = (int16Field = 123),\n inner = (foo = (int16Field = 123)),\n inner2 = (innerBound = (foo = (int16Field = 123))),\n inner2Bind = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n inner2Text = (baz = \"text\", innerBound = (foo = (int16Field = 123))),\n revFoo = [12, 34, 56]);\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n const textConst :Text = \"foo\";\n const dataConst :Data = \"bar\";\n const structConst :TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n const enumConst :TestEnum = corge;\n\n const voidListConst :List(Void) = [void, void, void, void, void, void];\n const boolListConst :List(Bool) = [true, false, false, true];\n const int8ListConst :List(Int8) = [111, -111];\n const int16ListConst :List(Int16) = [11111, -11111];\n const int32ListConst :List(Int32) = [111111111, -111111111];\n const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];\n const uint8ListConst :List(UInt8) = [111, 222] ;\n const uint16ListConst :List(UInt16) = [33333, 44444];\n const uint32ListConst :List(UInt32) = [3333333333];\n const uint64ListConst :List(UInt64) = [11111111111111111111];\n const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];\n const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];\n const textListConst :List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n const dataListConst :List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n const structListConst :List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n const enumListConst :List(TestEnum) = [foo, garply];\n}\n\nconst globalInt :UInt32 = 12345;\nconst globalText :Text = \"foobar\";\nconst globalStruct :TestAllTypes = (int32Field = 54321);\nconst globalPrintableStruct :TestPrintInlineStructs = (someText = \"foo\");\nconst derivedConstant :TestAllTypes = (\n uInt32Field = .globalInt,\n textField = TestConstants.textConst,\n structField = TestConstants.structConst,\n int16List = TestConstants.int16ListConst,\n structList = TestConstants.structListConst);\n\nconst genericConstant :TestGenerics(TestAllTypes, Text) =\n (foo = (int16Field = 123), rev = (foo = \"text\", rev = (foo = (int16Field = 321))));\n\nconst embeddedData :Data = embed \"testdata\/packed\";\nconst embeddedText :Text = embed \"testdata\/short.txt\";\nconst embeddedStruct :TestAllTypes = embed \"testdata\/binary\";\n\nstruct TestAnyPointerConstants {\n anyKindAsStruct @0 :AnyPointer;\n anyStructAsStruct @1 :AnyStruct;\n anyKindAsList @2 :AnyPointer;\n anyListAsList @3 :AnyList;\n\n}\n\nconst anyPointerConstants :TestAnyPointerConstants = (\n anyKindAsStruct = TestConstants.structConst,\n anyStructAsStruct = TestConstants.structConst,\n anyKindAsList = TestConstants.int32ListConst,\n anyListAsList = TestConstants.int32ListConst,\n);\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x :Text);\n bar @1 () -> ();\n baz @2 (s: TestAllTypes);\n}\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestAllTypes -> ();\n grault @2 () -> TestAllTypes;\n}\n\ninterface TestExtends2 extends(TestExtends) {}\n\ninterface TestPipeline {\n getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);\n testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();\n\n struct Box {\n cap @0 :TestInterface;\n }\n}\n\ninterface TestCallOrder {\n getCallSequence @0 (expected: UInt32) -> (n: UInt32);\n # First call returns 0, next returns 1, ...\n #\n # The input `expected` is ignored but useful for disambiguating debug logs.\n}\n\ninterface TestTailCallee {\n struct TailResult {\n i @0 :UInt32;\n t @1 :Text;\n c @2 :TestCallOrder;\n }\n\n foo @0 (i :Int32, t :Text) -> TailResult;\n}\n\ninterface TestTailCaller {\n foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;\n}\n\ninterface TestHandle {}\n\ninterface TestMoreStuff extends(TestCallOrder) {\n # Catch-all type that contains lots of testing methods.\n\n callFoo @0 (cap :TestInterface) -> (s: Text);\n # Call `cap.foo()`, check the result, and return \"bar\".\n\n callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);\n # Like callFoo but waits for `cap` to resolve first.\n\n neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);\n # Doesn't return. You should cancel it.\n\n hold @3 (cap :TestInterface) -> ();\n # Returns immediately but holds on to the capability.\n\n callHeld @4 () -> (s: Text);\n # Calls the capability previously held using `hold` (and keeps holding it).\n\n getHeld @5 () -> (cap :TestInterface);\n # Returns the capability previously held using `hold` (and keeps holding it).\n\n echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);\n # Just returns the input cap.\n\n expectCancel @7 (cap :TestInterface) -> ();\n # evalLater()-loops forever, holding `cap`. Must be canceled.\n\n methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = \"foo\") -> (d :Text, e :Text = \"bar\");\n\n getHandle @9 () -> (handle :TestHandle);\n # Get a new handle. Tests have an out-of-band way to check the current number of live handles, so\n # this can be used to test garbage collection.\n\n getNull @10 () -> (nullCap :TestMoreStuff);\n # Always returns a null capability.\n\n getEnormousString @11 () -> (str :Text);\n # Attempts to return an 100MB string. Should always fail.\n}\n\ninterface TestMembrane {\n makeThing @0 () -> (thing :Thing);\n callPassThrough @1 (thing :Thing, tailCall :Bool) -> Result;\n callIntercept @2 (thing :Thing, tailCall :Bool) -> Result;\n loopback @3 (thing :Thing) -> (thing :Thing);\n\n interface Thing {\n passThrough @0 () -> Result;\n intercept @1 () -> Result;\n }\n\n struct Result {\n text @0 :Text;\n }\n}\n\nstruct TestContainMembrane {\n cap @0 :TestMembrane.Thing;\n list @1 :List(TestMembrane.Thing);\n}\n\nstruct TestTransferCap {\n list @0 :List(Element);\n struct Element {\n text @0 :Text;\n cap @1 :TestInterface;\n }\n}\n\ninterface TestKeywordMethods {\n delete @0 ();\n class @1 ();\n void @2 ();\n return @3 ();\n}\n\ninterface TestAuthenticatedBootstrap(VatId) {\n getCallerId @0 () -> (caller :VatId);\n}\n\nstruct TestSturdyRef {\n hostId @0 :TestSturdyRefHostId;\n objectId @1 :AnyPointer;\n}\n\nstruct TestSturdyRefHostId {\n host @0 :Text;\n}\n\nstruct TestSturdyRefObjectId {\n tag @0 :Tag;\n enum Tag {\n testInterface @0;\n testExtends @1;\n testPipeline @2;\n testTailCallee @3;\n testTailCaller @4;\n testMoreStuff @5;\n }\n}\n\nstruct TestProvisionId {}\nstruct TestRecipientId {}\nstruct TestThirdPartyCapId {}\nstruct TestJoinResult {}\n\nstruct TestNameAnnotation $Cxx.name(\"RenamedStruct\") {\n union {\n badFieldName @0 :Bool $Cxx.name(\"goodFieldName\");\n bar @1 :Int8;\n }\n\n enum BadlyNamedEnum $Cxx.name(\"RenamedEnum\") {\n foo @0;\n bar @1;\n baz @2 $Cxx.name(\"qux\");\n }\n\n anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name(\"anotherGoodFieldName\");\n\n struct NestedStruct $Cxx.name(\"RenamedNestedStruct\") {\n badNestedFieldName @0 :Bool $Cxx.name(\"goodNestedFieldName\");\n anotherBadNestedFieldName @1 :NestedStruct $Cxx.name(\"anotherGoodNestedFieldName\");\n\n enum DeeplyNestedEnum $Cxx.name(\"RenamedDeeplyNestedEnum\") {\n quux @0;\n corge @1;\n grault @2 $Cxx.name(\"garply\");\n }\n }\n\n badlyNamedUnion :union $Cxx.name(\"renamedUnion\") {\n badlyNamedGroup :group $Cxx.name(\"renamedGroup\") {\n foo @3 :Void;\n bar @4 :Void;\n }\n baz @5 :NestedStruct $Cxx.name(\"qux\");\n }\n}\n\ninterface TestNameAnnotationInterface $Cxx.name(\"RenamedInterface\") {\n badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name(\"renamedParam\")) $Cxx.name(\"renamedMethod\");\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"bd500c564b9a95f242b17efd34675e9e12001b3e","subject":"fix typo","message":"fix typo\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/compat\/json.capnp","new_file":"c++\/src\/capnp\/compat\/json.capnp","new_contents":"# Copyright (c) 2015 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0x8ef99297a43a5e34;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"capnp::json\");\n\nstruct Value {\n union {\n null @0 :Void;\n boolean @1 :Bool;\n number @2 :Float64;\n string @3 :Text;\n array @4 :List(Value);\n object @5 :List(Field);\n # Standard JSON values.\n\n call @6 :Call;\n # Non-standard: A \"function call\", applying a named function (named by a single identifier)\n # to a parameter list. Examples:\n #\n # BinData(0, \"Zm9vCg==\")\n # ISODate(\"2015-04-15T08:44:50.218Z\")\n #\n # Mongo DB users will recognize the above as exactly the syntax Mongo uses to represent BSON\n # \"binary\" and \"date\" types in text, since JSON has no analog of these. This is basically the\n # reason this extension exists. We do NOT recommend using `call` unless you specifically need\n # to be compatible with some silly format that uses this syntax.\n }\n\n struct Field {\n name @0 :Text;\n value @1 :Value;\n }\n\n struct Call {\n function @0 :Text;\n params @1 :List(Value);\n }\n}\n\n# ========================================================================================\n# Annotations to control parsing. Typical usage:\n#\n# using Json = import \"\/capnp\/compat\/json.capnp\";\n#\n# And then later on:\n#\n# myField @0 :Text $Json.name(\"my_field\");\n\nannotation name @0xfa5b1fd61c2e7c3d (field, enumerant, method, group, union): Text;\n# Define an alternative name to use when encoding the given item in JSON. This can be used, for\n# example, to use snake_case names where needed, even though Cap'n Proto uses strictly camelCase.\n#\n# (However, because JSON is derived from JavaScript, you *should* use camelCase names when\n# defining JSON-based APIs. But, when supporting a pre-existing API you may not have a choice.)\n\nannotation flatten @0x82d3e852af0336bf (field, group, union): FlattenOptions;\n# Specifies that an aggregate field should be flattened into its parent.\n#\n# In order to flatten a member of a union, the union (or, for an anonymous union, the parent\n# struct type) must have the $jsonDiscriminator annotation.\n#\n# TODO(someday): Maybe support \"flattening\" a List(Value.Field) as a way to support unknown JSON\n# fields?\n\nstruct FlattenOptions {\n prefix @0 :Text = \"\";\n # Optional: Adds the given prefix to flattened field names.\n}\n\nannotation discriminator @0xcfa794e8d19a0162 (struct, union): DiscriminatorOptions;\n# Specifies that a union's variant will be decided not by which fields are present, but instead\n# by a special discriminator field. The value of the discriminator field is a string naming which\n# variant is active. This allows the members of the union to have the $jsonFlatten annotation, or\n# to all have the same name.\n\nstruct DiscriminatorOptions {\n name @0 :Text;\n # The name of the discriminator field. Defaults to matching the name of the union.\n\n valueName @1 :Text;\n # If non-null, specifies that the union's value shall have the given field name, rather than the\n # value's name. In this case the union's variant can only be determined by looking at the\n # discriminant field, not by inspecting which value field is present.\n #\n # It is an error to use `valueName` while also declaring some variants as $flatten.\n}\n\nannotation base64 @0xd7d879450a253e4b (field): Void;\n# Place on a field of type `Data` to indicate that its JSON representation is a Base64 string.\n\nannotation hex @0xf061e22f0ae5c7b5 (field): Void;\n# Place on a field of type `Data` to indicate that its JSON representation is a hex string.\n","old_contents":"# Copyright (c) 2015 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0x8ef99297a43a5e34;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"capnp::json\");\n\nstruct Value {\n union {\n null @0 :Void;\n boolean @1 :Bool;\n number @2 :Float64;\n string @3 :Text;\n array @4 :List(Value);\n object @5 :List(Field);\n # Standard JSON values.\n\n call @6 :Call;\n # Non-standard: A \"function call\", applying a named function (named by a single identifier)\n # to a parameter list. Examples:\n #\n # BinData(0, \"Zm9vCg==\")\n # ISODate(\"2015-04-15T08:44:50.218Z\")\n #\n # Mongo DB users will recognize the above as exactly the syntax Mongo uses to represent BSON\n # \"binary\" and \"date\" types in text, since JSON has no analog of these. This is basically the\n # reason this extension exists. We do NOT recommend using `call` unless you specifically need\n # to be compatible with some silly format that uses this syntax.\n }\n\n struct Field {\n name @0 :Text;\n value @1 :Value;\n }\n\n struct Call {\n function @0 :Text;\n params @1 :List(Value);\n }\n}\n\n# ========================================================================================\n# Annotations to control parsing. Typical usage:\n#\n# using Json = import \"\/capnp\/compat\/json.capnp\";\n#\n# And then later on:\n#\n# myField @0 :Text $Json.name(\"my_field\");\n\nannotation name @0xfa5b1fd61c2e7c3d (field, enumerant, method, group, union): Text;\n# Define an alternative name to use when encoding the given item in JSON. This can be used, for\n# example, to use snake_case names where needed, even though Cap'n Proto uses strictly camelCase.\n#\n# (However, because JSON is derived from JavaScript, you *should* use camelCase names when\n# defining JSON-based APIs. But, when supporting a pre-existing API you may not have a choice.)\n\nannotation flatten @0x82d3e852af0336bf (field, group, union): FlattenOptions;\n# Specifies that an aggregate field should be flattened into its parent.\n#\n# In order to flatten a member of a union, the union (or, for an anonymous union, the parent\n# struct type) must have the $jsonDiscribinator annotation.\n#\n# TODO(someday): Maybe support \"flattening\" a List(Value.Field) as a way to support unknown JSON\n# fields?\n\nstruct FlattenOptions {\n prefix @0 :Text = \"\";\n # Optional: Adds the given prefix to flattened field names.\n}\n\nannotation discriminator @0xcfa794e8d19a0162 (struct, union): DiscriminatorOptions;\n# Specifies that a union's variant will be decided not by which fields are present, but instead\n# by a special discriminator field. The value of the discriminator field is a string naming which\n# variant is active. This allows the members of the union to have the $jsonFlatten annotation, or\n# to all have the same name.\n\nstruct DiscriminatorOptions {\n name @0 :Text;\n # The name of the discriminator field. Defaults to matching the name of the union.\n\n valueName @1 :Text;\n # If non-null, specifies that the union's value shall have the given field name, rather than the\n # value's name. In this case the union's variant can only be determined by looking at the\n # discriminant field, not by inspecting which value field is present.\n #\n # It is an error to use `valueName` while also declaring some variants as $flatten.\n}\n\nannotation base64 @0xd7d879450a253e4b (field): Void;\n# Place on a field of type `Data` to indicate that its JSON representation is a Base64 string.\n\nannotation hex @0xf061e22f0ae5c7b5 (field): Void;\n# Place on a field of type `Data` to indicate that its JSON representation is a hex string.\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"3ba6def15627757ba0d61f754dff17332014fde9","subject":"Bump version","message":"Bump version\n","repos":"simonv3\/quick-survey,simonv3\/quick-survey,simonv3\/quick-survey,simonv3\/quick-survey,simonv3\/quick-survey","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xa14b514d53144d18;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wupmzqk4872vgsye9t9x5dmrdw17mad97dk21jvcm2ph4jataze0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Quick Survey\"),\n\n appVersion = 2, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.0.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Survey\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"..\/meta\/icons\/squirrel_128x128.svg\"),\n grain = (svg = embed \"..\/meta\/icons\/squirrel_24x24.svg\"),\n market = (svg = embed \"..\/meta\/icons\/squirrel_150x150.svg\"),\n marketBig = (svg = embed \"..\/meta\/icons\/squirrel_300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/simonv3\/quick-survey\/\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/simonv3\/quick-survey\/\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity, office],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"svansintjan@gmail.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"..\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Simon Vansintjan\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"..\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"..\/meta\/description.md\"),\n # The app's description description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Surveys\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1275, height = 676, png = embed \"..\/meta\/screenshots\/quick-survey.png\"),\n (width = 1275, height = 438, png = embed \"..\/meta\/screenshots\/quick-survey-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xa14b514d53144d18;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wupmzqk4872vgsye9t9x5dmrdw17mad97dk21jvcm2ph4jataze0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Quick Survey\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Survey\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"..\/meta\/icons\/squirrel_128x128.svg\"),\n grain = (svg = embed \"..\/meta\/icons\/squirrel_24x24.svg\"),\n market = (svg = embed \"..\/meta\/icons\/squirrel_150x150.svg\"),\n marketBig = (svg = embed \"..\/meta\/icons\/squirrel_300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/simonv3\/quick-survey\/\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/simonv3\/quick-survey\/\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = mit),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity, office],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"svansintjan@gmail.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n pgpSignature = embed \"..\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Simon Vansintjan\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"..\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"..\/meta\/description.md\"),\n # The app's description description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Surveys\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1275, height = 676, png = embed \"..\/meta\/screenshots\/quick-survey.png\"),\n (width = 1275, height = 438, png = embed \"..\/meta\/screenshots\/quick-survey-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"16591e503bfe8c5b0d0d1fefd56ba9f4b14d0d96","subject":"Start running tests with two workers rather than one. So far works fine.","message":"Start running tests with two workers rather than one. So far works fine.\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"src\/blackrock\/master.capnp","new_file":"src\/blackrock\/master.capnp","new_contents":"# Sandstorm Blackrock\n# Copyright (c) 2015 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0xf58bc2dacec400ce;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"blackrock\");\n\nstruct MasterConfig {\n workerCount @0 :UInt32;\n\n # For now, we expect exactly one of each of the other machine types.\n\n frontendConfig @1 :import \"frontend.capnp\".FrontendConfig;\n}\n\nconst testConfig :MasterConfig = (\n workerCount = 2,\n frontendConfig = (\n baseUrl = \"http:\/\/localrock.sandstorm.io:6080\",\n wildcardHost = \"*.localrock.sandstorm.io:6080\",\n allowDemoAccounts = false,\n isTesting = true\n )\n);\n","old_contents":"# Sandstorm Blackrock\n# Copyright (c) 2015 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0xf58bc2dacec400ce;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"blackrock\");\n\nstruct MasterConfig {\n workerCount @0 :UInt32;\n\n # For now, we expect exactly one of each of the other machine types.\n\n frontendConfig @1 :import \"frontend.capnp\".FrontendConfig;\n}\n\nconst testConfig :MasterConfig = (\n workerCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/localrock.sandstorm.io:6080\",\n wildcardHost = \"*.localrock.sandstorm.io:6080\",\n allowDemoAccounts = false,\n isTesting = true\n )\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"c1e5d5a831b16ec778575a0ad33c9d3457ee5bc5","subject":"the master Z union in test.capnp includes all elements now, include specific planes and airport","message":"the master Z union in test.capnp includes all elements now, include specific planes and airport\n","repos":"zombiezen\/go-capnproto2,hodduc\/go-capnproto2,zombiezen\/go-capnproto,hodduc\/go-capnproto2,zombiezen\/go-capnproto2,tpukep\/caps,zombiezen\/go-capnproto","old_file":"test.capnp","new_file":"test.capnp","new_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n}\n\n\n\n","old_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n }\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"d0ad7aafdbbbe28b39c5d134cd691261e5ce789b","subject":"include zdatevec for a List(Zdate)","message":"include zdatevec for a List(Zdate)\n","repos":"zombiezen\/go-capnproto,zombiezen\/go-capnproto,zombiezen\/go-capnproto2,zombiezen\/go-capnproto2,hodduc\/go-capnproto2,tpukep\/caps,hodduc\/go-capnproto2","old_file":"test.capnp","new_file":"test.capnp","new_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n }\n}\n\n\n","old_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"capn_test\");\n$Go.import(\"go-capnproto\/example\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n }\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"16013a45d1dcab2f527c16dd4b2a911b09ee470b","subject":"Set appTitle and bump version.","message":"Set appTitle and bump version.\n","repos":"ashwini-angular\/etherpad-lite,ashwini-angular\/etherpad-lite,ashwini-angular\/etherpad-lite,ashwini-angular\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 4, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"66cc08c9041d31fb5d51bfd0dc42171b59b78b3e","subject":"metadata","message":"metadata\n","repos":"sandstorm-io\/collections-app,sandstorm-io\/collections-app","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.0\"),\n\n actions = [\n (\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/sandstorm-collections-app\",\n license = (openSource = mit),\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n upstreamAuthor = \"David Renshaw\",\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xd7ed440331369f59;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"s3u2xgmqwznz2n3apf30sm3gw1d85y029enw5pymx734cnk5n78h\",\n\n manifest = (\n appTitle = (defaultText = \"Collections\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.0.0\"),\n\n actions = [\n ( title = (defaultText = \"new collection\"),\n nounPhrase = (defaultText = \"collection\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/sandstorm.io\",\n codeUrl = \"http:\/\/example.com\",\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"david@sandstorm.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"share with groups\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \"spk\" ),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/collections-server\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"d453d749b19f1d989a079c725cb438ccfafa0cea","subject":"Clarify the RPC spec in some places","message":"Clarify the RPC spec in some places\n\nBased on discussions in the Google group:\n\nhttps:\/\/groups.google.com\/forum\/#!topic\/capnproto\/_1kBtRSC51s\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"0b24806435c08cba83880d0fcdbb3fea7f83693c","subject":"bump version number","message":"bump version number\n","repos":"neynah\/sharelatex,dwrensha\/sharelatex,dwrensha\/sharelatex,neynah\/sharelatex","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 5, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.2\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/host.conf\", \"etc\/localtime\", \"etc\/nsswitch.conf\",\n \"etc\/resolv.conf\"\n ]\n ),\n ( sourcePath = \"\/var\/lib\/texmf\", packagePath=\"usr\/local\/lib\/texmf\")\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"usr\/share\/texmf-dist\",\n \"document-updater\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"web\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"track-changes\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"real-time\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\"]\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/usr\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","old_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/host.conf\", \"etc\/localtime\", \"etc\/nsswitch.conf\",\n \"etc\/resolv.conf\"\n ]\n ),\n ( sourcePath = \"\/var\/lib\/texmf\", packagePath=\"usr\/local\/lib\/texmf\")\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"usr\/share\/texmf-dist\",\n \"document-updater\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"web\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"track-changes\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\",\n \"real-time\/node_modules\/redis-sharelatex\/node_modules\/coffee-script\"]\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/usr\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"8831be21cb7dd210a7cfefb781f8e01a2ffae5b4","subject":"Tweak Sandstorm activity event text","message":"Tweak Sandstorm activity event text\n","repos":"Achaikos\/Rocket.Chat,fatihwk\/Rocket.Chat,alexbrazier\/Rocket.Chat,alexbrazier\/Rocket.Chat,ziedmahdi\/Rocket.Chat,ealbers\/Rocket.Chat,pachox\/Rocket.Chat,danielbressan\/Rocket.Chat,Gyubin\/Rocket.Chat,mwharrison\/Rocket.Chat,Movile\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,AimenJoe\/Rocket.Chat,LearnersGuild\/Rocket.Chat,wtsarchive\/Rocket.Chat,igorstajic\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,NMandapaty\/Rocket.Chat,JamesHGreen\/Rocket.Chat,4thParty\/Rocket.Chat,JamesHGreen\/Rocket_API,ziedmahdi\/Rocket.Chat,cnash\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,AimenJoe\/Rocket.Chat,mrinaldhar\/Rocket.Chat,flaviogrossi\/Rocket.Chat,ealbers\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,karlprieb\/Rocket.Chat,nishimaki10\/Rocket.Chat,Gudii\/Rocket.Chat,Gudii\/Rocket.Chat,inoxth\/Rocket.Chat,pitamar\/Rocket.Chat,LearnersGuild\/echo-chat,marzieh312\/Rocket.Chat,mwharrison\/Rocket.Chat,yuyixg\/Rocket.Chat,Achaikos\/Rocket.Chat,danielbressan\/Rocket.Chat,Movile\/Rocket.Chat,Gyubin\/Rocket.Chat,galrotem1993\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,LearnersGuild\/Rocket.Chat,fatihwk\/Rocket.Chat,pkgodara\/Rocket.Chat,igorstajic\/Rocket.Chat,inoio\/Rocket.Chat,karlprieb\/Rocket.Chat,VoiSmart\/Rocket.Chat,ggazzo\/Rocket.Chat,pachox\/Rocket.Chat,intelradoux\/Rocket.Chat,JamesHGreen\/Rocket_API,danielbressan\/Rocket.Chat,mwharrison\/Rocket.Chat,k0nsl\/Rocket.Chat,mrsimpson\/Rocket.Chat,ahmadassaf\/Rocket.Chat,Sing-Li\/Rocket.Chat,Achaikos\/Rocket.Chat,flaviogrossi\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,intelradoux\/Rocket.Chat,abduljanjua\/TheHub,nishimaki10\/Rocket.Chat,fatihwk\/Rocket.Chat,galrotem1993\/Rocket.Chat,matthewshirley\/Rocket.Chat,4thParty\/Rocket.Chat,xasx\/Rocket.Chat,tntobias\/Rocket.Chat,marzieh312\/Rocket.Chat,cnash\/Rocket.Chat,k0nsl\/Rocket.Chat,tntobias\/Rocket.Chat,wtsarchive\/Rocket.Chat,fatihwk\/Rocket.Chat,ziedmahdi\/Rocket.Chat,marzieh312\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,wtsarchive\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,karlprieb\/Rocket.Chat,LearnersGuild\/Rocket.Chat,subesokun\/Rocket.Chat,intelradoux\/Rocket.Chat,Gudii\/Rocket.Chat,Achaikos\/Rocket.Chat,Sing-Li\/Rocket.Chat,xasx\/Rocket.Chat,yuyixg\/Rocket.Chat,ealbers\/Rocket.Chat,Gudii\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,abduljanjua\/TheHub,tntobias\/Rocket.Chat,mrsimpson\/Rocket.Chat,inoxth\/Rocket.Chat,AlecTroemel\/Rocket.Chat,LearnersGuild\/echo-chat,pkgodara\/Rocket.Chat,abduljanjua\/TheHub,ahmadassaf\/Rocket.Chat,k0nsl\/Rocket.Chat,VoiSmart\/Rocket.Chat,mrsimpson\/Rocket.Chat,AlecTroemel\/Rocket.Chat,ggazzo\/Rocket.Chat,xasx\/Rocket.Chat,xasx\/Rocket.Chat,mrinaldhar\/Rocket.Chat,intelradoux\/Rocket.Chat,Sing-Li\/Rocket.Chat,cnash\/Rocket.Chat,matthewshirley\/Rocket.Chat,pachox\/Rocket.Chat,mrsimpson\/Rocket.Chat,wtsarchive\/Rocket.Chat,mrinaldhar\/Rocket.Chat,inoxth\/Rocket.Chat,pitamar\/Rocket.Chat,cnash\/Rocket.Chat,yuyixg\/Rocket.Chat,inoio\/Rocket.Chat,AlecTroemel\/Rocket.Chat,karlprieb\/Rocket.Chat,galrotem1993\/Rocket.Chat,Sing-Li\/Rocket.Chat,ahmadassaf\/Rocket.Chat,JamesHGreen\/Rocket.Chat,subesokun\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,flaviogrossi\/Rocket.Chat,pkgodara\/Rocket.Chat,galrotem1993\/Rocket.Chat,pitamar\/Rocket.Chat,pkgodara\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,igorstajic\/Rocket.Chat,VoiSmart\/Rocket.Chat,matthewshirley\/Rocket.Chat,AimenJoe\/Rocket.Chat,4thParty\/Rocket.Chat,abduljanjua\/TheHub,ziedmahdi\/Rocket.Chat,Gyubin\/Rocket.Chat,JamesHGreen\/Rocket.Chat,inoio\/Rocket.Chat,AimenJoe\/Rocket.Chat,Movile\/Rocket.Chat,matthewshirley\/Rocket.Chat,k0nsl\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,mwharrison\/Rocket.Chat,alexbrazier\/Rocket.Chat,JamesHGreen\/Rocket_API,JamesHGreen\/Rocket.Chat,LearnersGuild\/Rocket.Chat,LearnersGuild\/echo-chat,ealbers\/Rocket.Chat,flaviogrossi\/Rocket.Chat,NMandapaty\/Rocket.Chat,NMandapaty\/Rocket.Chat,marzieh312\/Rocket.Chat,alexbrazier\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ahmadassaf\/Rocket.Chat,danielbressan\/Rocket.Chat,Movile\/Rocket.Chat,pitamar\/Rocket.Chat,subesokun\/Rocket.Chat,yuyixg\/Rocket.Chat,JamesHGreen\/Rocket_API,AlecTroemel\/Rocket.Chat,tntobias\/Rocket.Chat,Gyubin\/Rocket.Chat,NMandapaty\/Rocket.Chat,igorstajic\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,nishimaki10\/Rocket.Chat,4thParty\/Rocket.Chat,subesokun\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,LearnersGuild\/echo-chat,inoxth\/Rocket.Chat,nishimaki10\/Rocket.Chat,pachox\/Rocket.Chat,ggazzo\/Rocket.Chat,ggazzo\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 38, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.37.1\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n eventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 38, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.37.1\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n eventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"message sent\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"private message sent\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a300b73d56750a1a5645767d375be60839314e84","subject":"- Set WITH_API=true on Sandstorm, so that export works.","message":"- Set WITH_API=true on Sandstorm, so that export works.\n\nThanks to xet7 !\n","repos":"wekan\/wekan,libreboard\/libreboard,GhassenRjab\/wekan,wekan\/wekan,wekan\/wekan,libreboard\/libreboard,GhassenRjab\/wekan,GhassenRjab\/wekan,wekan\/wekan,wekan\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 110,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.25.0~2018-08-09\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 110,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.25.0~2018-08-09\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"485f6b5ac2fdeb0896465692a48f3ad8e402673b","subject":"Allow Sandstorm to serve Wekan HTTP API","message":"Allow Sandstorm to serve Wekan HTTP API\n\nThis is probably not a \"whole\" fix, but this may be a missing piece.","repos":"libreboard\/libreboard,wekan\/wekan,libreboard\/libreboard,GhassenRjab\/wekan,wekan\/wekan,GhassenRjab\/wekan,GhassenRjab\/wekan,wekan\/wekan,wekan\/wekan,wekan\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 118,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.33.0~2018-08-16\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/api\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 118,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.33.0~2018-08-16\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c409ef9ca0e31e659c8f3f851358c688d066483d","subject":"capnp: add docs for go.capnp","message":"capnp: add docs for go.capnp\n","repos":"zombiezen\/go-capnproto,zombiezen\/go-capnproto2,hodduc\/go-capnproto2,zombiezen\/go-capnproto2,hodduc\/go-capnproto2,zombiezen\/go-capnproto","old_file":"go.capnp","new_file":"go.capnp","new_contents":"@0xd12a1c51fedd6c88;\n\nannotation package(file) :Text;\n# The Go package name for the generated file.\n\nannotation import(file) :Text;\n# The Go import path that the generated file is accessible from.\n# Used to generate import statements and check if two types are in the\n# same package.\n\nannotation doc(struct, field, enum) :Text;\n# Adds a doc comment to the generated code.\n\nannotation tag(enumerant) :Text;\n# Changes the string representation of the enum in the generated code.\n\nannotation notag(enumerant) :Void;\n# Removes the string representation of the enum in the generated code.\n\nannotation customtype(field) :Text;\n# OBSOLETE, not used by code generator.\n\nannotation name(struct, field, union, enum, enumerant, interface, method, param, annotation, const, group) :Text;\n# Used to rename the element in the generated code.\n\n$package(\"capnp\");\n","old_contents":"@0xd12a1c51fedd6c88;\nannotation package(file) :Text;\nannotation import(file) :Text;\nannotation doc(struct, field, enum) :Text;\nannotation tag(enumerant) : Text;\nannotation notag(enumerant) : Void;\nannotation customtype(field) : Text;\n# DEPRECATED\nannotation name(struct, field, union, enum, enumerant, interface, method, param, annotation, const, group) :Text;\n$package(\"capnp\");\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"1ebc1720b834e5cbca460119172717847eb15c98","subject":"Didn't mean to submit this file.","message":"Didn't mean to submit this file.\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"src\/blackrock\/coordinator.capnp","new_file":"src\/blackrock\/coordinator.capnp","new_contents":"","old_contents":"# Sandstorm Blackrock\n# Copyright (c) 2014 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0xe4c9d3f895ca2f67;\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"6a080a4bcea49ccfcf73131bc90fd4f3c34c0643","subject":"Allow recovery info in stored hash refs.","message":"Allow recovery info in stored hash refs.\n","repos":"google\/hat-backup,google\/hat-backup","old_file":"schema\/root.capnp","new_file":"schema\/root.capnp","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"d5668fe6157bac3ebded55639a8ddfcc68bef0c7","subject":"Jack <\/3: version 0.1.0!","message":"Jack <\/3: version 0.1.0!\n","repos":"sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f90ac03f6d7390e0b4f383001e59dff4c574b067","subject":"Release 0.10.0","message":"Release 0.10.0\n\nCloses #425\n","repos":"araczkowski\/paczka.pro,johnleeming\/wekan,araczkowski\/paczka.pro,libreboard\/libreboard,johnleeming\/wekan,ahmadassaf\/libreboard,Serubin\/wekan,oliver4u\/WEKAN_runpartner,mario-orlicky\/wekan,jtickle\/wekan,gelojavonitalla\/wekan,oliver4u\/WEKAN_runpartner,wekan\/wekan,ddanssaert\/wekan,mario-orlicky\/wekan,ddanssaert\/wekan,jtickle\/wekan,wykeith\/cp2m,johnleeming\/wekan,wekan\/wekan,nztqa\/wekan,oliver4u\/sap-wekan,floatinghotpot\/wekan,GhassenRjab\/wekan,ahmadassaf\/libreboard,pro-to-tip\/wekan,Serubin\/wekan,Xperterra\/wekan,johnleeming\/wekan,wekan\/wekan,jtickle\/wekan,GhassenRjab\/wekan,FSFTN\/Wekan,floatinghotpot\/wekan,wekan\/wekan,ddanssaert\/wekan,FSFTN\/Wekan,Xperterra\/wekan,nztqa\/wekan,Serubin\/wekan,libreboard\/libreboard,gelojavonitalla\/wekan,pro-to-tip\/wekan,wekan\/wekan,oliver4u\/sap-wekan,oliver4u\/sap-wekan,nztqa\/wekan,ahmadassaf\/libreboard,GhassenRjab\/wekan,AlexanderS\/wekan,mario-orlicky\/wekan,oliver4u\/WEKAN_runpartner,AlexanderS\/wekan,araczkowski\/paczka.pro,wykeith\/cp2m","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 9,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 8,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.10-rc4\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"http:\/\/libreboard.com\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"maxime@quandalle.com\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"92c333c9441b264adeb4cba9e1d5efe9337a7121","subject":"Minor clerical fix.","message":"Minor clerical fix.\n\nWe should use the capnp convention for names in .capnp files, so\ncapitalize Grain\n","repos":"zenhack\/go.sandstorm,zenhack\/go.sandstorm,zenhack\/go.sandstorm","old_file":"exp\/websession\/session_data.capnp","new_file":"exp\/websession\/session_data.capnp","new_contents":"@0x9cd7bc7194780111;\n\nusing Go = import \"\/go.capnp\";\n$Go.package(\"websession\");\n$Go.import(\"zenhack.net\/go\/sandstorm\/exp\/websession\");\n\nusing Grain = import \"\/grain.capnp\";\nusing Identity = import \"\/identity.capnp\";\nusing Powerbox = import \"\/powerbox.capnp\";\nusing Util = import \"\/util.capnp\";\n\nstruct SessionData {\n # SessionData contains all of the information that is passed to Grain.UiView's\n # new*Session methods, but which does not map to part of an HTTP request. We\n # package up the data in one struct, and make it available via the\n # GetSessionData Go function defined in this package.\n\n context @0 :Grain.SessionContext;\n userInfo @1 :Identity.UserInfo;\n sessionParams @2 :AnyPointer;\n tabId @3 :Data;\n\n union {\n normal @4 :Void; # A call to newSession\n\n request :group {\n # A call to newRequestSession\n requestInfo @5 :List(Powerbox.PowerboxDescriptor);\n }\n\n offer :group {\n # A call to newOfferSession\n offer @6 :Capability;\n descriptor @7 :Powerbox.PowerboxDescriptor;\n }\n }\n\n # relevant for both `request` and `offer`, but not `normal`:\n sessionType @8 :UInt64;\n}\n","old_contents":"@0x9cd7bc7194780111;\n\nusing Go = import \"\/go.capnp\";\n$Go.package(\"websession\");\n$Go.import(\"zenhack.net\/go\/sandstorm\/exp\/websession\");\n\nusing Grain = import \"\/grain.capnp\";\nusing Identity = import \"\/identity.capnp\";\nusing Powerbox = import \"\/powerbox.capnp\";\nusing Util = import \"\/util.capnp\";\n\nstruct SessionData {\n # SessionData contains all of the information that is passed to grain.UiView's\n # new*Session methods, but which does not map to part of an HTTP request. We\n # package up the data in one struct, and make it available via the\n # GetSessionData Go function defined in this package.\n\n context @0 :Grain.SessionContext;\n userInfo @1 :Identity.UserInfo;\n sessionParams @2 :AnyPointer;\n tabId @3 :Data;\n\n union {\n normal @4 :Void; # A call to newSession\n\n request :group {\n # A call to newRequestSession\n requestInfo @5 :List(Powerbox.PowerboxDescriptor);\n }\n\n offer :group {\n # A call to newOfferSession\n offer @6 :Capability;\n descriptor @7 :Powerbox.PowerboxDescriptor;\n }\n }\n\n # relevant for both `request` and `offer`, but not `normal`:\n sessionType @8 :UInt64;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"949110626b3926a32238740eb91fd73dfbc09143","subject":"Re-add C++ namespacing","message":"Re-add C++ namespacing\n","repos":"BinaryAnalysisPlatform\/holmes,maurer\/holmes,maurer\/holmes","old_file":"src\/holmes.capnp","new_file":"src\/holmes.capnp","new_contents":"@0xaaef86128cdda946;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"holmes\");\n\ninterface Holmes {\n # Values\n struct Val {\n union {\n uint64 @0 :UInt64;\n string @1 :Text;\n blob @2 :Data;\n list @3 :List(Val);\n }\n }\n\n struct HType {\n union {\n uint64 @0 :Void;\n string @1 :Void;\n blob @2 :Void;\n list @3 :HType;\n }\n }\n\n # Variables\n using Var = UInt32;\n\n # Logical facts\n using PredName = Text;\n struct Fact {\n predicate @0 :PredName;\n args @1 :List(Val);\n }\n\n struct BodyExpr {\n union {\n unbound @0 :Void;\n var @1 :Var;\n const @2 :Val;\n }\n }\n\n struct BodyClause {\n predicate @0 :PredName;\n args @1 :List(BodyExpr);\n }\n\n struct FExpr {\n func @0 :Text;\n args @1 :List(Expr);\n }\n\n struct Expr {\n union {\n var @0 :Var;\n val @1 :Val;\n app @2 : FExpr;\n }\n }\n\n struct BindExpr {\n union {\n normal @0 :BodyExpr;\n iterate @1 :BodyExpr;\n }\n }\n\n struct WhereClause {\n lhs @0 :List(BindExpr);\n rhs @1 :Expr;\n }\n\n struct Rule {\n head @0 :List(BodyClause);\n body @1 :List(BodyClause);\n where @2 :List(WhereClause);\n }\n\n interface HFunc {\n types @0 ()->(inputTypes : List(HType),\n outputTypes : List(HType));\n run @1 (args :List(Val)) -> (results :List(Val));\n }\n\n # Register a predicate\n newPredicate @0 (predName :PredName,\n argTypes :List(HType));\n\n # Add a fact to the extensional database\n newFact @1 (fact :Fact);\n\n # Ask the server to search or expand the intensional database\n # searching for a set of facts that matches a body clause\n # Returns the list of satisfying assignments to the body clauses.\n derive @2 (query :List(BodyClause)) -> (ctx :List(List(Val)));\n\n # Add a rule to expand the intentional database\n newRule @3 (rule :Rule) -> ();\n\n # Register a new external function\n newFunc @4 (name :Text, func :HFunc);\n}\n","old_contents":"@0xaaef86128cdda946;\ninterface Holmes {\n # Values\n struct Val {\n union {\n uint64 @0 :UInt64;\n string @1 :Text;\n blob @2 :Data;\n list @3 :List(Val);\n }\n }\n\n struct HType {\n union {\n uint64 @0 :Void;\n string @1 :Void;\n blob @2 :Void;\n list @3 :HType;\n }\n }\n\n # Variables\n using Var = UInt32;\n\n # Logical facts\n using PredName = Text;\n struct Fact {\n predicate @0 :PredName;\n args @1 :List(Val);\n }\n\n struct BodyExpr {\n union {\n unbound @0 :Void;\n var @1 :Var;\n const @2 :Val;\n }\n }\n\n struct BodyClause {\n predicate @0 :PredName;\n args @1 :List(BodyExpr);\n }\n\n struct FExpr {\n func @0 :Text;\n args @1 :List(Expr);\n }\n\n struct Expr {\n union {\n var @0 :Var;\n val @1 :Val;\n app @2 : FExpr;\n }\n }\n\n struct BindExpr {\n union {\n normal @0 :BodyExpr;\n iterate @1 :BodyExpr;\n }\n }\n\n struct WhereClause {\n lhs @0 :List(BindExpr);\n rhs @1 :Expr;\n }\n\n struct Rule {\n head @0 :List(BodyClause);\n body @1 :List(BodyClause);\n where @2 :List(WhereClause);\n }\n\n interface HFunc {\n types @0 ()->(inputTypes : List(HType),\n outputTypes : List(HType));\n run @1 (args :List(Val)) -> (results :List(Val));\n }\n\n # Register a predicate\n newPredicate @0 (predName :PredName,\n argTypes :List(HType));\n\n # Add a fact to the extensional database\n newFact @1 (fact :Fact);\n \n # Ask the server to search or expand the intensional database\n # searching for a set of facts that matches a body clause\n # Returns the list of satisfying assignments to the body clauses.\n derive @2 (query :List(BodyClause)) -> (ctx :List(List(Val)));\n\n # Add a rule to expand the intentional database\n newRule @3 (rule :Rule) -> ();\n\n # Register a new external function\n newFunc @4 (name :Text, func :HFunc);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f80e52758ea8bec0af5348cd5357656a88f7e942","subject":"Add comment","message":"Add comment\n","repos":"numenta\/htmresearch-core,akhilaananthram\/nupic.core,numenta\/nupic.core,jaredweiss\/nupic.core,lscheinkman\/nupic.core,rhyolight\/nupic.core,subutai\/nupic.core,numenta\/htmresearch-core,Bemujo\/https-github.com-numenta-nupic,breznak\/nupic.core,sambitgaan\/nupic.core,numenta\/nupic.core,metaml\/nupic.core,metaml\/nupic.core,breznak\/nupic.core,neuroidss\/nupic.core,brev\/nupic.core,scottpurdy\/nupic.core,rcrowder\/nupic.core,rhyolight\/nupic.core,ywcui1990\/nupic.core,neuroidss\/nupic.core,sambitgaan\/nupic.core,metaml\/nupic.core,scottpurdy\/nupic.core,subutai\/nupic.core,jaredweiss\/nupic.core,sambitgaan\/nupic.core,scottpurdy\/nupic.core,subutai\/nupic.core,ywcui1990\/nupic.core,ywcui1990\/nupic.core,EricSB\/nupic.core,Bemujo\/https-github.com-numenta-nupic,utensil\/nupic.core,lscheinkman\/nupic.core,sambitgaan\/nupic.core,akhilaananthram\/nupic.core,rcrowder\/nupic.core,EricSB\/nupic.core,Bemujo\/https-github.com-numenta-nupic,pettitda\/nupic.core,pettitda\/nupic.core,jaredweiss\/nupic.core,akhilaananthram\/nupic.core,EricSB\/nupic.core,rcrowder\/nupic.core,jaredweiss\/nupic.core,rhyolight\/nupic.core,Bemujo\/https-github.com-numenta-nupic,utensil\/nupic.core,scottpurdy\/nupic.core,akhilaananthram\/nupic.core,lscheinkman\/nupic.core,breznak\/nupic.core,numenta\/htmresearch-core,EricSB\/nupic.core,numenta\/htmresearch-core,lscheinkman\/nupic.core,pettitda\/nupic.core,metaml\/nupic.core,breznak\/nupic.core,subutai\/nupic.core,numenta\/nupic.core,neuroidss\/nupic.core,pettitda\/nupic.core,rhyolight\/nupic.core,ywcui1990\/nupic.core,numenta\/nupic.core,brev\/nupic.core,brev\/nupic.core,brev\/nupic.core,neuroidss\/nupic.core,utensil\/nupic.core,utensil\/nupic.core,rcrowder\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 16\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n\n}\n","old_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 16\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"85648744a1b200b858fddb139b55b48418f74586","subject":"add versioning test structs to aircraft.capnp schema","message":"add versioning test structs to aircraft.capnp schema\n","repos":"zombiezen\/go-capnproto2,hodduc\/go-capnproto2,tpukep\/caps,hodduc\/go-capnproto2,zombiezen\/go-capnproto2,zombiezen\/go-capnproto,zombiezen\/go-capnproto","old_file":"aircraftlib\/aircraft.capnp","new_file":"aircraftlib\/aircraft.capnp","new_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"aircraftlib\");\n$Go.import(\"go-capnproto\/aircraftlib\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n zdatavec @38: List(Zdata);\n }\n}\n\n# tests for Text\/List(Text) recusion handling\n\nstruct Counter {\n size @0: Int64;\n words @1: Text;\n wordlist @2: List(Text);\n}\n\nstruct Bag {\n counter @0: Counter;\n}\n\nstruct Zserver {\n waitingjobs @0: List(Zjob);\n}\n\nstruct Zjob {\n cmd @0: Text;\n args @1: List(Text);\n}\n\n# versioning test structs\n\nstruct VerEmpty {\n}\n\nstruct VerOneData {\n val @0: Int16;\n}\n\nstruct VerTwoData {\n val @0: Int16;\n duo @1: Int64;\n}\n\nstruct VerOnePtr {\n ptr @0: VerOneData;\n}\n\nstruct VerTwoPtr {\n ptr1 @0: VerOneData;\n ptr2 @1: VerOneData;\n}\n\nstruct VerTwoDataTwoPtr {\n val @0: Int16;\n duo @1: Int64;\n ptr1 @2: VerOneData;\n ptr2 @3: VerOneData;\n}\n\nstruct HoldsVerEmptyList {\n mylist @0: List(VerEmpty);\n}\n\nstruct HoldsVerOneDataList {\n mylist @0: List(VerOneData);\n}\n\nstruct HoldsVerTwoDataList {\n mylist @0: List(VerTwoData);\n}\n\nstruct HoldsVerOnePtrList {\n mylist @0: List(VerOnePtr);\n}\n\nstruct HoldsVerTwoPtrList {\n mylist @0: List(VerTwoPtr);\n}\n\nstruct HoldsVerTwoTwoList {\n mylist @0: List(VerTwoDataTwoPtr);\n}\n\n","old_contents":"using Go = import \"go.capnp\";\n\n$Go.package(\"aircraftlib\");\n$Go.import(\"go-capnproto\/aircraftlib\");\n\n@0x832bcc6686a26d56;\n\nstruct Zdate {\n year @0 :Int16;\n month @1 :UInt8;\n day @2 :UInt8;\n}\n\nstruct Zdata {\n data @0 :Data;\n}\n\n\nenum Airport {\n none @0;\n jfk @1;\n lax @2;\n sfo @3;\n luv @4;\n dfw @5;\n test @6; \n # test must be last because we use it to count\n # the number of elements in the Airport enum.\n}\n\nstruct PlaneBase {\n name @0: Text;\n homes @1: List(Airport);\n rating @2: Int64;\n canFly @3: Bool;\n capacity @4: Int64;\n maxSpeed @5: Float64;\n}\n\nstruct B737 {\n base @0: PlaneBase;\n}\n\nstruct A320 {\n base @0: PlaneBase;\n}\n\nstruct F16 {\n base @0: PlaneBase;\n}\n\n\n# need a struct with at least two pointers to catch certain bugs\nstruct Regression {\n base @0: PlaneBase;\n b0 @1: Float64; # intercept\n beta @2: List(Float64);\n planes @3: List(Aircraft);\n ymu @4: Float64; # y-mean in original space\n ysd @5: Float64; # y-standard deviation in original space\n}\n\n\n\nstruct Aircraft {\n # so we can restrict\n # and specify a Plane is required in\n # certain places.\n\n union {\n void @0: Void; # @0 will be the default, so always make @0 a Void.\n b737 @1: B737;\n a320 @2: A320;\n f16 @3: F16;\n }\n}\n\n\nstruct Z {\n # Z must contain all types, as this is our\n # runtime type identification. It is a thin shim.\n\n union {\n void @0: Void; # always first in any union.\n zz @1: Z; # any. fyi, this can't be 'z' alone.\n\n f64 @2: Float64;\n f32 @3: Float32;\n\n i64 @4: Int64;\n i32 @5: Int32;\n i16 @6: Int16;\n i8 @7: Int8;\n\n u64 @8: UInt64;\n u32 @9: UInt32;\n u16 @10: UInt16;\n u8 @11: UInt8;\n\n bool @12: Bool;\n text @13: Text;\n blob @14: Data;\n\n f64vec @15: List(Float64);\n f32vec @16: List(Float32);\n\n i64vec @17: List(Int64);\n i32vec @18: List(Int32);\n i16vec @19: List(Int16);\n i8vec @20: List(Int8);\n\n u64vec @21: List(UInt64);\n u32vec @22: List(UInt32);\n u16vec @23: List(UInt16);\n u8vec @24: List(UInt8);\n\n zvec @25: List(Z);\n zvecvec @26: List(List(Z));\n\n zdate @27: Zdate;\n zdata @28: Zdata;\n\n aircraftvec @29: List(Aircraft);\n aircraft @30: Aircraft;\n regression @31: Regression;\n planebase @32: PlaneBase;\n airport @33: Airport;\n b737 @34: B737;\n a320 @35: A320;\n f16 @36: F16;\n zdatevec @37: List(Zdate);\n zdatavec @38: List(Zdata);\n }\n}\n\nstruct Counter {\n size @0: Int64;\n words @1: Text;\n wordlist @2: List(Text);\n}\n\nstruct Bag {\n counter @0: Counter;\n}\n\nstruct Zserver {\n waitingjobs @0: List(Zjob);\n}\n\nstruct Zjob {\n cmd @0: Text;\n args @1: List(Text);\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"0c6ad499427588abb829fdd6e2bfab2e78f3b8d5","subject":"include node_modules so the packaged app actually works","message":"include node_modules so the packaged app actually works\n","repos":"neynah\/sharelatex,dwrensha\/sharelatex,neynah\/sharelatex,dwrensha\/sharelatex","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/host.conf\", \"etc\/localtime\", \"etc\/nsswitch.conf\",\n \"etc\/resolv.conf\"\n ]\n )\n ]\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\",\n \"document-updater\/node_modules\",\n \"docstore\/node_modules\",\n \"filestore\/node_modules\",\n \"web\/node_modules\",\n \"track-changes\/node_modules\",\n \"clsi\/node_modules\",\n \"real-time\/node_modules\"]\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","old_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/host.conf\", \"etc\/localtime\", \"etc\/nsswitch.conf\",\n \"etc\/resolv.conf\"\n ]\n )\n ]\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"6462f855c9388416517b0e5d29e11b4ede21f78e","subject":"- Try to fix Wekan Sandstorm API.","message":"- Try to fix Wekan Sandstorm API.\n\nThanks to ocdtrekkie and xet7 !\n","repos":"wekan\/wekan,libreboard\/libreboard,GhassenRjab\/wekan,GhassenRjab\/wekan,libreboard\/libreboard,wekan\/wekan,wekan\/wekan,wekan\/wekan,GhassenRjab\/wekan,wekan\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 125,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.40.0~2018-09-04\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"OAUTH2_CLIENT_ID\", value=\"\"),\n (key = \"OAUTH2_SECRET\", value=\"\"),\n (key = \"OAUTH2_SERVER_URL\", value=\"\"),\n (key = \"OAUTH2_AUTH_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_USERINFO_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_TOKEN_ENDPOINT\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 125,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"1.40.0~2018-09-04\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/api\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"OAUTH2_CLIENT_ID\", value=\"\"),\n (key = \"OAUTH2_SECRET\", value=\"\"),\n (key = \"OAUTH2_SERVER_URL\", value=\"\"),\n (key = \"OAUTH2_AUTH_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_USERINFO_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_TOKEN_ENDPOINT\", value=\"\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"849f599b13d7142d7ad8dae6e9c60a052316e951","subject":"Fill in some metadata in the pkgdef","message":"Fill in some metadata in the pkgdef\n","repos":"zenhack\/sandstorm-znc,zenhack\/sandstorm-znc,zenhack\/sandstorm-znc,zenhack\/sandstorm-znc,zenhack\/sandstorm-znc","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xa37fef404a0f433f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"fh7mfky3gremre301dsnncny0dwq8tvrf1vf33x56z3j1a69pgn0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"ZNC\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"bouncer\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"http:\/\/example.com\",\n # This should be the app's main website url.\n\n codeUrl = \"http:\/\/example.com\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"ian@zenhack.net\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"IRC Bouncer\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/opt\/app\/app\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\n # ZNC looks in $HOME for it's configuration.\n (key = \"HOME\", value = \"\/var\"),\n\n (key = \"SANDSTORM_ZNC_PORT\", value = \"8000\"),\n (key = \"SANDSTORM_IP_NETWORK_PORT\", value = \"6667\"),\n (key = \"SANDSTORM_APP_DIR\", value = \"\/opt\/app\"),\n ]\n);\n\n# vim: set ts=2 sw=2 et :\n","old_contents":"@0xa37fef404a0f433f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"fh7mfky3gremre301dsnncny0dwq8tvrf1vf33x56z3j1a69pgn0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Example App\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"http:\/\/example.com\",\n # This should be the app's main website url.\n\n codeUrl = \"http:\/\/example.com\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"youremail@example.com\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Example App Team\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"one-to-three words\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/opt\/app\/app\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\n # ZNC looks in $HOME for it's configuration.\n (key = \"HOME\", value = \"\/var\"),\n\n (key = \"SANDSTORM_ZNC_PORT\", value = \"8000\"),\n (key = \"SANDSTORM_IP_NETWORK_PORT\", value = \"6667\"),\n (key = \"SANDSTORM_APP_DIR\", value = \"\/opt\/app\"),\n ]\n);\n\n# vim: set ts=2 sw=2 et :\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"5b84dbaf300c27e7043c2ba822739963c0170fdd","subject":"Added test for binary hex literal","message":"Added test for binary hex literal\n","repos":"zarvox\/capnproto,rcrowder\/capnproto,zarvox\/capnproto,geofft\/capnproto,martindale\/capnproto,ligzy\/capnproto,bryce-gibson\/capnproto,rcrowder\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,Fraser999\/capnproto,rcrowder\/capnproto,ocdtrekkie\/capnproto,joliss\/capnproto,mologie\/capnproto,geofft\/capnproto,bsn069\/capnproto,johnkdoe\/capnproto,ligzy\/capnproto,Fraser999\/capnproto,khklau\/capnproto,bsn069\/capnproto,hntrmrrs\/capnproto,hntrmrrs\/capnproto,nagyistoce\/capnproto,kamalmarhubi\/capnproto,nagyistoce\/capnproto,a-richardson\/capnproto,johnkdoe\/capnproto,mrdomino\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,bryce-gibson\/capnproto,MarPiRK\/capnproto,geofft\/capnproto,modulexcite\/capnproto,jparyani\/capnproto,Fraser999\/capnproto,vladon\/capnproto,maurer\/capnproto,nagyistoce\/capnproto,ocdtrekkie\/capnproto,modulexcite\/capnproto,a-richardson\/capnproto,khklau\/capnproto,ligzy\/capnproto,bsn069\/capnproto,bryce-gibson\/capnproto,MarPiRK\/capnproto,vladon\/capnproto,maurer\/capnproto,mrdomino\/capnproto,mologie\/capnproto,pjulien\/capnproto,pjulien\/capnproto,zarvox\/capnproto,martindale\/capnproto,jparyani\/capnproto,pjulien\/capnproto,joliss\/capnproto,kamalmarhubi\/capnproto,kamalmarhubi\/capnproto,modulexcite\/capnproto,jparyani\/capnproto,maurer\/capnproto,vladon\/capnproto,ocdtrekkie\/capnproto,khklau\/capnproto,a-richardson\/capnproto,mologie\/capnproto,MarPiRK\/capnproto,martindale\/capnproto","old_file":"c++\/src\/capnp\/test.capnp","new_file":"c++\/src\/capnp\/test.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xd508eebdc2dc42b8;\n\nusing Cxx = import \"c++.capnp\";\n\n# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified\n# names for stuff in the capnproto namespace.\n$Cxx.namespace(\"capnproto_test::capnp::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = 0x\"62 61 72\"; # \"bar\"\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n\n # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer\n # in the struct.\n}\n\nstruct TestOutOfOrder {\n foo @3 :Text;\n bar @2 :Text;\n baz @8 :Text;\n qux @0 :Text;\n quux @6 :Text;\n corge @4 :Text;\n grault @1 :Text;\n garply @7 :Text;\n waldo @5 :Text;\n}\n\nstruct TestUnion {\n union0 @0! :union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1! :union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2! :union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3! :union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnnamedUnion {\n before @0 :Text;\n\n union {\n foo @1 :UInt16;\n bar @3 :UInt32;\n }\n\n middle @2 :UInt16;\n\n after @4 :Text;\n}\n\nstruct TestUnionInUnion {\n # There is no reason to ever do this.\n outer :union {\n inner :union {\n foo @0 :Int32;\n bar @1 :Int32;\n }\n baz @2 :Int32;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n }\n }\n}\n\nstruct TestInterleavedGroups {\n group1 :group {\n foo @0 :UInt32;\n bar @2 :UInt64;\n union {\n qux @4 :UInt16;\n corge :group {\n grault @6 :UInt64;\n garply @8 :UInt16;\n plugh @14 :Text;\n xyzzy @16 :Text;\n }\n\n fred @12 :Text;\n }\n\n waldo @10 :Text;\n }\n\n group2 :group {\n foo @1 :UInt32;\n bar @3 :UInt64;\n union {\n qux @5 :UInt16;\n corge :group {\n grault @7 :UInt64;\n garply @9 :UInt16;\n plugh @15 :Text;\n xyzzy @17 :Text;\n }\n\n fred @13 :Text;\n }\n\n waldo @11 :Text;\n }\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),\n union3 = (u3f0s8 = 55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = (u0f1s0 = void), union1 = (u1f0sp = \"foo\"), union2 = (u2f0s1 = true),\n union3 = (u3f0s32 = 12345678));\n\n unnamed1 @2 :TestUnnamedUnion = (foo = 123);\n unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = \"foo\", after = \"bar\");\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n # Versions of the above which cannot be encoded as primitive lists.\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestFieldZeroIsBit {\n bit @0 :Bool;\n secondBit @1 :Bool = true;\n thirdField @2 :UInt8 = 123;\n}\n\nstruct TestListDefaults {\n lists @0 :TestLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false), (f = true), (f = true)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")],\n int32ListList = [[1, 2, 3], [4, 5], [12341234]],\n textListList = [[\"foo\", \"bar\"], [\"baz\"], [\"qux\", \"corge\"]],\n structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);\n}\n\nstruct TestLateUnion {\n # Test what happens if the unions are not the first ordinals in the struct. At one point this\n # was broken for the dynamic API.\n\n foo @0 :Int32;\n bar @1 :Text;\n baz @2 :Int16;\n\n theUnion @3! :union {\n qux @4 :Text;\n corge @5 :List(Int32);\n grault @6 :Float32;\n }\n\n anotherUnion @7! :union {\n qux @8 :Text;\n corge @9 :List(Int32);\n grault @10 :Float32;\n }\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n}\n\nstruct TestStructUnion {\n un @0! :union {\n struct @1 :SomeStruct;\n object @2 :TestAnyPointer;\n }\n\n struct SomeStruct {\n someText @0 :Text;\n moreText @1 :Text;\n }\n}\n\nstruct TestPrintInlineStructs {\n someText @0 :Text;\n\n structList @1 :List(InlineStruct);\n struct InlineStruct {\n int32Field @0 :Int32;\n textField @1 :Text;\n }\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n const textConst :Text = \"foo\";\n const dataConst :Data = \"bar\";\n const structConst :TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n const enumConst :TestEnum = corge;\n\n const voidListConst :List(Void) = [void, void, void, void, void, void];\n const boolListConst :List(Bool) = [true, false, false, true];\n const int8ListConst :List(Int8) = [111, -111];\n const int16ListConst :List(Int16) = [11111, -11111];\n const int32ListConst :List(Int32) = [111111111, -111111111];\n const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];\n const uint8ListConst :List(UInt8) = [111, 222] ;\n const uint16ListConst :List(UInt16) = [33333, 44444];\n const uint32ListConst :List(UInt32) = [3333333333];\n const uint64ListConst :List(UInt64) = [11111111111111111111];\n const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];\n const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];\n const textListConst :List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n const dataListConst :List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n const structListConst :List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n const enumListConst :List(TestEnum) = [foo, garply];\n}\n\nconst globalInt :UInt32 = 12345;\nconst globalText :Text = \"foobar\";\nconst globalStruct :TestAllTypes = (int32Field = 54321);\nconst globalPrintableStruct :TestPrintInlineStructs = (someText = \"foo\");\nconst derivedConstant :TestAllTypes = (\n uInt32Field = .globalInt,\n textField = TestConstants.textConst,\n structField = TestConstants.structConst,\n int16List = TestConstants.int16ListConst,\n structList = TestConstants.structListConst);\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x :Text);\n bar @1 () -> ();\n baz @2 (s: TestAllTypes);\n}\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestAllTypes -> ();\n grault @2 () -> TestAllTypes;\n}\n\ninterface TestPipeline {\n getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);\n testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();\n\n struct Box {\n cap @0 :TestInterface;\n }\n}\n\ninterface TestCallOrder {\n getCallSequence @0 (expected: UInt32) -> (n: UInt32);\n # First call returns 0, next returns 1, ...\n #\n # The input `expected` is ignored but useful for disambiguating debug logs.\n}\n\ninterface TestTailCallee {\n struct TailResult {\n i @0 :UInt32;\n t @1 :Text;\n c @2 :TestCallOrder;\n }\n\n foo @0 (i :Int32, t :Text) -> TailResult;\n}\n\ninterface TestTailCaller {\n foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;\n}\n\ninterface TestMoreStuff extends(TestCallOrder) {\n # Catch-all type that contains lots of testing methods.\n\n callFoo @0 (cap :TestInterface) -> (s: Text);\n # Call `cap.foo()`, check the result, and return \"bar\".\n\n callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);\n # Like callFoo but waits for `cap` to resolve first.\n\n neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);\n # Doesn't return. You should cancel it.\n\n hold @3 (cap :TestInterface) -> ();\n # Returns immediately but holds on to the capability.\n\n callHeld @4 () -> (s: Text);\n # Calls the capability previously held using `hold` (and keeps holding it).\n\n getHeld @5 () -> (cap :TestInterface);\n # Returns the capability previously held using `hold` (and keeps holding it).\n\n echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);\n # Just returns the input cap.\n\n expectCancel @7 (cap :TestInterface) -> ();\n # evalLater()-loops forever, holding `cap`. Must be canceled.\n\n methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = \"foo\") -> (d :Text, e :Text = \"bar\");\n}\n\ninterface TestKeywordMethods {\n delete @0 ();\n class @1 ();\n void @2 ();\n return @3 ();\n}\n\nstruct TestSturdyRefHostId {\n host @0 :Text;\n}\n\nstruct TestSturdyRefObjectId {\n tag @0 :Tag;\n enum Tag {\n testInterface @0;\n testExtends @1;\n testPipeline @2;\n testTailCallee @3;\n testTailCaller @4;\n testMoreStuff @5;\n }\n}\n\nstruct TestProvisionId {}\nstruct TestRecipientId {}\nstruct TestThirdPartyCapId {}\nstruct TestJoinResult {}\n\nstruct TestNameAnnotation $Cxx.name(\"RenamedStruct\") {\n union {\n badFieldName @0 :Bool $Cxx.name(\"goodFieldName\");\n bar @1 :Int8;\n }\n\n enum BadlyNamedEnum $Cxx.name(\"RenamedEnum\") {\n foo @0;\n bar @1;\n baz @2 $Cxx.name(\"qux\");\n }\n\n anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name(\"anotherGoodFieldName\");\n\n struct NestedStruct $Cxx.name(\"RenamedNestedStruct\") {\n badNestedFieldName @0 :Bool $Cxx.name(\"goodNestedFieldName\");\n anotherBadNestedFieldName @1 :NestedStruct $Cxx.name(\"anotherGoodNestedFieldName\");\n\n enum DeeplyNestedEnum $Cxx.name(\"RenamedDeeplyNestedEnum\") {\n quux @0;\n corge @1;\n grault @2 $Cxx.name(\"garply\");\n }\n }\n\n badlyNamedUnion :union $Cxx.name(\"renamedUnion\") {\n badlyNamedGroup :group $Cxx.name(\"renamedGroup\") {\n foo @3 :Void;\n bar @4 :Void;\n }\n baz @5 :NestedStruct $Cxx.name(\"qux\");\n }\n}\n\ninterface TestNameAnnotationInterface $Cxx.name(\"RenamedInterface\") {\n badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name(\"renamedParam\")) $Cxx.name(\"renamedMethod\");\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xd508eebdc2dc42b8;\n\nusing Cxx = import \"c++.capnp\";\n\n# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified\n# names for stuff in the capnproto namespace.\n$Cxx.namespace(\"capnproto_test::capnp::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = \"bar\";\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestAnyPointer {\n anyPointerField @0 :AnyPointer;\n\n # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer\n # in the struct.\n}\n\nstruct TestOutOfOrder {\n foo @3 :Text;\n bar @2 :Text;\n baz @8 :Text;\n qux @0 :Text;\n quux @6 :Text;\n corge @4 :Text;\n grault @1 :Text;\n garply @7 :Text;\n waldo @5 :Text;\n}\n\nstruct TestUnion {\n union0 @0! :union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1! :union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2! :union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3! :union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnnamedUnion {\n before @0 :Text;\n\n union {\n foo @1 :UInt16;\n bar @3 :UInt32;\n }\n\n middle @2 :UInt16;\n\n after @4 :Text;\n}\n\nstruct TestUnionInUnion {\n # There is no reason to ever do this.\n outer :union {\n inner :union {\n foo @0 :Int32;\n bar @1 :Int32;\n }\n baz @2 :Int32;\n }\n}\n\nstruct TestGroups {\n groups :union {\n foo :group {\n corge @0 :Int32;\n grault @2 :Int64;\n garply @8 :Text;\n }\n bar :group {\n corge @3 :Int32;\n grault @4 :Text;\n garply @5 :Int64;\n }\n baz :group {\n corge @1 :Int32;\n grault @6 :Text;\n garply @7 :Text;\n }\n }\n}\n\nstruct TestInterleavedGroups {\n group1 :group {\n foo @0 :UInt32;\n bar @2 :UInt64;\n union {\n qux @4 :UInt16;\n corge :group {\n grault @6 :UInt64;\n garply @8 :UInt16;\n plugh @14 :Text;\n xyzzy @16 :Text;\n }\n\n fred @12 :Text;\n }\n\n waldo @10 :Text;\n }\n\n group2 :group {\n foo @1 :UInt32;\n bar @3 :UInt64;\n union {\n qux @5 :UInt16;\n corge :group {\n grault @7 :UInt64;\n garply @9 :UInt16;\n plugh @15 :Text;\n xyzzy @17 :Text;\n }\n\n fred @13 :Text;\n }\n\n waldo @11 :Text;\n }\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),\n union3 = (u3f0s8 = 55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = (u0f1s0 = void), union1 = (u1f0sp = \"foo\"), union2 = (u2f0s1 = true),\n union3 = (u3f0s32 = 12345678));\n\n unnamed1 @2 :TestUnnamedUnion = (foo = 123);\n unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = \"foo\", after = \"bar\");\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n # Versions of the above which cannot be encoded as primitive lists.\n struct Struct0c { f @0 :Void; pad @1 :Text; }\n struct Struct1c { f @0 :Bool; pad @1 :Text; }\n struct Struct8c { f @0 :UInt8; pad @1 :Text; }\n struct Struct16c { f @0 :UInt16; pad @1 :Text; }\n struct Struct32c { f @0 :UInt32; pad @1 :Text; }\n struct Struct64c { f @0 :UInt64; pad @1 :Text; }\n struct StructPc { f @0 :Text; pad @1 :UInt64; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n\n int32ListList @7 :List(List(Int32));\n textListList @8 :List(List(Text));\n structListList @9 :List(List(TestAllTypes));\n}\n\nstruct TestFieldZeroIsBit {\n bit @0 :Bool;\n secondBit @1 :Bool = true;\n thirdField @2 :UInt8 = 123;\n}\n\nstruct TestListDefaults {\n lists @0 :TestLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false), (f = true), (f = true)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")],\n int32ListList = [[1, 2, 3], [4, 5], [12341234]],\n textListList = [[\"foo\", \"bar\"], [\"baz\"], [\"qux\", \"corge\"]],\n structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);\n}\n\nstruct TestLateUnion {\n # Test what happens if the unions are not the first ordinals in the struct. At one point this\n # was broken for the dynamic API.\n\n foo @0 :Int32;\n bar @1 :Text;\n baz @2 :Int16;\n\n theUnion @3! :union {\n qux @4 :Text;\n corge @5 :List(Int32);\n grault @6 :Float32;\n }\n\n anotherUnion @7! :union {\n qux @8 :Text;\n corge @9 :List(Int32);\n grault @10 :Float32;\n }\n}\n\nstruct TestOldVersion {\n # A subset of TestNewVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestOldVersion;\n}\n\nstruct TestNewVersion {\n # A superset of TestOldVersion.\n old1 @0 :Int64;\n old2 @1 :Text;\n old3 @2 :TestNewVersion;\n new1 @3 :Int64 = 987;\n new2 @4 :Text = \"baz\";\n}\n\nstruct TestStructUnion {\n un @0! :union {\n struct @1 :SomeStruct;\n object @2 :TestAnyPointer;\n }\n\n struct SomeStruct {\n someText @0 :Text;\n moreText @1 :Text;\n }\n}\n\nstruct TestPrintInlineStructs {\n someText @0 :Text;\n\n structList @1 :List(InlineStruct);\n struct InlineStruct {\n int32Field @0 :Int32;\n textField @1 :Text;\n }\n}\n\nstruct TestEmptyStruct {}\n\nstruct TestConstants {\n const voidConst :Void = void;\n const boolConst :Bool = true;\n const int8Const :Int8 = -123;\n const int16Const :Int16 = -12345;\n const int32Const :Int32 = -12345678;\n const int64Const :Int64 = -123456789012345;\n const uint8Const :UInt8 = 234;\n const uint16Const :UInt16 = 45678;\n const uint32Const :UInt32 = 3456789012;\n const uint64Const :UInt64 = 12345678901234567890;\n const float32Const :Float32 = 1234.5;\n const float64Const :Float64 = -123e45;\n const textConst :Text = \"foo\";\n const dataConst :Data = \"bar\";\n const structConst :TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n const enumConst :TestEnum = corge;\n\n const voidListConst :List(Void) = [void, void, void, void, void, void];\n const boolListConst :List(Bool) = [true, false, false, true];\n const int8ListConst :List(Int8) = [111, -111];\n const int16ListConst :List(Int16) = [11111, -11111];\n const int32ListConst :List(Int32) = [111111111, -111111111];\n const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];\n const uint8ListConst :List(UInt8) = [111, 222] ;\n const uint16ListConst :List(UInt16) = [33333, 44444];\n const uint32ListConst :List(UInt32) = [3333333333];\n const uint64ListConst :List(UInt64) = [11111111111111111111];\n const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];\n const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];\n const textListConst :List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n const dataListConst :List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n const structListConst :List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n const enumListConst :List(TestEnum) = [foo, garply];\n}\n\nconst globalInt :UInt32 = 12345;\nconst globalText :Text = \"foobar\";\nconst globalStruct :TestAllTypes = (int32Field = 54321);\nconst globalPrintableStruct :TestPrintInlineStructs = (someText = \"foo\");\nconst derivedConstant :TestAllTypes = (\n uInt32Field = .globalInt,\n textField = TestConstants.textConst,\n structField = TestConstants.structConst,\n int16List = TestConstants.int16ListConst,\n structList = TestConstants.structListConst);\n\ninterface TestInterface {\n foo @0 (i :UInt32, j :Bool) -> (x :Text);\n bar @1 () -> ();\n baz @2 (s: TestAllTypes);\n}\n\ninterface TestExtends extends(TestInterface) {\n qux @0 ();\n corge @1 TestAllTypes -> ();\n grault @2 () -> TestAllTypes;\n}\n\ninterface TestPipeline {\n getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);\n testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();\n\n struct Box {\n cap @0 :TestInterface;\n }\n}\n\ninterface TestCallOrder {\n getCallSequence @0 (expected: UInt32) -> (n: UInt32);\n # First call returns 0, next returns 1, ...\n #\n # The input `expected` is ignored but useful for disambiguating debug logs.\n}\n\ninterface TestTailCallee {\n struct TailResult {\n i @0 :UInt32;\n t @1 :Text;\n c @2 :TestCallOrder;\n }\n\n foo @0 (i :Int32, t :Text) -> TailResult;\n}\n\ninterface TestTailCaller {\n foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;\n}\n\ninterface TestMoreStuff extends(TestCallOrder) {\n # Catch-all type that contains lots of testing methods.\n\n callFoo @0 (cap :TestInterface) -> (s: Text);\n # Call `cap.foo()`, check the result, and return \"bar\".\n\n callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);\n # Like callFoo but waits for `cap` to resolve first.\n\n neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);\n # Doesn't return. You should cancel it.\n\n hold @3 (cap :TestInterface) -> ();\n # Returns immediately but holds on to the capability.\n\n callHeld @4 () -> (s: Text);\n # Calls the capability previously held using `hold` (and keeps holding it).\n\n getHeld @5 () -> (cap :TestInterface);\n # Returns the capability previously held using `hold` (and keeps holding it).\n\n echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);\n # Just returns the input cap.\n\n expectCancel @7 (cap :TestInterface) -> ();\n # evalLater()-loops forever, holding `cap`. Must be canceled.\n\n methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = \"foo\") -> (d :Text, e :Text = \"bar\");\n}\n\ninterface TestKeywordMethods {\n delete @0 ();\n class @1 ();\n void @2 ();\n return @3 ();\n}\n\nstruct TestSturdyRefHostId {\n host @0 :Text;\n}\n\nstruct TestSturdyRefObjectId {\n tag @0 :Tag;\n enum Tag {\n testInterface @0;\n testExtends @1;\n testPipeline @2;\n testTailCallee @3;\n testTailCaller @4;\n testMoreStuff @5;\n }\n}\n\nstruct TestProvisionId {}\nstruct TestRecipientId {}\nstruct TestThirdPartyCapId {}\nstruct TestJoinResult {}\n\nstruct TestNameAnnotation $Cxx.name(\"RenamedStruct\") {\n union {\n badFieldName @0 :Bool $Cxx.name(\"goodFieldName\");\n bar @1 :Int8;\n }\n\n enum BadlyNamedEnum $Cxx.name(\"RenamedEnum\") {\n foo @0;\n bar @1;\n baz @2 $Cxx.name(\"qux\");\n }\n\n anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name(\"anotherGoodFieldName\");\n\n struct NestedStruct $Cxx.name(\"RenamedNestedStruct\") {\n badNestedFieldName @0 :Bool $Cxx.name(\"goodNestedFieldName\");\n anotherBadNestedFieldName @1 :NestedStruct $Cxx.name(\"anotherGoodNestedFieldName\");\n\n enum DeeplyNestedEnum $Cxx.name(\"RenamedDeeplyNestedEnum\") {\n quux @0;\n corge @1;\n grault @2 $Cxx.name(\"garply\");\n }\n }\n\n badlyNamedUnion :union $Cxx.name(\"renamedUnion\") {\n badlyNamedGroup :group $Cxx.name(\"renamedGroup\") {\n foo @3 :Void;\n bar @4 :Void;\n }\n baz @5 :NestedStruct $Cxx.name(\"qux\");\n }\n}\n\ninterface TestNameAnnotationInterface $Cxx.name(\"RenamedInterface\") {\n badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name(\"renamedParam\")) $Cxx.name(\"renamedMethod\");\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"de0a4a51110070c8332cdce4f8f3ba1883d62f86","subject":"Fix a typo","message":"Fix a typo\n\ns\/starp\/strap\/\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstrap interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, calls foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n # as doing so would introduce unnecessary round trip latency.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n # set in place of results.\n # - Vat A sends a `Finish` for the bar() call to Vat B.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n #\n # The receiver should act as if the sender had sent a release message with count=1 for each\n # CapDescriptor in the original Call message.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n # capability (rather than a struct), and `results.content` is just a capability pointer with\n # index 0. A `Finish` is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n #\n # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n # with it, but the C++ implementation appears to wait for the call to finish before sending\n # this.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here. `takeFromOtherQuestion` can only used once per question.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remote object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n #\n # Note that it is currently not possible to include a broken capability in the CapDescriptor\n # table. Instead, create a new export (`senderPromise`) for each broken capability and then\n # immediately follow the payload-bearing Call or Return message with one Resolve message for each\n # broken capability, resolving it to an exception.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # The ID of a capability in the sender's export table (receiver's import table). It may be a\n # newly allocated table entry, or an existing entry (increments the reference count).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine only once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used\n# in the `Provide` message sent from that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`.\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent\n# to that third party (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"618758037b95d06915bdaedef781c1fcd71e89b6","subject":"renaming goalie to its proper name","message":"renaming goalie to its proper name\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/common\/entity.capnp","new_file":"src\/common\/entity.capnp","new_contents":"@0xc98f2d65bc9a57fc;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::common::entity\");\n\nusing Field = import \"field.capnp\";\nusing Physics = import \"\/common\/physics.capnp\";\n\nusing TeamName = Text;\n\nenum PlayerType\n{\n outfield @0;\n goalKeeper @1;\n}\n\nenum UniformNumber\n{\n one @0;\n two @1;\n three @2;\n four @3;\n five @4;\n six @5;\n seven @6;\n eight @7;\n nine @8;\n ten @9;\n eleven @10;\n}\n\nstruct PlayerId\n{\n side @0 :Field.Side;\n uniform @1 :UniformNumber;\n}\n\nstruct Player\n{\n id @0 :PlayerId;\n type @1 :PlayerType;\n position @2 :Physics.Position;\n stamina @3 :Physics.KiloJoule;\n effort @4 :Physics.KiloJoule;\n bodyDirection @5 :Physics.Degree;\n headDirection @6 :Physics.Degree;\n velocity @7 :Physics.MilliMetrePerSecond;\n}\n\nenum ParticipantType\n{\n player @0;\n coach @1;\n referee @2;\n trainer @3;\n}\n\nstruct Ball\n{\n position @0 :Physics.Position;\n direction @1 :Physics.Degree;\n velocity @2 :Physics.MilliMetrePerSecond;\n}\n","old_contents":"@0xc98f2d65bc9a57fc;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::common::entity\");\n\nusing Field = import \"field.capnp\";\nusing Physics = import \"\/common\/physics.capnp\";\n\nusing TeamName = Text;\n\nenum PlayerType\n{\n outfield @0;\n goalie @1;\n}\n\nenum UniformNumber\n{\n one @0;\n two @1;\n three @2;\n four @3;\n five @4;\n six @5;\n seven @6;\n eight @7;\n nine @8;\n ten @9;\n eleven @10;\n}\n\nstruct PlayerId\n{\n side @0 :Field.Side;\n uniform @1 :UniformNumber;\n}\n\nstruct Player\n{\n id @0 :PlayerId;\n type @1 :PlayerType;\n position @2 :Physics.Position;\n stamina @3 :Physics.KiloJoule;\n effort @4 :Physics.KiloJoule;\n bodyDirection @5 :Physics.Degree;\n headDirection @6 :Physics.Degree;\n velocity @7 :Physics.MilliMetrePerSecond;\n}\n\nenum ParticipantType\n{\n player @0;\n coach @1;\n referee @2;\n trainer @3;\n}\n\nstruct Ball\n{\n position @0 :Physics.Position;\n direction @1 :Physics.Degree;\n velocity @2 :Physics.MilliMetrePerSecond;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"5c2f206317bba0019dbd3806591f785ba4aa9dbe","subject":"use the app id of the released app","message":"use the app id of the released app\n","repos":"neynah\/acronymy,dwrensha\/acronymy","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n\n\n id = \"7m2fcfn7qdyexs3jmn6vrdngcryeuc8y4fa6jpyj4fgwh5tq27ph\",\n\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","old_contents":"@0xd78090a95ff14b08;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qd72z4m2y8ug2kyhxh51s9ytqpkwgte59v3dj8xhmak8p2dzyfvh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Acronymy Instance\"),\n command = .initCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .continueCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst initCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\", \"--init\", \"\/data.db\", \"\/var\/data.db\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n\nconst continueCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/acronymy\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"44f727b44a7cedf9d9816570114e22ce2f1be068","subject":"bump version","message":"bump version\n","repos":"jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.3.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n # For all vagrant-spk apps, we don't care about the Vagrant\n # VM state, so we ignore it here.\n \"opt\/app\/.sandstorm\/.vagrant\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\n \"usr\/lib\/python3.4\", # include all of the Python runtime\n \"usr\/lib\/python3\", # include pure-Python packages from Debian\n \"usr\/local\/lib\/python3.4\", # include python packages from pip\n \"opt\/app\/static\",\n ],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.2.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n # For all vagrant-spk apps, we don't care about the Vagrant\n # VM state, so we ignore it here.\n \"opt\/app\/.sandstorm\/.vagrant\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\n \"usr\/lib\/python3.4\", # include all of the Python runtime\n \"usr\/lib\/python3\", # include pure-Python packages from Debian\n \"usr\/local\/lib\/python3.4\", # include python packages from pip\n \"opt\/app\/static\",\n ],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"eda77dac54521207581b461a91061545b5543321","subject":"Update shortDescription","message":"Update shortDescription\n","repos":"dwrensha\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xaecd42915acc793f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"aax9j672p6z8n7nyupzvj2nmumeqd4upa0f7mgu8gprwmy53x04h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"WordPress\"),\n appVersion = 8,\n appMarketingVersion = (defaultText = \"2015.10.21 (4.3.2-alpha)\"),\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/wordpress-128.svg\"),\n grain = (svg = embed \"app-graphics\/wordpress-24.svg\"),\n market = (svg = embed \"app-graphics\/wordpress-150.svg\"),\n ),\n website = \"https:\/\/wordpress.org\/\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/wordpress-sandstorm\",\n license = (openSource = gpl2),\n categories = [webPublishing,],\n author = (\n upstreamAuthor = \"WordPress Project\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Content management\"),\n screenshots = [(width = 448, height = 346, png = embed \"screenshot1.png\"),\n (width = 448, height = 348, png = embed \"screenshot2.png\")],\n changeLog = (defaultText = embed \"changeLog.md\"),\n ),\n\n\n\n actions = [\n ( title = (defaultText = \"New site\"),\n nounPhrase = (defaultText = \"site\"),\n command = .startCommand\n )\n ],\n\n continueCommand = .continueCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\"), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/nsswitch.conf\", \"etc\/localtime\",\n \"etc\/host.conf\", \"etc\/resolv.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"wordpress-read-only\", \"read-only-plugins\"],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows administrative actions\")),\n (name = \"editor\", title = (defaultText = \"editor\"),\n description = (defaultText = \"allows publishing of posts of others\")),\n (name = \"author\", title = (defaultText = \"author\"),\n description = (defaultText = \"allows publishing of own posts\")),\n (name = \"contributor\", title = (defaultText = \"contributor\"),\n description = (defaultText = \"allows writing of posts\")),\n (name = \"subscriber\", title = (defaultText = \"subscriber\"),\n description = (defaultText = \"allows profile customization\"))],\n roles = [(title = (defaultText = \"admin\"),\n permissions = [true, true, true, true, true],\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"editor\"),\n permissions = [false, true, true, true, true],\n verbPhrase = (defaultText = \"can publish posts of others\")),\n (title = (defaultText = \"author\"),\n permissions = [false, false, true, true, true],\n verbPhrase = (defaultText = \"can publish own posts\")),\n (title = (defaultText = \"contributor\"),\n permissions = [false, false, false, true, true],\n verbPhrase = (defaultText = \"can write posts\"),\n default = true),\n (title = (defaultText = \"subscriber\"),\n permissions = [false, false, false, false, true],\n verbPhrase = (defaultText = \"can customize profile\"))]\n )\n )\n);\n\nconst startCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\nconst continueCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/continue.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xaecd42915acc793f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"aax9j672p6z8n7nyupzvj2nmumeqd4upa0f7mgu8gprwmy53x04h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"WordPress\"),\n appVersion = 8,\n appMarketingVersion = (defaultText = \"2015.10.21 (4.3.2-alpha)\"),\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/wordpress-128.svg\"),\n grain = (svg = embed \"app-graphics\/wordpress-24.svg\"),\n market = (svg = embed \"app-graphics\/wordpress-150.svg\"),\n ),\n website = \"https:\/\/wordpress.org\/\",\n codeUrl = \"https:\/\/github.com\/dwrensha\/wordpress-sandstorm\",\n license = (openSource = gpl2),\n categories = [webPublishing,],\n author = (\n upstreamAuthor = \"WordPress Project\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n screenshots = [(width = 448, height = 346, png = embed \"screenshot1.png\"),\n (width = 448, height = 348, png = embed \"screenshot2.png\")],\n changeLog = (defaultText = embed \"changeLog.md\"),\n ),\n\n\n\n actions = [\n ( title = (defaultText = \"New site\"),\n nounPhrase = (defaultText = \"site\"),\n command = .startCommand\n )\n ],\n\n continueCommand = .continueCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\"), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/nsswitch.conf\", \"etc\/localtime\",\n \"etc\/host.conf\", \"etc\/resolv.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"wordpress-read-only\", \"read-only-plugins\"],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows administrative actions\")),\n (name = \"editor\", title = (defaultText = \"editor\"),\n description = (defaultText = \"allows publishing of posts of others\")),\n (name = \"author\", title = (defaultText = \"author\"),\n description = (defaultText = \"allows publishing of own posts\")),\n (name = \"contributor\", title = (defaultText = \"contributor\"),\n description = (defaultText = \"allows writing of posts\")),\n (name = \"subscriber\", title = (defaultText = \"subscriber\"),\n description = (defaultText = \"allows profile customization\"))],\n roles = [(title = (defaultText = \"admin\"),\n permissions = [true, true, true, true, true],\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"editor\"),\n permissions = [false, true, true, true, true],\n verbPhrase = (defaultText = \"can publish posts of others\")),\n (title = (defaultText = \"author\"),\n permissions = [false, false, true, true, true],\n verbPhrase = (defaultText = \"can publish own posts\")),\n (title = (defaultText = \"contributor\"),\n permissions = [false, false, false, true, true],\n verbPhrase = (defaultText = \"can write posts\"),\n default = true),\n (title = (defaultText = \"subscriber\"),\n permissions = [false, false, false, false, true],\n verbPhrase = (defaultText = \"can customize profile\"))]\n )\n )\n);\n\nconst startCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\nconst continueCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/continue.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f0d690cf1f9fbd98c212faa923ea7c139f15b226","subject":"[marv] Fix erroneous capnp structs","message":"[marv] Fix erroneous capnp structs\n\nclose https:\/\/github.com\/ternaris\/marv\/issues\/43\n","repos":"ternaris\/marv-robotics,ternaris\/marv-robotics","old_file":"code\/marv\/marv_pycapnp\/types.capnp","new_file":"code\/marv\/marv_pycapnp\/types.capnp","new_contents":"# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\n@0x8ce54f16698f41e9;\n\nusing Timedelta = UInt64;\nusing Timestamp = UInt64;\n\nstruct BoolValue {\n value @0 :Bool;\n}\n\nstruct Int8Value {\n value @0 :Int8;\n}\n\nstruct Int16Value {\n value @0 :Int16;\n}\n\nstruct Int32Value {\n value @0 :Int32;\n}\n\nstruct Int64Value {\n value @0 :Int64;\n}\n\nstruct UInt8Value {\n value @0 :UInt8;\n}\n\nstruct UInt16Value {\n value @0 :UInt16;\n}\n\nstruct UInt32Value {\n value @0 :UInt32;\n}\n\nstruct UInt64Value {\n value @0 :UInt64;\n}\n\nstruct Float32Value {\n value @0 :Float32;\n}\n\nstruct Float64Value {\n value @0 :Float64;\n}\n\nstruct TextValue {\n value @0 :Text;\n}\n\nstruct DataValue {\n value @0 :Data;\n}\n\nstruct TimedBool {\n value @0 :Bool;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt8 {\n value @0 :Int8;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt16 {\n value @0 :Int16;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt32 {\n value @0 :Int32;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt64 {\n value @0 :Int64;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt8 {\n value @0 :UInt8;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt16 {\n value @0 :UInt16;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt32 {\n value @0 :UInt32;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt64 {\n value @0 :UInt64;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedFloat32 {\n value @0 :Float32;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedFloat64 {\n value @0 :Float64;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedText {\n value @0 :Text;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedData {\n value @0 :Data;\n timestamp @1 :Timestamp;\n}\n\n\n\n# Below here unused so far\n\nstruct Datetime {\n timestamp @0 :Timestamp;\n # ns since epoch\n\n tzoffset @1 :Int16;\n # timezone offset in minutes\n}\n\nstruct Map(Key, Value) {\n items @0 :List(Item);\n\n struct Item {\n key @0 :Key;\n value @1 :Value;\n }\n}\n","old_contents":"# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\n@0x8ce54f16698f41e9;\n\nusing Timedelta = UInt64;\nusing Timestamp = UInt64;\n\nstruct BoolValue {\n value @0 :Bool;\n}\n\nstruct Int8Value {\n value @0 :Int8;\n}\n\nstruct Int16Value {\n value @0 :Int16;\n}\n\nstruct Int32Value {\n value @0 :Int32;\n}\n\nstruct Int64Value {\n value @0 :Int64;\n}\n\nstruct UInt8Value {\n value @0 :UInt8;\n}\n\nstruct UInt16Value {\n value @0 :UInt16;\n}\n\nstruct UInt32Value {\n value @0 :UInt32;\n}\n\nstruct UInt64Value {\n value @0 :UInt64;\n}\n\nstruct Float32Value {\n value @0 :Float32Value;\n}\n\nstruct Float64Value {\n value @0 :Float64Value;\n}\n\nstruct TextValue {\n value @0 :Text;\n}\n\nstruct DataValue {\n value @0 :Data;\n}\n\nstruct TimedBool {\n value @0 :Bool;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt8 {\n value @0 :Int8;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt16 {\n value @0 :Int16;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt32 {\n value @0 :Int32;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedInt64 {\n value @0 :Int64;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt8 {\n value @0 :UInt8;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt16 {\n value @0 :UInt16;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt32 {\n value @0 :UInt32;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedUInt64 {\n value @0 :UInt64;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedFloat32 {\n value @0 :Float32Value;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedFloat64 {\n value @0 :Float64Value;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedText {\n value @0 :Text;\n timestamp @1 :Timestamp;\n}\n\nstruct TimedData {\n value @0 :Data;\n timestamp @1 :Timestamp;\n}\n\n\n\n# Below here unused so far\n\nstruct Datetime {\n timestamp @0 :Timestamp;\n # ns since epoch\n\n tzoffset @1 :Int16;\n # timezone offset in minutes\n}\n\nstruct Map(Key, Value) {\n items @0 :List(Item);\n\n struct Item {\n key @0 :Key;\n value @1 :Value;\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"4b971751623fd590fe93a90806a1e426369a75e3","subject":"add an 'admin' permission","message":"add an 'admin' permission\n","repos":"neynah\/wordpress-sandstorm,neynah\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,neynah\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,neynah\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xaecd42915acc793f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"aax9j672p6z8n7nyupzvj2nmumeqd4upa0f7mgu8gprwmy53x04h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New WordPress Site\"),\n command = .startCommand\n )\n ],\n\n continueCommand = .continueCommand\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\"), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"wordpress\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\")]\n )\n )\n);\n\nconst startCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\nconst continueCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/continue.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xaecd42915acc793f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"aax9j672p6z8n7nyupzvj2nmumeqd4upa0f7mgu8gprwmy53x04h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New WordPress Site\"),\n command = .startCommand\n )\n ],\n\n continueCommand = .continueCommand\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\"), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"wordpress\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst startCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\nconst continueCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/continue.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"b6add996549b1a09fc66b44f288a586e73d336c9","subject":"Expand capnp file. [skip ci]","message":"Expand capnp file. [skip ci]\n","repos":"firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii,JC5\/firefly-iii,firefly-iii\/firefly-iii","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 1,\n appMarketingVersion = (defaultText = \"4.6.9\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.github.io\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n #license = (openSource = mit),\n license = (proprietary = (defaultText = embed \"..\/LICENSE\")),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n upstreamAuthor = \"James Cole\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 1,\n appMarketingVersion = (defaultText = \"4.6.9\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.github.io\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n #license = (openSource = mit),\n license = (proprietary = (defaultText = embed \"..\/LICENSE\")),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n upstreamAuthor = \"James Cole\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"4707ede638a5777bd807cd68fe21564aa0bb5225","subject":"More RPC doc tweaks.","message":"More RPC doc tweaks.\n","repos":"vladon\/capnproto,bsn069\/capnproto,mologie\/capnproto,mologie\/capnproto,joliss\/capnproto,maurer\/capnproto,rcrowder\/capnproto,martindale\/capnproto,kamalmarhubi\/capnproto,geofft\/capnproto,modulexcite\/capnproto,jparyani\/capnproto,zarvox\/capnproto,ocdtrekkie\/capnproto,joliss\/capnproto,ocdtrekkie\/capnproto,mrdomino\/capnproto,pjulien\/capnproto,Fraser999\/capnproto,artillery\/capnproto,johnkdoe\/capnproto,rcrowder\/capnproto,nagyistoce\/capnproto,bsn069\/capnproto,geofft\/capnproto,maurer\/capnproto,kamalmarhubi\/capnproto,hntrmrrs\/capnproto,jparyani\/capnproto,ligzy\/capnproto,hntrmrrs\/capnproto,martindale\/capnproto,jparyani\/capnproto,pjulien\/capnproto,vladon\/capnproto,ligzy\/capnproto,a-richardson\/capnproto,khklau\/capnproto,geofft\/capnproto,a-richardson\/capnproto,nagyistoce\/capnproto,rcrowder\/capnproto,nagyistoce\/capnproto,zarvox\/capnproto,mrdomino\/capnproto,Fraser999\/capnproto,mologie\/capnproto,MarPiRK\/capnproto,johnkdoe\/capnproto,pjulien\/capnproto,bryce-gibson\/capnproto,Fraser999\/capnproto,johnkdoe\/capnproto,artillery\/capnproto,khklau\/capnproto,modulexcite\/capnproto,bryce-gibson\/capnproto,zarvox\/capnproto,kamalmarhubi\/capnproto,ocdtrekkie\/capnproto,artillery\/capnproto,martindale\/capnproto,bryce-gibson\/capnproto,bsn069\/capnproto,maurer\/capnproto,a-richardson\/capnproto,modulexcite\/capnproto,hntrmrrs\/capnproto,MarPiRK\/capnproto,joliss\/capnproto,MarPiRK\/capnproto,khklau\/capnproto,vladon\/capnproto,ligzy\/capnproto,mrdomino\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. Comments in this file indicate which level requires the corresponding\n# feature to be implemented -- if unspecified, the feature must be implemented at level 1.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction, but interactions between\n# three or more parties are supported only via proxying of objects. E.g. if Alice wants to send\n# Bob a capability pointing to Carol, Alice must host a local proxy of Carol and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support \"join\" or \"eq\" across capabilities received from different vats, although they\n# should be supported on capabilities received from the same vat.\n#\n# * **Level 2:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 3:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, \"Level 2\" is irrelevant and\n# \"Level 3\" is much easier than usual to implement. When such an implementation is actually run\n# inside a container, the contained app effectively gets to make full use of the container's\n# network at level 3. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a ReleaseAnswer\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `ReleaseAnswer`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 1 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n resolve @2 :Resolve; # Resolve a previously-sent promise.\n\n release @3 :Release; # Release a capability so that the remote object can be deallocated.\n releaseAnswer @4 :ReleaseAnswer; # Release a returned answer \/ cancel a call.\n\n restore @5 :Restore; # Restore a persistent capability from a previous connection.\n\n # Level 2 features -----------------------------------------------\n\n provide @6 :Provide; # Provide a capability to a third party.\n accept @7 :Accept; # Accept a capability provided by a third party.\n\n # Level 3 features -----------------------------------------------\n\n join @8 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\nstruct Call {\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching ReleaseAnswer has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `ReleaseAnswer` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a ReleaseAnswer message\n # before the call had completed.\n }\n}\n\nstruct Resolve {\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct ReleaseAnswer {\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\nstruct Restore {\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this restore message, which will eventually receive a Return\n # message containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Provide {\n # **Level 2 feature**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a ReleaseAnswer message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **Level 2 feature**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\nstruct Join {\n # **Level 3 feature**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `ReleaseAnswer`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `ReleaseAnswer` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **Level 2 feature**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n\n sturdyRef @6 :SturdyRef;\n # If non-null, this is a SturdyRef that can be used to store this capability persistently and\n # restore access to in in the future (using a `Restore` message). If null, this capability will\n # be lost if the connection dies. Generally, application interfaces should define when a client\n # can expect a capability to be persistent (and therefore have a SturdyRef attached). However,\n # application protocols should never embed SturdyRefs directly, as various infrastructure like\n # transports, gateways, and sandboxes may need to be aware of SturdyRefs being passed over the\n # wire in order to transform them into different namespaces.\n}\n\nstruct PromisedAnswer {\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list? Of course, if we wanted to get arbitrarily\n # complicated, the ideal would be for the caller to be able to upload a script to run that\n # derives the capability given the former answer, but that's probably unreasonable.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **Level 2 feature**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 3 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to authenticate vats in three-party introductions.\n# - How to implement `Join`.\n# - How to store capabilities long-term without holding a connection open.\n#\n# Three-party interactions\n# ------------------------\n#\n# **Level 2 feature**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **Level 3 feature**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n#\n# Persistent references\n# ---------------------\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n\nusing SturdyRef = Object;\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **Level 2 feature**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 1 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 3 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 1 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 2 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. Comments in this file indicate which level requires the corresponding\n# feature to be implemented -- if unspecified, the feature must be implemented at level 1.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction, but interactions between\n# three or more parties are supported only via proxying of objects. E.g. if Alice wants to send\n# Bob a capability pointing to Carol, Alice must host a local proxy of Carol and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support \"join\" or \"eq\" across capabilities received from different vats, although they\n# should be supported on capabilities received from the same vat.\n#\n# * **Level 2:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 3:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, \"Level 2\" is irrelevant and\n# \"Level 3\" is much easier than usual to implement. When such an implementation is actually run\n# inside a container, the contained app effectively gets to make full use of the container's\n# network at level 3. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a ReleaseAnswer\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `ReleaseAnswer`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n # Level 1 features -----------------------------------------------\n\n call @0 :Call; # Begin a method call.\n return @1 :Return; # Complete a method call.\n resolve @2 :Resolve; # Resolve a previously-sent promise.\n\n release @3 :Release; # Release a capability so that the remote object can be deallocated.\n releaseAnswer @4 :ReleaseAnswer; # Release a returned answer \/ cancel a call.\n\n restore @5 :Restore; # Restore a persistent capability from a previous connection.\n\n # Level 2 features -----------------------------------------------\n\n provide @6 :Provide; # Provide a capability to a third party.\n accept @7 :Accept; # Accept a capability provided by a third party.\n\n # Level 3 features -----------------------------------------------\n\n join @8 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\nstruct Call {\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching ReleaseAnswer has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `ReleaseAnswer` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a ReleaseAnswer message\n # before the call had completed.\n }\n}\n\nstruct Resolve {\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct ReleaseAnswer {\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\nstruct Restore {\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this restore message, which will eventually receive a Return\n # message containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Provide {\n # **Level 2 feature**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a ReleaseAnswer message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **Level 2 feature**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\nstruct Join {\n # **Level 3 feature**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `ReleaseAnswer`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `ReleaseAnswer` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **Level 2 feature**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n\n sturdyRef @6 :SturdyRef;\n # If non-null, this is a SturdyRef that can be used to store this capability persistently and\n # restore access to in in the future (using a `Restore` message). If null, this capability will\n # be lost if the connection dies. Generally, application interfaces should define when a client\n # can expect a capability to be persistent (and therefore have a SturdyRef attached). However,\n # application protocols should never embed SturdyRefs directly, as various infrastructure like\n # transports, gateways, and sandboxes may need to be aware of SturdyRefs being passed over the\n # wire in order to transform them into different namespaces.\n}\n\nstruct PromisedAnswer {\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n path @1 :List(UInt16);\n # Path to the capability in the response. This is a list of indexes into the pointer\n # sections of structs forming a path from the root struct to a particular capability. Each\n # pointer except for the last one must point to another struct -- it is an error if one ends\n # up pointing to a list or something else.\n #\n # If the question refers to an `Accept` (or anything other than a `Call`), this list must be\n # empty.\n #\n # TODO(someday): Would it make sense to support lists in the path, and say that the method\n # should be executed on every element of the list? Of course, if we wanted to get arbitrarily\n # complicated, the ideal would be for the caller to be able to upload a script to run that\n # derives the capability given the former answer, but that's probably unreasonable.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **Level 2 feature**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n reason @0 :Text;\n # Human-readable failure description.\n\n isPermanent @1 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @2 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n\n nature @3 :Nature;\n # The nature of the failure. This is intended mostly to allow classification of errors for\n # reporting and monitoring purposes -- the caller is not expected to handle different natures\n # differently.\n\n enum Nature {\n # These correspond to kj::Exception::Nature.\n\n precondition @0;\n localBug @1;\n osError @2;\n networkFailure @3;\n other @4;\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 3 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to authenticate vats in three-party introductions.\n# - How to implement `Join`.\n# - How to store capabilities long-term without holding a connection open.\n#\n# Three-party interactions\n# ------------------------\n#\n# **Level 2 feature**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **Level 3 feature**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n#\n# Persistent references\n# ---------------------\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n\nusing SturdyRef = Object;\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n\nusing ProvisionId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **Level 2 feature**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **Level 2 feature**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 1 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 3 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 1 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 2 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c389ab850be8cec848b10083cc2355b069705776","subject":"Use absolute capnp import path","message":"Use absolute capnp import path\n","repos":"chanceraine\/nupic,GeraldLoeffler\/nupic,scottpurdy\/nupic,virneo\/nupic,vitaly-krugl\/nupic,numenta\/nupic,cogmission\/nupic,runt18\/nupic,neuroidss\/nupic,scottpurdy\/nupic,arhik\/nupic,pulinagrawal\/nupic,mcanthony\/nupic,pulinagrawal\/nupic,BoltzmannBrain\/nupic,pulinagrawal\/nupic,mcanthony\/nupic,metaml\/nupic,lscheinkman\/nupic,rayNymous\/nupic,virneo\/nupic,darshanthaker\/nupic,pap\/nupic,brev\/nupic,sambitgaan\/nupic,BeiLuoShiMen\/nupic,rayNymous\/nupic,BoltzmannBrain\/nupic,badlogicmanpreet\/nupic,arhik\/nupic,passiweinberger\/nupic,subutai\/nupic,akhilaananthram\/nupic,rcrowder\/nupic,vamsirajendra\/nupic,BeiLuoShiMen\/nupic,scottpurdy\/nupic,breznak\/nupic,lscheinkman\/nupic,subutai\/nupic,go-bears\/nupic,rhyolight\/nupic,elkingtonmcb\/nupic,mcanthony\/nupic,BeiLuoShiMen\/nupic,numenta-ci\/nupic,fergalbyrne\/nupic,numenta-ci\/nupic,ywcui1990\/nupic,vamsirajendra\/nupic,cogmission\/nupic,chen0031\/nupic,go-bears\/nupic,ben-hopps\/nupic,passiweinberger\/nupic,elkingtonmcb\/nupic,wanghaven\/nupic,ywcui1990\/nupic,numenta\/nupic,sambitgaan\/nupic,GeraldLoeffler\/nupic,cngo-github\/nupic,metaml\/nupic,go-bears\/nupic,allanino\/nupic,wanghaven\/nupic,neuroidss\/nupic,rcrowder\/nupic,marionleborgne\/nupic,neuroidss\/nupic,wanghaven\/nupic,chen0031\/nupic,fergalbyrne\/nupic,cngo-github\/nupic,loretoparisi\/nupic,alfonsokim\/nupic,virneo\/nupic,cogmission\/nupic,vamsirajendra\/nupic,akhilaananthram\/nupic,glorizen\/nupic,EricSB\/nupic,markneville\/nupic,loretoparisi\/nupic,fergalbyrne\/nupic,alfonsokim\/nupic,numenta\/nupic,darshanthaker\/nupic,SaganBolliger\/nupic,marionleborgne\/nupic,marionleborgne\/nupic,rhyolight\/nupic,blueburningcoder\/nupic,elkingtonmcb\/nupic,jcasner\/nupic,eranchetz\/nupic,blueburningcoder\/nupic,BoltzmannBrain\/nupic,chanceraine\/nupic,vitaly-krugl\/nupic,loretoparisi\/nupic,badlogicmanpreet\/nupic,chen0031\/nupic,ywcui1990\/nupic,rcrowder\/nupic,pap\/nupic,SaganBolliger\/nupic,metaml\/nupic,EricSB\/nupic,brev\/nupic,runt18\/nupic,markneville\/nupic,eranchetz\/nupic,sambitgaan\/nupic,vitaly-krugl\/nupic,markneville\/nupic,jcasner\/nupic,breznak\/nupic,EricSB\/nupic,runt18\/nupic,passiweinberger\/nupic,brev\/nupic,allanino\/nupic,rayNymous\/nupic,akhilaananthram\/nupic,breznak\/nupic,SaganBolliger\/nupic,ben-hopps\/nupic,chanceraine\/nupic,numenta-ci\/nupic,arhik\/nupic,badlogicmanpreet\/nupic,glorizen\/nupic,allanino\/nupic,pap\/nupic,glorizen\/nupic,rhyolight\/nupic,ben-hopps\/nupic,blueburningcoder\/nupic,subutai\/nupic,darshanthaker\/nupic,alfonsokim\/nupic,GeraldLoeffler\/nupic,cngo-github\/nupic,eranchetz\/nupic,jcasner\/nupic,lscheinkman\/nupic","old_file":"nupic\/encoders\/category.capnp","new_file":"nupic\/encoders\/category.capnp","new_contents":"@0xb639caa166140b0f;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\n# Next ID: 5\nstruct CategoryEncoderProto {\n\n # Next ID: 2\n struct CategoryMapping {\n index @0 :UInt32;\n category @1 :Text;\n }\n\n width @0 :UInt32;\n indexToCategory @1 :List(CategoryMapping);\n name @2 :Text;\n verbosity @3 :UInt8;\n encoder @4 :ScalarEncoderProto;\n}\n","old_contents":"@0xb639caa166140b0f;\n\nusing import \"scalar.capnp\".ScalarEncoderProto;\n\n# Next ID: 5\nstruct CategoryEncoderProto {\n\n # Next ID: 2\n struct CategoryMapping {\n index @0 :UInt32;\n category @1 :Text;\n }\n\n width @0 :UInt32;\n indexToCategory @1 :List(CategoryMapping);\n name @2 :Text;\n verbosity @3 :UInt8;\n encoder @4 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"4f6c331441b574f088147f325e756143c74ff9a0","subject":"Bump version to 0.66.0-develop","message":"Bump version to 0.66.0-develop\n","repos":"flaviogrossi\/Rocket.Chat,Sing-Li\/Rocket.Chat,subesokun\/Rocket.Chat,inoio\/Rocket.Chat,nishimaki10\/Rocket.Chat,pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat,nishimaki10\/Rocket.Chat,flaviogrossi\/Rocket.Chat,4thParty\/Rocket.Chat,nishimaki10\/Rocket.Chat,VoiSmart\/Rocket.Chat,pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat,inoio\/Rocket.Chat,pkgodara\/Rocket.Chat,subesokun\/Rocket.Chat,Sing-Li\/Rocket.Chat,Sing-Li\/Rocket.Chat,Sing-Li\/Rocket.Chat,VoiSmart\/Rocket.Chat,flaviogrossi\/Rocket.Chat,subesokun\/Rocket.Chat,VoiSmart\/Rocket.Chat,inoio\/Rocket.Chat,4thParty\/Rocket.Chat,pkgodara\/Rocket.Chat,flaviogrossi\/Rocket.Chat,subesokun\/Rocket.Chat,nishimaki10\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 73, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.66.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"HOME\", value = \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 72, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.66.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"HOME\", value = \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"6d20056e0fe6ab333d1489eb8b2b36668b0bb793","subject":"Fix the verbs in Sandstorm activity events","message":"Fix the verbs in Sandstorm activity events\n","repos":"mrsimpson\/Rocket.Chat,karlprieb\/Rocket.Chat,JamesHGreen\/Rocket.Chat,pkgodara\/Rocket.Chat,tntobias\/Rocket.Chat,AlecTroemel\/Rocket.Chat,matthewshirley\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,LearnersGuild\/echo-chat,mrinaldhar\/Rocket.Chat,danielbressan\/Rocket.Chat,wtsarchive\/Rocket.Chat,flaviogrossi\/Rocket.Chat,mwharrison\/Rocket.Chat,pachox\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,xasx\/Rocket.Chat,xasx\/Rocket.Chat,intelradoux\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ggazzo\/Rocket.Chat,Gyubin\/Rocket.Chat,pachox\/Rocket.Chat,ggazzo\/Rocket.Chat,matthewshirley\/Rocket.Chat,4thParty\/Rocket.Chat,ahmadassaf\/Rocket.Chat,ahmadassaf\/Rocket.Chat,galrotem1993\/Rocket.Chat,pkgodara\/Rocket.Chat,nishimaki10\/Rocket.Chat,marzieh312\/Rocket.Chat,wtsarchive\/Rocket.Chat,ziedmahdi\/Rocket.Chat,ealbers\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,fatihwk\/Rocket.Chat,galrotem1993\/Rocket.Chat,igorstajic\/Rocket.Chat,flaviogrossi\/Rocket.Chat,Gudii\/Rocket.Chat,Achaikos\/Rocket.Chat,k0nsl\/Rocket.Chat,NMandapaty\/Rocket.Chat,mrsimpson\/Rocket.Chat,inoxth\/Rocket.Chat,intelradoux\/Rocket.Chat,galrotem1993\/Rocket.Chat,JamesHGreen\/Rocket_API,flaviogrossi\/Rocket.Chat,wtsarchive\/Rocket.Chat,Movile\/Rocket.Chat,Gyubin\/Rocket.Chat,danielbressan\/Rocket.Chat,alexbrazier\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,karlprieb\/Rocket.Chat,LearnersGuild\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,nishimaki10\/Rocket.Chat,fatihwk\/Rocket.Chat,igorstajic\/Rocket.Chat,mrinaldhar\/Rocket.Chat,Sing-Li\/Rocket.Chat,inoio\/Rocket.Chat,karlprieb\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,Gudii\/Rocket.Chat,Movile\/Rocket.Chat,flaviogrossi\/Rocket.Chat,ealbers\/Rocket.Chat,mrsimpson\/Rocket.Chat,LearnersGuild\/Rocket.Chat,inoio\/Rocket.Chat,tntobias\/Rocket.Chat,VoiSmart\/Rocket.Chat,danielbressan\/Rocket.Chat,JamesHGreen\/Rocket.Chat,xasx\/Rocket.Chat,Gudii\/Rocket.Chat,pachox\/Rocket.Chat,4thParty\/Rocket.Chat,Movile\/Rocket.Chat,abduljanjua\/TheHub,Movile\/Rocket.Chat,cnash\/Rocket.Chat,Gyubin\/Rocket.Chat,Achaikos\/Rocket.Chat,yuyixg\/Rocket.Chat,yuyixg\/Rocket.Chat,alexbrazier\/Rocket.Chat,ahmadassaf\/Rocket.Chat,pitamar\/Rocket.Chat,4thParty\/Rocket.Chat,subesokun\/Rocket.Chat,JamesHGreen\/Rocket_API,danielbressan\/Rocket.Chat,JamesHGreen\/Rocket.Chat,nishimaki10\/Rocket.Chat,ealbers\/Rocket.Chat,yuyixg\/Rocket.Chat,galrotem1993\/Rocket.Chat,pkgodara\/Rocket.Chat,JamesHGreen\/Rocket.Chat,marzieh312\/Rocket.Chat,Sing-Li\/Rocket.Chat,AlecTroemel\/Rocket.Chat,pitamar\/Rocket.Chat,LearnersGuild\/Rocket.Chat,mwharrison\/Rocket.Chat,VoiSmart\/Rocket.Chat,NMandapaty\/Rocket.Chat,NMandapaty\/Rocket.Chat,JamesHGreen\/Rocket_API,ziedmahdi\/Rocket.Chat,k0nsl\/Rocket.Chat,JamesHGreen\/Rocket_API,fatihwk\/Rocket.Chat,nishimaki10\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,inoxth\/Rocket.Chat,ziedmahdi\/Rocket.Chat,mwharrison\/Rocket.Chat,karlprieb\/Rocket.Chat,subesokun\/Rocket.Chat,xasx\/Rocket.Chat,LearnersGuild\/echo-chat,LearnersGuild\/Rocket.Chat,AimenJoe\/Rocket.Chat,wtsarchive\/Rocket.Chat,tntobias\/Rocket.Chat,k0nsl\/Rocket.Chat,AimenJoe\/Rocket.Chat,inoxth\/Rocket.Chat,AlecTroemel\/Rocket.Chat,abduljanjua\/TheHub,cnash\/Rocket.Chat,Sing-Li\/Rocket.Chat,ggazzo\/Rocket.Chat,mrinaldhar\/Rocket.Chat,AimenJoe\/Rocket.Chat,ziedmahdi\/Rocket.Chat,cnash\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,VoiSmart\/Rocket.Chat,subesokun\/Rocket.Chat,4thParty\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,mrinaldhar\/Rocket.Chat,Achaikos\/Rocket.Chat,Gudii\/Rocket.Chat,pitamar\/Rocket.Chat,cnash\/Rocket.Chat,igorstajic\/Rocket.Chat,intelradoux\/Rocket.Chat,ahmadassaf\/Rocket.Chat,Achaikos\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,pkgodara\/Rocket.Chat,alexbrazier\/Rocket.Chat,LearnersGuild\/echo-chat,snaiperskaya96\/Rocket.Chat,Sing-Li\/Rocket.Chat,igorstajic\/Rocket.Chat,inoio\/Rocket.Chat,pachox\/Rocket.Chat,subesokun\/Rocket.Chat,matthewshirley\/Rocket.Chat,NMandapaty\/Rocket.Chat,yuyixg\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,pitamar\/Rocket.Chat,alexbrazier\/Rocket.Chat,inoxth\/Rocket.Chat,intelradoux\/Rocket.Chat,AimenJoe\/Rocket.Chat,mrsimpson\/Rocket.Chat,Gyubin\/Rocket.Chat,ggazzo\/Rocket.Chat,abduljanjua\/TheHub,matthewshirley\/Rocket.Chat,ealbers\/Rocket.Chat,LearnersGuild\/echo-chat,mwharrison\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,fatihwk\/Rocket.Chat,marzieh312\/Rocket.Chat,tntobias\/Rocket.Chat,k0nsl\/Rocket.Chat,abduljanjua\/TheHub,marzieh312\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 38, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.37.1\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n eventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"message sent\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"private message sent\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 38, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.37.1\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n eventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"message received\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"private message received\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a84f811a2eba7601646f402e649240c323b090c2","subject":"sandstorm package screenshots","message":"sandstorm package screenshots\n","repos":"strawlab\/neuron-catalog,strawlab\/neuron-catalog,strawlab\/neuron-catalog","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xe102d2c131b69f04;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u1pa4174jqhvn93fkgr6u07mfgpk53dtgvfqqz9hec0pxk6c8nuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Neuron Catalog\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Neuron Catalog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n # marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/strawlab.org\/neuron-catalog\",\n\n codeUrl = \"https:\/\/github.com\/strawlab\/neuron-catalog\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = agpl3),\n\n categories = [science, productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"strawman@astraw.com\",\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Andrew Straw\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Record keeping\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 823, height = 478, png = embed \"screenshots\/binary-data.png\"),\n (width = 822, height = 703, png = embed \"screenshots\/neuron-types.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"read\"), (name = \"write\"), (name = \"admin\")],\n roles = [(title = (defaultText = \"reader\"),\n permissions = [true, false, false]),\n (title = (defaultText = \"writer\"),\n permissions = [true, true, false]),\n (title = (defaultText = \"admin\"),\n permissions = [true, true, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xe102d2c131b69f04;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u1pa4174jqhvn93fkgr6u07mfgpk53dtgvfqqz9hec0pxk6c8nuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Neuron Catalog\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Neuron Catalog\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n # marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/strawlab.org\/neuron-catalog\",\n\n codeUrl = \"https:\/\/github.com\/strawlab\/neuron-catalog\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (openSource = agpl3),\n\n categories = [science, productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"strawman@astraw.com\",\n\n pgpSignature = embed \"pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n # upstreamAuthor = \"Andrew Straw\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n description = (defaultText = embed \"description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Record keeping\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"read\"), (name = \"write\"), (name = \"admin\")],\n roles = [(title = (defaultText = \"reader\"),\n permissions = [true, false, false]),\n (title = (defaultText = \"writer\"),\n permissions = [true, true, false]),\n (title = (defaultText = \"admin\"),\n permissions = [true, true, true])]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"ee00a35f59145a87cf9485650c6bcc1f72c75a7c","subject":"Switch to absolute import paths for capnp.","message":"Switch to absolute import paths for capnp.\n","repos":"metaml\/nupic.core,scottpurdy\/nupic.core,utensil\/nupic.core,Bemujo\/https-github.com-numenta-nupic,sambitgaan\/nupic.core,akhilaananthram\/nupic.core,EricSB\/nupic.core,ywcui1990\/nupic.core,numenta\/nupic.core,rhyolight\/nupic.core,breznak\/nupic.core,pettitda\/nupic.core,numenta\/htmresearch-core,Bemujo\/https-github.com-numenta-nupic,numenta\/htmresearch-core,breznak\/nupic.core,Bemujo\/https-github.com-numenta-nupic,numenta\/nupic.core,lscheinkman\/nupic.core,numenta\/nupic.core,rhyolight\/nupic.core,EricSB\/nupic.core,sambitgaan\/nupic.core,breznak\/nupic.core,Bemujo\/https-github.com-numenta-nupic,rhyolight\/nupic.core,neuroidss\/nupic.core,ywcui1990\/nupic.core,akhilaananthram\/nupic.core,pettitda\/nupic.core,breznak\/nupic.core,akhilaananthram\/nupic.core,subutai\/nupic.core,EricSB\/nupic.core,numenta\/htmresearch-core,lscheinkman\/nupic.core,akhilaananthram\/nupic.core,subutai\/nupic.core,utensil\/nupic.core,EricSB\/nupic.core,subutai\/nupic.core,scottpurdy\/nupic.core,jaredweiss\/nupic.core,brev\/nupic.core,pettitda\/nupic.core,rcrowder\/nupic.core,sambitgaan\/nupic.core,brev\/nupic.core,rhyolight\/nupic.core,lscheinkman\/nupic.core,brev\/nupic.core,metaml\/nupic.core,rcrowder\/nupic.core,ywcui1990\/nupic.core,metaml\/nupic.core,utensil\/nupic.core,utensil\/nupic.core,brev\/nupic.core,pettitda\/nupic.core,neuroidss\/nupic.core,lscheinkman\/nupic.core,rcrowder\/nupic.core,jaredweiss\/nupic.core,jaredweiss\/nupic.core,rcrowder\/nupic.core,scottpurdy\/nupic.core,subutai\/nupic.core,numenta\/htmresearch-core,ywcui1990\/nupic.core,scottpurdy\/nupic.core,jaredweiss\/nupic.core,numenta\/nupic.core,metaml\/nupic.core,sambitgaan\/nupic.core,neuroidss\/nupic.core,neuroidss\/nupic.core","old_file":"src\/nupic\/algorithms\/SpatialPoolerProto.capnp","new_file":"src\/nupic\/algorithms\/SpatialPoolerProto.capnp","new_contents":"@0xaf55f2dcb92e4304;\n\n# TODO: Use absolute path\nusing import \"\/nupic\/math\/SparseBinaryMatrixProto.capnp\".SparseBinaryMatrixProto;\nusing import \"\/nupic\/math\/SparseMatrixProto.capnp\".SparseMatrixProto;\nusing import \"\/nupic\/utils\/RandomProto.capnp\".RandomProto;\n\n# Next ID: 37\nstruct SpatialPoolerProto {\n random @0 :RandomProto;\n numInputs @1 :UInt32;\n numColumns @2 :UInt32;\n columnDimensions @3 :List(UInt32);\n inputDimensions @4 :List(UInt32);\n potentialRadius @5 :UInt32;\n potentialPct @6 :Float32;\n inhibitionRadius @35 :UInt32;\n globalInhibition @7 :Bool;\n numActiveColumnsPerInhArea @8 :UInt32;\n localAreaDensity @9 :Float32;\n stimulusThreshold @10 :UInt32;\n synPermInactiveDec @11 :Float32;\n synPermActiveInc @12 :Float32;\n synPermBelowStimulusInc @13 :Float32;\n synPermConnected @14 :Float32;\n minPctOverlapDutyCycles @15 :Float32;\n minPctActiveDutyCycles @16 :Float32;\n dutyCyclePeriod @17 :UInt16;\n maxBoost @18 :Float32;\n wrapAround @36 :Bool;\n spVerbosity @19 :UInt8;\n\n synPermMin @20 :Float32;\n synPermMax @21 :Float32;\n synPermTrimThreshold @22 :Float32;\n updatePeriod @23 :UInt16;\n\n version @24 :UInt16;\n iterationNum @25 :UInt32;\n iterationLearnNum @26 :UInt32;\n\n # List length equals number of columns, elements are indices of input bits\n # in potential pool\n potentialPools @27 :SparseBinaryMatrixProto;\n\n # List length equals number of columns, elements are SparseFloat instances with\n # an input bit index and the permanence value for all non-zero permanences.\n permanences @28 :SparseMatrixProto;\n\n # Tie break float values for each column to break ties\n tieBreaker @29 :List(Float32);\n\n overlapDutyCycles @30 :List(Float32);\n activeDutyCycles @31 :List(Float32);\n minOverlapDutyCycles @32 :List(Float32);\n minActiveDutyCycles @33 :List(Float32);\n boostFactors @34 :List(Float32);\n}\n","old_contents":"@0xaf55f2dcb92e4304;\n\n# TODO: Use absolute path\nusing import \"..\/math\/SparseBinaryMatrixProto.capnp\".SparseBinaryMatrixProto;\nusing import \"..\/math\/SparseMatrixProto.capnp\".SparseMatrixProto;\nusing import \"..\/utils\/RandomProto.capnp\".RandomProto;\n\n# Next ID: 37\nstruct SpatialPoolerProto {\n random @0 :RandomProto;\n numInputs @1 :UInt32;\n numColumns @2 :UInt32;\n columnDimensions @3 :List(UInt32);\n inputDimensions @4 :List(UInt32);\n potentialRadius @5 :UInt32;\n potentialPct @6 :Float32;\n inhibitionRadius @35 :UInt32;\n globalInhibition @7 :Bool;\n numActiveColumnsPerInhArea @8 :UInt32;\n localAreaDensity @9 :Float32;\n stimulusThreshold @10 :UInt32;\n synPermInactiveDec @11 :Float32;\n synPermActiveInc @12 :Float32;\n synPermBelowStimulusInc @13 :Float32;\n synPermConnected @14 :Float32;\n minPctOverlapDutyCycles @15 :Float32;\n minPctActiveDutyCycles @16 :Float32;\n dutyCyclePeriod @17 :UInt16;\n maxBoost @18 :Float32;\n wrapAround @36 :Bool;\n spVerbosity @19 :UInt8;\n\n synPermMin @20 :Float32;\n synPermMax @21 :Float32;\n synPermTrimThreshold @22 :Float32;\n updatePeriod @23 :UInt16;\n\n version @24 :UInt16;\n iterationNum @25 :UInt32;\n iterationLearnNum @26 :UInt32;\n\n # List length equals number of columns, elements are indices of input bits\n # in potential pool\n potentialPools @27 :SparseBinaryMatrixProto;\n\n # List length equals number of columns, elements are SparseFloat instances with\n # an input bit index and the permanence value for all non-zero permanences.\n permanences @28 :SparseMatrixProto;\n\n # Tie break float values for each column to break ties\n tieBreaker @29 :List(Float32);\n\n overlapDutyCycles @30 :List(Float32);\n activeDutyCycles @31 :List(Float32);\n minOverlapDutyCycles @32 :List(Float32);\n minActiveDutyCycles @33 :List(Float32);\n boostFactors @34 :List(Float32);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"e71edcc6ab894a89e3621af7250b20c0421518f9","subject":"Bump version.","message":"Bump version.\n","repos":"ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 10, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"2015.08.01 (1.5.6+)\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 9, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"2015.06.18 (1.5.6+)\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"d98d3f708905807fed1b3961aa9da68228f1eee4","subject":"Revise comments following feedback in anticipation of merge","message":"Revise comments following feedback in anticipation of merge\n","repos":"glorizen\/nupic,passiweinberger\/nupic,mcanthony\/nupic,metaml\/nupic,EricSB\/nupic,go-bears\/nupic,cngo-github\/nupic,ben-hopps\/nupic,alfonsokim\/nupic,pulinagrawal\/nupic,darshanthaker\/nupic,alfonsokim\/nupic,virneo\/nupic,fergalbyrne\/nupic,alfonsokim\/nupic,sambitgaan\/nupic,runt18\/nupic,chanceraine\/nupic,pap\/nupic,ywcui1990\/nupic,metaml\/nupic,runt18\/nupic,breznak\/nupic,blueburningcoder\/nupic,subutai\/nupic,mcanthony\/nupic,brev\/nupic,numenta-ci\/nupic,GeraldLoeffler\/nupic,chen0031\/nupic,GeraldLoeffler\/nupic,jcasner\/nupic,arhik\/nupic,rayNymous\/nupic,pap\/nupic,neuroidss\/nupic,glorizen\/nupic,ben-hopps\/nupic,scottpurdy\/nupic,allanino\/nupic,BoltzmannBrain\/nupic,vitaly-krugl\/nupic,sambitgaan\/nupic,loretoparisi\/nupic,rcrowder\/nupic,pulinagrawal\/nupic,pulinagrawal\/nupic,vamsirajendra\/nupic,vitaly-krugl\/nupic,vitaly-krugl\/nupic,scottpurdy\/nupic,arhik\/nupic,neuroidss\/nupic,passiweinberger\/nupic,badlogicmanpreet\/nupic,SaganBolliger\/nupic,cogmission\/nupic,cngo-github\/nupic,passiweinberger\/nupic,vamsirajendra\/nupic,numenta-ci\/nupic,rcrowder\/nupic,GeraldLoeffler\/nupic,arhik\/nupic,scottpurdy\/nupic,go-bears\/nupic,mcanthony\/nupic,numenta-ci\/nupic,ywcui1990\/nupic,akhilaananthram\/nupic,cogmission\/nupic,brev\/nupic,rayNymous\/nupic,BeiLuoShiMen\/nupic,breznak\/nupic,akhilaananthram\/nupic,elkingtonmcb\/nupic,jcasner\/nupic,runt18\/nupic,subutai\/nupic,allanino\/nupic,rcrowder\/nupic,chen0031\/nupic,markneville\/nupic,marionleborgne\/nupic,breznak\/nupic,lscheinkman\/nupic,elkingtonmcb\/nupic,loretoparisi\/nupic,sambitgaan\/nupic,numenta\/nupic,neuroidss\/nupic,wanghaven\/nupic,pap\/nupic,BoltzmannBrain\/nupic,BeiLuoShiMen\/nupic,BeiLuoShiMen\/nupic,subutai\/nupic,chen0031\/nupic,virneo\/nupic,ben-hopps\/nupic,eranchetz\/nupic,eranchetz\/nupic,metaml\/nupic,markneville\/nupic,marionleborgne\/nupic,blueburningcoder\/nupic,BoltzmannBrain\/nupic,chanceraine\/nupic,brev\/nupic,badlogicmanpreet\/nupic,badlogicmanpreet\/nupic,jcasner\/nupic,fergalbyrne\/nupic,cngo-github\/nupic,darshanthaker\/nupic,marionleborgne\/nupic,ywcui1990\/nupic,eranchetz\/nupic,SaganBolliger\/nupic,EricSB\/nupic,markneville\/nupic,go-bears\/nupic,blueburningcoder\/nupic,SaganBolliger\/nupic,akhilaananthram\/nupic,numenta\/nupic,darshanthaker\/nupic,rhyolight\/nupic,lscheinkman\/nupic,rhyolight\/nupic,allanino\/nupic,virneo\/nupic,fergalbyrne\/nupic,vamsirajendra\/nupic,cogmission\/nupic,chanceraine\/nupic,numenta\/nupic,lscheinkman\/nupic,rhyolight\/nupic,elkingtonmcb\/nupic,glorizen\/nupic,wanghaven\/nupic,EricSB\/nupic,loretoparisi\/nupic,rayNymous\/nupic,wanghaven\/nupic","old_file":"nupic\/encoders\/scalar.capnp","new_file":"nupic\/encoders\/scalar.capnp","new_contents":"@0xfa7d16f86048a6e4;\n\n# Next ID: 10\nstruct ScalarEncoderProto {\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n radius @5 :Float32;\n resolution @6 :Float32;\n name @7 :Text;\n verbosity @8 :UInt8;\n clipInput @9 :Bool;\n}\n","old_contents":"@0xfa7d16f86048a6e4;\n\nstruct ScalarEncoderProto {\n # ScalarEncoder() constructor signature\n\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n radius @5 :Float32;\n resolution @6 :Float32;\n name @7 :Text;\n verbosity @8 :UInt8;\n clipInput @9 :Bool;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"c46c7735746834c63014cb82db71d362946faa6f","subject":"Removed variable field from SetExpr (should not have been added)","message":"Removed variable field from SetExpr (should not have been added)\n","repos":"niekbouman\/commelec-api,niekbouman\/commelec-api,niekbouman\/commelec-api,niekbouman\/commelec-api","old_file":"src\/schema.capnp","new_file":"src\/schema.capnp","new_contents":"# The MIT License (MIT)\n# \n# Copyright (c) 2015 Andrey Bernstein and Niek J. Bouman\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n# \n@0xdb1b4800e80dbd2d;\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"msg\");\n#\n# COMMELEC message format v1.0\n#\n# Specified in Cap'n Proto's schema language (Requires Cap'n Proto v0.5\n# [ http:\/\/kentonv.github.io\/capnproto\/language.html ] \n#\n# Copyright (c) 2015 by Andrey Bernstein & Niek J. Bouman\n#\n# EPFL - Swiss Federal Institute of Technology Lausanne\n\n#=====================================================\n# Top-Level \"Message\" Type, Request and Advertisement \n#=====================================================\n\nstruct Message {\n agentId @0 :UInt32;\n union {\n request @1 :Request;\n advertisement @2 :Advertisement;\n }\n}\n\nstruct Request {\n setpoint @0 :List(Float64);\n}\n\nstruct Advertisement {\n pQProfile @0 :SetExpr;\n beliefFunction @1 :SetExpr;\n costFunction @2 :RealExpr;\n implementedSetpoint @3 :List(Float64);\n}\n\n#==============================================\n# Definition of RealExpr and its child structs\n#==============================================\n\nstruct RealExpr {\n name @0 :Text;\n union {\n real @1 :Float64;\n polynomial @2 :Polynomial;\n unaryOperation @3 :UnaryOperation;\n binaryOperation @4 :BinaryOperation;\n listOperation @5 :ListOperation;\n caseDistinction @6 :CaseDistinction(RealExpr);\n reference @7 :Text;\n variable @8 :Text;\n }\n}\n\nstruct UnaryOperation {\n arg @0 :RealExpr;\n operation :union {\n negate @1 :Void;\n abs @2 :Void;\n sign @3 :Void;\n multInv @4 :Void;\n square @5 :Void;\n sqrt @6 :Void;\n sin @7 :Void;\n cos @8 :Void;\n tan @9 :Void;\n exp @10 :Void;\n ln @11 :Void;\n log10 @12 :Void;\n round @13 :Void;\n floor @14 :Void;\n ceil @15 :Void;\n }\n}\n\nstruct BinaryOperation {\n argA @0 :RealExpr;\n argB @1 :RealExpr;\n operation :union {\n sum @2 :Void;\n prod @3 :Void;\n pow @4 :Void;\n min @5 :Void;\n max @6 :Void;\n lessEqThan @7 :Void; # expression yields a boolean\n greaterThan @8 :Void; # expression yields a boolean\n }\n}\n\nstruct ListOperation {\n args @0 :List(RealExpr);\n operation :union {\n sum @1 :Void;\n prod @2 :Void;\n }\n}\n\nstruct Polynomial {\n variables @0 :List(Text);\n maxVarDegree @1 :UInt8; \n coefficients @2 :List(SparseCoeff);\n}\n\nstruct SparseCoeff {\n offset @0 :UInt32;\n value @1 :Float64;\n}\n\nstruct CaseDistinction(CaseType) {\n variables @0 :List(Text);\n cases @1 :List(ExprCase(CaseType)); \n}\n\nstruct ExprCase(CaseType) {\n # Representation of a single case for use in CaseDistinction\n # (order of evaluation follows List ordering)\n set @0 :SetExpr;\n expression @1 :CaseType;\n}\n\n#=============================================\n# Definition of SetExpr and its child structs\n#=============================================\n\nstruct SetExpr {\n name @0 :Text;\n union {\n singleton @1 :List(RealExpr); # dimension of the point equals the length of the list \n ball @2 :Ball;\n rectangle @3 :List(BoundaryPair);\n convexPolytope @4 :ConvexPolytope;\n intersection @5 :List(SetExpr);\n caseDistinction @6 :CaseDistinction(SetExpr);\n reference @7 :Text;\n }\n}\n\nstruct Ball {\n center @0 :List(RealExpr);\n radius @1 :RealExpr;\n}\n\nstruct BoundaryPair {\n boundA @0 :RealExpr; # the \"interpreter\" is responsible for sorting \n boundB @1 :RealExpr; # the bounds, i.e., which bound is min and max \n}\n\nstruct ConvexPolytope {\n # A convex polytope formed by linear constraints\n # In case of a polygon, i.e., a two-dimensional polytope, the\n # length of the inner list of field 'a' will be equal to two. \n a @0 :List(List(RealExpr));\n b @1 :List(RealExpr);\n}\n","old_contents":"# The MIT License (MIT)\n# \n# Copyright (c) 2015 Andrey Bernstein and Niek J. Bouman\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n# \n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n# \n@0xdb1b4800e80dbd2d;\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"msg\");\n#\n# COMMELEC message format v1.0\n#\n# Specified in Cap'n Proto's schema language (Requires Cap'n Proto v0.5\n# [ http:\/\/kentonv.github.io\/capnproto\/language.html ] \n#\n# Copyright (c) 2015 by Andrey Bernstein & Niek J. Bouman\n#\n# EPFL - Swiss Federal Institute of Technology Lausanne\n\n#=====================================================\n# Top-Level \"Message\" Type, Request and Advertisement \n#=====================================================\n\nstruct Message {\n agentId @0 :UInt32;\n union {\n request @1 :Request;\n advertisement @2 :Advertisement;\n }\n}\n\nstruct Request {\n setpoint @0 :List(Float64);\n}\n\nstruct Advertisement {\n pQProfile @0 :SetExpr;\n beliefFunction @1 :SetExpr;\n costFunction @2 :RealExpr;\n implementedSetpoint @3 :List(Float64);\n}\n\n#==============================================\n# Definition of RealExpr and its child structs\n#==============================================\n\nstruct RealExpr {\n name @0 :Text;\n union {\n real @1 :Float64;\n polynomial @2 :Polynomial;\n unaryOperation @3 :UnaryOperation;\n binaryOperation @4 :BinaryOperation;\n listOperation @5 :ListOperation;\n caseDistinction @6 :CaseDistinction(RealExpr);\n reference @7 :Text;\n variable @8 :Text;\n }\n}\n\nstruct UnaryOperation {\n arg @0 :RealExpr;\n operation :union {\n negate @1 :Void;\n abs @2 :Void;\n sign @3 :Void;\n multInv @4 :Void;\n square @5 :Void;\n sqrt @6 :Void;\n sin @7 :Void;\n cos @8 :Void;\n tan @9 :Void;\n exp @10 :Void;\n ln @11 :Void;\n log10 @12 :Void;\n round @13 :Void;\n floor @14 :Void;\n ceil @15 :Void;\n }\n}\n\nstruct BinaryOperation {\n argA @0 :RealExpr;\n argB @1 :RealExpr;\n operation :union {\n sum @2 :Void;\n prod @3 :Void;\n pow @4 :Void;\n min @5 :Void;\n max @6 :Void;\n lessEqThan @7 :Void; # expression yields a boolean\n greaterThan @8 :Void; # expression yields a boolean\n }\n}\n\nstruct ListOperation {\n args @0 :List(RealExpr);\n operation :union {\n sum @1 :Void;\n prod @2 :Void;\n }\n}\n\nstruct Polynomial {\n variables @0 :List(Text);\n maxVarDegree @1 :UInt8; \n coefficients @2 :List(SparseCoeff);\n}\n\nstruct SparseCoeff {\n offset @0 :UInt32;\n value @1 :Float64;\n}\n\nstruct CaseDistinction(CaseType) {\n variables @0 :List(Text);\n cases @1 :List(ExprCase(CaseType)); \n}\n\nstruct ExprCase(CaseType) {\n # Representation of a single case for use in CaseDistinction\n # (order of evaluation follows List ordering)\n set @0 :SetExpr;\n expression @1 :CaseType;\n}\n\n#=============================================\n# Definition of SetExpr and its child structs\n#=============================================\n\nstruct SetExpr {\n name @0 :Text;\n union {\n singleton @1 :List(RealExpr); # dimension of the point equals the length of the list \n ball @2 :Ball;\n rectangle @3 :List(BoundaryPair);\n convexPolytope @4 :ConvexPolytope;\n intersection @5 :List(SetExpr);\n caseDistinction @6 :CaseDistinction(SetExpr);\n reference @7 :Text;\n variable @8 :Text;\n }\n}\n\nstruct Ball {\n center @0 :List(RealExpr);\n radius @1 :RealExpr;\n}\n\nstruct BoundaryPair {\n boundA @0 :RealExpr; # the \"interpreter\" is responsible for sorting \n boundB @1 :RealExpr; # the bounds, i.e., which bound is min and max \n}\n\nstruct ConvexPolytope {\n # A convex polytope formed by linear constraints\n # In case of a polygon, i.e., a two-dimensional polytope, the\n # length of the inner list of field 'a' will be equal to two. \n a @0 :List(List(RealExpr));\n b @1 :List(RealExpr);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"f112d599ddc1d5778b93534a3a0a84028ea5f8d9","subject":"change paramter name in temporal memory proto","message":"change paramter name in temporal memory proto\n","repos":"EricSB\/nupic.core,numenta\/nupic.core,sambitgaan\/nupic.core,brev\/nupic.core,rcrowder\/nupic.core,akhilaananthram\/nupic.core,Bemujo\/https-github.com-numenta-nupic,metaml\/nupic.core,brev\/nupic.core,rcrowder\/nupic.core,sambitgaan\/nupic.core,ywcui1990\/nupic.core,lscheinkman\/nupic.core,numenta\/nupic.core,jaredweiss\/nupic.core,pettitda\/nupic.core,jaredweiss\/nupic.core,pettitda\/nupic.core,scottpurdy\/nupic.core,metaml\/nupic.core,Bemujo\/https-github.com-numenta-nupic,rhyolight\/nupic.core,sambitgaan\/nupic.core,rhyolight\/nupic.core,jaredweiss\/nupic.core,numenta\/htmresearch-core,ywcui1990\/nupic.core,ywcui1990\/nupic.core,pettitda\/nupic.core,numenta\/htmresearch-core,EricSB\/nupic.core,breznak\/nupic.core,breznak\/nupic.core,brev\/nupic.core,ywcui1990\/nupic.core,scottpurdy\/nupic.core,brev\/nupic.core,lscheinkman\/nupic.core,lscheinkman\/nupic.core,metaml\/nupic.core,neuroidss\/nupic.core,subutai\/nupic.core,EricSB\/nupic.core,utensil\/nupic.core,akhilaananthram\/nupic.core,lscheinkman\/nupic.core,Bemujo\/https-github.com-numenta-nupic,utensil\/nupic.core,jaredweiss\/nupic.core,sambitgaan\/nupic.core,utensil\/nupic.core,rhyolight\/nupic.core,scottpurdy\/nupic.core,rcrowder\/nupic.core,neuroidss\/nupic.core,neuroidss\/nupic.core,metaml\/nupic.core,numenta\/nupic.core,numenta\/htmresearch-core,akhilaananthram\/nupic.core,numenta\/nupic.core,Bemujo\/https-github.com-numenta-nupic,akhilaananthram\/nupic.core,subutai\/nupic.core,rhyolight\/nupic.core,utensil\/nupic.core,scottpurdy\/nupic.core,subutai\/nupic.core,subutai\/nupic.core,neuroidss\/nupic.core,numenta\/htmresearch-core,rcrowder\/nupic.core,EricSB\/nupic.core,breznak\/nupic.core,pettitda\/nupic.core,breznak\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 19\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32; \n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n matchingSegments @16 :List(UInt32);\n matchingCells @17 :List(UInt32);\n predictedSegmentDecrement @18 :Float32;\n}\n","old_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 19\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32; \n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n matchingSegments @16 :List(UInt32);\n matchingCells @17 :List(UInt32);\n permanenceOrphanDecrement @18 :Float32;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"f3e86e6de3056f19b28857c293a095db3546f497","subject":"Update marketing version.","message":"Update marketing version.\n","repos":"ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite,ocdtrekkie\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 7, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"2012.05.31 (1.5.6+)\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 7, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9b2e039da2bccd70274095042ef8869fca4a4d9a","subject":"update sandstorm metadata for appVersion 19 release","message":"update sandstorm metadata for appVersion 19 release\n","repos":"wekan\/wekan,wekan\/wekan,johnleeming\/wekan,mario-orlicky\/wekan,Serubin\/wekan,oliver4u\/sap-wekan,oliver4u\/WEKAN_runpartner,oliver4u\/WEKAN_runpartner,libreboard\/libreboard,johnleeming\/wekan,oliver4u\/sap-wekan,mario-orlicky\/wekan,mario-orlicky\/wekan,jtickle\/wekan,libreboard\/libreboard,Serubin\/wekan,oliver4u\/WEKAN_runpartner,jtickle\/wekan,nztqa\/wekan,wekan\/wekan,GhassenRjab\/wekan,nztqa\/wekan,nztqa\/wekan,ddanssaert\/wekan,ddanssaert\/wekan,GhassenRjab\/wekan,GhassenRjab\/wekan,wekan\/wekan,johnleeming\/wekan,oliver4u\/sap-wekan,jtickle\/wekan,johnleeming\/wekan,wekan\/wekan,ddanssaert\/wekan,Serubin\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 19,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.16.0~2017-03-21\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wefork\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n upstreamAuthor = \"Maxime Quandalle\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"meta\/dwrensha-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 17,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0~2016-11-28\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wefork\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n upstreamAuthor = \"Maxime Quandalle\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"meta\/dwrensha-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"5fc652c2bda068ca61dda12863523d809f4142bc","subject":"replaced the MatchOpen with MatchStatus which is more useful","message":"replaced the MatchOpen with MatchStatus which is more useful\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/common\/command.capnp","new_file":"src\/common\/command.capnp","new_contents":"@0xc6f85ffb87e200e2;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::common\");\n\nusing Entity = import \"entity.capnp\";\nusing Metadata = import \"metadata.capnp\";\nusing Physics = import \"physics.capnp\";\nusing Rule = import \"rule.capnp\";\n\nstruct Registration\n{\n version @0 :Metadata.Version;\n teamName @1 :Entity.TeamName;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct MatchStatus\n{\n playMode @0 :Rule.PlayMode;\n score @1 :Rule.Score;\n gameTime @2 :Physics.NanoSecond;\n}\n\nstruct MatchClose\n{\n finalScore @0 :Rule.Score;\n}\n\nenum AbortReason\n{\n registrationTimeOut @0;\n otherTeamDisconnect @1;\n}\n\nstruct MatchAbort\n{\n reason @0 :AbortReason;\n score @1 :Rule.Score;\n}\n","old_contents":"@0xc6f85ffb87e200e2;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::common\");\n\nusing Entity = import \"entity.capnp\";\nusing Metadata = import \"metadata.capnp\";\nusing Rule = import \"rule.capnp\";\n\nstruct Registration\n{\n version @0 :Metadata.Version;\n teamName @1 :Entity.TeamName;\n uniform @2 :Entity.UniformNumber;\n playerType @3 :Entity.PlayerType;\n}\n\nstruct MatchOpen\n{\n playMode @0 :Rule.PlayMode;\n}\n\nstruct MatchClose\n{\n finalScore @0 :Rule.Score;\n}\n\nenum AbortReason\n{\n registrationTimeOut @0;\n otherTeamDisconnect @1;\n}\n\nstruct MatchAbort\n{\n reason @0 :AbortReason;\n score @1 :Rule.Score;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"e3553ab226aa0827c0b5b9585e6edf895bd84736","subject":"Add 'next id' comment to LinkProto schema.","message":"Add 'next id' comment to LinkProto schema.\n","repos":"rcrowder\/nupic.core,subutai\/nupic.core,jaredweiss\/nupic.core,akhilaananthram\/nupic.core,breznak\/nupic.core,ywcui1990\/nupic.core,ywcui1990\/nupic.core,subutai\/nupic.core,metaml\/nupic.core,akhilaananthram\/nupic.core,rhyolight\/nupic.core,lscheinkman\/nupic.core,rhyolight\/nupic.core,sambitgaan\/nupic.core,subutai\/nupic.core,numenta\/htmresearch-core,pettitda\/nupic.core,EricSB\/nupic.core,numenta\/nupic.core,numenta\/htmresearch-core,numenta\/htmresearch-core,metaml\/nupic.core,utensil\/nupic.core,numenta\/nupic.core,numenta\/htmresearch-core,breznak\/nupic.core,akhilaananthram\/nupic.core,Bemujo\/https-github.com-numenta-nupic,Bemujo\/https-github.com-numenta-nupic,jaredweiss\/nupic.core,pettitda\/nupic.core,ywcui1990\/nupic.core,rhyolight\/nupic.core,breznak\/nupic.core,scottpurdy\/nupic.core,rcrowder\/nupic.core,Bemujo\/https-github.com-numenta-nupic,scottpurdy\/nupic.core,utensil\/nupic.core,pettitda\/nupic.core,neuroidss\/nupic.core,brev\/nupic.core,pettitda\/nupic.core,jaredweiss\/nupic.core,sambitgaan\/nupic.core,EricSB\/nupic.core,utensil\/nupic.core,rcrowder\/nupic.core,neuroidss\/nupic.core,brev\/nupic.core,utensil\/nupic.core,neuroidss\/nupic.core,breznak\/nupic.core,sambitgaan\/nupic.core,rcrowder\/nupic.core,scottpurdy\/nupic.core,metaml\/nupic.core,lscheinkman\/nupic.core,neuroidss\/nupic.core,EricSB\/nupic.core,numenta\/nupic.core,ywcui1990\/nupic.core,brev\/nupic.core,brev\/nupic.core,lscheinkman\/nupic.core,rhyolight\/nupic.core,Bemujo\/https-github.com-numenta-nupic,numenta\/nupic.core,EricSB\/nupic.core,metaml\/nupic.core,sambitgaan\/nupic.core,scottpurdy\/nupic.core,lscheinkman\/nupic.core,subutai\/nupic.core,jaredweiss\/nupic.core,akhilaananthram\/nupic.core","old_file":"src\/nupic\/proto\/LinkProto.capnp","new_file":"src\/nupic\/proto\/LinkProto.capnp","new_contents":"@0x9d7ec2149bcaf713;\n\n# Next ID: 6\nstruct LinkProto {\n type @0 :Text;\n params @1 :Text;\n\n srcRegion @2 :Text;\n srcOutput @3 :Text;\n\n destRegion @4 :Text;\n destInput @5 :Text;\n}\n","old_contents":"@0x9d7ec2149bcaf713;\n\nstruct LinkProto {\n type @0 :Text;\n params @1 :Text;\n\n srcRegion @2 :Text;\n srcOutput @3 :Text;\n\n destRegion @4 :Text;\n destInput @5 :Text;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"33cab03a7bc8212c00b4d2ab432d04ddbde365da","subject":"catalog.capnp: add symlink type to file","message":"catalog.capnp: add symlink type to file\n","repos":"zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm","old_file":"catalog.capnp","new_file":"catalog.capnp","new_contents":"using Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n }\n}\n","old_contents":"using Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit code.\n # It is assumed that this command does not do anything destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"b6a159916a36f82346cdd5337577b2d790f31587","subject":"Add appMarketingVersion","message":"Add appMarketingVersion\n","repos":"ocdtrekkie\/draw,neynah\/draw,neynah\/draw,ocdtrekkie\/draw,ocdtrekkie\/draw,neynah\/draw","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x8b8d9e21789be80e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"1gda5n8p8zsc0r9pcana2yjgtvsq169068k4ve8mk68z4x9fvzuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"EtherDraw\"),\n\n appVersion = 0, # Increment this for every release.\n\tappMarketingVersion = (defaultText = \"0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New EtherDraw\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9002\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x8b8d9e21789be80e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"1gda5n8p8zsc0r9pcana2yjgtvsq169068k4ve8mk68z4x9fvzuh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"EtherDraw\"),\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New EtherDraw\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9002\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"433e5fb79a1ea7089b6bf04ca12b1f4de838e6d8","subject":".sandstorm: add icons to pkgdef","message":".sandstorm: add icons to pkgdef\n","repos":"zombiezen\/sandpass,zombiezen\/sandpass,zombiezen\/sandpass","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.2.1\"),\n\n actions = [\n ( title = (defaultText = \"New database\"),\n nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/icons\/appGrid.svg\"),\n appGrid = (svg = embed \"..\/icons\/appGrid.svg\"),\n grain = (svg = embed \"..\/icons\/grain.svg\"),\n market = (svg = embed \"..\/icons\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n changeLog = (defaultText = embed \"..\/CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/js\",\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\")\n ),\n ( name = \"write\",\n title = (defaultText = \"Write to database\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true]\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","old_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.2.1\"),\n\n actions = [\n ( title = (defaultText = \"New database\"),\n nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n changeLog = (defaultText = embed \"..\/CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/js\",\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\")\n ),\n ( name = \"write\",\n title = (defaultText = \"Write to database\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true]\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"bccd16c7bfac957af762439d0bdde5e817e78977","subject":"increment appVersion","message":"increment appVersion\n","repos":"jacksingleton\/hacker-slides,Eynaliyev\/hacker-slides,paulproteus\/hacker-slides,paulproteus\/hacker-slides,paulproteus\/hacker-slides,nicolastrres\/hacker-slides,FFrancieli\/hacker-slides,FFrancieli\/hacker-slides,nicolastrres\/hacker-slides,nicolastrres\/hacker-slides,cben\/hacker-slides,cben\/hacker-slides,neynah\/hacker-slides,jacksingleton\/hacker-slides,neynah\/hacker-slides,neynah\/hacker-slides,jacksingleton\/hacker-slides,FFrancieli\/hacker-slides,jacksingleton\/hacker-slides,cben\/hacker-slides,FFrancieli\/hacker-slides,neynah\/hacker-slides,Eynaliyev\/hacker-slides,nicolastrres\/hacker-slides,Eynaliyev\/hacker-slides,jacksingleton\/hacker-slides,Eynaliyev\/hacker-slides,cben\/hacker-slides,paulproteus\/hacker-slides","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New HackerSlides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New HackerSlides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"26ea0630befe6a36409494d4c866a2a7254b8589","subject":"Bump to v4 (upstream v0.4.3)","message":"Bump to v4 (upstream v0.4.3)\n","repos":"jparyani\/Mailpile,jparyani\/Mailpile,jparyani\/Mailpile","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xc3217fd74cd95974;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"0s6hcw325yjs22c03hh09uyr0wxy8r09qet34637kep6tncfh9uh\",\n\n manifest = (\n appVersion = 4,\n\n actions = [\n ( title = (defaultText = \"New Mailpile Mailbox\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ),\n # Include source directory.\n\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\" ),\n # Include Sandstorm protocol schemas (especially email.capnp).\n\n ( sourcePath = \"\/bin\/busybox\", packagePath = \"bin\/sh\" ),\n # Map bin\/sh to busybox.\n\n ( sourcePath = \"\/\", hidePaths = [ \"home\", \"proc\", \"sys\", \"lib\/x86_64-linux-gnu\/libnss_myhostname.so.2\" ] ),\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\", packagePath = \"usr\/include\" )\n # Map root dir.\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n alwaysInclude = [ \"mailpile\", \"plugins\", \"static\" ]\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"\/run-sandstorm.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"PYTHONPATH\", value = \"\/usr\/include\")\n ]\n);\n","old_contents":"@0xc3217fd74cd95974;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n id = \"0s6hcw325yjs22c03hh09uyr0wxy8r09qet34637kep6tncfh9uh\",\n\n manifest = (\n appVersion = 2,\n\n actions = [\n ( title = (defaultText = \"New Mailpile Mailbox\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ),\n # Include source directory.\n\n ( sourcePath = \"\/opt\/sandstorm\/latest\/usr\/include\/sandstorm\" ),\n # Include Sandstorm protocol schemas (especially email.capnp).\n\n ( sourcePath = \"\/bin\/busybox\", packagePath = \"bin\/sh\" ),\n # Map bin\/sh to busybox.\n\n ( sourcePath = \"\/\", hidePaths = [ \"home\", \"proc\", \"sys\", \"lib\/x86_64-linux-gnu\/libnss_myhostname.so.2\" ] )\n # Map root dir.\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n alwaysInclude = [ \"mailpile\", \"plugins\", \"static\" ]\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"\/run-sandstorm.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"4e487dd0eba2eb68135402603a423bc93c5c10f5","subject":"pull in updated rpc.capnp","message":"pull in updated rpc.capnp\n","repos":"dwrensha\/capnproto-rust,danburkert\/capnproto-rust,maurer\/capnproto-rust,larquin\/capnproto-rust,tempbottle\/capnproto-rust,placrosse\/capnproto-rust","old_file":"capnp-rpc\/rpc.capnp","new_file":"capnp-rpc\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to convert a persistent capability reference into a live one.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf services. This\n# level should be considered only a temporary stepping-stone toward level 1 as the lack of object\n# references drastically changes how protocols are designed. Applications _should not_ attempt\n# to design their protocols around the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities -- i.e. capabilities that remain valid even after disconnect, and can be restored\n# on a future connection.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message which replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages which (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` which had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are to other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller still wants to receive it \/ hasn't yet finished processing it. It could\n # also be useful to notify the server that it need not marshal the results because the caller\n # doesn't want them anyway, even if the caller is still sending pipelined calls, although this\n # seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, which eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise which is known to resolve back to a\n # capability hoste by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise which is known to resolve to a third-party\n # capability which the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target @1 :MessageTarget;\n # What is to be saved.\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released -- thus\n # `Delete` behaves like POSIX's `unlink()` when called on a file that is currently open.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `ReleaseEmbargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `ReleaseEmbargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = AnyPointer;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = AnyPointer;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to convert a persistent capability reference into a live one.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf services. This\n# level should be considered only a temporary stepping-stone toward level 1 as the lack of object\n# references drastically changes how protocols are designed. Applications _should not_ attempt\n# to design their protocols around the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities -- i.e. capabilities that remain valid even after disconnect, and can be restored\n# on a future connection.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message which replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages which (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherAnswer` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` which had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the results other than the ones listed below should be implicitly\n # released.\n # 3) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are to other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not requried\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and (2)? It would be possible and useful to notify the\n # server that it doesn't need to keep around the response to service pipeline requests even\n # though the caller still wants to receive it \/ hasn't yet finished processing it. It could\n # also be useful to notify the server that it need not marshal the results because the caller\n # doesn't want them anyway, even if the caller is still sending pipelined calls, although this\n # seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forgot to\n # set it they'd never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, which eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise which is known to resolve back to a\n # capability hoste by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise which is known to resolve to a third-party\n # capability which the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `results` is a SturdyRef.\n\n target @1 :MessageTarget;\n # What is to be saved.\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement public singleton services that exist for the\n # lifetime of the host process and probably have non-secret names. A level 0 receiver of\n # `Restore` should never actually send a `Return` message, but should simply expect `Call`\n # messages addressed to the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender\n # of `Restore` can ignore the corresponding `Return` and just keep addressing the\n # `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released -- thus\n # `Delete` behaves like POSIX's `unlink()` when called on a file that is currently open.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty (null) result.\n\n objectId @1 :SturdyRefObjectId;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `ReleaseEmbargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `ReleaseEmbargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct SturdyRef {\n # **(level 2)**\n #\n # A combination of a SturdyRefObjectId and SturdyRefHostId. This is what a client of the ref\n # would typically save in its own storage. This type is also the result of a `Save` message.\n\n hostId @0 :SturdyRefHostId;\n # Describes how to connect to and authenticate a vat that hosts this SturdyRef (and can therefore\n # accept a `Restore` message for it).\n\n objectId @1 :SturdyRefObjectId;\n # The opaque ref in the scope of the host vat, to be sent in the `Restore` message.\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident in assigning blame.\n\n durability @2 :Durability;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n enum Durability {\n permanent @0; # Retrying the exact same operation will fail in the same way.\n temporary @1; # Retrying the exact same operation might succeed.\n overloaded @2; # The error may be due to the system being overloaded. Retrying may work\n # later on, but for now the caller should not retry right away as this will\n # likely exacerbate the problem.\n }\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRefHostId = AnyPointer;\n# **(level 2)**\n#\n# Identifies the host of a persistent capability which can be restored using a `Restore` message.\n# That is, this identifies where the `Restore` message should be sent, but does not provide any\n# part of the `Restore` message's content. `SturdyRefHostId` is usually paired with a\n# `SturdyRefObjectId`, often in the form of a `SturdyRef`.\n#\n# `SturdyRefHostId` could be as simple as a network address and public key fingerprint. Or, it\n# might be more complicated or abstract. For example, on some kinds of networks, `SturdyRefHostId`\n# might be an abstract service name without any information on where that service is physically\n# located; the network itself might provide a separate service for mapping such names to locations.\n# It could even be the case that a particular service name maps to a group of vats, where any vat\n# in the group is able to restore the ref. Such an approach would make `SturdyRefHostId`s more\n# robust against changes in network topology.\n\nusing SturdyRefObjectId = AnyPointer;\n# **(mostly level 2)**\n#\n# A SturdyRefObjectId identifies a persistent object which may be restored later, within the scope\n# of some host. The contents of a SturdyRefObjectId are entirely determined by the vat that hosts\n# it. In fact, different vats on the same network may actually use different definitions for\n# SturdyRefObjectId, so SturdyRefObjectId is not actually parameterized per-network but rather\n# per-vat. A SturdyRefObjectId is typically paired with a `SturdyRefHostId` (in a\n# `SturdyRef`) which describes how to find a vat capable of restoring the ref.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToRefHost(hostId :SturdyRefHostId) :Connection;\n# # Connect to the given SturdyRef host. The transport should return a promise which does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"8699769e93bf542bcd0cb6d7d4c4075937946939","subject":"Etherpad doesn't want to start unless we always-include node_modules. Haven't figured out why, but this only adds 400k to the spk so whatever.","message":"Etherpad doesn't want to start unless we always-include node_modules. Haven't figured out why, but this only adds 400k to the spk so whatever.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 13, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\", \"node_modules\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 13, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.6.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n nounPhrase = (defaultText = \"pad\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/etherpad-128.svg\"),\n grain = (svg = embed \"app-graphics\/etherpad-24.svg\"),\n market = (svg = embed \"app-graphics\/etherpad-150.svg\"),\n ),\n\n website = \"http:\/\/etherpad.org\/\",\n codeUrl = \"https:\/\/github.com\/kentonv\/etherpad-lite\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"kenton@sandstorm.io\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Etherpad Foundation\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Document editor\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f9e3b317d499cb835069c184a32efe4e4083b641","subject":"Going to need to bump app version.","message":"Going to need to bump app version.\n","repos":"ashwini-angular\/etherpad-lite,ashwini-angular\/etherpad-lite,ashwini-angular\/etherpad-lite,ashwini-angular\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 6, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"reader\"),\n permissions = [false],\n verbPhrase = (defaultText = \"can read\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 5, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"1.5.6\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"reader\"),\n permissions = [false],\n verbPhrase = (defaultText = \"can read\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"05b6a8374b381162c3635c06a99c6c4d60c0c78c","subject":"Set appTitle and bump version.","message":"Set appTitle and bump version.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 4, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"a901d43e8023309d3264d615e7b9d07e7be1d79e","subject":"Remove references to obsolete isCallersFault","message":"Remove references to obsolete isCallersFault\n\nAt some point isCallersFault was marked as obsolete, but the description\nof abort still referenced it, suggesting particular usage. This patch\nremoves said references.\n\nSince `git-diff` does *such* a good job with prose: This just removes\nthe two parentheticals and re-flows the paragraph.\n","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message or because the sender had an\n # internal error. The sender will shut down the outgoing half of the connection after `abort`\n # and will completely close the connection shortly thereafter (it's up to the sender how much\n # of a time buffer they want to offer for the client to receive the `abort` before the\n # connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` message sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n#\n# The protocol is significantly more complicated than most RPC protocols. However, this is\n# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented\n# programming. That is, just like TCP is a surprisingly complicated protocol that implements a\n# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol\n# that implements a conceptually-simple object abstraction.\n#\n# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E\n# programming language:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of objects and talks to other\n# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats\n# and processes (in the unix sense of the word), although this is not strictly always true (one\n# process could run multiple vats, or a distributed virtual vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" that is neither the sender nor the\n# receiver. Documentation is generally written from the point of view of the sender.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# When a new connection is formed, the only interesting things that can be done are to send a\n# `Bootstrap` (level 0) or `Accept` (level 3) message.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application. The goal is to support \"E-Order\",\n# which states that two calls made on the same reference must be delivered in the order which they\n# were made:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support that an\n# implementation may target. For many applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. Only the bootstrap interface\n# can be called. At this level, the implementation does not support object-oriented protocols and\n# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only\n# a temporary stepping-stone toward level 1 as the lack of object references drastically changes\n# how protocols are designed. Applications _should not_ attempt to design their protocols around\n# the limitations of level 0 implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability\n# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a\n# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do\n# not support checking if two capabilities received from different vats actually point to the\n# same object (\"join\"), although they should be able to do this check on capabilities received\n# from the same vat.\n#\n# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities\n# that remain valid even after disconnect, and can be restored on a future connection. When a\n# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used\n# to restore the capability later.\n#\n# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A)\n# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically\n# form a direct connection to Vat C rather than have requests be proxied through Vat A.\n#\n# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities\n# are equivalent).\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic two-party network\n# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired\n# with a container proxy, the contained app effectively gets to make full use of the proxy's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* get the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all future calls to them throw\n# exceptions). All exports and answers are implicitly released. The only things not lost are\n# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the sender's question table (which corresponds to the receiver's answer\n# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in\n# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller\n# messages until a Return message is sent.\n\nusing AnswerId = QuestionId;\n# **(level 0)**\n#\n# Identifies an answer in the sender's answer table (which corresponds to the receiver's question\n# table).\n#\n# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the sender's export table (which corresponds\n# to the receiver's import table). The exporter chooses an ID before sending a capability over the\n# wire. If the capability is already in the table, the exporter should reuse the same ID. If the\n# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID\n# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in\n# this case, the importer shall expect a later `Resolve` message that replaces the promise.\n#\n# ExportId\/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the\n# wire (from the exporter to the importer), the export's reference count is incremented (unless\n# otherwise specified). The reference count is later decremented by a `Release` message. Since\n# the `Release` message can specify an arbitrary number by which to reduce the reference count, the\n# importer should usually batch reference decrements and only send a `Release` when it believes the\n# reference count has hit zero. Of course, it is possible that a new reference to the export is\n# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to\n# keep track of the reference count on its end as well to avoid race conditions.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state after disconnect (although a transport layer could implement a concept of\n# persistent connections if it is transparent to the RPC layer).\n\nusing ImportId = ExportId;\n# **(level 1)**\n#\n# Identifies an imported capability or promise in the sender's import table (which corresponds to\n# the receiver's export table).\n#\n# ImportId is physically equivalent to ExportId, since the export and import tables correspond,\n# but we define a separate type for documentation purposes: we always use the type representing\n# the sender's point of view.\n#\n# An `ImportId` remains valid in importer -> exporter messages until the importer has sent\n# `Release` messages that (it believes) have reduced the reference count to zero.\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # The sender previously received this message from the peer but didn't understand it or doesn't\n # yet implement the functionality that was requested. So, the sender is echoing the message\n # back. In some cases, the receiver may be able to recover from this by pretending the sender\n # had taken some appropriate \"null\" action.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The level 0 implementation will echo it back as\n # `unimplemented`. The original sender can then simply release the cap to which the promise\n # had resolved, thus avoiding a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the original sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface.\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution.\n\n # Level 2 features -----------------------------------------------\n\n obsoleteSave @7 :AnyPointer;\n # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n # by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n # implemented.\n\n obsoleteDelete @9 :AnyPointer;\n # Obsolete way to delete a SturdyRef. This operation was never implemented.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Bootstrap {\n # **(level 0)**\n #\n # Get the \"bootstrap\" interface exported by the remote vat.\n #\n # For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n # exported by a vat. If the vat acts as a server fielding connections from clients, then the\n # bootstrap interface defines the basic functionality available to a client when it connects.\n # The exact interface definition obviously depends on the application.\n #\n # We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n # never be used. In such a world, any time you connect to a new vat, you do so because you\n # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n #\n # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n # actually return a new Cap'n Proto capability, thus introducing you to the target system via\n # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n # connections without ever using `Bootstrap`.\n #\n # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n # interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n # such as legacy DNS.\n #\n # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n # `Return` indicating an exception, or should return a dummy capability with no methods.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n deprecatedObjectId @1 :AnyPointer;\n # ** DEPRECATED **\n #\n # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n # which one to return. If this pointer is null, then the default bootstrap interface is returned.\n #\n # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple\n # bootstrap interfaces, it should instead define a single bootstarp interface that has methods\n # that return each of the other interfaces.\n #\n # **History**\n #\n # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n # (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n # (non-secret) SturdyRef.\n #\n # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n # used to obtain the main interface. Since most applications had only one main interface that\n # they wanted to restore, they tended to designate this with a null `objectId`.\n #\n # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n # multiple main interfaces by allowing them to be exported under string names. In this case,\n # `objectId` was a Text value specifying the name.\n #\n # All of this proved problematic for several reasons:\n #\n # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n # machine to connect to and would be able to immediately restore a SturdyRef on connection.\n # However, in practice, the ability to restore SturdyRefs is itself a capability that may\n # require going through an authentication process to obtain. Thus, it makes more sense to\n # define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n #\n # - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n # practice of exporting singleton services with string names. If singleton services are desired,\n # it is better to have one main interface that has methods that can be used to obtain each\n # service, in order to get all the usual benefits of schemas and type checking.\n #\n # - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n # capabilities exported by a vat are in fact not public: they are intended to be accessed only\n # by clients who are capable of forming a connection to the vat. This can lead to trouble if\n # the client itself has other clients and wishes to foward some `Restore` requests from those\n # external clients -- it has to be very careful not to allow through `Restore` requests\n # addressing the default capability.\n #\n # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n # application exports a default capability to its supervisor that provides access to\n # functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n # may publish other capabilities that may be persistent, in which case the application needs\n # to field `Restore` requests that could come from anywhere. These requests of course have to\n # pass through the supervisor, as all communications with the outside world must. But, the\n # supervisor has to be careful not to honor an external request addressing the application's\n # default capability, since this capability is privileged. Unfortunately, the default\n # capability cannot be given an unguessable name, because then the supervisor itself would not\n # be able to address it!\n #\n # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n # use in restoring SturdyRefs.\n #\n # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n # SturdyRef, but indicated that the client would not restore the ref again in the future. This\n # operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n # it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n # the utility of such an operation is questionable. You wouldn't be able to rely on it for\n # garbage collection since a client could always disappear permanently without remembering to\n # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n # design systems such that SturdyRefs never represent \"owned\" pointers.\n #\n # For example, say a SturdyRef points to an image file hosted on some server. That image file\n # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n # a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n # existence of the image in its collection.\n}\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, that identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target @1 :MessageTarget;\n # The object that should receive this call.\n\n interfaceId @2 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @3 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n allowThirdPartyTailCall @8 :Bool = false;\n # Indicates whether or not the receiver is allowed to send a `Return` containing\n # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n # will have to proxy the return in the case of a tail call to a third-party vat.\n\n params @4 :Payload;\n # The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n # the method.\n\n sendResultsTo :union {\n # Where should the return message be sent?\n\n caller @5 :Void;\n # Send the return message back to the caller (the usual).\n\n yourself @6 :Void;\n # **(level 1)**\n #\n # Don't actually return the results to the sender. Instead, hold on to them and await\n # instructions from the sender regarding what to do with them. In particular, the sender\n # may subsequently send a `Return` for some other call (which the receiver had previously made\n # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n # as the results of the other call.\n #\n # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n # field `resultsSentElsewhere` in that `Return` rather than including the results.\n #\n # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n # returning the result of a call from Vat B back to Vat A.\n #\n # In particular, the most common use case for this feature is when Vat A makes a call to a\n # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n # in the calls so that the results need not pass back through Vat B.\n #\n # For example:\n # - Alice, in Vat A, call foo() on Bob in Vat B.\n # - Alice makes a pipelined call bar() on the promise returned by foo().\n # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n # to Alice).\n # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n # Notice that bar() and bar'() are travelling in opposite directions on the same network\n # link.\n # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the\n # question ID originally assigned to the bar() call.\n # - Vat A receives bar'() and delivers it to Carol.\n # - When bar'() returns, Vat A immediately takes the results and returns them from bar().\n # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in\n # place of results.\n # - Vat A sends a `Finish` for that call to Vat B.\n # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with\n # `receivedFromYourself` set in place of the results.\n # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'().\n\n thirdParty @7 :RecipientId;\n # **(level 3)**\n #\n # The call's result should be returned to a different vat. The receiver (the callee) expects\n # to receive an `Accept` message from the indicated vat, and should return the call's result\n # to it, rather than to the sender of the `Call`.\n #\n # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n # also sends a `Return` to Vat B with `resultsSentElsewhere`.\n }\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n answerId @0 :AnswerId;\n # Equal to the QuestionId of the corresponding `Call` message.\n\n releaseParamCaps @1 :Bool = true;\n # If true, all capabilities that were in the params should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # to set it to false they'll quickly get errors.\n\n union {\n results @2 :Payload;\n # The result.\n #\n # For regular method calls, `results.content` points to the result struct.\n #\n # For a `Return` in response to an `Accept`, `results` contains a single capability (rather\n # than a struct), and `results.content` is just a capability pointer with index 0. A `Finish`\n # is still required in this case.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n resultsSentElsewhere @5 :Void;\n # This is set when returning from a `Call` that had `sendResultsTo` set to something other\n # than `caller`.\n\n takeFromOtherQuestion @6 :QuestionId;\n # The sender has also sent (before this message) a `Call` with the given question ID and with\n # `sendResultsTo.yourself` set, and the results of that other call should be used as the\n # results here.\n\n acceptFromThirdParty @7 :ThirdPartyCapId;\n # **(level 3)**\n #\n # The caller should contact a third-party vat to pick up the results. An `Accept` message\n # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n # else cares about the result either (e.g. there are no other outstanding calls pipelined on\n # the result of this one) then the callee may wish to immediately cancel the operation and\n # send back a Return message with \"canceled\" set. However, implementations are not required\n # to support premature cancellation -- instead, the implementation may wait until the call\n # actually completes and send a normal `Return` message.\n #\n # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n # possible and useful to notify the server that it doesn't need to keep around the response to\n # service pipeline requests even though the caller still wants to receive it \/ hasn't yet\n # finished processing it. It could also be useful to notify the server that it need not marshal\n # the results because the caller doesn't want them anyway, even if the caller is still sending\n # pipelined calls, although this seems less useful (just saving some bytes on the wire).\n\n questionId @0 :QuestionId;\n # ID of the call whose result is to be released.\n\n releaseResultCaps @1 :Bool = true;\n # If true, all capabilities that were in the results should be considered released. The sender\n # must not send separate `Release` messages for them. Level 0 implementations in particular\n # should always set this true. This defaults true because if level 0 implementations forget to\n # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n # set it false they'll quickly get errors.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n #\n # When implementing promise resolution, it's important to understand how embargos work and the\n # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message,\n # below.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver\n # will release the export soon after receiving `Resolve`, and the sender will not send this\n # `ExportId` again until it has been released and recycled.\n #\n # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,\n # this indicates that the sender will follow up at some point with a `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is sent again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message may or may not still be sent (the `Resolve` may have already been in-flight when\n # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer\n # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which\n # the receiver has no knowledge, because it already released it earlier. In this case, the\n # receiver should simply release the capability to which the promise resolved.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n #\n # The sender promises that from this point forth, until `promiseId` is released, it shall\n # simply forward all messages to the capability designated by `cap`. This is true even if\n # `cap` itself happens to desigate another promise, and that other promise later resolves --\n # messages sent to `promiseId` shall still go to that other promise, not to its resolution.\n # This is important in the case that the receiver of the `Resolve` ends up sending a\n # `Disembargo` message towards `promiseId` in order to control message ordering -- that\n # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even\n # if that object is itself a promise.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ImportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\nstruct Disembargo {\n # **(level 1)**\n #\n # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted.\n #\n # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an\n # application makes two calls foo() and bar() on the same capability reference, in that order,\n # the calls should be delivered in the order in which they were made. But if foo() is called\n # on a promise, and that promise happens to resolve before bar() is called, then the two calls\n # may travel different paths over the network, and thus could arrive in the wrong order. In\n # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along\n # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the\n # `Disembargo` arrives, `bar()` can then be delivered.\n #\n # There are two particular cases where embargos are important. Consider object Alice, in Vat A,\n # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two\n # cases are:\n # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo`\n # message that echos through Vat B and back, to ensure that all pipelined calls on the promise\n # have been delivered.\n # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs\n # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we\n # piggyback on the state that has already been set up to handle the handoff: the `Accept`\n # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while\n # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for\n # an example.\n #\n # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise\n # already pointed at), no embargo is needed, because the pipelined calls are delivered over the\n # same path as the later direct calls.\n #\n # Keep in mind that promise resolution happens both in the form of Resolve messages as well as\n # Return messages (which resolve PromisedAnswers). Embargos apply in both cases.\n #\n # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to\n # implement the embargo internally. When Vat A is notified of promise resolution, it could\n # send a dummy no-op call to promise P and wait for it to complete. Until that call completes,\n # all calls to the capability are queued locally. This strategy works, but is pessimistic:\n # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start\n # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be\n # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way\n # of accomplishing the same thing as a no-op call, but isn't any faster.)\n #\n # *The Tribble 4-way Race Condition*\n #\n # Any implementation of promise resolution and embargos must be aware of what we call the\n # \"Tribble 4-way race condition\", after Dean Tribble, who explained the problem in a lively\n # Friam meeting.\n #\n # Embargos are designed to work in the case where a two-hop path is being shortened to one hop.\n # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1\n # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same\n # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop\n # path (with four parties) to a 1-hop path (Alice -> Bob).\n #\n # Extending the embargo\/disembargo protocol to be able to shorted multiple hops at once seems\n # difficult. Instead, we make a rule that prevents this case from coming up:\n #\n # One a promise P has been resolved to a remove object reference R, then all further messages\n # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is\n # itself a promise, and has resolved to some other object Q, messages sent to P will still be\n # forwarded to R, not directly to Q (R will of course further forward the messages to Q).\n #\n # This rule does not cause a significant performance burden because once P has resolved to R, it\n # is expected that people sending messages to P will shortly start sending them to R instead and\n # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further\n # optimize its path.\n\n target @0 :MessageTarget;\n # What is to be disembargoed.\n\n using EmbargoId = UInt32;\n # Used in `senderLoopback` and `receiverLoopback`, below.\n\n context :union {\n senderLoopback @1 :EmbargoId;\n # The sender is requesting a disembargo on a promise that is known to resolve back to a\n # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls\n # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`\n # set to the same value as `senderLoopback`. This value is chosen by the sender, and since\n # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure\n # the value is unambiguous.\n #\n # The receiver must verify that the target capability actually resolves back to the sender's\n # vat. Otherwise, the sender has committed a protocol error and should be disconnected.\n\n receiverLoopback @2 :EmbargoId;\n # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to\n # this capability, and that Disembargo is now being echoed back.\n\n accept @3 :Void;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a promise that is known to resolve to a third-party\n # capability that the sender is currently in the process of accepting (using `Accept`).\n # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The\n # receiver should now send a `Disembargo` with `provide` set to the question ID of that\n # `Provide` message.\n #\n # See `Accept.embargo` for an example.\n\n provide @4 :QuestionId;\n # **(level 3)**\n #\n # The sender is requesting a disembargo on a capability currently being provided to a third\n # party. The question ID identifies the `Provide` message previously sent by the sender to\n # this capability. On receipt, the receiver (the capability host) shall release the embargo\n # on the `Accept` message that it has received from the third party. See `Accept.embargo` for\n # an example.\n }\n}\n\n# Level 2 message types ----------------------------------------------\n\n# See persistent.capnp.\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. A result will be\n # returned once the third party has successfully received the capability. The sender must at some\n # point send a `Finish` message as with any other call, and that message can be used to cancel the\n # whole operation.\n\n target @1 :MessageTarget;\n # What is to be provided to the third party.\n\n recipient @2 :RecipientId;\n # Identity of the third party that is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n #\n # This message is also used to pick up a redirected return -- see `Return.redirect`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability (or the call result in the case of a redirected\n # return).\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n\n embargo @2 :Bool;\n # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent,\n # and any pipelined calls will not be delivered, until the embargo is released. The receiver\n # (the capability host) will expect the provider (the vat that sent the `Provide` message) to\n # eventually send a `Disembargo` message with the field `context.provide` set to the question ID\n # of the original `Provide` message. At that point, the embargo is released and the queued\n # messages are delivered.\n #\n # For example:\n # - Alice, in Vat A, holds a promise P, which currently points toward Vat B.\n # - Alice calls foo() on P. The `Call` message is sent to Vat B.\n # - The promise P in Vat B ends up resolving to Carol, in Vat C.\n # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient.\n # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a\n # `ThirdPartyCapId` identifying Carol in Vat C.\n # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that\n # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept`\n # message.\n # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set.\n # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't\n # know anything about the mechanics of promise resolution happening under the hood, but she\n # expects that bar() will be delivered after foo() because that is the order in which she\n # initiated the calls.\n # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which\n # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability\n # are embargoed, Vat C does not deliver the call yet.\n # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C.\n # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the\n # question ID of the `Provide` message it had sent previously.\n # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo()\n # before delivering bar().\n # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from\n # Vat A, as well as deliver bar().\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities that are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies that may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinResult.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinResult.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any return, the result must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the result they receive until the\n # return they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join results before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n target @1 :MessageTarget;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key, which is used to establish\n # a direct connection.\n\n # TODO(before implementing): Change this so that multiple parts can be sent in a single Join\n # message, so that if multiple join parts are going to cross the same connection they can be sent\n # together, so that the receive can potentially optimize its handling of them. In the case where\n # all parts are bundled together, should the recipient be expected to simply return a cap, so\n # that the caller can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct MessageTarget {\n # The target of a `Call` or other messages that target a capability.\n\n union {\n importedCap @0 :ImportId;\n # This message is to a capability or promise previously imported by the caller (exported by\n # the receiver).\n\n promisedAnswer @1 :PromisedAnswer;\n # This message is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so\n # that initial startup doesn't require a round trip.\n }\n}\n\nstruct Payload {\n # Represents some data structure that might contain capabilities.\n\n content @0 :AnyPointer;\n # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into\n # `capTable`.\n\n capTable @1 :List(CapDescriptor);\n # Descriptors corresponding to the cap pointers in `content`.\n}\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer contains an index\n # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each\n # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal\n # the CapDescriptor directly to the application, but should instead wrap it in some kind of\n # callable object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n none @0 :Void;\n # There is no capability here. This `CapDescriptor` should not appear in the payload content.\n # A `none` CapDescriptor can be generated when an application inserts a capability into a\n # message and then later changes its mind and removes it -- rewriting all of the other\n # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed\n # struct or list instance is zeroed out of the message but the space is not reclaimed.\n # Hopefully this is unusual.\n\n senderHosted @1 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @2 :ExportId;\n # A promise that the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise. Note that even if the same\n # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of\n # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this\n # `CapDescriptor`) may choose not to send the `Resolve` at all.\n\n receiverHosted @3 :ImportId;\n # A capability (or promise) previously exported by the receiver (imported by the sender).\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the results of a currently-outstanding call posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n #\n # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its\n # `vine` instead.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual result struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the result in order to get the capability actually\n # being addressed. E.g. if the result is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # result of which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `Op` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `Op` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat that the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # A proxy for the third-party object exported by the sender. In CapTP terminology this is called\n # a \"vine\", because it is an indirect reference to the third-party object that snakes through the\n # sender vat. This serves two purposes:\n #\n # * Level 1 and 2 implementations that don't understand how to connect to a third party may\n # simply send calls to the vine. Such calls will be forwarded to the third-party by the\n # sender.\n #\n # * Level 3 implementations must release the vine once they have successfully picked up the\n # object from the third party. This ensures that the capability is not released by the sender\n # prematurely.\n #\n # The sender will close the `Provide` request that it has sent to the third party as soon as\n # it receives either a `Call` or a `Release` message directed at the vine.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n #\n # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy\n # world where everything always works as expected, no exceptions would ever be thrown. Clients\n # should only ever catch exceptions as a means to implement fault-tolerance, where \"fault\" can\n # mean:\n # - Bugs.\n # - Invalid input.\n # - Configuration errors.\n # - Network problems.\n # - Insufficient resources.\n # - Version skew (unimplemented functionality).\n # - Other logistical problems.\n #\n # Exceptions should NOT be used to flag application-specific conditions that a client is expected\n # to handle in an application-specific way. Put another way, in the Cap'n Proto world,\n # \"checked exceptions\" (where an interface explicitly defines the exceptions it throws and\n # clients are forced by the type system to handle those exceptions) do NOT make sense.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n type @3 :Type;\n # The type of the error. The purpose of this enum is not to describe the error itself, but\n # rather to describe how the client might want to respond to the error.\n\n enum Type {\n failed @0;\n # A generic problem occurred, and it is believed that if the operation were repeated without\n # any change in the state of the world, the problem would occur again.\n #\n # A client might respond to this error by logging it for investigation by the developer and\/or\n # displaying it to the user.\n\n overloaded @1;\n # The request was rejected due to a temporary lack of resources.\n #\n # Examples include:\n # - There's not enough CPU time to keep up with incoming requests, so some are rejected.\n # - The server ran out of RAM or disk space during the request.\n # - The operation timed out (took significantly longer than it should have).\n #\n # A client might respond to this error by scheduling to retry the operation much later. The\n # client should NOT retry again immediately since this would likely exacerbate the problem.\n\n disconnected @2;\n # The method failed because a connection to some necessary capability was lost.\n #\n # Examples include:\n # - The client introduced the server to a third-party capability, the connection to that third\n # party was subsequently lost, and then the client requested that the server use the dead\n # capability for something.\n # - The client previously requested that the server obtain a capability from some third party.\n # The server returned a capability to an object wrapping the third-party capability. Later,\n # the server's connection to the third party was lost.\n # - The capability has been revoked. Revocation does not necessarily mean that the client is\n # no longer authorized to use the capability; it is often used simply as a way to force the\n # client to repeat the setup process, perhaps to efficiently move them to a new back-end or\n # get them to recognize some other change that has occurred.\n #\n # A client should normally respond to this error by releasing all capabilities it is currently\n # holding related to the one it called and then re-creating them by restoring SturdyRefs and\/or\n # repeating the method calls used to create them originally. In other words, disconnect and\n # start over. This should in turn cause the server to obtain a new copy of the capability that\n # it lost, thus making everything work.\n #\n # If the client receives another `disconnencted` error in the process of rebuilding the\n # capability and retrying the call, it should treat this as an `overloaded` error: the network\n # is currently unreliable, possibly due to load or other temporary issues.\n\n unimplemented @3;\n # The server doesn't implement the requested method. If there is some other method that the\n # client could call (perhaps an older and\/or slower interface), it should try that instead.\n # Otherwise, this should be treated like `failed`.\n }\n\n obsoleteIsCallersFault @1 :Bool;\n # OBSOLETE. Ignore.\n\n obsoleteDurability @2 :UInt16;\n # OBSOLETE. See `type` instead.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where\n# these common definitions live.)\n#\n# Another common network type is the two-party network, in which one of the parties typically\n# interacts with the outside world entirely through the other party. In such a connection between\n# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were\n# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear\n# to Bob as if they were hosted by Alice. This network type is interesting because from the point\n# of view of a simple application that communicates with only one other party via the two-party\n# protocol, there are no three-party interactions at all, and joins are unusually simple to\n# implement, so implementing at level 4 is barely more complicated than implementing at level 1.\n# Moreover, if you pair an app implementing the two-party network with a container that implements\n# some other network, the app can then participate on the container's network just as if it\n# implemented that network directly. The types used by the two-party network are defined in\n# `rpc-twoparty.capnp`.\n#\n# The things that we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = AnyPointer;\n# **(level 2)**\n#\n# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef\n# is restored to a live object is specified along with the SturdyRef definition (i.e. not by\n# rpc.capnp).\n#\n# Generally a SturdyRef needs to specify three things:\n# - How to reach the vat that can restore the ref (e.g. a hostname or IP address).\n# - How to authenticate the vat after connecting (e.g. a public key fingerprint).\n# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose\n# format is defined by the specific vat -- the client has no need to inspect the object ID.\n# It is important that the objec ID be unguessable if the object is not public (and objects\n# should almost never be public).\n#\n# The above are only suggestions. Some networks might work differently. For example, a private\n# network might employ a special restorer service whose sole purpose is to restore SturdyRefs.\n# In this case, the entire contents of SturdyRef might be opaque, because they are intended only\n# to be forwarded to the restorer service.\n\nusing ProvisionId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the question ID used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = AnyPointer;\n# **(level 3)**\n#\n# The information that must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our\n# case, the `Provide` message's `questionId` can serve as the nonce.)\n\nusing ThirdPartyCapId = AnyPointer;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` message sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = AnyPointer;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret that can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinResult = AnyPointer;\n# **(level 4)**\n#\n# Information returned as the result to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinResult` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinResult`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connect(vatId :VatId) :Connection;\n# # Connect to the given vat. The transport should return a promise that does not\n# # resolve until authentication has completed, but allows messages to be pipelined in before\n# # that; the transport either queues these messages until authenticated, or sends them encrypted\n# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a\n# # round trip for authentication.\n#\n# accept() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connect() are returned by this method.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinResult(result :JoinResult) :Void;\n# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"b4c3d4ff604ecb377de549675d79b7f4712fdc55","subject":"catalog: document that ID cannot be zero","message":"catalog: document that ID cannot be zero\n","repos":"zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm","old_file":"catalog.capnp","new_file":"catalog.capnp","new_contents":"# Copyright 2016 The Minimal Configuration Manager Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nusing Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog and cannot be zero.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful\n # exit code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit\n # code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n ifDepsChanged @5 :List(ResourceId);\n # Command will be run only if one of the resources listed made a\n # change to the system during application. It is an error for the\n # list to be empty or for the list to contain IDs that are not in\n # the resource's dependencies list.\n }\n}\n","old_contents":"# Copyright 2016 The Minimal Configuration Manager Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nusing Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n user @0 :UserRef;\n group @1 :GroupRef;\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful\n # exit code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit\n # code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n ifDepsChanged @5 :List(ResourceId);\n # Command will be run only if one of the resources listed made a\n # change to the system during application. It is an error for the\n # list to be empty or for the list to contain IDs that are not in\n # the resource's dependencies list.\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"70fc177ecd1ea77dc7271f18fff329e34d613240","subject":"Revise comments following feedback in anticipation of merge","message":"Revise comments following feedback in anticipation of merge\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"nupic\/encoders\/scalar.capnp","new_file":"nupic\/encoders\/scalar.capnp","new_contents":"@0xfa7d16f86048a6e4;\n\n# Next ID: 10\nstruct ScalarEncoderProto {\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n radius @5 :Float32;\n resolution @6 :Float32;\n name @7 :Text;\n verbosity @8 :UInt8;\n clipInput @9 :Bool;\n}\n","old_contents":"@0xfa7d16f86048a6e4;\n\nstruct ScalarEncoderProto {\n # ScalarEncoder() constructor signature\n\n w @0 :UInt32;\n minval @1 :Float32;\n maxval @2 :Float32;\n periodic @3 :Bool;\n n @4 :UInt32;\n radius @5 :Float32;\n resolution @6 :Float32;\n name @7 :Text;\n verbosity @8 :UInt8;\n clipInput @9 :Bool;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"cfd1b1a0169024acc8dd158cbc77b3f7b1d7fe49","subject":"fixed typos","message":"fixed typos\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/csprotocol\/protocol.capnp","new_file":"src\/csprotocol\/protocol.capnp","new_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Error = import \"\/core\/error.capnp\";\nusing Metadata = import \"\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\n\nstruct TransmissionHeader\n{\n wantReliable @0 :Bool;\n wantOrdering @1 :Bool;\n unusedA @2 :Bool;\n unusedB @3 :Bool;\n unusedC @4 :Bool;\n unusedD @5 :Bool;\n unusedE @6 :Bool;\n unusedF @7 :Bool;\n channel @8 :Metadata.ChannelId;\n sequence @9 :Metadata.SequenceNumber;\n}\n\nstruct ClientTransmission\n{\n header @0 :TransmissionHeader;\n union\n {\n\tinit @1 :Command.InitRequest;\n\treconnect @2 :Command.ReconnectRequest;\n\tbye @3 :Command.ByeRequest;\n }\n}\n\nstruct ServerTransmission\n{\n header @0 :TransmissionHeader;\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tinit @3 :Command.InitReply;\n\treconnect @4 :Command.ReconnectReply;\n\tbye @5 :Command.ByeReply;\n }\n}\n","old_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Error = import \"\/core\/error.capnp\";\nusing Metadata = import \"\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\n\nstruct TransmissionHeader\n{\n wantReliable @0 :Bool;\n wantOrdering @1 :Bool;\n unusedA @2 :Bool;\n unusedB @3 :Bool;\n unusedC @4 :Bool;\n unusedD @5 :Bool;\n unusedE @6 :Bool;\n unusedF @7 :Bool;\n channel @8 :Metadata.channelId;\n sequence @9 :Metadata.SequenceNumber;\n}\n\nstruct ClientTransmission\n{\n header @0 :TransmissionHeader\n union\n {\n\tinit @1 :Command.InitRequest;\n\treconnect @2 :Command.ReconnectRequest;\n\tbye @3 :Command.ByeRequest;\n }\n}\n\nstruct ServerTransmission\n{\n header @0 :TransmissionHeader\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tinit @3 :Command.InitReply;\n\treconnect @4 :Command.ReconnectReply;\n\tbye @5 :Command.ByeReply;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"0c71f9083db92fcb61d4bc38c7a34c331970ce9f","subject":"oops used a duplicate Capn Proto ID","message":"oops used a duplicate Capn Proto ID\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/csprotocol\/protocol.capnp","new_file":"src\/csprotocol\/protocol.capnp","new_contents":"@0xabe13ea5f0adf862;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Error = import \"\/core\/error.capnp\";\nusing Metadata = import \"\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\nusing CoreCommand = import \"\/core\/command.capnp\";\n\nstruct TransmissionHeader\n{\n wantReliable @0 :Bool;\n wantOrdering @1 :Bool;\n unusedA @2 :Bool;\n unusedB @3 :Bool;\n unusedC @4 :Bool;\n unusedD @5 :Bool;\n unusedE @6 :Bool;\n unusedF @7 :Bool;\n channel @8 :Metadata.ChannelId;\n sequence @9 :Metadata.SequenceNumber;\n}\n\nstruct ClientTransmission\n{\n header @0 :TransmissionHeader;\n union\n {\n\tinit @1 :Command.InitRequest;\n\tcontrol @2 :Void;\n }\n}\n\nstruct ServerTransmission\n{\n header @0 :TransmissionHeader;\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tinit @3 :Command.InitReply;\n\tclose @4 :CoreCommand.MatchClose;\n\tabort @5 :CoreCommand.MatchAbort;\n }\n}\n","old_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Error = import \"\/core\/error.capnp\";\nusing Metadata = import \"\/core\/metadata.capnp\";\nusing Command = import \"command.capnp\";\nusing CoreCommand = import \"\/core\/command.capnp\";\n\nstruct TransmissionHeader\n{\n wantReliable @0 :Bool;\n wantOrdering @1 :Bool;\n unusedA @2 :Bool;\n unusedB @3 :Bool;\n unusedC @4 :Bool;\n unusedD @5 :Bool;\n unusedE @6 :Bool;\n unusedF @7 :Bool;\n channel @8 :Metadata.ChannelId;\n sequence @9 :Metadata.SequenceNumber;\n}\n\nstruct ClientTransmission\n{\n header @0 :TransmissionHeader;\n union\n {\n\tinit @1 :Command.InitRequest;\n\tcontrol @2 :Void;\n }\n}\n\nstruct ServerTransmission\n{\n header @0 :TransmissionHeader;\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tinit @3 :Command.InitReply;\n\tclose @4 :CoreCommand.MatchClose;\n\tabort @5 :CoreCommand.MatchAbort;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"23e62f72069a3a0c7d085b17a202050f392c7a75","subject":"Bumped ordinal number in date.capnp","message":"Bumped ordinal number in date.capnp\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"src\/nupic\/encoders\/date.capnp","new_file":"src\/nupic\/encoders\/date.capnp","new_contents":"@0x9b23d989c61ef9e6;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","old_contents":"@0x9b23d989c61ef9e5;\n\nusing import \"\/nupic\/encoders\/scalar.capnp\".ScalarEncoderProto;\n\nstruct DateEncoderProto {\n name @0 :Text;\n seasonEncoder @1 :ScalarEncoderProto;\n dayOfWeekEncoder @2 :ScalarEncoderProto;\n weekendEncoder @3 :ScalarEncoderProto;\n customDaysEncoder @4 :ScalarEncoderProto;\n holidayEncoder @5 :ScalarEncoderProto;\n timeOfDayEncoder @6 :ScalarEncoderProto;\n hourOfWeekEncoder @6 :ScalarEncoderProto;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"211506ba09fc4078104190d186fac75b9c90fda6","subject":"trying to get an ask api call working","message":"trying to get an ask api call working\n","repos":"rustyrazorblade\/killranswers,rustyrazorblade\/killranswers","old_file":"killranswers.capnp","new_file":"killranswers.capnp","new_contents":"@0xce4c7cd66480f6f2;\n\ninterface KillrAnswers {\n ask @0 (i :Text) -> (questionId: Text);\n}\n\nstruct Question {\n questionId @0 : Text;\n questionText @1 : Text;\n}\n\nstruct Category {\n categoryId @0 : Text;\n}\n","old_contents":"@0xce4c7cd66480f6f2;\n\ninterface KillrAnswers {\n struct Question {\n questionId @0 : Text;\n questionText @1 : Text;\n }\n\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"40b4cdc06f3f25024f459ed1416b56f825258b8c","subject":"Fix SignedCtrlPld comment in capnp schema (#2479)","message":"Fix SignedCtrlPld comment in capnp schema (#2479)\n\n","repos":"netsec-ethz\/scion,netsec-ethz\/scion,Oncilla\/scion,Oncilla\/scion,netsec-ethz\/scion,netsec-ethz\/scion,Oncilla\/scion,Oncilla\/scion","old_file":"proto\/sign.capnp","new_file":"proto\/sign.capnp","new_contents":"@0x99440334ec0946a0;\nusing Go = import \"go.capnp\";\n$Go.package(\"proto\");\n$Go.import(\"github.com\/scionproto\/scion\/go\/proto\");\n\nstruct SignedBlob {\n blob @0 :Data;\n sign @1 :Sign;\n}\n\nstruct Sign {\n # Signature type. If this is `none`, then the rest of this struct should be ignored.\n type @0 :SignType;\n # Id (e.g. ISD-AS) of signer. Unset if signType is `none`.\n src @1 :Data;\n # Signature over blob, type (represented as a UTF-8 string, e.g.,\n # \"ed25519\"), src, and timestamp (represented in network-byte order) using\n # signType, created by src. Unset if signType is `none`.\n signature @2 :Data;\n # Signature creation time. Seconds since Unix Epoch.\n timestamp @3 :UInt32;\n}\n\nenum SignType {\n none @0;\n ed25519 @1;\n}\n","old_contents":"@0x99440334ec0946a0;\nusing Go = import \"go.capnp\";\n$Go.package(\"proto\");\n$Go.import(\"github.com\/scionproto\/scion\/go\/proto\");\n\nstruct SignedBlob {\n blob @0 :Data;\n sign @1 :Sign;\n}\n\nstruct Sign {\n # Signature type. If this is `none`, then the rest of this struct should be ignored.\n type @0 :SignType;\n # Id (e.g. ISD-AS) of signer. Unset if signType is `none`.\n src @1 :Data;\n # Signature over blob, using signType, created by src. Unset if signType is `none`.\n signature @2 :Data;\n # Signature creation time. Seconds since Unix Epoch.\n timestamp @3 :UInt32;\n}\n\nenum SignType {\n none @0;\n ed25519 @1;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"56e7760f39ceae86a2c3f093dafe21eb0dc758b3","subject":"added in a query to discover the team's registration status","message":"added in a query to discover the team's registration status\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/info.capnp","new_file":"src\/bcprotocol\/info.capnp","new_contents":"@0xc9dafaeac85c954c;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Physics = import \"\/core\/physics.capnp\";\nusing Rule = import \"\/core\/rule.capnp\";\n\nstruct ScoreQuery { }\n\nstruct ScoreResult\n{\n time @0 :Physics.NanoSecond;\n ourScore @1 :Rule.Score;\n theirScore @2 :Rule.Score;\n}\n\nstruct TimeQuery { }\n\nstruct TimeResult\n{\n time @0 :Physics.NanoSecond;\n}\n\nstruct RegistrationQuery { }\n\nstruct TeamRegistrationStatus\n{\n teamName @0 :Text;\n playerCount @1 :UInt8;\n}\n\nstruct RegistrationResult\n{\n startTime @0 :Physics.NanoSecond;\n deadLine @1 :Physics.NanoSecond;\n leftTeam @2 :TeamRegistrationStatus;\n rightTeam @3 :TeamRegistrationStatus;\n}\n","old_contents":"@0xc9dafaeac85c954c;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Physics = import \"\/core\/physics.capnp\";\nusing Rule = import \"\/core\/rule.capnp\";\n\nstruct ScoreQuery { }\n\nstruct ScoreResult\n{\n time @0 :Physics.Nanoseconds;\n ourScore @1 :Rule.Score;\n theirScore @2 :Rule.Score;\n}\n\nstruct TimeQuery { }\n\nstruct TimeResult\n{\n time @0 :Physics.Nanoseconds;\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"c862eeefeb49a2175ef52eca05a52fe536a82a1c","subject":"Explicitly namespace holmes","message":"Explicitly namespace holmes\n","repos":"tempbottle\/holmes,BinaryAnalysisPlatform\/holmes,chubbymaggie\/holmes,maurer\/holmes,maurer\/holmes","old_file":"server\/holmes.capnp","new_file":"server\/holmes.capnp","new_contents":"@0xaaef86128cdda946;\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n$Cxx.namespace(\"holmes\");\n\ninterface Holmes {\n # Dynamic value type for use in facts\n struct Val {\n union {\n stringVal @0 :Text;\n addrVal @1 :UInt64;\n blobVal @2 :Data;\n }\n }\n \n # Logical facts\n using FactName = Text;\n struct Fact {\n factName @0 :FactName;\n args @1 :List(Val);\n }\n\n # Argument restriction when searching\n struct TemplateVal {\n union {\n exactVal @0 :Val; #Argument must have this exact value\n unbound @1 :Void; #Argument is unrestricted\n }\n }\n\n # FactTemplate to be used as a search query\n struct FactTemplate {\n factName @0 :FactName;\n args @1 :List(TemplateVal);\n }\n \n # Callback provided by an analysis\n interface Analysis {\n analyze @0 (premises :List(Fact)) -> (derived :List(Fact));\n }\n\n # Assert a fact to the server\n set @0 (fact :Fact);\n \n # Ask the server to search for facts\n derive @1 (target :FactTemplate) -> (facts :List(Fact));\n \n # Register as an analysis\n analyzer @2 (premises :List(FactTemplate),\n\t analysis :Analysis);\n}\n","old_contents":"@0xaaef86128cdda946;\n\ninterface Holmes {\n # Dynamic value type for use in facts\n struct Val {\n union {\n stringVal @0 :Text;\n addrVal @1 :UInt64;\n blobVal @2 :Data;\n }\n }\n \n # Logical facts\n using FactName = Text;\n struct Fact {\n factName @0 :FactName;\n args @1 :List(Val);\n }\n\n # Argument restriction when searching\n struct TemplateVal {\n union {\n exactVal @0 :Val; #Argument must have this exact value\n unbound @1 :Void; #Argument is unrestricted\n }\n }\n\n # FactTemplate to be used as a search query\n struct FactTemplate {\n factName @0 :FactName;\n args @1 :List(TemplateVal);\n }\n \n # Callback provided by an analysis\n interface Analysis {\n analyze @0 (premises :List(Fact)) -> (derived :List(Fact));\n }\n\n # Assert a fact to the server\n set @0 (fact :Fact);\n \n # Ask the server to search for facts\n derive @1 (target :FactTemplate) -> (facts :List(Fact));\n \n # Register as an analysis\n analyzer @2 (premises :List(FactTemplate),\n\t analysis :Analysis);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"d6f11a6cc2203d688d20e5dab182a6091f34bb06","subject":"Prepend copyright statement to Cap'n Proto schema.","message":"Prepend copyright statement to Cap'n Proto schema.\n","repos":"google\/hat-backup,google\/hat-backup","old_file":"schema\/root.capnp","new_file":"schema\/root.capnp","new_contents":"# Copyright 2014 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n@0x81f586f4d873f6ac;\n\nstruct Snapshot {\n\tid @0 :Int64;\n\n\tfamilyName @1: Text;\n\tmsg @2 :Text;\n\n\thash @3 :Data;\n\ttreeReference @4 :Data;\n}\n\nstruct SnapshotList {\n\tsnapshots @0 :List(Snapshot);\n}\n\nstruct ChunkRef {\n\tblobId @0 :Data;\n\n\toffset @1: Int64;\n\tlength @2: Int64;\n}\n\nstruct HashRef {\n\thash @0 :Data;\n\tchunkRef @1 :ChunkRef;\n}\n\nstruct HashRefList {\n\thashRefs @0 :List(HashRef);\n}\n","old_contents":"@0x81f586f4d873f6ac;\n\nstruct Snapshot {\n\tid @0 :Int64;\n\n\tfamilyName @1: Text;\n\tmsg @2 :Text;\n\n\thash @3 :Data;\n\ttreeReference @4 :Data;\n}\n\nstruct SnapshotList {\n\tsnapshots @0 :List(Snapshot);\n}\n\nstruct ChunkRef {\n\tblobId @0 :Data;\n\n\toffset @1: Int64;\n\tlength @2: Int64;\n}\n\nstruct HashRef {\n\thash @0 :Data;\n\tchunkRef @1 :ChunkRef;\n}\n\nstruct HashRefList {\n\thashRefs @0 :List(HashRef);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"eca954fc453566938ea5990ddde94414d923e751","subject":"New App Key","message":"New App Key\n\nAccording to: https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/appid-replacements.capnp\n","repos":"JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2016.02.02 beta\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0xf808754757003fd7;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"n8cn71407n4mezn7mg0k5kkm21juuphhecc24hdf9kf56zyxm4ah\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2016.02.02 beta\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"9f51123fc5aed6df72da958101808f007d079d58","subject":"Bump sandstorm package to 0.2.0","message":"Bump sandstorm package to 0.2.0\n","repos":"sprin\/http-header-debugger,sprin\/http-header-debugger,sprin\/http-header-debugger","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0x883e6eeef30755a7;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u3agt06j2g56q9374g6j8qz2rt1jf813zxuxc0v1xehuqj33pzw0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"HTTP Header Debugger\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.2.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New debugger\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sprin\/http-header-debugger\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/sprin\/http-header-debugger\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"steffen@sprin.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Steffen Prince\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"debug HTTP proxy\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0x883e6eeef30755a7;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"u3agt06j2g56q9374g6j8qz2rt1jf813zxuxc0v1xehuqj33pzw0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Proxy Debugger\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New debugger\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n # Data which is not needed specifically to execute the app, but is useful\n # for purposes like marketing and display. These fields are documented at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#add-required-metadata\n # and (in deeper detail) in the sandstorm source code, in the Metadata section of\n # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sprin\/proxy-debugger\",\n # This should be the app's main website url.\n\n codeUrl = \"https:\/\/github.com\/sprin\/proxy-debugger\",\n # URL of the app's source code repository, e.g. a GitHub URL.\n # Required if you specify a license requiring redistributing code, but optional otherwise.\n\n license = (none = void),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n # Fields relating to the author of this app.\n\n contactEmail = \"steffen@sprin.io\",\n # Email address to contact for any issues with this app. This includes end-user support\n # requests as well as app store administrator requests, so it is very important that this be a\n # valid address with someone paying attention to it.\n\n #pgpSignature = embed \"path\/to\/pgp-signature\",\n # PGP signature attesting responsibility for the app ID. This is a binary-format detached\n # signature of the following ASCII message (not including the quotes, no newlines, and\n # replacing with the standard base-32 text format of the app's ID):\n #\n # \"I am the author of the Sandstorm.io app with the following ID: \"\n #\n # You can create a signature file using `gpg` like so:\n #\n # echo -n \"I am the author of the Sandstorm.io app with the following ID: \" | gpg --sign > pgp-signature\n #\n # Further details including how to set up GPG and how to use keybase.io can be found\n # at https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#verify-your-identity\n\n upstreamAuthor = \"Steffen Prince\",\n # Name of the original primary author of this app, if it is different from the person who\n # produced the Sandstorm package. Setting this implies that the author connected to the PGP\n # signature only \"packaged\" the app for Sandstorm, rather than developing the app.\n # Remove this line if you consider yourself as the author of the app.\n ),\n\n #pgpKeyring = embed \"path\/to\/pgp-keyring\",\n # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in\n # this manifest (as of this writing, there is only one: `author.pgpSignature`).\n #\n # To generate a keyring containing just your public key, do:\n #\n # gpg --export > keyring\n #\n # Where `` is a PGP key ID or email address associated with the key.\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"debug HTTP proxy\"),\n # A very short (one-to-three words) description of what the app does. For example,\n # \"Document editor\", or \"Notetaking\", or \"Email client\". This will be displayed under the app\n # title in the grid view in the app market.\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"3ade899279defe0bbe15f641c1bcc22d73cecb5e","subject":"using GetResult","message":"using GetResult\n","repos":"rustyrazorblade\/PunisherDB,rustyrazorblade\/PunisherDB","old_file":"ramp.capnp","new_file":"ramp.capnp","new_contents":"@0xbcc55cbe2b79513a;\n\ninterface RampInterface {\n prepare @0 (key:Text, value:Text, dependencies:List(Text), timestamp:Int64);\n commit @1 (timestamp:Int64);\n get @2 (key:Text) -> (result: GetResult);\n getVersion @3 (key:Text, timestamp:Int64) -> (result: GetResult);\n}\n\n# since a Get or GetVersion call can have no result we need a union here\nstruct GetResult {\n union {\n none @0 : Void;\n version @1 : Version;\n }\n}\n\nstruct Version {\n value @0: Text;\n timestamp @1: Int64;\n dependencies @2: List(Text);\n}\n","old_contents":"@0xbcc55cbe2b79513a;\n\ninterface RampInterface {\n prepare @0 (key:Text, value:Text, dependencies:List(Text), timestamp:Int64);\n commit @1 (timestamp:Int64);\n get @2 (key:Text) -> (value:Text, timestamp:Int64, dependencies:List(Text));\n getVersion @3 (key:Text, timestamp:Int64) -> (value:Text, timestamp:Int64, dependencies:List(Text));\n}\n\nstruct GetResult {\n union {\n none @0 : Void;\n version @1 : Version;\n }\n}\n\nstruct Version {\n value @0: Text;\n timestamp @1: Int64;\n dependencies @2: List(Text);\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"85155645f83ce6a793ed8fbbea7f7b1078cb8258","subject":"bump version of sandstorm SPK","message":"bump version of sandstorm SPK\n","repos":"Deepakkothandan\/Rocket.Chat,acaronmd\/Rocket.Chat,pitamar\/Rocket.Chat,mwharrison\/Rocket.Chat,TribeMedia\/Rocket.Chat,yuyixg\/Rocket.Chat,jbsavoy18\/rocketchat-1,ggazzo\/Rocket.Chat,VoiSmart\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,Achaikos\/Rocket.Chat,timkinnane\/Rocket.Chat,xboston\/Rocket.Chat,flaviogrossi\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,mrsimpson\/Rocket.Chat,mrsimpson\/Rocket.Chat,org100h1\/Rocket.Panda,cnash\/Rocket.Chat,qnib\/Rocket.Chat,Gyubin\/Rocket.Chat,tntobias\/Rocket.Chat,AimenJoe\/Rocket.Chat,pachox\/Rocket.Chat,timkinnane\/Rocket.Chat,cnash\/Rocket.Chat,Movile\/Rocket.Chat,TribeMedia\/Rocket.Chat,JamesHGreen\/Rocket.Chat,abduljanjua\/TheHub,ziedmahdi\/Rocket.Chat,flaviogrossi\/Rocket.Chat,mrsimpson\/Rocket.Chat,k0nsl\/Rocket.Chat,litewhatever\/Rocket.Chat,steedos\/chat,mwharrison\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,cdwv\/Rocket.Chat,igorstajic\/Rocket.Chat,AlecTroemel\/Rocket.Chat,org100h1\/Rocket.Panda,litewhatever\/Rocket.Chat,fatihwk\/Rocket.Chat,liuliming2008\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,alexbrazier\/Rocket.Chat,igorstajic\/Rocket.Chat,mrinaldhar\/Rocket.Chat,LearnersGuild\/Rocket.Chat,capensisma\/Rocket.Chat,amaapp\/ama,ggazzo\/Rocket.Chat,PavelVanecek\/Rocket.Chat,xasx\/Rocket.Chat,ealbers\/Rocket.Chat,cnash\/Rocket.Chat,haoyixin\/Rocket.Chat,inoio\/Rocket.Chat,OtkurBiz\/Rocket.Chat,AimenJoe\/Rocket.Chat,LearnersGuild\/echo-chat,NMandapaty\/Rocket.Chat,xasx\/Rocket.Chat,acaronmd\/Rocket.Chat,NMandapaty\/Rocket.Chat,pachox\/Rocket.Chat,LearnersGuild\/echo-chat,ahmadassaf\/Rocket.Chat,abhishekshukla0302\/trico,JamesHGreen\/Rocket.Chat,Flitterkill\/Rocket.Chat,mccambridge\/Rocket.Chat,steedos\/chat,tlongren\/Rocket.Chat,xasx\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,galrotem1993\/Rocket.Chat,amaapp\/ama,LeonardOliveros\/Rocket.Chat,ut7\/Rocket.Chat,4thParty\/Rocket.Chat,pitamar\/Rocket.Chat,AlecTroemel\/Rocket.Chat,PavelVanecek\/Rocket.Chat,PavelVanecek\/Rocket.Chat,mccambridge\/Rocket.Chat,ziedmahdi\/Rocket.Chat,subesokun\/Rocket.Chat,k0nsl\/Rocket.Chat,amaapp\/ama,matthewshirley\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ggazzo\/Rocket.Chat,liuliming2008\/Rocket.Chat,pachox\/Rocket.Chat,tlongren\/Rocket.Chat,inoxth\/Rocket.Chat,mrinaldhar\/Rocket.Chat,capensisma\/Rocket.Chat,litewhatever\/Rocket.Chat,abhishekshukla0302\/trico,amaapp\/ama,Sing-Li\/Rocket.Chat,Flitterkill\/Rocket.Chat,xboston\/Rocket.Chat,AimenJoe\/Rocket.Chat,klatys\/Rocket.Chat,timkinnane\/Rocket.Chat,marzieh312\/Rocket.Chat,k0nsl\/Rocket.Chat,marzieh312\/Rocket.Chat,Flitterkill\/Rocket.Chat,JamesHGreen\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,haoyixin\/Rocket.Chat,bt\/Rocket.Chat,alexbrazier\/Rocket.Chat,JamesHGreen\/Rocket_API,mccambridge\/Rocket.Chat,fduraibi\/Rocket.Chat,acaronmd\/Rocket.Chat,mrinaldhar\/Rocket.Chat,Gudii\/Rocket.Chat,wicked539\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Achaikos\/Rocket.Chat,xasx\/Rocket.Chat,TribeMedia\/Rocket.Chat,mwharrison\/Rocket.Chat,4thParty\/Rocket.Chat,pachox\/Rocket.Chat,alexbrazier\/Rocket.Chat,pitamar\/Rocket.Chat,nishimaki10\/Rocket.Chat,matthewshirley\/Rocket.Chat,k0nsl\/Rocket.Chat,flaviogrossi\/Rocket.Chat,galrotem1993\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,ut7\/Rocket.Chat,VoiSmart\/Rocket.Chat,karlprieb\/Rocket.Chat,subesokun\/Rocket.Chat,litewhatever\/Rocket.Chat,LearnersGuild\/echo-chat,inoio\/Rocket.Chat,abhishekshukla0302\/trico,Achaikos\/Rocket.Chat,Gyubin\/Rocket.Chat,danielbressan\/Rocket.Chat,VoiSmart\/Rocket.Chat,yuyixg\/Rocket.Chat,Gudii\/Rocket.Chat,qnib\/Rocket.Chat,subesokun\/Rocket.Chat,acaronmd\/Rocket.Chat,steedos\/chat,wtsarchive\/Rocket.Chat,NMandapaty\/Rocket.Chat,LearnersGuild\/echo-chat,liuliming2008\/Rocket.Chat,alexbrazier\/Rocket.Chat,karlprieb\/Rocket.Chat,Dianoga\/Rocket.Chat,TribeMedia\/Rocket.Chat,subesokun\/Rocket.Chat,fatihwk\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,steedos\/chat,snaiperskaya96\/Rocket.Chat,klatys\/Rocket.Chat,cdwv\/Rocket.Chat,cdwv\/Rocket.Chat,wtsarchive\/Rocket.Chat,LearnersGuild\/Rocket.Chat,ut7\/Rocket.Chat,matthewshirley\/Rocket.Chat,tlongren\/Rocket.Chat,cnash\/Rocket.Chat,JamesHGreen\/Rocket.Chat,pitamar\/Rocket.Chat,klatys\/Rocket.Chat,PavelVanecek\/Rocket.Chat,haoyixin\/Rocket.Chat,wicked539\/Rocket.Chat,intelradoux\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,abduljanjua\/TheHub,OtkurBiz\/Rocket.Chat,ealbers\/Rocket.Chat,marzieh312\/Rocket.Chat,JamesHGreen\/Rocket_API,Achaikos\/Rocket.Chat,ahmadassaf\/Rocket.Chat,abhishekshukla0302\/trico,haoyixin\/Rocket.Chat,Sing-Li\/Rocket.Chat,AimenJoe\/Rocket.Chat,xboston\/Rocket.Chat,danielbressan\/Rocket.Chat,Dianoga\/Rocket.Chat,flaviogrossi\/Rocket.Chat,marzieh312\/Rocket.Chat,Sing-Li\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,NMandapaty\/Rocket.Chat,mwharrison\/Rocket.Chat,klatys\/Rocket.Chat,mccambridge\/Rocket.Chat,Gudii\/Rocket.Chat,mrinaldhar\/Rocket.Chat,Gyubin\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,inoio\/Rocket.Chat,nishimaki10\/Rocket.Chat,ahmadassaf\/Rocket.Chat,karlprieb\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,Gudii\/Rocket.Chat,Flitterkill\/Rocket.Chat,bt\/Rocket.Chat,danielbressan\/Rocket.Chat,bt\/Rocket.Chat,inoxth\/Rocket.Chat,nishimaki10\/Rocket.Chat,pkgodara\/Rocket.Chat,linnovate\/hi,qnib\/Rocket.Chat,fatihwk\/Rocket.Chat,4thParty\/Rocket.Chat,jbsavoy18\/rocketchat-1,org100h1\/Rocket.Panda,ziedmahdi\/Rocket.Chat,Gyubin\/Rocket.Chat,fduraibi\/Rocket.Chat,jbsavoy18\/rocketchat-1,BorntraegerMarc\/Rocket.Chat,Movile\/Rocket.Chat,Dianoga\/Rocket.Chat,wtsarchive\/Rocket.Chat,OtkurBiz\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Movile\/Rocket.Chat,tntobias\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,ahmadassaf\/Rocket.Chat,wicked539\/Rocket.Chat,nishimaki10\/Rocket.Chat,ziedmahdi\/Rocket.Chat,LearnersGuild\/Rocket.Chat,fduraibi\/Rocket.Chat,abduljanjua\/TheHub,mrsimpson\/Rocket.Chat,fatihwk\/Rocket.Chat,qnib\/Rocket.Chat,liuliming2008\/Rocket.Chat,inoxth\/Rocket.Chat,intelradoux\/Rocket.Chat,fduraibi\/Rocket.Chat,OtkurBiz\/Rocket.Chat,Dianoga\/Rocket.Chat,igorstajic\/Rocket.Chat,intelradoux\/Rocket.Chat,Movile\/Rocket.Chat,yuyixg\/Rocket.Chat,wtsarchive\/Rocket.Chat,Sing-Li\/Rocket.Chat,xboston\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,JamesHGreen\/Rocket_API,capensisma\/Rocket.Chat,pkgodara\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,matthewshirley\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,ealbers\/Rocket.Chat,pkgodara\/Rocket.Chat,JamesHGreen\/Rocket_API,tntobias\/Rocket.Chat,LearnersGuild\/Rocket.Chat,tlongren\/Rocket.Chat,intelradoux\/Rocket.Chat,wicked539\/Rocket.Chat,galrotem1993\/Rocket.Chat,ealbers\/Rocket.Chat,inoxth\/Rocket.Chat,danielbressan\/Rocket.Chat,ut7\/Rocket.Chat,org100h1\/Rocket.Panda,4thParty\/Rocket.Chat,yuyixg\/Rocket.Chat,igorstajic\/Rocket.Chat,tntobias\/Rocket.Chat,galrotem1993\/Rocket.Chat,bt\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,jbsavoy18\/rocketchat-1,timkinnane\/Rocket.Chat,karlprieb\/Rocket.Chat,ggazzo\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,cdwv\/Rocket.Chat,abduljanjua\/TheHub,pkgodara\/Rocket.Chat,linnovate\/hi","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.7.2445\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.6\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"3dece8dbfbdac031a54decedf30d9471c4aae784","subject":"Expand comments for Brand.Scope.inherit","message":"Expand comments for Brand.Scope.inherit\n\nThe first time I learned about Cap'n Proto generics, and again this weekend while trying to relearn them, I spent a long amount of time trying to understand the meaning of Brand.Scope.inherit. I found the existing doc comment to be unhelpful: what exactly is a \"reference point\" and what does it mean to inherit from one?\r\n\r\nWhat finally made things click was to think of Brands as type substitutions, and to think of inherit as an identity substitution -- it just replaces the parameters with themselves.\r\n\r\nThis pull request expands the documentation and adds an example that should make things more clear.","repos":"mologie\/capnproto,mologie\/capnproto,mologie\/capnproto","old_file":"c++\/src\/capnp\/schema.capnp","new_file":"c++\/src\/capnp\/schema.capnp","new_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n@0xa93fc509624c72d9;\n$Cxx.namespace(\"capnp::schema\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n parameters @32 :List(Parameter);\n # If this node is parameterized (generic), the list of parameters. Empty for non-generic types.\n\n isGeneric @33 :Bool;\n # True if this node is generic, meaning that it or one of its parent scopes has a non-empty\n # `parameters`.\n\n struct Parameter {\n # Information about one of the node's parameters.\n\n name @0 :Text;\n }\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n\n superclasses @31 :List(Superclass);\n # Superclasses of this interface.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n\n struct SourceInfo {\n # Additional information about a node which is not needed at runtime, but may be useful for\n # documentation or debugging purposes. This is kept in a separate struct to make sure it\n # doesn't accidentally get included in contexts where it is not needed. The\n # `CodeGeneratorRequest` includes this information in a separate array.\n\n id @0 :Id;\n # ID of the Node which this info describes.\n\n docComment @1 :Text;\n # The top-level doc comment for the Node.\n\n members @2 :List(Member);\n # Information about each member -- i.e. fields (for structs), enumerants (for enums), or\n # methods (for interfaces).\n #\n # This list is the same length and order as the corresponding list in the Node, i.e.\n # Node.struct.fields, Node.enum.enumerants, or Node.interface.methods.\n\n struct Member {\n docComment @0 :Text;\n # Doc comment on the member.\n }\n\n # TODO(someday): Record location of the declaration in the original source code.\n }\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n const noDiscriminant :UInt16 = 0xffff;\n\n discriminantValue @3 :UInt16 = Field.noDiscriminant;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff.\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n\n hadExplicitDefault @10 :Bool;\n # Whether the default value was specified explicitly. Non-explicit default values are always\n # zero or empty values. Usually, whether the default value was explicit shouldn't matter.\n # The main use case for this flag is for structs representing method parameters:\n # explicitly-defaulted parameters may be allowed to be omitted when calling the method.\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Superclass {\n id @0 :Id;\n brand @1 :Brand;\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n implicitParameters @7 :List(Node.Parameter);\n # The parameters listed in [] (typically, type \/ generic parameters), whose bindings are intended\n # to be inferred rather than specified explicitly, although not all languages support this.\n\n paramStructType @2 :Id;\n # ID of the parameter struct type. If a named parameter list was specified in the method\n # declaration (rather than a single struct parameter type) then a corresponding struct type is\n # auto-generated. Such an auto-generated type will not be listed in the interface's\n # `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.\n # (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes\n # this a situation where you can't just climb the scope chain to find where a particular\n # generic parameter was introduced. Making the `scopeId` zero was a mistake.)\n\n paramBrand @5 :Brand;\n # Brand of param struct type.\n\n resultStructType @3 :Id;\n # ID of the return struct type; similar to `paramStructType`.\n\n resultBrand @6 :Brand;\n # Brand of result struct type.\n\n annotations @4 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n brand @21 :Brand;\n }\n struct :group {\n typeId @16 :Id;\n brand @22 :Brand;\n }\n interface :group {\n typeId @17 :Id;\n brand @23 :Brand;\n }\n\n anyPointer :union {\n unconstrained :union {\n # A regular AnyPointer.\n #\n # The name \"unconstrained\" means as opposed to constraining it to match a type parameter.\n # In retrospect this name is probably a poor choice given that it may still be constrained\n # to be a struct, list, or capability.\n\n anyKind @18 :Void; # truly AnyPointer\n struct @25 :Void; # AnyStruct\n list @26 :Void; # AnyList\n capability @27 :Void; # Capability\n }\n\n parameter :group {\n # This is actually a reference to a type parameter defined within this scope.\n\n scopeId @19 :Id;\n # ID of the generic type whose parameter we're referencing. This should be a parent of the\n # current scope.\n\n parameterIndex @20 :UInt16;\n # Index of the parameter within the generic type's parameter list.\n }\n\n implicitMethodParameter :group {\n # This is actually a reference to an implicit (generic) parameter of a method. The only\n # legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.\n\n parameterIndex @24 :UInt16;\n }\n }\n }\n}\n\nstruct Brand {\n # Specifies bindings for parameters of generics. Since these bindings turn a generic into a\n # non-generic, we call it the \"brand\".\n\n scopes @0 :List(Scope);\n # For each of the target type and each of its parent scopes, a parameterization may be included\n # in this list. If no parameterization is included for a particular relevant scope, then either\n # that scope has no parameters or all parameters should be considered to be `AnyPointer`.\n\n struct Scope {\n scopeId @0 :Id;\n # ID of the scope to which these params apply.\n\n union {\n bind @1 :List(Binding);\n # List of parameter bindings.\n\n inherit @2 :Void;\n # The place where the Brand appears is within this scope or a sub-scope, and bindings\n # for this scope are deferred to later Brand applications. This is equivalent to a\n # pass-through binding list, where each of this scope's parameters is bound to itself.\n # For example:\n #\n # struct Outer(T) {\n # struct Inner {\n # value @0 :T;\n # }\n # innerInherit @0 :Inner; # Outer Brand.Scope is `inherit`.\n # innerBindSelf @1 :Outer(T).Inner; # Outer Brand.Scope explicitly binds T to T.\n # }\n #\n # The innerInherit and innerBindSelf fields have equivalent types, but different Brand\n # styles.\n }\n }\n\n struct Binding {\n union {\n unbound @0 :Void;\n type @1 :Type;\n\n # TODO(someday): Allow non-type parameters? Unsure if useful.\n }\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :AnyPointer;\n\n enum @15 :UInt16;\n struct @16 :AnyPointer;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n anyPointer @18 :AnyPointer;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n brand @2 :Brand;\n # Brand of the annotation.\n #\n # Note that the annotation itself is not allowed to be parameterized, but its scope might be.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CapnpVersion {\n major @0 :UInt16;\n minor @1 :UInt8;\n micro @2 :UInt8;\n}\n\nstruct CodeGeneratorRequest {\n capnpVersion @2 :CapnpVersion;\n # Version of the `capnp` executable. Generally, code generators should ignore this, but the code\n # generators that ship with `capnp` itself will print a warning if this mismatches since that\n # probably indicates something is misconfigured.\n #\n # The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version\n # is older than that.\n\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n sourceInfo @3 :List(Node.SourceInfo);\n # Information about the original source code for each node, where available. This array may be\n # omitted or may be missing some nodes if no info is available for them.\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","old_contents":"# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n\n@0xa93fc509624c72d9;\n$Cxx.namespace(\"capnp::schema\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n parameters @32 :List(Parameter);\n # If this node is parameterized (generic), the list of parameters. Empty for non-generic types.\n\n isGeneric @33 :Bool;\n # True if this node is generic, meaning that it or one of its parent scopes has a non-empty\n # `parameters`.\n\n struct Parameter {\n # Information about one of the node's parameters.\n\n name @0 :Text;\n }\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n\n superclasses @31 :List(Superclass);\n # Superclasses of this interface.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n\n struct SourceInfo {\n # Additional information about a node which is not needed at runtime, but may be useful for\n # documentation or debugging purposes. This is kept in a separate struct to make sure it\n # doesn't accidentally get included in contexts where it is not needed. The\n # `CodeGeneratorRequest` includes this information in a separate array.\n\n id @0 :Id;\n # ID of the Node which this info describes.\n\n docComment @1 :Text;\n # The top-level doc comment for the Node.\n\n members @2 :List(Member);\n # Information about each member -- i.e. fields (for structs), enumerants (for enums), or\n # methods (for interfaces).\n #\n # This list is the same length and order as the corresponding list in the Node, i.e.\n # Node.struct.fields, Node.enum.enumerants, or Node.interface.methods.\n\n struct Member {\n docComment @0 :Text;\n # Doc comment on the member.\n }\n\n # TODO(someday): Record location of the declaration in the original source code.\n }\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n const noDiscriminant :UInt16 = 0xffff;\n\n discriminantValue @3 :UInt16 = Field.noDiscriminant;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff.\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n\n hadExplicitDefault @10 :Bool;\n # Whether the default value was specified explicitly. Non-explicit default values are always\n # zero or empty values. Usually, whether the default value was explicit shouldn't matter.\n # The main use case for this flag is for structs representing method parameters:\n # explicitly-defaulted parameters may be allowed to be omitted when calling the method.\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Superclass {\n id @0 :Id;\n brand @1 :Brand;\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n implicitParameters @7 :List(Node.Parameter);\n # The parameters listed in [] (typically, type \/ generic parameters), whose bindings are intended\n # to be inferred rather than specified explicitly, although not all languages support this.\n\n paramStructType @2 :Id;\n # ID of the parameter struct type. If a named parameter list was specified in the method\n # declaration (rather than a single struct parameter type) then a corresponding struct type is\n # auto-generated. Such an auto-generated type will not be listed in the interface's\n # `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.\n # (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes\n # this a situation where you can't just climb the scope chain to find where a particular\n # generic parameter was introduced. Making the `scopeId` zero was a mistake.)\n\n paramBrand @5 :Brand;\n # Brand of param struct type.\n\n resultStructType @3 :Id;\n # ID of the return struct type; similar to `paramStructType`.\n\n resultBrand @6 :Brand;\n # Brand of result struct type.\n\n annotations @4 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n brand @21 :Brand;\n }\n struct :group {\n typeId @16 :Id;\n brand @22 :Brand;\n }\n interface :group {\n typeId @17 :Id;\n brand @23 :Brand;\n }\n\n anyPointer :union {\n unconstrained :union {\n # A regular AnyPointer.\n #\n # The name \"unconstrained\" means as opposed to constraining it to match a type parameter.\n # In retrospect this name is probably a poor choice given that it may still be constrained\n # to be a struct, list, or capability.\n\n anyKind @18 :Void; # truly AnyPointer\n struct @25 :Void; # AnyStruct\n list @26 :Void; # AnyList\n capability @27 :Void; # Capability\n }\n\n parameter :group {\n # This is actually a reference to a type parameter defined within this scope.\n\n scopeId @19 :Id;\n # ID of the generic type whose parameter we're referencing. This should be a parent of the\n # current scope.\n\n parameterIndex @20 :UInt16;\n # Index of the parameter within the generic type's parameter list.\n }\n\n implicitMethodParameter :group {\n # This is actually a reference to an implicit (generic) parameter of a method. The only\n # legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.\n\n parameterIndex @24 :UInt16;\n }\n }\n }\n}\n\nstruct Brand {\n # Specifies bindings for parameters of generics. Since these bindings turn a generic into a\n # non-generic, we call it the \"brand\".\n\n scopes @0 :List(Scope);\n # For each of the target type and each of its parent scopes, a parameterization may be included\n # in this list. If no parameterization is included for a particular relevant scope, then either\n # that scope has no parameters or all parameters should be considered to be `AnyPointer`.\n\n struct Scope {\n scopeId @0 :Id;\n # ID of the scope to which these params apply.\n\n union {\n bind @1 :List(Binding);\n # List of parameter bindings.\n\n inherit @2 :Void;\n # The place where this Brand appears is actually within this scope or a sub-scope,\n # and the bindings for this scope should be inherited from the reference point.\n }\n }\n\n struct Binding {\n union {\n unbound @0 :Void;\n type @1 :Type;\n\n # TODO(someday): Allow non-type parameters? Unsure if useful.\n }\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :AnyPointer;\n\n enum @15 :UInt16;\n struct @16 :AnyPointer;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n anyPointer @18 :AnyPointer;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n brand @2 :Brand;\n # Brand of the annotation.\n #\n # Note that the annotation itself is not allowed to be parameterized, but its scope might be.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CapnpVersion {\n major @0 :UInt16;\n minor @1 :UInt8;\n micro @2 :UInt8;\n}\n\nstruct CodeGeneratorRequest {\n capnpVersion @2 :CapnpVersion;\n # Version of the `capnp` executable. Generally, code generators should ignore this, but the code\n # generators that ship with `capnp` itself will print a warning if this mismatches since that\n # probably indicates something is misconfigured.\n #\n # The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version\n # is older than that.\n\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n sourceInfo @3 :List(Node.SourceInfo);\n # Information about the original source code for each node, where available. This array may be\n # omitted or may be missing some nodes if no info is available for them.\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"e8ca80e7a32240fcb924b000040e6a53c05b91bc","subject":"Update version","message":"Update version\n","repos":"neynah\/lets-chat,neynah\/lets-chat,ashwini-angular\/lets-chat,jparyani\/lets-chat,jparyani\/lets-chat,jparyani\/lets-chat,neynah\/lets-chat,ashwini-angular\/lets-chat,ashwini-angular\/lets-chat","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"templates\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x99f9db243de9f4eb;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"qkgkaxfqhgsff8zgx2f4nf1a8xvmpte6wa19egmfkk06mzt7e8dh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Let's Chat\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Let's Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"hosts\", packagePath = \"etc\/hosts\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"33411\", \"--\", \"bash\", \"run_grain.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"5d3fe23cb6adc05a16aff4aae143f00f66d4b7a7","subject":"first draft of capnProto schema. Does not yet compile","message":"first draft of capnProto schema. Does not yet compile\n","repos":"fehlmach\/rains","old_file":"proto\/rainsMsg.capnp","new_file":"proto\/rainsMsg.capnp","new_contents":"@0xfb2d77234707241e; # unique file ID, generated by `capnp id`\nusing Go = import \"go.capnp\";\n$Go.package(\"proto\");\n$Go.import(\"proto\");\n\nstruct RainsMessage {\n #RainsMessage contains the data of a message\n\tToken @0 :Data;\n\tContent @1 :List(MessageSection);\n\tSignatures @2 :List(Signature);\n\tCapabilities @3 :List(Text);\n}\n\ninterface MessageSection {\n}\n\nconst NoCapability :Text = \"\";\nconst TLSOverTCP :Text = \"urn:x-rains:tlssrv\";\n\n\ninterface MessageSectionWithSig extends(MessageSection) {\n #MessageSectionWithSig can be either an Assertion, Shard or Zone\n\tSigs @0 () -> (sig :Signature);\n\tAddSig @1 (sig :Signature);\n\tDeleteSig @2 (int :Int32);\n\tDeleteAllSigs @3 ();\n #TODO CFE what is the syntax of a method without arguments\n\tGetContext @4 () -> (context :Text);\n\tGetSubjectZone @5 () -> (zone :Text);\n\tCreateStub @6 () -> (section :MessageSectionWithSig);\n\tValidFrom @7 () -> (validFrom :int64);\n\tValidUntil @8 () -> (validUntil :int64);\n\tHash @9 () -> (hash :Text);\n\tInterval @10 :Interval;\n}\n\ninterface Interval {\n #Interval defines an interval over strings\n\tBegin @0 () -> (begin :Text)\n\tEnd @1 () -> (end :Text)\n}\n\n\ninterface Hashable {\n #Hashable can be implemented by objects that are not natively hashable.\n\tHash @0 () -> (hash :Text);\n}\n\n\nstruct AssertionSection {\n #AssertionSection contains information about the assertion\n\tSubjectName @0 :Text;\n\tContent @1 :List(Object);\n\tSignatures @2 :List(Signature);\n\tSubjectZone @3 :Text;\n\tContext @4 :Text;\n}\n\n\nstruct ShardSection {\n #ShardSection contains information about the shard\n\tContent @0 :List(AssertionSection);\n\tSignatures @1 :List(Signature);\n\tSubjectZone @2 :Text;\n\tContext @3 :Text;\n\tRangeFrom @4 :Text;\n\tRangeTo @5 :Text;\n}\n\n\nstruct ZoneSection {\n #ZoneSection contains information about the zone\n\tSignatures @0 :List(Signature);\n\tSubjectZone @1 :Text;\n\tContext @2 :Text;\n\tContent @3 :List(MessageSectionWithSig);\n}\n\n\nstruct QuerySection {\n #QuerySection contains information about the query\n\tToken @0 :Data;\n\tName @1 :Text;\n\tContext @2 :Text;\n\tType @3 :ObjectType;\n\tExpires @4 :Int64; #time when this query expires represented as the number of seconds elapsed since January 1, 1970 UTC\n\tOptions @5 :List(QueryOption);\n}\n\nenum QueryOption {\n\tMinE2ELatency @1;\n\tMinLastHopAnswerSize @2;\n\tMinInfoLeakage @3;\n\tCachedAnswersOnly @4;\n\tExpiredAssertionsOk @5;\n\tTokenTracing @6;\n\tNoVerificationDelegation @7;\n\tNoProactiveCaching @8;\n}\n\nenum ObjectType {\n\tOTName @1;\n\tOTIP6Addr @2;\n\tOTIP4Addr @3;\n\tOTRedirection @4;\n\tOTDelegation @5;\n\tOTNameset @6;\n\tOTCertInfo @7;\n\tOTServiceInfo @8;\n\tOTRegistrar @9;\n\tOTRegistrant @10;\n\tOTInfraKey @11;\n\tOTExtraKey @12;\n}\n\nstruct SubjectAddr {\n\tAddressFamily @0 :Text;\n\tPrefixLength @1 :UInt32;\n\tAddress @2 :Text;\n}\n\n\nstruct AddressAssertionSection {\n #AddressAssertionSection contains information about the address assertion\n\tSubjectAddr @0 :SubjectAddr;\n\tContent @1 :List(Object);\n\tSignatures @2 :List(Signature);\n\tContext @3 :Text;\n}\n\n\nstruct AddressZoneSection {\n #AddressZoneSection contains information about the address zone\n\tSubjectAddr @0 :SubjectAddr;\n\tSignatures @1 :List:(Signature);\n\tContext @2 :Text;\n\tContent @3 :List(AddressAssertionSection);\n}\n\n\nstruct AddressQuerySection {\n #AddressQuerySection contains information about the address query\n\tSubjectAddr @0 :SubjectAddr;\n\tToken @1 :Data;\n\tContext @2 :Text;\n\tTypes @3 :List(Int32);\n\tExpires @4 :Int64\n\tOptions @5 :List(QueryOption);\n}\n\n\nstruct NotificationSection {\n #NotificationSection contains information about the notification\n\tToken @0 :Data;\n\tType @1 :NotificationType;\n\tData @2 :Text;\n}\n\nenum NotificationType {\n\tHeartbeat @0;\n\tCapHashNotKnown @1;\n\tBadMessage @2;\n\tRcvInconsistentMsg @3;\n\tNoAssertionsExist @4;\n\tMsgTooLarge @5;\n\tUnspecServerErr @6;\n\tServerNotCapable @7;\n\tNoAssertionAvail @8;\n}\n\n\nstruct Signature {\n #Signature on a Rains message or section\n\tKeySpace @0 :KeySpaceID;\n\tAlgorithm @1 :SignatureAlgorithmType;\n\tValidSince @2 :Int64;\n\tValidUntil @3 :Int64;\n\tData @4 :Data;\n}\n\n\nenum KeySpaceID {\n#KeySpaceID identifies a key space\n\tRainsKeySpace @0;\n}\n\n\n\nenum SignatureAlgorithmType {\n#SignatureAlgorithmType specifies a signature algorithm type\n\tEd25519 @0;\n\tEd448 @1;\n\tEcdsa256 @2;\n\tEcdsa384 @3;\n}\n\n\n\nenum HashAlgorithmType {\n#HashAlgorithmType specifies a hash algorithm type\n\tNoHashAlgo @0;\n\tSha256 @1;\n\tSha384 @2;\n\tSha512 @3;\n}\n\n\nstruct PublicKey {\n #PublicKey contains information about a public key\n\tType @0 :SignatureAlgorithmType;\n\tKey @1 :Data;\n\tValidFrom @2 :Int64;\n\tValidUntil @3 :Int64;\n}\n\n\nstruct CertificateObject {\n #CertificateObject contains certificate information\n\tType @0 :ProtocolType;\n\tUsage @1 :CertificateUsage;\n\tHashAlgo @2 :HashAlgorithmType;\n\tData @3 :Data;\n}\n\nenum ProtocolType {\n\tPTUnspecified @0;\n\tPTTLS @1;\n}\n\nenum CertificateUsage {\n\tCUTrustAnchor @0;\n\tCUEndEntity @1;\n}\n\nstruct ServiceInfo {\n #ServiceInfo contains information how to access a named service\n\tName @0 :Text;\n\tPort @1 :UInt16;\n\tPriority @2 :UInt32;\n}\n\nstruct Object {\n #Object is a container for different values determined by the given type.\n\tType @0 :ObjectType;\n\tValue @1 :Data;\n}","old_contents":"\nstruct RainsMessage {\n #RainsMessage contains the data of a message\n\tToken @0 :Data;\n\tContent @1 :List(MessageSection);\n\tSignatures @2 :List(Signature);\n\tCapabilities @3 :List(Text);\n}\n\n\n\ninterface MessageSection {\n}\n\nconst NoCapability :Text = \"\";\nconst TLSOverTCP :Text = \"urn:x-rains:tlssrv\";\n\n\ninterface MessageSectionWithSig extends(MessageSection) {\n #MessageSectionWithSig can be either an Assertion, Shard or Zone\n\tSigs @0 () -> (sig :Signature);\n\tAddSig @0 (sig :Signature);\n\tDeleteSig @0 (int :Int32);\n\tDeleteAllSigs @0 ();\n #TODO CFE what is the syntax of a method without arguments\n\tGetContext @0 () -> (context :Text);\n\tGetSubjectZone @0 () -> (zone :Text);\n\tCreateStub @0 () -> (section :MessageSectionWithSig);\n\tValidFrom @0 () -> (validFrom :int64);\n\tValidUntil @0 () -> (validUntil :int64);\n\tHash @0 () -> (hash :Text);\n\tInterval :Interval\n}\n\ntype Interval interface {\n #Interval defines an interval over strings\n\tBegin() string\n\tEnd() string\n}\n\n\/\/TotalInterval is an interval over the whole namespace\ntype TotalInterval struct{}\n\nfunc (t TotalInterval) Begin() string {\n\treturn \"\"\n}\n\nfunc (t TotalInterval) End() string {\n\treturn \"\"\n}\n\n\/\/StringInterval implements Interval for a single string value\ntype StringInterval struct {\n\tName string\n}\n\nfunc (s StringInterval) Begin() string {\n\treturn s.Name\n}\n\nfunc (s StringInterval) End() string {\n\treturn s.Name\n}\n\n\/\/Hashable can be implemented by objects that are not natively hashable.\ntype Hashable interface {\n\t\/\/Hash must return a string uniquely identifying the object\n\tHash() string\n}\n\n\/\/AssertionSection contains information about the assertion\ntype AssertionSection struct {\n\tSubjectName string\n\tContent []Object\n\tSignatures []Signature\n\tSubjectZone string\n\tContext string\n}\n\n\/\/Sigs return the assertion's signatures\nfunc (a *AssertionSection) Sigs() []Signature {\n\treturn a.Signatures\n}\n\n\/\/AddSig adds the given signature\nfunc (a *AssertionSection) AddSig(sig Signature) {\n\ta.Signatures = append(a.Signatures, sig)\n}\n\n\/\/DeleteSig deletes ith signature\nfunc (a *AssertionSection) DeleteSig(i int) {\n\ta.Signatures = append(a.Signatures[:i], a.Signatures[i+1:]...)\n}\n\n\/\/DeleteAllSigs deletes all signatures\nfunc (a *AssertionSection) DeleteAllSigs() {\n\ta.Signatures = []Signature{}\n}\n\n\/\/GetContext returns the context of the assertion\nfunc (a *AssertionSection) GetContext() string {\n\treturn a.Context\n}\n\n\/\/GetSubjectZone returns the zone of the assertion\nfunc (a *AssertionSection) GetSubjectZone() string {\n\treturn a.SubjectZone\n}\n\n\/\/CreateStub creates a copy of the assertion without the signatures.\nfunc (a *AssertionSection) CreateStub() MessageSectionWithSig {\n\tstub := &AssertionSection{}\n\t*stub = *a\n\tstub.DeleteAllSigs()\n\treturn stub\n}\n\n\/\/Begin returns the begining of the interval of this assertion.\nfunc (a *AssertionSection) Begin() string {\n\treturn a.SubjectName\n}\n\n\/\/End returns the end of the interval of this assertion.\nfunc (a *AssertionSection) End() string {\n\treturn a.SubjectName\n}\n\n\/\/ValidFrom returns the earliest validFrom date of all contained signatures\nfunc (a *AssertionSection) ValidFrom() int64 {\n\tvalid := a.Signatures[0].ValidSince\n\tfor _, sig := range a.Signatures[1:] {\n\t\tif sig.ValidSince < valid {\n\t\t\tvalid = sig.ValidSince\n\t\t}\n\t}\n\treturn valid\n}\n\n\/\/ValidUntil returns the latest validUntil date of all contained signatures\nfunc (a *AssertionSection) ValidUntil() int64 {\n\t\/\/FIXME CFE this is not correct. There might be a time interval between several signatures during which this assertion is not valid.\n\t\/\/Return the latest time which is reachable with all contained signatures without gaps in between\n\tvalid := a.Signatures[0].ValidUntil\n\tfor _, sig := range a.Signatures[1:] {\n\t\tif sig.ValidSince > valid {\n\t\t\tvalid = sig.ValidSince\n\t\t}\n\t}\n\treturn valid\n}\n\n\/\/Hash returns a string containing all information uniquely identifying an assertion.\nfunc (a *AssertionSection) Hash() string {\n\treturn fmt.Sprintf(\"%s_%s_%s_%v_%v\", a.Context, a.SubjectZone, a.SubjectName, a.Content, a.Signatures)\n}\n\n\/\/EqualContextZoneName return true if the given assertion has the same context, zone, name.\nfunc (a *AssertionSection) EqualContextZoneName(assertion *AssertionSection) bool {\n\treturn a.Context == assertion.Context &&\n\t\ta.SubjectZone == assertion.SubjectZone &&\n\t\ta.SubjectName == assertion.SubjectName\n}\n\n\/\/ShardSection contains information about the shard\ntype ShardSection struct {\n\tContent []*AssertionSection\n\tSignatures []Signature\n\tSubjectZone string\n\tContext string\n\tRangeFrom string\n\tRangeTo string\n}\n\n\/\/Sigs return the shard's signatures\nfunc (s *ShardSection) Sigs() []Signature {\n\treturn s.Signatures\n}\n\n\/\/AddSig adds the given signature\nfunc (s *ShardSection) AddSig(sig Signature) {\n\ts.Signatures = append(s.Signatures, sig)\n}\n\n\/\/DeleteSig deletes ith signature\nfunc (s *ShardSection) DeleteSig(i int) {\n\ts.Signatures = append(s.Signatures[:i], s.Signatures[i+1:]...)\n}\n\n\/\/DeleteAllSigs deletes all signatures\nfunc (s *ShardSection) DeleteAllSigs() {\n\ts.Signatures = []Signature{}\n\tfor _, assertion := range s.Content {\n\t\tassertion.DeleteAllSigs()\n\t}\n}\n\n\/\/GetContext returns the context of the shard\nfunc (s *ShardSection) GetContext() string {\n\treturn s.Context\n}\n\n\/\/GetSubjectZone returns the zone of the shard\nfunc (s *ShardSection) GetSubjectZone() string {\n\treturn s.SubjectZone\n}\n\n\/\/CreateStub creates a copy of the shard and its contained assertions without the signatures.\nfunc (s *ShardSection) CreateStub() MessageSectionWithSig {\n\tstub := &ShardSection{}\n\t*stub = *s\n\tstub.Content = []*AssertionSection{}\n\tfor _, assertion := range s.Content {\n\t\tstub.Content = append(stub.Content, assertion.CreateStub().(*AssertionSection))\n\t}\n\tstub.DeleteAllSigs()\n\treturn stub\n}\n\n\/\/Begin returns the begining of the interval of this shard.\nfunc (s *ShardSection) Begin() string {\n\treturn s.RangeFrom\n}\n\n\/\/End returns the end of the interval of this shard.\nfunc (s *ShardSection) End() string {\n\treturn s.RangeTo\n}\n\n\/\/ValidFrom returns the earliest validFrom date of all contained signatures\nfunc (s *ShardSection) ValidFrom() int64 {\n\tvalid := s.Signatures[0].ValidSince\n\tfor _, sig := range s.Signatures[1:] {\n\t\tif sig.ValidSince < valid {\n\t\t\tvalid = sig.ValidSince\n\t\t}\n\t}\n\treturn valid\n}\n\n\/\/ValidUntil returns the latest validUntil date of all contained signatures\nfunc (s *ShardSection) ValidUntil() int64 {\n\t\/\/FIXME CFE this is not correct. There might be a time interval between several signatures during which this assertion is not valid.\n\t\/\/Return the latest time which is reachable with all contained signatures without gaps in between\n\tvalid := s.Signatures[0].ValidUntil\n\tfor _, sig := range s.Signatures[1:] {\n\t\tif sig.ValidSince > valid {\n\t\t\tvalid = sig.ValidSince\n\t\t}\n\t}\n\treturn valid\n}\n\n\/\/Hash returns a string containing all information uniquely identifying a shard.\nfunc (s *ShardSection) Hash() string {\n\taHashes := \"\"\n\tfor _, a := range s.Content {\n\t\taHashes += a.Hash()\n\t}\n\treturn fmt.Sprintf(\"%s_%s_%s_%s_%s_%v\", s.Context, s.SubjectZone, s.RangeFrom, s.RangeTo, aHashes, s.Signatures)\n}\n\n\/\/ZoneSection contains information about the zone\ntype ZoneSection struct {\n\tSignatures []Signature\n\tSubjectZone string\n\tContext string\n\tContent []MessageSectionWithSig\n}\n\n\/\/Sigs return the zone's signatures\nfunc (z *ZoneSection) Sigs() []Signature {\n\treturn z.Signatures\n}\n\n\/\/AddSig adds the given signature\nfunc (z *ZoneSection) AddSig(sig Signature) {\n\tz.Signatures = append(z.Signatures, sig)\n}\n\n\/\/DeleteSig deletes ith signature\nfunc (z *ZoneSection) DeleteSig(i int) {\n\tz.Signatures = append(z.Signatures[:i], z.Signatures[i+1:]...)\n}\n\n\/\/DeleteAllSigs deletes all signatures\nfunc (z *ZoneSection) DeleteAllSigs() {\n\tz.Signatures = []Signature{}\n\tfor _, section := range z.Content {\n\t\tswitch section := section.(type) {\n\t\tcase *AssertionSection, *ShardSection:\n\t\t\tsection.DeleteAllSigs()\n\t\tdefault:\n\t\t\tlog.Warn(\"Unknown message section\", \"messageSection\", section)\n\t\t}\n\t}\n}\n\n\/\/GetContext returns the context of the zone\nfunc (z *ZoneSection) GetContext() string {\n\treturn z.Context\n}\n\n\/\/GetSubjectZone returns the zone of the zone\nfunc (z *ZoneSection) GetSubjectZone() string {\n\treturn z.SubjectZone\n}\n\n\/\/CreateStub creates a copy of the zone and the contained shards and assertions without the signatures.\nfunc (z *ZoneSection) CreateStub() MessageSectionWithSig {\n\tstub := &ZoneSection{}\n\t*stub = *z\n\tstub.Content = []MessageSectionWithSig{}\n\tfor _, section := range z.Content {\n\t\tswitch section := section.(type) {\n\t\tcase *AssertionSection, *ShardSection:\n\t\t\tstub.Content = append(stub.Content, section.CreateStub())\n\t\tdefault:\n\t\t\tlog.Warn(\"Unknown message section\", \"messageSection\", section)\n\t\t}\n\t}\n\tstub.DeleteAllSigs()\n\treturn stub\n}\n\n\/\/Begin returns the begining of the interval of this zone.\nfunc (z *ZoneSection) Begin() string {\n\treturn \"\"\n}\n\n\/\/End returns the end of the interval of this zone.\nfunc (z *ZoneSection) End() string {\n\treturn \"\"\n}\n\n\/\/ValidFrom returns the earliest validFrom date of all contained signatures\nfunc (z *ZoneSection) ValidFrom() int64 {\n\tvalid := z.Signatures[0].ValidSince\n\tfor _, sig := range z.Signatures[1:] {\n\t\tif sig.ValidSince < valid {\n\t\t\tvalid = sig.ValidSince\n\t\t}\n\t}\n\treturn valid\n}\n\n\/\/ValidUntil returns the latest validUntil date of all contained signatures\nfunc (z *ZoneSection) ValidUntil() int64 {\n\t\/\/FIXME CFE this is not correct. There might be a time interval between several signatures during which this assertion is not valid.\n\t\/\/Return the latest time which is reachable with all contained signatures without gaps in between\n\tvalid := z.Signatures[0].ValidUntil\n\tfor _, sig := range z.Signatures[1:] {\n\t\tif sig.ValidSince > valid {\n\t\t\tvalid = sig.ValidSince\n\t\t}\n\t}\n\treturn valid\n}\n\n\/\/Hash returns a string containing all information uniquely identifying a shard.\nfunc (z *ZoneSection) Hash() string {\n\tcontentHashes := \"\"\n\tfor _, v := range z.Content {\n\t\tswitch v := v.(type) {\n\t\tcase *AssertionSection, *ShardSection:\n\t\t\tcontentHashes += v.Hash()\n\t\tdefault:\n\t\t\tlog.Warn(fmt.Sprintf(\"not supported zone section content, must be assertion or shard, got %T\", v))\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"%s_%s_%s_%v\", z.Context, z.SubjectZone, contentHashes, z.Signatures)\n}\n\n\/\/QuerySection contains information about the query\ntype QuerySection struct {\n\t\/\/Mandatory\n\tToken Token\n\tName string\n\tContext string\n\tType ObjectType\n\tExpires int64 \/\/time when this query expires represented as the number of seconds elapsed since January 1, 1970 UTC\n\n\t\/\/Optional\n\tOptions []QueryOption\n}\n\n\/\/ContainsOption returns true if the query contains the given query option.\nfunc (q QuerySection) ContainsOption(option QueryOption) bool {\n\tfor _, opt := range q.Options {\n\t\tif opt == option {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype QueryOption int\n\nconst (\n\tMinE2ELatency QueryOption = 1\n\tMinLastHopAnswerSize QueryOption = 2\n\tMinInfoLeakage QueryOption = 3\n\tCachedAnswersOnly QueryOption = 4\n\tExpiredAssertionsOk QueryOption = 5\n\tTokenTracing QueryOption = 6\n\tNoVerificationDelegation QueryOption = 7\n\tNoProactiveCaching QueryOption = 8\n)\n\ntype ObjectType int\n\nfunc (o ObjectType) String() string {\n\treturn strconv.Itoa(int(o))\n}\n\nconst (\n\tOTName ObjectType = 1\n\tOTIP6Addr ObjectType = 2\n\tOTIP4Addr ObjectType = 3\n\tOTRedirection ObjectType = 4\n\tOTDelegation ObjectType = 5\n\tOTNameset ObjectType = 6\n\tOTCertInfo ObjectType = 7\n\tOTServiceInfo ObjectType = 8\n\tOTRegistrar ObjectType = 9\n\tOTRegistrant ObjectType = 10\n\tOTInfraKey ObjectType = 11\n\tOTExtraKey ObjectType = 12\n)\n\n\/\/SubjectAddr TODO correct?\ntype SubjectAddr struct {\n\tAddressFamily string\n\tPrefixLength uint\n\tAddress string\n}\n\n\/\/AddressAssertionSection contains information about the address assertion\ntype AddressAssertionSection struct {\n\tSubjectAddr\n\tContent []Object\n\tSignatures []Signature\n\tContext string\n}\n\n\/\/AddressZoneSection contains information about the address zone\ntype AddressZoneSection struct {\n\tSubjectAddr\n\tSignatures []Signature\n\tContext string\n\tContent []AddressAssertionSection\n}\n\n\/\/AddressQuerySection contains information about the address query\ntype AddressQuerySection struct {\n\tSubjectAddr\n\tToken []byte\n\tContext string\n\tTypes []int\n\tExpires int\n\t\/\/Optional\n\tOptions []int\n}\n\n\/\/NotificationSection contains information about the notification\ntype NotificationSection struct {\n\t\/\/Mandatory\n\tToken Token\n\tType NotificationType\n\t\/\/Optional\n\tData string\n}\n\ntype NotificationType int\n\nconst (\n\tHeartbeat NotificationType = 100\n\tCapHashNotKnown NotificationType = 399\n\tBadMessage NotificationType = 400\n\tRcvInconsistentMsg NotificationType = 403\n\tNoAssertionsExist NotificationType = 404\n\tMsgTooLarge NotificationType = 413\n\tUnspecServerErr NotificationType = 500\n\tServerNotCapable NotificationType = 501\n\tNoAssertionAvail NotificationType = 504\n)\n\n\/\/Signature on a Rains message or section\ntype Signature struct {\n\tKeySpace KeySpaceID\n\tAlgorithm SignatureAlgorithmType\n\tValidSince int64\n\tValidUntil int64\n\tData interface{}\n}\n\n\/\/KeySpaceID identifies a key space\ntype KeySpaceID int\n\nconst (\n\tRainsKeySpace KeySpaceID = 0\n)\n\n\/\/AlgorithmType specifies an identifier an algorithm\n\/\/TODO CFE how do we want to distinguish SignatureAlgorithmType and HashAlgorithmType\ntype KeyAlgorithmType int\n\nfunc (k KeyAlgorithmType) String() string {\n\treturn strconv.Itoa(int(k))\n}\n\n\/\/SignatureAlgorithmType specifies a signature algorithm type\ntype SignatureAlgorithmType int\n\nconst (\n\tEd25519 SignatureAlgorithmType = 1\n\tEd448 SignatureAlgorithmType = 2\n\tEcdsa256 SignatureAlgorithmType = 3\n\tEcdsa384 SignatureAlgorithmType = 4\n)\n\n\/\/FIXME CFE are these types necessary???\n\/\/Ed25519PublicKey is a 32-byte bit string\ntype Ed25519PublicKey [32]byte\n\n\/\/Ed448PublicKey is a 57-byte bit string\ntype Ed448PublicKey [57]byte\n\ntype Ecdsa256PublicKey struct {\n\t\/\/TODO to implement\n}\n\ntype Ecdsa384PublicKey struct {\n\t\/\/TODO to implement\n}\n\n\/\/HashAlgorithmType specifies a hash algorithm type\ntype HashAlgorithmType int\n\nconst (\n\tNoHashAlgo HashAlgorithmType = 0\n\tSha256 HashAlgorithmType = 1\n\tSha384 HashAlgorithmType = 2\n\tSha512 HashAlgorithmType = 3\n)\n\n\/\/PublicKey contains information about a public key\ntype PublicKey struct {\n\t\/\/TODO CFE remove type if not needed anywhere\n\tType SignatureAlgorithmType\n\tKey interface{}\n\tValidFrom int64\n\tValidUntil int64\n}\n\n\/\/NamesetExpression encodes a modified POSIX Extended Regular Expression format\ntype NamesetExpression string\n\n\/\/CertificateObject contains certificate information\ntype CertificateObject struct {\n\tType ProtocolType\n\tUsage CertificateUsage\n\tHashAlgo HashAlgorithmType\n\tData []byte\n}\n\ntype ProtocolType int\n\nconst (\n\tPTUnspecified ProtocolType = 0\n\tPTTLS ProtocolType = 1\n)\n\ntype CertificateUsage int\n\nconst (\n\tCUTrustAnchor CertificateUsage = 2\n\tCUEndEntity CertificateUsage = 3\n)\n\n\/\/ServiceInfo contains information how to access a named service\ntype ServiceInfo struct {\n\tName string\n\tPort uint16\n\tPriority uint\n}\n\n\/\/Object is a container for different values determined by the given type.\ntype Object struct {\n\tType ObjectType\n\tValue interface{}\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"38cc05f12fea731f4abb7c4ec6d8140d7c3a15b2","subject":"Reduce default maximum trajectory playback speed","message":"Reduce default maximum trajectory playback speed\n","repos":"ternaris\/marv-robotics,ternaris\/marv-robotics","old_file":"code\/marv-api\/marv_detail\/types.capnp","new_file":"code\/marv-api\/marv_detail\/types.capnp","new_contents":"# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\n@0xa1475499038e2711;\n\nusing import \"\/marv_nodes\/types.capnp\".Comment;\nusing import \"\/marv_nodes\/types.capnp\".File;\nusing import \"\/marv_nodes\/types.capnp\".GeoJson;\nusing import \"\/marv_pycapnp\/types.capnp\".Timedelta;\nusing import \"\/marv_pycapnp\/types.capnp\".Timestamp;\nusing import \"\/marv_pycapnp\/types.capnp\".TimelineEvent;\n\nusing Filesize = UInt64;\nusing RowId = UInt64;\n\n\nenum Align {\n left @0;\n center @1;\n right @2;\n}\n\n\nenum Formatter {\n string @0;\n filesize @1;\n int @2;\n rellink @3;\n datetime @4;\n timedelta @5;\n link @6;\n route @7;\n distance @8;\n speed @9;\n acceleration @10;\n}\n\n\nstruct Cell {\n union {\n void @0 :Void;\n text @1 :Text;\n bool @2 :Bool;\n uint64 @3 :UInt64;\n link @4 :Link;\n timedelta @5 :Timedelta;\n timestamp @6 :Timestamp;\n route @7 :Route;\n }\n}\n\n\nstruct Link {\n href @0 :Text;\n target @1 :Text = \"_blank\";\n title @2 :Text;\n download @3 :Text;\n}\n\n\nstruct Route {\n route @0 :Text;\n id @1 :Text;\n title @2 :Text;\n}\n\n\nstruct Compare {\n sections @0 :List(Section);\n title @1 :Text;\n error @2 :Text;\n}\n\n\nstruct Detail {\n sections @0 :List(Section);\n summary @1 :Section;\n title @2 :Text;\n error @3 :Text;\n}\n\n\nstruct Section {\n title @0 :Text;\n widgets @1 :List(Widget);\n}\n\n\nstruct Widget {\n title @0 :Text;\n union {\n void @1 :Void;\n custom @12 :Custom;\n dropdown @14 :Dropdown;\n gallery @2 :Gallery;\n image @3 :Image;\n keyval @4 :Keyval;\n link @13 :Link;\n mpld3 @5 :Text; # marv-partial or json\n map @6 :Map;\n mapPartial @11 :Text;\n pre @7 :Pre;\n table @8 :Table;\n pointcloud @9 :Pointcloud;\n video @10 :Video;\n plotly @15: Text; # marv-partial\n pdf @16 :Pdf; # marv-partial\n eventlist @17 :Eventlist;\n }\n\n struct Custom {\n type @0 :Text;\n data @1 :Text; # json\n }\n\n struct Gallery {\n images @0 :List(Image);\n }\n\n struct Image {\n src @0 :Text;\n }\n\n struct Keyval {\n items @0 :List(Item);\n\n struct Item {\n title @0 :Text;\n formatter @1 :Formatter;\n list @2 :Bool;\n cell @3 :Cell;\n }\n }\n\n struct Map {\n zoom @0 :Zoom;\n layers @1 :List(Layer);\n bgcolor @2 :List(UInt8) = [240, 240, 240, 255]; # rgba\n speed :group {\n min @3 :Float32 = 1.0;\n max @4 :Float32 = 100.0;\n default @5 :Float32 = 1.0;\n }\n\n struct Layer {\n title @0 :Text;\n color @1 :List(UInt8);\n transform @2 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n union {\n geojson @3 :GeoJson;\n tiles @4 :List(Tile);\n }\n }\n\n struct Tile {\n title @0 :Text;\n url @1 :Text;\n attribution @2: Text;\n zoom @3 :Zoom;\n retina @4 :UInt8 = 1;\n }\n\n struct Zoom {\n min @0 :Int8;\n max @1 :Int8;\n }\n }\n\n struct Dropdown {\n widgets @0 :List(Widget);\n }\n\n struct Pre {\n text @0 :Text;\n }\n\n struct Table {\n actions @0 :List(Action);\n columns @1 :List(Column);\n rows @2 :List(Row);\n sortcolumn @3 :Int16;\n sortorder @4 :Sortorder;\n\n struct Action {\n name @0 :Text;\n title @1 :Text;\n method @2 :HTTPMethod;\n data @3 :Text;\n\n enum HTTPMethod {\n post @0;\n get @1;\n }\n }\n\n struct Column {\n title @0 :Text;\n align @1 :Align;\n formatter @2 :Formatter;\n list @3 :Bool;\n sortkey @4 :Text;\n }\n\n struct Row {\n id @0 :RowId;\n cells @1 :List(Cell);\n }\n\n enum Sortorder {\n ascending @0;\n descending @1;\n }\n }\n\n struct Pointcloud {\n uri @0 :Text;\n # TODO: rename to blob or stream or src like for image and video?\n size @1 :UInt64;\n # Bytesize of point cloud stream blob\n pointsize @2 :Float32;\n transform @3 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n speed :group {\n min @4 :Float32 = 1.0;\n max @5 :Float32 = 1000.0;\n default @6 :Float32 = 1.0;\n }\n rangex @7 :List(Float32);\n rangey @8 :List(Float32);\n rangez @9 :List(Float32);\n ranged @10 :List(Float32);\n frameid @11 :Text;\n }\n\n struct Video {\n src @0 :Text;\n }\n\n struct Pdf {\n src @0 :Text;\n }\n\n struct Eventlist {\n subtype @0: Text;\n events @1 :List(TimelineEvent);\n }\n}\n","old_contents":"# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\n@0xa1475499038e2711;\n\nusing import \"\/marv_nodes\/types.capnp\".Comment;\nusing import \"\/marv_nodes\/types.capnp\".File;\nusing import \"\/marv_nodes\/types.capnp\".GeoJson;\nusing import \"\/marv_pycapnp\/types.capnp\".Timedelta;\nusing import \"\/marv_pycapnp\/types.capnp\".Timestamp;\nusing import \"\/marv_pycapnp\/types.capnp\".TimelineEvent;\n\nusing Filesize = UInt64;\nusing RowId = UInt64;\n\n\nenum Align {\n left @0;\n center @1;\n right @2;\n}\n\n\nenum Formatter {\n string @0;\n filesize @1;\n int @2;\n rellink @3;\n datetime @4;\n timedelta @5;\n link @6;\n route @7;\n distance @8;\n speed @9;\n acceleration @10;\n}\n\n\nstruct Cell {\n union {\n void @0 :Void;\n text @1 :Text;\n bool @2 :Bool;\n uint64 @3 :UInt64;\n link @4 :Link;\n timedelta @5 :Timedelta;\n timestamp @6 :Timestamp;\n route @7 :Route;\n }\n}\n\n\nstruct Link {\n href @0 :Text;\n target @1 :Text = \"_blank\";\n title @2 :Text;\n download @3 :Text;\n}\n\n\nstruct Route {\n route @0 :Text;\n id @1 :Text;\n title @2 :Text;\n}\n\n\nstruct Compare {\n sections @0 :List(Section);\n title @1 :Text;\n error @2 :Text;\n}\n\n\nstruct Detail {\n sections @0 :List(Section);\n summary @1 :Section;\n title @2 :Text;\n error @3 :Text;\n}\n\n\nstruct Section {\n title @0 :Text;\n widgets @1 :List(Widget);\n}\n\n\nstruct Widget {\n title @0 :Text;\n union {\n void @1 :Void;\n custom @12 :Custom;\n dropdown @14 :Dropdown;\n gallery @2 :Gallery;\n image @3 :Image;\n keyval @4 :Keyval;\n link @13 :Link;\n mpld3 @5 :Text; # marv-partial or json\n map @6 :Map;\n mapPartial @11 :Text;\n pre @7 :Pre;\n table @8 :Table;\n pointcloud @9 :Pointcloud;\n video @10 :Video;\n plotly @15: Text; # marv-partial\n pdf @16 :Pdf; # marv-partial\n eventlist @17 :Eventlist;\n }\n\n struct Custom {\n type @0 :Text;\n data @1 :Text; # json\n }\n\n struct Gallery {\n images @0 :List(Image);\n }\n\n struct Image {\n src @0 :Text;\n }\n\n struct Keyval {\n items @0 :List(Item);\n\n struct Item {\n title @0 :Text;\n formatter @1 :Formatter;\n list @2 :Bool;\n cell @3 :Cell;\n }\n }\n\n struct Map {\n zoom @0 :Zoom;\n layers @1 :List(Layer);\n bgcolor @2 :List(UInt8) = [240, 240, 240, 255]; # rgba\n speed :group {\n min @3 :Float32 = 1.0;\n max @4 :Float32 = 1000.0;\n default @5 :Float32 = 1.0;\n }\n\n struct Layer {\n title @0 :Text;\n color @1 :List(UInt8);\n transform @2 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n union {\n geojson @3 :GeoJson;\n tiles @4 :List(Tile);\n }\n }\n\n struct Tile {\n title @0 :Text;\n url @1 :Text;\n attribution @2: Text;\n zoom @3 :Zoom;\n retina @4 :UInt8 = 1;\n }\n\n struct Zoom {\n min @0 :Int8;\n max @1 :Int8;\n }\n }\n\n struct Dropdown {\n widgets @0 :List(Widget);\n }\n\n struct Pre {\n text @0 :Text;\n }\n\n struct Table {\n actions @0 :List(Action);\n columns @1 :List(Column);\n rows @2 :List(Row);\n sortcolumn @3 :Int16;\n sortorder @4 :Sortorder;\n\n struct Action {\n name @0 :Text;\n title @1 :Text;\n method @2 :HTTPMethod;\n data @3 :Text;\n\n enum HTTPMethod {\n post @0;\n get @1;\n }\n }\n\n struct Column {\n title @0 :Text;\n align @1 :Align;\n formatter @2 :Formatter;\n list @3 :Bool;\n sortkey @4 :Text;\n }\n\n struct Row {\n id @0 :RowId;\n cells @1 :List(Cell);\n }\n\n enum Sortorder {\n ascending @0;\n descending @1;\n }\n }\n\n struct Pointcloud {\n uri @0 :Text;\n # TODO: rename to blob or stream or src like for image and video?\n size @1 :UInt64;\n # Bytesize of point cloud stream blob\n pointsize @2 :Float32;\n transform @3 :List(Float32) = [1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1];\n speed :group {\n min @4 :Float32 = 1.0;\n max @5 :Float32 = 1000.0;\n default @6 :Float32 = 1.0;\n }\n rangex @7 :List(Float32);\n rangey @8 :List(Float32);\n rangez @9 :List(Float32);\n ranged @10 :List(Float32);\n frameid @11 :Text;\n }\n\n struct Video {\n src @0 :Text;\n }\n\n struct Pdf {\n src @0 :Text;\n }\n\n struct Eventlist {\n subtype @0: Text;\n events @1 :List(TimelineEvent);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"9241f752923f515ea867a7e95ac0208ec7550dc8","subject":"catalog: make (User|Group)Ref.id default to -1","message":"catalog: make (User|Group)Ref.id default to -1\n\nThis allows a null ref to behave identically to a zero ref, at the small\n(at the moment) expense of being a backward-incompatible schema change.\nThat's what pre-1.0 is for!\n\nUpdates #4\n","repos":"zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm,zombiezen\/mcm","old_file":"catalog.capnp","new_file":"catalog.capnp","new_contents":"# Copyright 2016 The Minimal Configuration Manager Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nusing Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog and cannot be zero.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n const unset :UInt16 = 0xffff;\n const permMask :UInt16 = 0x01ff;\n const sticky :UInt16 = 0x0200;\n const setuid :UInt16 = 0x0400;\n const setgid :UInt16 = 0x0800;\n\n bits @2 :UInt16 = File.Mode.unset;\n # The Unix mode bits, specified in a system-independent manner using\n # the constants above. If the field is the default value, then\n # don't change the mode.\n\n user @0 :UserRef;\n # OS owner of the file. If null, then don't change.\n group @1 :GroupRef;\n # OS group of the file. If null, then don't change.\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32 = -1 $Go.name(\"ID\");\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32 = -1 $Go.name(\"ID\");\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful\n # exit code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit\n # code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n ifDepsChanged @5 :List(ResourceId);\n # Command will be run only if one of the resources listed made a\n # change to the system during application. It is an error for the\n # list to be empty or for the list to contain IDs that are not in\n # the resource's dependencies list.\n }\n}\n","old_contents":"# Copyright 2016 The Minimal Configuration Manager Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nusing Cxx = import \"\/third_party\/capnproto\/c++\/src\/capnp\/c++.capnp\";\nusing Go = import \"\/third_party\/golang\/capnproto\/std\/go.capnp\";\n\n@0x88881ae7af33bcb5;\n$Cxx.namespace(\"mcm\");\n$Go.package(\"catalog\");\n$Go.import(\"github.com\/zombiezen\/mcm\/catalog\");\n\nstruct Catalog {\n # The root struct in a catalog file.\n\n resources @0 :List(Resource);\n}\n\nusing ResourceId = UInt64;\n\nstruct Resource {\n id @0 :ResourceId $Go.name(\"ID\");\n # The resource's identifier, used for dependencies.\n # The identifier should be unique within a catalog and cannot be zero.\n\n comment @1 :Text;\n # An optional human-readable description of the resource for use in\n # error and progress messages.\n\n dependencies @2 :List(ResourceId);\n # Resources that must be applied before this resource can be applied.\n\n union {\n noop @3 :Void;\n # Does nothing. Mainly to give the resource a safe default.\n\n file @4 :File;\n exec @5 :Exec;\n }\n}\n\nstruct File @0x8dc4ac52b2962163 {\n # An entry on the filesystem.\n\n path @0 :Text;\n # An absolute OS-specific file path.\n\n union {\n plain :group {\n content @1 :Data;\n # Byte content of the file. If null, then file content is\n # untouched by the executor, but it is an error if the file does\n # not exist.\n\n mode @2 :Mode;\n }\n directory :group {\n mode @3 :Mode;\n }\n symlink :group {\n target @5 :Text;\n # Where the link should point to. This may be an absolute path or\n # a path relative to the link.\n }\n\n absent @4 :Void;\n }\n\n struct Mode {\n const unset :UInt16 = 0xffff;\n const permMask :UInt16 = 0x01ff;\n const sticky :UInt16 = 0x0200;\n const setuid :UInt16 = 0x0400;\n const setgid :UInt16 = 0x0800;\n\n bits @2 :UInt16 = File.Mode.unset;\n # The Unix mode bits, specified in a system-independent manner using\n # the constants above. If the field is the default value, then\n # don't change the mode.\n\n user @0 :UserRef;\n # OS owner of the file. If null, then don't change.\n group @1 :GroupRef;\n # OS group of the file. If null, then don't change.\n }\n}\n\nstruct UserRef {\n # A reference to a OS user.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct GroupRef {\n # A reference to an OS group.\n\n union {\n id @0 :Int32;\n name @1 :Text;\n }\n}\n\nstruct Exec @0x984c97311006f1ca {\n # An execution of an arbitrary program.\n\n struct Command {\n # An individual program invocation.\n\n union {\n argv @0 :List(Text);\n # A list of arguments as passed to exec.\n # There must be at least one argument, which must be an absolute\n # path to the executable.\n\n bash @1 :Text;\n # A script as passed to bash.\n }\n\n struct EnvVar {\n # A single environment variable.\n\n name @0 :Text;\n value @1 :Text;\n }\n\n environment @2 :List(EnvVar);\n # The subprocess's environment.\n # An empty or null list is an empty environment.\n\n workingDirectory @3 :Text;\n # The subprocess's working directory.\n # An empty or null string is the root.\n }\n\n command @0 :Command;\n # Command to run if the condition is met.\n\n condition :union {\n always @1 :Void;\n # Command will always be run. Used if the command is idempotent.\n onlyIf @2 :Command;\n # Command will be run only if another command returns a successful\n # exit code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n unless @3 :Command;\n # Command will be run only if another command returns a failure exit\n # code. It is assumed that this command does not do anything\n # destructive and may be run multiple times.\n fileAbsent @4 :Text;\n # Command will be run only if the OS file path does not exist.\n ifDepsChanged @5 :List(ResourceId);\n # Command will be run only if one of the resources listed made a\n # change to the system during application. It is an error for the\n # list to be empty or for the list to contain IDs that are not in\n # the resource's dependencies list.\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"94b0b4a9a2f10051984d9f8cca1afdda62276cf7","subject":"more detailed definition of player & ball; might need more adjustments later on","message":"more detailed definition of player & ball; might need more adjustments later on\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/core\/entity.capnp","new_file":"src\/core\/entity.capnp","new_contents":"@0xc98f2d65bc9a57fc;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing Field = import \"field.capnp\";\nusing Physics = import \"\/core\/physics.capnp\";\n\nenum PlayerType\n{\n outfield @0;\n goalie @1;\n}\n\nenum UniformNumber\n{\n one @0;\n two @1;\n three @2;\n four @3;\n five @4;\n six @5;\n seven @6;\n eight @7;\n nine @8;\n ten @9;\n eleven @10;\n}\n\nstruct PlayerId\n{\n side @0 :Field.Side;\n uniform @1 :UniformNumber;\n type @2 :PlayerType;\n}\n\nstruct Player\n{\n id @0 :PlayerId;\n position @1 :Physics.Position;\n stamina @2 :Physics.KiloJoule;\n effort @3 :Physics.KiloJoule;\n bodyDirection @4 :Physics.Degree;\n headDirection @5 :Physics.Degree;\n velocity @6 :Physics.MilliMetrePerSecond;\n}\n\nenum ParticipantType\n{\n player @0;\n coach @1;\n referee @2;\n trainer @3;\n}\n\nstruct Ball\n{\n position @0 :Physics.Position;\n direction @1 :Physics.Degree;\n velocity @2 :Physics.MilliMetrePerSecond;\n}\n","old_contents":"@0xc98f2d65bc9a57fc;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::core\");\n\nusing Field = import \"field.capnp\";\nusing Physics = import \"\/core\/physics.capnp\";\n\nenum PlayerType\n{\n outfield @0;\n goalie @1;\n}\n\nenum UniformNumber\n{\n one @0;\n two @1;\n three @2;\n four @3;\n five @4;\n six @5;\n seven @6;\n eight @7;\n nine @8;\n ten @9;\n eleven @10;\n}\n\nstruct PlayerId\n{\n side @0 :Field.Side;\n uniform @1 :UniformNumber;\n type @2 :PlayerType;\n}\n\nstruct Player\n{\n id @0 :PlayerId;\n}\n\nenum ParticipantType\n{\n player @0;\n coach @1;\n referee @2;\n trainer @3;\n}\n\nstruct Ball {}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"4079c4b6de9be659f333c02ad2847bb822db5d38","subject":"Jack <\/3: current appVersion to 4 after having to release 0.2.2 (appVersion 3)","message":"Jack <\/3: current appVersion to 4 after having to release 0.2.2 (appVersion 3)\n","repos":"sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.3.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 3, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.3.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"99734329c03dcd889f2a890c97dcb1ced3c807fe","subject":"bump sandstorm appVersion","message":"bump sandstorm appVersion\n","repos":"igorstajic\/Rocket.Chat,inoio\/Rocket.Chat,danielbressan\/Rocket.Chat,galrotem1993\/Rocket.Chat,ealbers\/Rocket.Chat,steedos\/chat,abduljanjua\/TheHub,wtsarchive\/Rocket.Chat,mccambridge\/Rocket.Chat,Sing-Li\/Rocket.Chat,flaviogrossi\/Rocket.Chat,Gyubin\/Rocket.Chat,AimenJoe\/Rocket.Chat,Gyubin\/Rocket.Chat,ggazzo\/Rocket.Chat,pkgodara\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,haoyixin\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,wtsarchive\/Rocket.Chat,OtkurBiz\/Rocket.Chat,yuyixg\/Rocket.Chat,litewhatever\/Rocket.Chat,JamesHGreen\/Rocket_API,mrsimpson\/Rocket.Chat,LearnersGuild\/echo-chat,yuyixg\/Rocket.Chat,abduljanjua\/TheHub,karlprieb\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,qnib\/Rocket.Chat,timkinnane\/Rocket.Chat,LearnersGuild\/Rocket.Chat,cnash\/Rocket.Chat,inoxth\/Rocket.Chat,PavelVanecek\/Rocket.Chat,linnovate\/hi,JamesHGreen\/Rocket.Chat,LearnersGuild\/echo-chat,matthewshirley\/Rocket.Chat,PavelVanecek\/Rocket.Chat,VoiSmart\/Rocket.Chat,tntobias\/Rocket.Chat,alexbrazier\/Rocket.Chat,jbsavoy18\/rocketchat-1,fduraibi\/Rocket.Chat,xboston\/Rocket.Chat,JamesHGreen\/Rocket_API,org100h1\/Rocket.Panda,trt15-ssci-organization\/Rocket.Chat,pachox\/Rocket.Chat,ziedmahdi\/Rocket.Chat,ut7\/Rocket.Chat,ziedmahdi\/Rocket.Chat,fduraibi\/Rocket.Chat,AlecTroemel\/Rocket.Chat,haoyixin\/Rocket.Chat,ahmadassaf\/Rocket.Chat,abhishekshukla0302\/trico,4thParty\/Rocket.Chat,timkinnane\/Rocket.Chat,Dianoga\/Rocket.Chat,Dianoga\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,jbsavoy18\/rocketchat-1,tntobias\/Rocket.Chat,Gudii\/Rocket.Chat,JamesHGreen\/Rocket.Chat,mrinaldhar\/Rocket.Chat,klatys\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ealbers\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,NMandapaty\/Rocket.Chat,acaronmd\/Rocket.Chat,k0nsl\/Rocket.Chat,k0nsl\/Rocket.Chat,flaviogrossi\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,LearnersGuild\/Rocket.Chat,ggazzo\/Rocket.Chat,wicked539\/Rocket.Chat,fatihwk\/Rocket.Chat,galrotem1993\/Rocket.Chat,igorstajic\/Rocket.Chat,xboston\/Rocket.Chat,litewhatever\/Rocket.Chat,Flitterkill\/Rocket.Chat,tntobias\/Rocket.Chat,abhishekshukla0302\/trico,pkgodara\/Rocket.Chat,AlecTroemel\/Rocket.Chat,mwharrison\/Rocket.Chat,galrotem1993\/Rocket.Chat,tntobias\/Rocket.Chat,karlprieb\/Rocket.Chat,mccambridge\/Rocket.Chat,cdwv\/Rocket.Chat,amaapp\/ama,subesokun\/Rocket.Chat,capensisma\/Rocket.Chat,subesokun\/Rocket.Chat,TribeMedia\/Rocket.Chat,VoiSmart\/Rocket.Chat,alexbrazier\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,NMandapaty\/Rocket.Chat,TribeMedia\/Rocket.Chat,Flitterkill\/Rocket.Chat,VoiSmart\/Rocket.Chat,subesokun\/Rocket.Chat,fduraibi\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,Sing-Li\/Rocket.Chat,steedos\/chat,Gyubin\/Rocket.Chat,pitamar\/Rocket.Chat,intelradoux\/Rocket.Chat,mrsimpson\/Rocket.Chat,wicked539\/Rocket.Chat,wicked539\/Rocket.Chat,flaviogrossi\/Rocket.Chat,timkinnane\/Rocket.Chat,fatihwk\/Rocket.Chat,wicked539\/Rocket.Chat,4thParty\/Rocket.Chat,Achaikos\/Rocket.Chat,cnash\/Rocket.Chat,steedos\/chat,nishimaki10\/Rocket.Chat,ealbers\/Rocket.Chat,OtkurBiz\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,pachox\/Rocket.Chat,ggazzo\/Rocket.Chat,pachox\/Rocket.Chat,bt\/Rocket.Chat,acaronmd\/Rocket.Chat,acaronmd\/Rocket.Chat,steedos\/chat,k0nsl\/Rocket.Chat,xboston\/Rocket.Chat,bt\/Rocket.Chat,Movile\/Rocket.Chat,pachox\/Rocket.Chat,Achaikos\/Rocket.Chat,TribeMedia\/Rocket.Chat,matthewshirley\/Rocket.Chat,wtsarchive\/Rocket.Chat,Movile\/Rocket.Chat,abduljanjua\/TheHub,trt15-ssci-organization\/Rocket.Chat,yuyixg\/Rocket.Chat,AimenJoe\/Rocket.Chat,tlongren\/Rocket.Chat,amaapp\/ama,ziedmahdi\/Rocket.Chat,qnib\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,org100h1\/Rocket.Panda,haoyixin\/Rocket.Chat,tlongren\/Rocket.Chat,yuyixg\/Rocket.Chat,cdwv\/Rocket.Chat,fatihwk\/Rocket.Chat,mccambridge\/Rocket.Chat,inoxth\/Rocket.Chat,Gudii\/Rocket.Chat,JamesHGreen\/Rocket.Chat,PavelVanecek\/Rocket.Chat,Gudii\/Rocket.Chat,galrotem1993\/Rocket.Chat,4thParty\/Rocket.Chat,danielbressan\/Rocket.Chat,bt\/Rocket.Chat,k0nsl\/Rocket.Chat,abhishekshukla0302\/trico,haoyixin\/Rocket.Chat,xasx\/Rocket.Chat,amaapp\/ama,OtkurBiz\/Rocket.Chat,danielbressan\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,mrinaldhar\/Rocket.Chat,intelradoux\/Rocket.Chat,xasx\/Rocket.Chat,marzieh312\/Rocket.Chat,mwharrison\/Rocket.Chat,pitamar\/Rocket.Chat,mwharrison\/Rocket.Chat,pkgodara\/Rocket.Chat,inoio\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Gudii\/Rocket.Chat,nishimaki10\/Rocket.Chat,Achaikos\/Rocket.Chat,JamesHGreen\/Rocket_API,danielbressan\/Rocket.Chat,marzieh312\/Rocket.Chat,Sing-Li\/Rocket.Chat,Sing-Li\/Rocket.Chat,litewhatever\/Rocket.Chat,jbsavoy18\/rocketchat-1,AimenJoe\/Rocket.Chat,Dianoga\/Rocket.Chat,ut7\/Rocket.Chat,pkgodara\/Rocket.Chat,Achaikos\/Rocket.Chat,Movile\/Rocket.Chat,litewhatever\/Rocket.Chat,abhishekshukla0302\/trico,OtkurBiz\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,fatihwk\/Rocket.Chat,subesokun\/Rocket.Chat,ut7\/Rocket.Chat,liuliming2008\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,inoxth\/Rocket.Chat,ahmadassaf\/Rocket.Chat,PavelVanecek\/Rocket.Chat,xboston\/Rocket.Chat,NMandapaty\/Rocket.Chat,klatys\/Rocket.Chat,ahmadassaf\/Rocket.Chat,karlprieb\/Rocket.Chat,qnib\/Rocket.Chat,cdwv\/Rocket.Chat,cnash\/Rocket.Chat,nishimaki10\/Rocket.Chat,bt\/Rocket.Chat,ggazzo\/Rocket.Chat,Flitterkill\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,fduraibi\/Rocket.Chat,AimenJoe\/Rocket.Chat,marzieh312\/Rocket.Chat,linnovate\/hi,qnib\/Rocket.Chat,matthewshirley\/Rocket.Chat,timkinnane\/Rocket.Chat,org100h1\/Rocket.Panda,ziedmahdi\/Rocket.Chat,alexbrazier\/Rocket.Chat,mrsimpson\/Rocket.Chat,xasx\/Rocket.Chat,JamesHGreen\/Rocket_API,intelradoux\/Rocket.Chat,igorstajic\/Rocket.Chat,klatys\/Rocket.Chat,Movile\/Rocket.Chat,klatys\/Rocket.Chat,mwharrison\/Rocket.Chat,liuliming2008\/Rocket.Chat,org100h1\/Rocket.Panda,ahmadassaf\/Rocket.Chat,capensisma\/Rocket.Chat,pitamar\/Rocket.Chat,Gyubin\/Rocket.Chat,mrsimpson\/Rocket.Chat,alexbrazier\/Rocket.Chat,matthewshirley\/Rocket.Chat,inoxth\/Rocket.Chat,flaviogrossi\/Rocket.Chat,ealbers\/Rocket.Chat,xasx\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,capensisma\/Rocket.Chat,tlongren\/Rocket.Chat,karlprieb\/Rocket.Chat,marzieh312\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,Flitterkill\/Rocket.Chat,LearnersGuild\/Rocket.Chat,JamesHGreen\/Rocket.Chat,liuliming2008\/Rocket.Chat,Dianoga\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,wtsarchive\/Rocket.Chat,LearnersGuild\/echo-chat,igorstajic\/Rocket.Chat,jbsavoy18\/rocketchat-1,amaapp\/ama,LearnersGuild\/Rocket.Chat,abduljanjua\/TheHub,trt15-ssci-organization\/Rocket.Chat,acaronmd\/Rocket.Chat,NMandapaty\/Rocket.Chat,pitamar\/Rocket.Chat,liuliming2008\/Rocket.Chat,nishimaki10\/Rocket.Chat,LeonardOliveros\/Rocket.Chat,ut7\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,4thParty\/Rocket.Chat,AlecTroemel\/Rocket.Chat,mrinaldhar\/Rocket.Chat,TribeMedia\/Rocket.Chat,cdwv\/Rocket.Chat,cnash\/Rocket.Chat,mccambridge\/Rocket.Chat,tlongren\/Rocket.Chat,inoio\/Rocket.Chat,intelradoux\/Rocket.Chat,LearnersGuild\/echo-chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 2, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.7.2445\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 1, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.7.2445\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a0feb91dad184a43168a3458a0df6124131fe83e","subject":"Bump appVersion","message":"Bump appVersion\n","repos":"JamesHGreen\/Rocket.Chat,ahmadassaf\/Rocket.Chat,Movile\/Rocket.Chat,karlprieb\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,matthewshirley\/Rocket.Chat,JamesHGreen\/Rocket.Chat,ealbers\/Rocket.Chat,ahmadassaf\/Rocket.Chat,mrinaldhar\/Rocket.Chat,yuyixg\/Rocket.Chat,alexbrazier\/Rocket.Chat,Gudii\/Rocket.Chat,Sing-Li\/Rocket.Chat,OtkurBiz\/Rocket.Chat,mrinaldhar\/Rocket.Chat,cnash\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,AlecTroemel\/Rocket.Chat,alexbrazier\/Rocket.Chat,fatihwk\/Rocket.Chat,inoio\/Rocket.Chat,inoxth\/Rocket.Chat,intelradoux\/Rocket.Chat,igorstajic\/Rocket.Chat,NMandapaty\/Rocket.Chat,JamesHGreen\/Rocket_API,cnash\/Rocket.Chat,pachox\/Rocket.Chat,intelradoux\/Rocket.Chat,fatihwk\/Rocket.Chat,ahmadassaf\/Rocket.Chat,galrotem1993\/Rocket.Chat,LearnersGuild\/echo-chat,yuyixg\/Rocket.Chat,mrinaldhar\/Rocket.Chat,wtsarchive\/Rocket.Chat,OtkurBiz\/Rocket.Chat,pkgodara\/Rocket.Chat,JamesHGreen\/Rocket_API,Movile\/Rocket.Chat,ggazzo\/Rocket.Chat,mwharrison\/Rocket.Chat,NMandapaty\/Rocket.Chat,igorstajic\/Rocket.Chat,LearnersGuild\/Rocket.Chat,mwharrison\/Rocket.Chat,inoxth\/Rocket.Chat,abduljanjua\/TheHub,flaviogrossi\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,JamesHGreen\/Rocket.Chat,yuyixg\/Rocket.Chat,ggazzo\/Rocket.Chat,LearnersGuild\/echo-chat,VoiSmart\/Rocket.Chat,pitamar\/Rocket.Chat,4thParty\/Rocket.Chat,inoio\/Rocket.Chat,ggazzo\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,pitamar\/Rocket.Chat,fatihwk\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,AimenJoe\/Rocket.Chat,ziedmahdi\/Rocket.Chat,tntobias\/Rocket.Chat,mrsimpson\/Rocket.Chat,danielbressan\/Rocket.Chat,AlecTroemel\/Rocket.Chat,OtkurBiz\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,LearnersGuild\/Rocket.Chat,Achaikos\/Rocket.Chat,nishimaki10\/Rocket.Chat,Movile\/Rocket.Chat,ziedmahdi\/Rocket.Chat,mrsimpson\/Rocket.Chat,Gyubin\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,JamesHGreen\/Rocket.Chat,VoiSmart\/Rocket.Chat,mwharrison\/Rocket.Chat,marzieh312\/Rocket.Chat,ziedmahdi\/Rocket.Chat,flaviogrossi\/Rocket.Chat,inoxth\/Rocket.Chat,JamesHGreen\/Rocket_API,marzieh312\/Rocket.Chat,intelradoux\/Rocket.Chat,tntobias\/Rocket.Chat,Sing-Li\/Rocket.Chat,cnash\/Rocket.Chat,wtsarchive\/Rocket.Chat,ealbers\/Rocket.Chat,Achaikos\/Rocket.Chat,igorstajic\/Rocket.Chat,mwharrison\/Rocket.Chat,wicked539\/Rocket.Chat,ziedmahdi\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,LearnersGuild\/Rocket.Chat,abduljanjua\/TheHub,alexbrazier\/Rocket.Chat,galrotem1993\/Rocket.Chat,AlecTroemel\/Rocket.Chat,AlecTroemel\/Rocket.Chat,k0nsl\/Rocket.Chat,mrsimpson\/Rocket.Chat,nishimaki10\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,flaviogrossi\/Rocket.Chat,xasx\/Rocket.Chat,AimenJoe\/Rocket.Chat,danielbressan\/Rocket.Chat,pkgodara\/Rocket.Chat,xasx\/Rocket.Chat,karlprieb\/Rocket.Chat,JamesHGreen\/Rocket_API,NMandapaty\/Rocket.Chat,LearnersGuild\/echo-chat,tntobias\/Rocket.Chat,matthewshirley\/Rocket.Chat,matthewshirley\/Rocket.Chat,marzieh312\/Rocket.Chat,k0nsl\/Rocket.Chat,wtsarchive\/Rocket.Chat,xasx\/Rocket.Chat,ggazzo\/Rocket.Chat,pitamar\/Rocket.Chat,galrotem1993\/Rocket.Chat,Gyubin\/Rocket.Chat,wicked539\/Rocket.Chat,Gudii\/Rocket.Chat,pkgodara\/Rocket.Chat,Gudii\/Rocket.Chat,pachox\/Rocket.Chat,LearnersGuild\/Rocket.Chat,danielbressan\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,VoiSmart\/Rocket.Chat,abduljanjua\/TheHub,Movile\/Rocket.Chat,alexbrazier\/Rocket.Chat,subesokun\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,nishimaki10\/Rocket.Chat,Gudii\/Rocket.Chat,wicked539\/Rocket.Chat,subesokun\/Rocket.Chat,tntobias\/Rocket.Chat,inoio\/Rocket.Chat,ealbers\/Rocket.Chat,marzieh312\/Rocket.Chat,karlprieb\/Rocket.Chat,danielbressan\/Rocket.Chat,LearnersGuild\/echo-chat,Sing-Li\/Rocket.Chat,Gyubin\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,Achaikos\/Rocket.Chat,galrotem1993\/Rocket.Chat,NMandapaty\/Rocket.Chat,karlprieb\/Rocket.Chat,pkgodara\/Rocket.Chat,Achaikos\/Rocket.Chat,xasx\/Rocket.Chat,subesokun\/Rocket.Chat,cnash\/Rocket.Chat,ealbers\/Rocket.Chat,AimenJoe\/Rocket.Chat,flaviogrossi\/Rocket.Chat,k0nsl\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,Sing-Li\/Rocket.Chat,pachox\/Rocket.Chat,Gyubin\/Rocket.Chat,4thParty\/Rocket.Chat,inoxth\/Rocket.Chat,k0nsl\/Rocket.Chat,igorstajic\/Rocket.Chat,fatihwk\/Rocket.Chat,matthewshirley\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,subesokun\/Rocket.Chat,mrinaldhar\/Rocket.Chat,wicked539\/Rocket.Chat,wtsarchive\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,mrsimpson\/Rocket.Chat,yuyixg\/Rocket.Chat,ahmadassaf\/Rocket.Chat,abduljanjua\/TheHub,4thParty\/Rocket.Chat,nishimaki10\/Rocket.Chat,pitamar\/Rocket.Chat,intelradoux\/Rocket.Chat,AimenJoe\/Rocket.Chat,pachox\/Rocket.Chat,OtkurBiz\/Rocket.Chat,4thParty\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 38, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.36.0\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n eventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"message received\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"private message received\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 36, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.36.0\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n eventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"message received\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"private message received\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"2036930fd2e330c84304ca081eacb2409045706d","subject":"Bump version.","message":"Bump version.\n","repos":"dwrensha\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,neynah\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,neynah\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,dwrensha\/wordpress-sandstorm,neynah\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm,neynah\/wordpress-sandstorm,theodorerambert\/wordpress-sandstorm","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xaecd42915acc793f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"aax9j672p6z8n7nyupzvj2nmumeqd4upa0f7mgu8gprwmy53x04h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"WordPress\"),\n appVersion = 5,\n appMarketingVersion = (defaultText = \"2015.07.15--4.2.3-alpha\"),\n\n actions = [\n ( title = (defaultText = \"New WordPress Site\"),\n command = .startCommand\n )\n ],\n\n continueCommand = .continueCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\"), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/nsswitch.conf\", \"etc\/localtime\",\n \"etc\/host.conf\", \"etc\/resolv.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"wordpress-read-only\", \"read-only-plugins\"],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows administrative actions\")),\n (name = \"editor\", title = (defaultText = \"editor\"),\n description = (defaultText = \"allows publishing of posts of others\")),\n (name = \"author\", title = (defaultText = \"author\"),\n description = (defaultText = \"allows publishing of own posts\")),\n (name = \"contributor\", title = (defaultText = \"contributor\"),\n description = (defaultText = \"allows writing of posts\")),\n (name = \"subscriber\", title = (defaultText = \"subscriber\"),\n description = (defaultText = \"allows profile customization\"))],\n roles = [(title = (defaultText = \"admin\"),\n permissions = [true, true, true, true, true],\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"editor\"),\n permissions = [false, true, true, true, true],\n verbPhrase = (defaultText = \"can publish posts of others\")),\n (title = (defaultText = \"author\"),\n permissions = [false, false, true, true, true],\n verbPhrase = (defaultText = \"can publish own posts\")),\n (title = (defaultText = \"contributor\"),\n permissions = [false, false, false, true, true],\n verbPhrase = (defaultText = \"can write posts\"),\n default = true),\n (title = (defaultText = \"subscriber\"),\n permissions = [false, false, false, false, true],\n verbPhrase = (defaultText = \"can customize profile\"))]\n )\n )\n);\n\nconst startCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\nconst continueCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/continue.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xaecd42915acc793f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"aax9j672p6z8n7nyupzvj2nmumeqd4upa0f7mgu8gprwmy53x04h\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"WordPress\"),\n appVersion = 4,\n appMarketingVersion = (defaultText = \"2015.06.28--4.2.3-alpha\"),\n\n actions = [\n ( title = (defaultText = \"New WordPress Site\"),\n command = .startCommand\n )\n ],\n\n continueCommand = .continueCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\"), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/nsswitch.conf\", \"etc\/localtime\",\n \"etc\/host.conf\", \"etc\/resolv.conf\"]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\"wordpress-read-only\", \"read-only-plugins\"],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"allows administrative actions\")),\n (name = \"editor\", title = (defaultText = \"editor\"),\n description = (defaultText = \"allows publishing of posts of others\")),\n (name = \"author\", title = (defaultText = \"author\"),\n description = (defaultText = \"allows publishing of own posts\")),\n (name = \"contributor\", title = (defaultText = \"contributor\"),\n description = (defaultText = \"allows writing of posts\")),\n (name = \"subscriber\", title = (defaultText = \"subscriber\"),\n description = (defaultText = \"allows profile customization\"))],\n roles = [(title = (defaultText = \"admin\"),\n permissions = [true, true, true, true, true],\n verbPhrase = (defaultText = \"can do anything\")),\n (title = (defaultText = \"editor\"),\n permissions = [false, true, true, true, true],\n verbPhrase = (defaultText = \"can publish posts of others\")),\n (title = (defaultText = \"author\"),\n permissions = [false, false, true, true, true],\n verbPhrase = (defaultText = \"can publish own posts\")),\n (title = (defaultText = \"contributor\"),\n permissions = [false, false, false, true, true],\n verbPhrase = (defaultText = \"can write posts\"),\n default = true),\n (title = (defaultText = \"subscriber\"),\n permissions = [false, false, false, false, true],\n verbPhrase = (defaultText = \"can customize profile\"))]\n )\n )\n);\n\nconst startCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n\nconst continueCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/continue.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"87ce042c63b403780bcd5c5a50967925d433a1a1","subject":"Add SANDSTORM=1 to the environment under Sandstorm","message":"Add SANDSTORM=1 to the environment under Sandstorm\n\nWe add the SANDSTORM=1 environment variable to sandstorm-pkgdef.capnp so that\naccounts-sandstorm will ensure that it's the only loaded accounts package when\nrunning under Sandstorm.\n","repos":"oliver4u\/WEKAN_runpartner,jtickle\/wekan,GhassenRjab\/wekan,wekan\/wekan,libreboard\/libreboard,oliver4u\/sap-wekan,ddanssaert\/wekan,Serubin\/wekan,wekan\/wekan,nztqa\/wekan,nztqa\/wekan,nztqa\/wekan,oliver4u\/sap-wekan,wekan\/wekan,Serubin\/wekan,mario-orlicky\/wekan,jtickle\/wekan,ddanssaert\/wekan,mario-orlicky\/wekan,GhassenRjab\/wekan,jtickle\/wekan,oliver4u\/sap-wekan,GhassenRjab\/wekan,johnleeming\/wekan,mario-orlicky\/wekan,Serubin\/wekan,johnleeming\/wekan,johnleeming\/wekan,wekan\/wekan,oliver4u\/WEKAN_runpartner,johnleeming\/wekan,wekan\/wekan,ddanssaert\/wekan,libreboard\/libreboard,oliver4u\/WEKAN_runpartner","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 12,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0-rc2\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"mquandalle@wekan.io\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 12,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0-rc2\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"mquandalle@wekan.io\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"16e1ad045642a547ab0fdda33662349e308c77e6","subject":"adding spec for new api calls","message":"adding spec for new api calls\n","repos":"rustyrazorblade\/killranswers,rustyrazorblade\/killranswers","old_file":"killranswers.capnp","new_file":"killranswers.capnp","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"e2fe9a5e9238c1ee82331f2e742906748a824662","subject":".sandstorm: rename app to Sandpass","message":".sandstorm: rename app to Sandpass\n","repos":"zombiezen\/sandpass,zombiezen\/sandpass,zombiezen\/sandpass","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n ( nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\")\n ),\n ( name = \"write\",\n title = (defaultText = \"Write to database\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true]\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","old_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"KeePass\"),\n appVersion = 0, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n ( nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n # Various icons to represent the app in various contexts.\n #appGrid = (svg = embed \"path\/to\/appgrid-128x128.svg\"),\n #grain = (svg = embed \"path\/to\/grain-24x24.svg\"),\n #market = (svg = embed \"path\/to\/market-150x150.svg\"),\n #marketBig = (svg = embed \"path\/to\/market-big-300x300.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \"notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n #description = (defaultText = embed \"path\/to\/description.md\"),\n # The app's description in Github-flavored Markdown format, to be displayed e.g.\n # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but\n # you can include a list of screenshots separately).\n\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n #(width = 746, height = 795, jpeg = embed \"path\/to\/screenshot-1.jpeg\"),\n #(width = 640, height = 480, png = embed \"path\/to\/screenshot-2.png\"),\n ],\n #changeLog = (defaultText = embed \"path\/to\/sandstorm-specific\/changelog.md\"),\n # Documents the history of changes in Github-flavored markdown format (with the same restrictions\n # as govern `description`). We recommend formatting this with an H1 heading for each version\n # followed by a bullet list of changes.\n ),\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\",\n \"etc\/ld.so.cache\" ]\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [\n \"opt\/app\/sandpass\",\n \"opt\/app\/templates\",\n ],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\")\n ),\n ( name = \"write\",\n title = (defaultText = \"Write to database\")\n )\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false]\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true]\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"e340a662d96094a8dbc7dafe12d1fa77b1e41591","subject":"Bump version.","message":"Bump version.\n","repos":"kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite,kentonv\/etherpad-lite","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 10, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"2015.08.01 (1.5.6+)\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0x93020f652e8a8459;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Etherpad\"),\n\n appVersion = 9, # Increment this for every release.\n \n appMarketingVersion = (defaultText = \"2015.06.18 (1.5.6+)\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Etherpad Document\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"src\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"modify\", title = (defaultText = \"modify\"),\n description = (defaultText = \"allows modifying the document\")),\n (name = \"comment\", title = (defaultText = \"comment\"),\n description = (defaultText = \"allows adding comments\"))],\n roles = [(title = (defaultText = \"editor\"),\n permissions = [true, true],\n verbPhrase = (defaultText = \"can edit\"),\n default = true),\n (title = (defaultText = \"viewer\"),\n permissions = [false, false],\n verbPhrase = (defaultText = \"can view\")),\n (title = (defaultText = \"commenter\"),\n permissions = [false, true],\n verbPhrase = (defaultText = \"can comment\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"9001\", \"--\", \"bin\/run.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"a3d23aa43cc41a183e73ee42f6e4c6bdb46134bb","subject":"Update license for Sandstorm file.","message":"Update license for Sandstorm file.\n","repos":"firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii,firefly-iii\/firefly-iii,JC5\/firefly-iii","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 1,\n appMarketingVersion = (defaultText = \"4.6.9.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.github.io\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n license = (openSource = gpl3),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n upstreamAuthor = \"James Cole\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","old_contents":"@0xb0032512fca90cd9;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appTitle = (defaultText = \"Firefly III\"),\n appVersion = 1,\n appMarketingVersion = (defaultText = \"4.6.9.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( nounPhrase = (defaultText = \"administration\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (png = (dpi1x = embed \"app-graphics\/firefly-iii-128.png\")),\n grain = (png = (dpi1x = embed \"app-graphics\/firefly-iii-24.png\",\n dpi2x = embed \"app-graphics\/firefly-iii-48.png\")),\n market = (png = (dpi1x = embed \"app-graphics\/firefly-iii-150.png\"))\n ),\n\n website = \"https:\/\/firefly-iii.github.io\/\",\n codeUrl = \"https:\/\/github.com\/firefly-iii\/firefly-iii\",\n #license = (openSource = mit),\n license = (proprietary = (defaultText = embed \"..\/LICENSE\")),\n # The license this package is distributed under. See\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#license\n\n categories = [productivity],\n # A list of categories\/genres to which this app belongs, sorted with best fit first.\n # See the list of categories at\n # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/publishing-apps\/#categories\n\n author = (\n contactEmail = \"thegrumpydictator@gmail.com\",\n upstreamAuthor = \"James Cole\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Financial management\"),\n screenshots = [\n # Screenshots to use for marketing purposes. Examples below.\n # Sizes are given in device-independent pixels, so if you took these\n # screenshots on a Retina-style high DPI screen, divide each dimension by two.\n\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-1.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-2.png\"),\n (width = 1291, height = 800, png = embed \"screenshots\/screenshot-3.png\"),\n\n ],\n changeLog = (defaultText = embed \"changelog.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"opt\/app\/app\",\"opt\/app\/bootstrap\",\"opt\/app\/config\",\"opt\/app\/database\",\"opt\/app\/public\",\"opt\/app\/resources\",\"opt\/app\/routes\",\"opt\/app\/vendor\"],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n #bridgeConfig = (\n # # Used for integrating permissions and roles into the Sandstorm shell\n # # and for sandstorm-http-bridge to pass to your app.\n # # Uncomment this block and adjust the permissions and roles to make\n # # sense for your app.\n # # For more information, see high-level documentation at\n # # https:\/\/docs.sandstorm.io\/en\/latest\/developing\/auth\/\n # # and advanced details in the \"BridgeConfig\" section of\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/package.capnp\n # viewInfo = (\n # # For details on the viewInfo field, consult \"ViewInfo\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n #\n # permissions = [\n # # Permissions which a user may or may not possess. A user's current\n # # permissions are passed to the app as a comma-separated list of `name`\n # # fields in the X-Sandstorm-Permissions header with each request.\n # #\n # # IMPORTANT: only ever append to this list! Reordering or removing fields\n # # will change behavior and permissions for existing grains! To deprecate a\n # # permission, or for more information, see \"PermissionDef\" in\n # # https:\/\/github.com\/sandstorm-io\/sandstorm\/blob\/master\/src\/sandstorm\/grain.capnp\n # (\n # name = \"editor\",\n # # Name of the permission, used as an identifier for the permission in cases where string\n # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.\n #\n # title = (defaultText = \"editor\"),\n # # Display name of the permission, e.g. to display in a checklist of permissions\n # # that may be assigned when sharing.\n #\n # description = (defaultText = \"grants ability to modify data\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # ],\n # roles = [\n # # Roles are logical collections of permissions. For instance, your app may have\n # # a \"viewer\" role and an \"editor\" role\n # (\n # title = (defaultText = \"editor\"),\n # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.\n #\n # permissions = [true],\n # # An array indicating which permissions this role carries.\n # # It should be the same length as the permissions array in\n # # viewInfo, and the order of the lists must match.\n #\n # verbPhrase = (defaultText = \"can make changes to the document\"),\n # # Brief explanatory text to show in the sharing UI indicating\n # # what a user assigned this role will be able to do with the grain.\n #\n # description = (defaultText = \"editors may view all site data and change settings.\"),\n # # Prose describing what this role means, suitable for a tool tip or similar help text.\n # ),\n # (\n # title = (defaultText = \"viewer\"),\n # permissions = [false],\n # verbPhrase = (defaultText = \"can view the document\"),\n # description = (defaultText = \"viewers may view what other users have written.\"),\n # ),\n # ],\n # ),\n # #apiPath = \"\/api\",\n # # Apps can export an API to the world. The API is to be used primarily by Javascript\n # # code and native apps, so it can't serve out regular HTML to browsers. If a request\n # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with\n # # this string, if specified.\n #),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/bin\/bash\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm\n # can detect if $SANDSTORM=\"1\" at runtime, switching UI and\/or backend to use\n # the app's Sandstorm-specific integration code.\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"9a545a40ee6ae4c71868a5517bf7b988cadb37d1","subject":"update version number","message":"update version number\n","repos":"dwrensha\/groovebasin,neynah\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appVersion = 3, # Increment this for every release.\n\n actions = [\n ( title = (defaultText = \"New GrooveBasin Instance\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\")]\n )\n )\n\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n appVersion = 1, # Increment this for every release.\n\n actions = [\n ( title = (defaultText = \"New GrooveBasin Instance\"),\n command = .myCommand\n )\n ],\n\n continueCommand = .myCommand\n ),\n\n sourceMap = (\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/nsswitch.conf\"]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n\n alwaysInclude = [],\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\")]\n )\n )\n\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"\/bin\/sh\", \"start.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"693053555547d417322973ccefc3ef63c5a0f743","subject":"update Sandstorm metadata for bugfix release","message":"update Sandstorm metadata for bugfix release\n","repos":"mario-orlicky\/wekan,libreboard\/libreboard,mario-orlicky\/wekan,wekan\/wekan,oliver4u\/WEKAN_runpartner,Serubin\/wekan,nztqa\/wekan,libreboard\/libreboard,wekan\/wekan,nztqa\/wekan,wekan\/wekan,oliver4u\/sap-wekan,johnleeming\/wekan,wekan\/wekan,johnleeming\/wekan,mario-orlicky\/wekan,jtickle\/wekan,ddanssaert\/wekan,GhassenRjab\/wekan,oliver4u\/WEKAN_runpartner,oliver4u\/WEKAN_runpartner,GhassenRjab\/wekan,jtickle\/wekan,nztqa\/wekan,GhassenRjab\/wekan,oliver4u\/sap-wekan,oliver4u\/sap-wekan,johnleeming\/wekan,ddanssaert\/wekan,Serubin\/wekan,ddanssaert\/wekan,Serubin\/wekan,wekan\/wekan,johnleeming\/wekan,jtickle\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 16,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0~2016-11-15\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wefork\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n upstreamAuthor = \"Maxime Quandalle\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"meta\/dwrensha-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 14,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0~2016-11-08\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n upstreamAuthor = \"Maxime Quandalle\",\n contactEmail = \"david@sandstorm.io\",\n pgpSignature = embed \"meta\/dwrensha-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"edea0aab4dc5a9af6bbcdc9b451af1df9fe491a5","subject":"Tweak RPC protocol.","message":"Tweak RPC protocol.\n","repos":"MarPiRK\/capnproto,bsn069\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,pjulien\/capnproto,bsn069\/capnproto,pjulien\/capnproto,jparyani\/capnproto,joliss\/capnproto,johnkdoe\/capnproto,hntrmrrs\/capnproto,johnkdoe\/capnproto,vladon\/capnproto,ligzy\/capnproto,modulexcite\/capnproto,nagyistoce\/capnproto,rcrowder\/capnproto,jparyani\/capnproto,artillery\/capnproto,a-richardson\/capnproto,modulexcite\/capnproto,ocdtrekkie\/capnproto,jparyani\/capnproto,kamalmarhubi\/capnproto,ligzy\/capnproto,khklau\/capnproto,Fraser999\/capnproto,zarvox\/capnproto,Fraser999\/capnproto,bryce-gibson\/capnproto,kamalmarhubi\/capnproto,modulexcite\/capnproto,bryce-gibson\/capnproto,maurer\/capnproto,ocdtrekkie\/capnproto,khklau\/capnproto,MarPiRK\/capnproto,rcrowder\/capnproto,mologie\/capnproto,mrdomino\/capnproto,rcrowder\/capnproto,martindale\/capnproto,bryce-gibson\/capnproto,geofft\/capnproto,vladon\/capnproto,artillery\/capnproto,maurer\/capnproto,kamalmarhubi\/capnproto,geofft\/capnproto,hntrmrrs\/capnproto,ligzy\/capnproto,zarvox\/capnproto,geofft\/capnproto,pjulien\/capnproto,zarvox\/capnproto,khklau\/capnproto,mologie\/capnproto,martindale\/capnproto,martindale\/capnproto,mologie\/capnproto,nagyistoce\/capnproto,bsn069\/capnproto,maurer\/capnproto,johnkdoe\/capnproto,artillery\/capnproto,a-richardson\/capnproto,MarPiRK\/capnproto,mrdomino\/capnproto,Fraser999\/capnproto,ocdtrekkie\/capnproto,nagyistoce\/capnproto,joliss\/capnproto,vladon\/capnproto,joliss\/capnproto,a-richardson\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted @0 :ExportId;\n # A capability newly exported by the sender. This is the ID of the new capability in the\n # sender's export table (receiver's import table).\n\n senderPromise @1 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n #\n # TODO(soon): Can we merge this with senderHosted? Change `Resolve` to be allowed on any\n # export (i.e. it can be delivered zero or one times). Maybe rename it to `Replace`.\n\n receiverHosted @2 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @3 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @4 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it must immediately\n # stop serving pipeline requests on this question ID. The crurrent request, as well as\n # all future pipeline requests on the same question ID, must return with\n # `unsupportedPipelineOp` set. The caller must then arrange to re-send the calls as normal\n # calls later. The reason that all future pipeline calls on the same question must fail is\n # so that if the caller was relying on the calls being delivered in a particular order, this\n # requirement is not violated.\n #\n # TODO(soon): There's still a problem here in that if the call returns then the caller might\n # start making regular (non-pipeline) calls to it before it finds out that the pipelined calls\n # failed. Also, what about PromisedAnswers that appear in CapDescriptors? Maybe what really\n # needs to happen here is, the callee echos the PromisedAnswer back to the caller to say\n # \"I don't know how to resolve this; please do it for me\", and in the meantime it blocks all\n # calls to the capability? Ick...\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident.\n\n isPermanent @2 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @3 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we use the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n\n # TODO(now): Change this so that multiple parts can be sent in a single Join message, so that\n # if multiple join parts are going to cross the same connection they can be sent together, so that\n # the receive can potentially optimize its handling of them. In the case where all parts are\n # bundled together, should the recipient be expected to simply return a cap, so that the caller\n # can immediately start pipelining to it?\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should\n # reply with a `Return` with `unsupportedPipelineOp` set.\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident.\n\n isPermanent @2 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @3 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32) :NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId :RecipientId) :Connection;\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# struct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"32c8bb08dca6ea83260124497cf9b9866770713b","subject":"Update Temoral Memory Proto to include Orphan Decay","message":"Update Temoral Memory Proto to include Orphan Decay\n","repos":"pettitda\/nupic.core,ywcui1990\/nupic.core,utensil\/nupic.core,scottpurdy\/nupic.core,neuroidss\/nupic.core,numenta\/htmresearch-core,rcrowder\/nupic.core,ywcui1990\/nupic.core,jaredweiss\/nupic.core,Bemujo\/https-github.com-numenta-nupic,akhilaananthram\/nupic.core,breznak\/nupic.core,rhyolight\/nupic.core,numenta\/htmresearch-core,rcrowder\/nupic.core,EricSB\/nupic.core,lscheinkman\/nupic.core,akhilaananthram\/nupic.core,metaml\/nupic.core,ywcui1990\/nupic.core,scottpurdy\/nupic.core,metaml\/nupic.core,pettitda\/nupic.core,utensil\/nupic.core,Bemujo\/https-github.com-numenta-nupic,numenta\/nupic.core,lscheinkman\/nupic.core,akhilaananthram\/nupic.core,rcrowder\/nupic.core,jaredweiss\/nupic.core,neuroidss\/nupic.core,numenta\/nupic.core,numenta\/htmresearch-core,lscheinkman\/nupic.core,sambitgaan\/nupic.core,metaml\/nupic.core,breznak\/nupic.core,utensil\/nupic.core,utensil\/nupic.core,numenta\/nupic.core,ywcui1990\/nupic.core,rhyolight\/nupic.core,Bemujo\/https-github.com-numenta-nupic,lscheinkman\/nupic.core,pettitda\/nupic.core,breznak\/nupic.core,brev\/nupic.core,brev\/nupic.core,rcrowder\/nupic.core,numenta\/nupic.core,Bemujo\/https-github.com-numenta-nupic,scottpurdy\/nupic.core,rhyolight\/nupic.core,EricSB\/nupic.core,subutai\/nupic.core,jaredweiss\/nupic.core,scottpurdy\/nupic.core,rhyolight\/nupic.core,neuroidss\/nupic.core,subutai\/nupic.core,jaredweiss\/nupic.core,sambitgaan\/nupic.core,pettitda\/nupic.core,subutai\/nupic.core,sambitgaan\/nupic.core,EricSB\/nupic.core,metaml\/nupic.core,numenta\/htmresearch-core,breznak\/nupic.core,brev\/nupic.core,EricSB\/nupic.core,brev\/nupic.core,akhilaananthram\/nupic.core,sambitgaan\/nupic.core,subutai\/nupic.core,neuroidss\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 19\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32; \n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n matchingSegments @16 :List(UInt32);\n matchingCells @17 :List(UInt32);\n permanenceOrphanDecrement @18 :Float32;\n}\n","old_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 19\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n permanenceOrphanDecrement @10 :Float32;\n\n connections @11 :ConnectionsProto;\n random @12 :RandomProto;\n\n # Lists of indices\n activeCells @13 :List(UInt32);\n predictiveCells @14 :List(UInt32);\n activeSegments @15 :List(UInt32);\n winnerCells @16 :List(UInt32);\n matchingSegments @17 :List(UInt32);\n matchingCells @18 :List(UInt32);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"ca481e2d396dc093ba62b8e6394966d522946050","subject":"Increased Version No.","message":"Increased Version No.\n\nVesion 6 alpha build from October 5th 2015\n","repos":"JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 6, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2015.10.05 alpha\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 5, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2015.08.24\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"b2c5b6afead79815a3d0483ee85ad6d562057eec","subject":"bump version number","message":"bump version number\n","repos":"neynah\/sharelatex,dwrensha\/sharelatex,dwrensha\/sharelatex,neynah\/sharelatex","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.1\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","old_contents":"@0xb1ad881ac0baba9f;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"5vuv7v0w7gu20z72m78n83rx9qqtqpmtk32f39823wh967z226qh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 3, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New ShareLaTeX Project\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath=\"\/usr\/bin\/niscud\", packagePath=\"usr\/bin\/mongod\"),\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n \n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [\"usr\/share\/texmf-dist\"]\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"2999\", \"--\", \"\/start.bash\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"USER\", value=\"sandstorm-user\")\n ]\n);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"2a9723761409529dba7bd3acf32864b7f9b93231","subject":"Test build","message":"Test build\n\nto solve https:\/\/github.com\/JamborJan\/paperwork\/issues\/36\n","repos":"JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork,JamborJan\/paperwork","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 7, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2016.02.02 beta\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0xaedf071934889091;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vxe8awcxvtj6yu0vgjpm1tsaeu7x8v8tfp71tyvnm6ykkephu9q0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Paperwork\"),\n\n appVersion = 6, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"2015.10.05 alpha\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Paperwork\"),\n nounPhrase = (defaultText = \"note\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/paperwork-128.svg\"),\n grain = (svg = embed \"app-graphics\/paperwork-24.svg\"),\n market = (svg = embed \"app-graphics\/paperwork-150.svg\"),\n ),\n\n website = \"http:\/\/paperwork.rocks\/\",\n codeUrl = \"https:\/\/github.com\/JamborJan\/paperwork\",\n license = (openSource = mit),\n categories = [productivity],\n\n author = (\n contactEmail = \"jan@jambor.pro\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Twostairs\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n\n screenshots = [\n (width = 448, height = 249, png = embed \"sandstorm-screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = [],\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n bridgeConfig = (\n viewInfo = (\n permissions = [(name = \"admin\", title = (defaultText = \"admin\"),\n description = (defaultText = \"Is the owner.\")),\n (name = \"write\", title = (defaultText = \"write\"),\n description = (defaultText = \"Can write.\")),\n (name = \"read\", title = (defaultText = \"read\"),\n description = (defaultText = \"Can read.\"))],\n roles = [(title = (defaultText = \"Owner\"),\n permissions = [true, true, true],\n verbPhrase = (defaultText = \"Is owner, can add & edit notes.\"),\n default = true),\n (title = (defaultText = \"Read & write\"),\n permissions = [false, true, true],\n verbPhrase = (defaultText = \"Can add & edit notes.\")),\n (title = (defaultText = \"Read only\"),\n permissions = [false, false, true],\n verbPhrase = (defaultText = \"Can read existing notes.\"))]\n )\n )\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"9d8e0d8febcbcbca332e5efa3b7d073bbf9a73f1","subject":"the ClientStatus message now includes a frame number value","message":"the ClientStatus message now includes a frame number value\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/csprotocol\/protocol.capnp","new_file":"src\/csprotocol\/protocol.capnp","new_contents":"@0xabe13ea5f0adf862;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Command = import \"command.capnp\";\nusing CommonCommand = import \"\/common\/command.capnp\";\nusing CommonAction = import \"\/common\/action.capnp\";\nusing CommonJudgement = import \"\/common\/judgement.capnp\";\nusing CommonMetadata = import \"\/common\/metadata.capnp\";\nusing Error = import \"\/common\/error.capnp\";\nusing Metadata = import \"\/common\/metadata.capnp\";\n\nusing RecipientId = UInt64;\n\nstruct ClientStatus\n{\n frame @0 :CommonMetadata.FrameNumber;\n status @1 :AnyPointer;\n}\n\nstruct ClientTransaction\n{\n union\n {\n\tregistration @0 :Command.RegistrationRequest;\n\taction @1 :CommonAction.PlayerAction;\n\tdisconnect @2 :Void;\n }\n}\n\nstruct ServerStatus\n{\n recipient @0 :RecipientId;\n snapshot @1 :AnyPointer;\n}\n\nstruct ServerTransaction\n{\n recipient @0 :RecipientId;\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tdisconnect @3 :Void;\n\tregSuccess @4 :Void;\n\tregError @5 :Command.RegistrationError;\n\tfieldOpen @6 :CommonJudgement.FieldOpen;\n\tkickOff @7 :CommonJudgement.KickOff;\n\ttimeOver @8 :CommonJudgement.TimeOver;\n\tmatchClose @9 :CommonJudgement.MatchClose;\n\tmatchAbort @10 :CommonJudgement.MatchAbort;\n\tplayJudgement @11 :CommonJudgement.PlayJudgement;\n }\n}\n","old_contents":"@0xabe13ea5f0adf862;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::csprotocol\");\n\nusing Command = import \"command.capnp\";\nusing CommonCommand = import \"\/common\/command.capnp\";\nusing CommonAction = import \"\/common\/action.capnp\";\nusing CommonJudgement = import \"\/common\/judgement.capnp\";\nusing Error = import \"\/common\/error.capnp\";\nusing Metadata = import \"\/common\/metadata.capnp\";\n\nusing RecipientId = UInt64;\n\nstruct ClientStatus\n{\n status @0 :AnyPointer;\n}\n\nstruct ClientTransaction\n{\n union\n {\n\tregistration @0 :Command.RegistrationRequest;\n\taction @1 :CommonAction.PlayerAction;\n\tdisconnect @2 :Void;\n }\n}\n\nstruct ServerStatus\n{\n recipient @0 :RecipientId;\n snapshot @1 :AnyPointer;\n}\n\nstruct ServerTransaction\n{\n recipient @0 :RecipientId;\n union\n {\n\tunknownMsg @1 :Error.UnknownMsgError;\n\tmalformedMsg @2 :Error.MalformedMsgError;\n\tdisconnect @3 :Void;\n\tregSuccess @4 :Void;\n\tregError @5 :Command.RegistrationError;\n\tfieldOpen @6 :CommonJudgement.FieldOpen;\n\tkickOff @7 :CommonJudgement.KickOff;\n\ttimeOver @8 :CommonJudgement.TimeOver;\n\tmatchClose @9 :CommonJudgement.MatchClose;\n\tmatchAbort @10 :CommonJudgement.MatchAbort;\n\tplayJudgement @11 :CommonJudgement.PlayJudgement;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"34d95c8d097403c6fa89c3cb9b9b5d6f4cf79440","subject":"Client response should return current leader.","message":"Client response should return current leader.\n","repos":"danburkert\/raft,tschottdorf\/raft,achanda\/raft,tempbottle\/raft-1,Hoverbear\/raft,danburkert\/raft,posix4e\/raft,jamwt\/raft,frewsxcv\/raft-rs,pwoolcoc\/raft,placrosse\/raft,Hoverbear\/raft,frewsxcv\/raft-rs,tschottdorf\/raft","old_file":"src\/messages.capnp","new_file":"src\/messages.capnp","new_contents":"@0xbdca3d7c76dab735;\n\nstruct RpcRequest {\n union {\n appendEntries @0 :AppendEntriesRequest;\n requestVote @1 :RequestVoteRequest;\n }\n}\n\nstruct RpcResponse {\n union {\n appendEntries @0 :AppendEntriesResponse;\n requestVote @1 :RequestVoteResponse;\n }\n}\n\nstruct AppendEntriesRequest {\n\n term @0 :UInt64;\n # The leader's term.\n\n prevLogIndex @1 :UInt64;\n # Index of log entry immediately preceding new ones.\n\n prevLogTerm @2 :UInt64;\n # Term of prevLogIndex entry.\n\n entries @3 :List(Data);\n # Log entries to store (empty for heartbeat; may send more than one for\n # efficiency).\n\n leaderCommit @4 :UInt64;\n # leader\u2019s commit index.\n}\n\nstruct AppendEntriesResponse {\n\n struct LogInfo {\n term @0 :UInt64;\n index @1 :UInt64;\n }\n\n union {\n success @0 :LogInfo;\n # The `AppendEntries` request was a success.\n\n staleTerm @1 :UInt64;\n # The `AppendEntries` request failed because the follower has a greater term\n # than the leader. The follower's term is included.\n\n inconsistentPrevEntry @2 :Void;\n # The `AppendEntries` request failed because the follower failed the\n # previous entry term and index checks.\n\n internalError @3 :Text;\n # an internal error occured; a description is included.\n }\n}\n\nstruct RequestVoteRequest {\n\n term @0 :UInt64;\n # The candidate's term.\n\n lastLogIndex @1 :UInt64;\n # The index of the candidate's last log entry.\n\n lastLogTerm @2 :UInt64;\n # The term of the candidate's last log entry.\n}\n\nstruct RequestVoteResponse {\n\n union {\n granted @0 :UInt64;\n # The voter voted for the candidate; the candidate's term is included.\n\n staleTerm @1 :UInt64;\n # The `RequestVote` request failed because the voter has a greater term\n # than the candidate. The voter's term is included.\n\n alreadyVoted @2 :Void;\n # The voter did not vote for the candidate, because the voter already voted\n # in the term.\n\n inconsistentLog @3 :Void;\n # The `RequestVote` request failed because the candidate's log is not\n # up-to-date with the voter's log.\n\n internalError @4 :Text;\n # an internal error occured; a description is included.\n }\n}\n\nstruct ClientRequest {\n entry @0 :Data;\n}\n\nstruct ClientResponse {\n union {\n success @0 :Void;\n # The client request succeeded.\n\n notLeader @1 :Text;\n # The client request failed because the Raft node is not the leader.\n # The value returned is the address of the leader.\n }\n}\n","old_contents":"@0xbdca3d7c76dab735;\n\nstruct RpcRequest {\n union {\n appendEntries @0 :AppendEntriesRequest;\n requestVote @1 :RequestVoteRequest;\n }\n}\n\nstruct RpcResponse {\n union {\n appendEntries @0 :AppendEntriesResponse;\n requestVote @1 :RequestVoteResponse;\n }\n}\n\nstruct AppendEntriesRequest {\n\n term @0 :UInt64;\n # The leader's term.\n\n prevLogIndex @1 :UInt64;\n # Index of log entry immediately preceding new ones.\n\n prevLogTerm @2 :UInt64;\n # Term of prevLogIndex entry.\n\n entries @3 :List(Data);\n # Log entries to store (empty for heartbeat; may send more than one for\n # efficiency).\n\n leaderCommit @4 :UInt64;\n # leader\u2019s commit index.\n}\n\nstruct AppendEntriesResponse {\n\n struct LogInfo {\n term @0 :UInt64;\n index @1 :UInt64;\n }\n\n union {\n success @0 :LogInfo;\n # The `AppendEntries` request was a success.\n\n staleTerm @1 :UInt64;\n # The `AppendEntries` request failed because the follower has a greater term\n # than the leader. The follower's term is included.\n\n inconsistentPrevEntry @2 :Void;\n # The `AppendEntries` request failed because the follower failed the\n # previous entry term and index checks.\n\n internalError @3 :Text;\n # an internal error occured; a description is included.\n }\n}\n\nstruct RequestVoteRequest {\n\n term @0 :UInt64;\n # The candidate's term.\n\n lastLogIndex @1 :UInt64;\n # The index of the candidate's last log entry.\n\n lastLogTerm @2 :UInt64;\n # The term of the candidate's last log entry.\n}\n\nstruct RequestVoteResponse {\n\n union {\n granted @0 :UInt64;\n # The voter voted for the candidate; the candidate's term is included.\n\n staleTerm @1 :UInt64;\n # The `RequestVote` request failed because the voter has a greater term\n # than the candidate. The voter's term is included.\n\n alreadyVoted @2 :Void;\n # The voter did not vote for the candidate, because the voter already voted\n # in the term.\n\n inconsistentLog @3 :Void;\n # The `RequestVote` request failed because the candidate's log is not\n # up-to-date with the voter's log.\n\n internalError @4 :Text;\n # an internal error occured; a description is included.\n }\n}\n\nstruct ClientRequest {\n entry @0 :Data;\n}\n\nstruct ClientResponse {\n union {\n success @0 :Void;\n # The client request succeeded.\n\n notLeader @1 :Void;\n # The client request failed because the Raft node is not the leader.\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a80c97a585009b6c0a478f793f89d31bec045a4e","subject":"formatting","message":"formatting\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"src\/blackrock\/machine.capnp","new_file":"src\/blackrock\/machine.capnp","new_contents":"# Sandstorm Blackrock\n# Copyright (c) 2015 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0x96022888188b4f2f;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"blackrock\");\n\nusing ClusterRpc = import \"cluster-rpc.capnp\";\nusing Storage = import \"storage.capnp\";\nusing StorageSchema = import \"storage-schema.capnp\";\nusing Worker = import \"worker.capnp\";\nusing Util = import \"\/sandstorm\/util.capnp\";\n\nusing VatId = ClusterRpc.VatId;\nusing Address = ClusterRpc.Address;\nusing SturdyRef = ClusterRpc.SturdyRef;\nusing Restorer = ClusterRpc.Restorer;\nusing BackendSet = ClusterRpc.BackendSet;\n\ninterface MasterRestorer(Ref) {\n # Represents a Restorer that can restore capabilities for any owner. This capability should only\n # be given to the cluster master, which must then attenuate it for specific owners before passing\n # it on to said owners.\n\n getForOwner @0 (domain :SturdyRef.Owner) -> (attenuated :Restorer(Ref));\n}\n\ninterface Gateway {\n # Gateway machines bridge between the cluster and the external network (usually the internet).\n # They bridge between different parameterizations of Cap'n Proto, serve as a firewall, and\n # provide a way for internal apps to make external requests which are explicitly prevented from\n # accessing internal machines (e.g. if an app requests to connect to some IP, we need to make\n # sure that IP is on the public internet, not internal; the best way to do that is to make\n # sure the connection is formed using a public network interface that can't even route to\n # internal IPs in the first place).\n\n # TODO(soon): Methods for:\n # - Sending \/ receiving general internet traffic. (In-cluster traffic is NOT permitted.)\n # - Making and accepting external Cap'n Proto connections and bridging those capabilities into\n # the fold.\n\n # TODO(cleanup): Move to its own file.\n}\n\ninterface Frontend {\n # Front-ends run the Sandstorm shell UI (a Meteor app). They accept HTTP connections proxied\n # from the Gateways.\n\n getHttpAddress @0 () -> (address :Address);\n # Get the address and port of the frontend's HTTP interface.\n\n # TODO(cleanup): Move this and Mongo stuff to a separate file frontend.capnp.\n}\n\ninterface Mongo {\n getMongoAddress @0 () -> (address :Address, username :Text, password :Text);\n}\n\ninterface MongoSibling {\n # TODO(soon): Information needed to set up replicas.\n}\n\ninterface Machine {\n # A machine, ready to serve.\n #\n # When a new machine is added to the cluster, its Machine capability is given to the cluster\n # master via an appropriately secure mechanism. Only the master should ever hold this capability.\n #\n # The master will call the methods below in order to tell the machine what it should do. Multiple\n # become*() method can be called to make the machine serve multiple purposes. Calling the same\n # become*() method twice, however, only updates the existing instance of that role and returns\n # the same capabilities as before.\n #\n # This interface is intentionally designed such that the master machine can perform its duties\n # without ever actually parsing any of the response messages. Everything the master does --\n # introducing machines to each other -- can be expressed via pipelining. This implies that it is\n # not possible to confuse or compromise the master machine by sending it weird messages. In the\n # future we could even literally extend the VatNetwork to discard incoming messages.\n\n becomeStorage @0 ()\n -> (sibling :Storage.StorageSibling,\n rootSet :Storage.StorageRootSet,\n storageRestorer :MasterRestorer(SturdyRef.Stored),\n storageFactory :Storage.StorageFactory,\n siblingSet: BackendSet(Storage.StorageSibling),\n hostedRestorerSet: BackendSet(Restorer(SturdyRef.Hosted)),\n gatewayRestorerSet: BackendSet(Restorer(SturdyRef.External)));\n becomeWorker @1 () -> (worker :Worker.Worker);\n becomeCoordinator @2 ()\n -> (coordinator :Worker.Coordinator,\n hostedRestorer :MasterRestorer(SturdyRef.Hosted),\n workerSet :BackendSet(Worker.Worker),\n storageRestorerSet :BackendSet(Restorer(SturdyRef.Stored)));\n becomeGateway @3 (storage :Storage.Assignable(StorageSchema.GatewayStorage))\n -> (gateway :Gateway,\n externalRestorer :MasterRestorer(SturdyRef.External),\n storageRestorers :BackendSet(Restorer(SturdyRef.Stored)),\n frontends :BackendSet(Frontend));\n becomeFrontend @4 (userStorage :Storage.Collection(StorageSchema.AccountStorage))\n -> (frontend :Frontend,\n storageRestorerSet: BackendSet(Restorer(SturdyRef.Stored)),\n storageRootSet: BackendSet(Storage.StorageRootSet),\n storageFactorieSet: BackendSet(Storage.StorageFactory),\n hostedRestorerSet: BackendSet(Restorer(SturdyRef.Hosted)),\n mongoSet: BackendSet(Mongo));\n becomeMongo @5 () -> (mongo :Mongo, siblingSet :BackendSet(MongoSibling));\n\n shutdown @6 ();\n # Do whatever is necessary to prepare this machine for safe shutdown. Do not return until it's\n # safe.\n}\n","old_contents":"# Sandstorm Blackrock\n# Copyright (c) 2015 Sandstorm Development Group, Inc.\n# All Rights Reserved\n\n@0x96022888188b4f2f;\n\n$import \"\/capnp\/c++.capnp\".namespace(\"blackrock\");\n\nusing ClusterRpc = import \"cluster-rpc.capnp\";\nusing Storage = import \"storage.capnp\";\nusing StorageSchema = import \"storage-schema.capnp\";\nusing Worker = import \"worker.capnp\";\nusing Util = import \"\/sandstorm\/util.capnp\";\n\nusing VatId = ClusterRpc.VatId;\nusing Address = ClusterRpc.Address;\nusing SturdyRef = ClusterRpc.SturdyRef;\nusing Restorer = ClusterRpc.Restorer;\nusing BackendSet = ClusterRpc.BackendSet;\n\ninterface MasterRestorer(Ref) {\n # Represents a Restorer that can restore capabilities for any owner. This capability should only\n # be given to the cluster master, which must then attenuate it for specific owners before passing\n # it on to said owners.\n\n getForOwner @0 (domain :SturdyRef.Owner) -> (attenuated :Restorer(Ref));\n}\n\ninterface Gateway {\n # Gateway machines bridge between the cluster and the external network (usually the internet).\n # They bridge between different parameterizations of Cap'n Proto, serve as a firewall, and\n # provide a way for internal apps to make external requests which are explicitly prevented from\n # accessing internal machines (e.g. if an app requests to connect to some IP, we need to make\n # sure that IP is on the public internet, not internal; the best way to do that is to make\n # sure the connection is formed using a public network interface that can't even route to\n # internal IPs in the first place).\n\n # TODO(soon): Methods for:\n # - Sending \/ receiving general internet traffic. (In-cluster traffic is NOT permitted.)\n # - Making and accepting external Cap'n Proto connections and bridging those capabilities into\n # the fold.\n\n # TODO(cleanup): Move to its own file.\n}\n\ninterface Frontend {\n # Front-ends run the Sandstorm shell UI (a Meteor app). They accept HTTP connections proxied\n # from the Gateways.\n\n getHttpAddress @0 () -> (address :Address);\n # Get the address and port of the frontend's HTTP interface.\n\n # TODO(cleanup): Move this and Mongo stuff to a separate file frontend.capnp.\n}\n\ninterface Mongo {\n getMongoAddress @0 () -> (address :Address, username :Text, password :Text);\n}\n\ninterface MongoSibling {\n # TODO(soon): Information needed to set up replicas.\n}\n\ninterface Machine {\n # A machine, ready to serve.\n #\n # When a new machine is added to the cluster, its Machine capability is given to the cluster\n # master via an appropriately secure mechanism. Only the master should ever hold this capability.\n #\n # The master will call the methods below in order to tell the machine what it should do. Multiple\n # become*() method can be called to make the machine serve multiple purposes. Calling the same\n # become*() method twice, however, only updates the existing instance of that role and returns\n # the same capabilities as before.\n #\n # This interface is intentionally designed such that the master machine can perform its duties\n # without ever actually parsing any of the response messages. Everything the master does --\n # introducing machines to each other -- can be expressed via pipelining. This implies that it is\n # not possible to confuse or compromise the master machine by sending it weird messages. In the\n # future we could even literally extend the VatNetwork to discard incoming messages.\n\n becomeStorage @0 ()\n -> (sibling :Storage.StorageSibling,\n rootSet :Storage.StorageRootSet,\n storageRestorer :MasterRestorer(SturdyRef.Stored),\n storageFactory :Storage.StorageFactory,\n siblingSet: BackendSet(Storage.StorageSibling),\n hostedRestorerSet: BackendSet(Restorer(SturdyRef.Hosted)),\n gatewayRestorerSet: BackendSet(Restorer(SturdyRef.External)));\n becomeWorker @1 () -> (worker :Worker.Worker);\n becomeCoordinator @2 ()\n -> (coordinator :Worker.Coordinator,\n hostedRestorer :MasterRestorer(SturdyRef.Hosted),\n workerSet: BackendSet(Worker.Worker),\n storageRestorerSet: BackendSet(Restorer(SturdyRef.Stored)));\n becomeGateway @3 (storage :Storage.Assignable(StorageSchema.GatewayStorage))\n -> (gateway :Gateway,\n externalRestorer :MasterRestorer(SturdyRef.External),\n storageRestorers :BackendSet(Restorer(SturdyRef.Stored)),\n frontends :BackendSet(Frontend));\n becomeFrontend @4 (userStorage :Storage.Collection(StorageSchema.AccountStorage))\n -> (frontend :Frontend,\n storageRestorerSet: BackendSet(Restorer(SturdyRef.Stored)),\n storageRootSet: BackendSet(Storage.StorageRootSet),\n storageFactorieSet: BackendSet(Storage.StorageFactory),\n hostedRestorerSet: BackendSet(Restorer(SturdyRef.Hosted)),\n mongoSet: BackendSet(Mongo));\n becomeMongo @5 () -> (mongo :Mongo, siblingSet :BackendSet(MongoSibling));\n\n shutdown @6 ();\n # Do whatever is necessary to prepare this machine for safe shutdown. Do not return until it's\n # safe.\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"ddd35176102dc17b68aeaeb10b483ed971c54f2a","subject":"Update Temoral Memory Proto to include Orphan Decay","message":"Update Temoral Memory Proto to include Orphan Decay\n","repos":"EricSB\/nupic.core,subutai\/nupic.core,scottpurdy\/nupic.core,pettitda\/nupic.core,breznak\/nupic.core,sambitgaan\/nupic.core,numenta\/htmresearch-core,utensil\/nupic.core,pettitda\/nupic.core,akhilaananthram\/nupic.core,lscheinkman\/nupic.core,sambitgaan\/nupic.core,numenta\/nupic.core,brev\/nupic.core,utensil\/nupic.core,lscheinkman\/nupic.core,rhyolight\/nupic.core,rhyolight\/nupic.core,rcrowder\/nupic.core,scottpurdy\/nupic.core,metaml\/nupic.core,neuroidss\/nupic.core,brev\/nupic.core,jaredweiss\/nupic.core,neuroidss\/nupic.core,pettitda\/nupic.core,sambitgaan\/nupic.core,rcrowder\/nupic.core,brev\/nupic.core,metaml\/nupic.core,lscheinkman\/nupic.core,jaredweiss\/nupic.core,subutai\/nupic.core,numenta\/nupic.core,EricSB\/nupic.core,metaml\/nupic.core,neuroidss\/nupic.core,utensil\/nupic.core,Bemujo\/https-github.com-numenta-nupic,ywcui1990\/nupic.core,numenta\/htmresearch-core,neuroidss\/nupic.core,scottpurdy\/nupic.core,jaredweiss\/nupic.core,Bemujo\/https-github.com-numenta-nupic,Bemujo\/https-github.com-numenta-nupic,ywcui1990\/nupic.core,akhilaananthram\/nupic.core,akhilaananthram\/nupic.core,breznak\/nupic.core,subutai\/nupic.core,numenta\/htmresearch-core,EricSB\/nupic.core,rcrowder\/nupic.core,numenta\/htmresearch-core,rcrowder\/nupic.core,lscheinkman\/nupic.core,pettitda\/nupic.core,breznak\/nupic.core,ywcui1990\/nupic.core,Bemujo\/https-github.com-numenta-nupic,metaml\/nupic.core,jaredweiss\/nupic.core,scottpurdy\/nupic.core,breznak\/nupic.core,utensil\/nupic.core,numenta\/nupic.core,rhyolight\/nupic.core,subutai\/nupic.core,sambitgaan\/nupic.core,ywcui1990\/nupic.core,EricSB\/nupic.core,brev\/nupic.core,rhyolight\/nupic.core,numenta\/nupic.core,akhilaananthram\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 19\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n permanenceOrphanDecrement @10 :Float32;\n\n connections @11 :ConnectionsProto;\n random @12 :RandomProto;\n\n # Lists of indices\n activeCells @13 :List(UInt32);\n predictiveCells @14 :List(UInt32);\n activeSegments @15 :List(UInt32);\n winnerCells @16 :List(UInt32);\n matchingSegments @17 :List(UInt32);\n matchingCells @18 :List(UInt32);\n}\n","old_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 18\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n # Lists of indices\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n matchingSegments @16 :List(UInt32);\n matchingCells @17 :List(UInt32);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"b0e00e86940cff264e970dc5e66aafcc9be8f74d","subject":"Adds next id comment to TestNodeProto schema.","message":"Adds next id comment to TestNodeProto schema.\n","repos":"akhilaananthram\/nupic.core,rcrowder\/nupic.core,numenta\/htmresearch-core,pettitda\/nupic.core,jaredweiss\/nupic.core,scottpurdy\/nupic.core,rhyolight\/nupic.core,numenta\/nupic.core,scottpurdy\/nupic.core,numenta\/nupic.core,numenta\/htmresearch-core,lscheinkman\/nupic.core,subutai\/nupic.core,metaml\/nupic.core,brev\/nupic.core,neuroidss\/nupic.core,neuroidss\/nupic.core,akhilaananthram\/nupic.core,brev\/nupic.core,metaml\/nupic.core,rcrowder\/nupic.core,numenta\/htmresearch-core,akhilaananthram\/nupic.core,subutai\/nupic.core,utensil\/nupic.core,Bemujo\/https-github.com-numenta-nupic,metaml\/nupic.core,neuroidss\/nupic.core,scottpurdy\/nupic.core,sambitgaan\/nupic.core,pettitda\/nupic.core,pettitda\/nupic.core,EricSB\/nupic.core,utensil\/nupic.core,breznak\/nupic.core,rcrowder\/nupic.core,Bemujo\/https-github.com-numenta-nupic,EricSB\/nupic.core,utensil\/nupic.core,subutai\/nupic.core,numenta\/htmresearch-core,brev\/nupic.core,sambitgaan\/nupic.core,subutai\/nupic.core,ywcui1990\/nupic.core,EricSB\/nupic.core,rhyolight\/nupic.core,neuroidss\/nupic.core,sambitgaan\/nupic.core,jaredweiss\/nupic.core,sambitgaan\/nupic.core,Bemujo\/https-github.com-numenta-nupic,rhyolight\/nupic.core,akhilaananthram\/nupic.core,numenta\/nupic.core,lscheinkman\/nupic.core,brev\/nupic.core,breznak\/nupic.core,scottpurdy\/nupic.core,ywcui1990\/nupic.core,metaml\/nupic.core,Bemujo\/https-github.com-numenta-nupic,utensil\/nupic.core,lscheinkman\/nupic.core,numenta\/nupic.core,ywcui1990\/nupic.core,pettitda\/nupic.core,jaredweiss\/nupic.core,rcrowder\/nupic.core,ywcui1990\/nupic.core,lscheinkman\/nupic.core,EricSB\/nupic.core,jaredweiss\/nupic.core,breznak\/nupic.core,rhyolight\/nupic.core,breznak\/nupic.core","old_file":"src\/nupic\/proto\/TestNodeProto.capnp","new_file":"src\/nupic\/proto\/TestNodeProto.capnp","new_contents":"@0xacbfb584b84b791c;\n\n# Next ID: 16\nstruct TestNodeProto {\n int32Param @0 :Int32;\n uint32Param @1 :UInt32;\n int64Param @2 :Int64;\n uint64Param @3 :UInt64;\n real32Param @4 :Float32;\n real64Param @5 :Float64;\n stringParam @6 :Text;\n\n real32ArrayParam @7 :List(Float32);\n int64ArrayParam @8 :List(Int64);\n\n iterations @9 :UInt32;\n outputElementCount @10 :UInt32;\n delta @11 :Int64;\n\n shouldCloneParam @12 :Bool;\n unclonedParam @13 :List(UInt32);\n unclonedInt64ArrayParam @14 :List(List(Int64));\n\n nodeCount @15 :UInt32;\n}\n","old_contents":"@0xacbfb584b84b791c;\n\nstruct TestNodeProto {\n int32Param @0 :Int32;\n uint32Param @1 :UInt32;\n int64Param @2 :Int64;\n uint64Param @3 :UInt64;\n real32Param @4 :Float32;\n real64Param @5 :Float64;\n # TODO: This wasn't serialized before?\n stringParam @6 :Text;\n\n real32ArrayParam @7 :List(Float32);\n int64ArrayParam @8 :List(Int64);\n\n iterations @9 :UInt32;\n outputElementCount @10 :UInt32;\n delta @11 :Int64;\n\n shouldCloneParam @12 :Bool;\n unclonedParam @13 :List(UInt32);\n unclonedInt64ArrayParam @14 :List(List(Int64));\n\n nodeCount @15 :UInt32;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"351d9d0c9577c9d543d543bc12a51388b0141324","subject":"Fix typo that caused parse error.","message":"Fix typo that caused parse error.\n","repos":"wekan\/wekan,wekan\/wekan,wekan\/wekan,wekan\/wekan,wekan\/wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 407,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"4.07.0~2020-05-26\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"RICHER_CARD_COMMENT_EDITOR\", value=\"false\"),\n (key = \"SCROLLINERTIA\", value=\"0\"),\n (key = \"SCROLLAMOUNT\", value=\"auto\"),\n (key = \"CARD_OPENED_WEBHOOK_ENABLED\", value=\"false\"),\n (key = \"NOTIFICATION_TRAY_AFTER_READ_DAYS_BEFORE_REMOVE\", value=\"\"),\n (key = \"BIGEVENTS_PATTERN\", value=\"NONE\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"OAUTH2_ENABLED\", value=\"\"),\n (key = \"OAUTH2_CLIENT_ID\", value=\"false\"),\n (key = \"OAUTH2_SECRET\", value=\"\"),\n (key = \"OAUTH2_SERVER_URL\", value=\"\"),\n (key = \"OAUTH2_AUTH_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_USERINFO_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_TOKEN_ENDPOINT\", value=\"\"),\n (key = \"LDAP_ENABLE\", value=\"false\"),\n (key = \"PASSWORD_LOGIN_ENABLED\", value=\"true\"),\n (key = \"SANDSTORM\", value=\"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"'# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 407,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"4.07.0~2020-05-26\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.github.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"x@xet7.org\",\n pgpSignature = embed \"meta\/wekanteam-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_01.png\"\n ),\n (\n width = 1920,\n height = 1133,\n png = embed \"meta\/screenshots\/board_view_02.png\"\n ),\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n (locale = \"fi\", text = embed \"meta\/t9n-changelog\/fi.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n (locale = \"fi\", text = \"osallistu\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taululle osallistumisen\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n (locale = \"fi\", text = \"asetukset\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n (locale = \"fi\", text = \"mahdollistaa taulun asetusten m\u00e4\u00e4ritt\u00e4misen\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n (locale = \"fi\", text = \"tarkkailija\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n (locale = \"fi\", text = \"voi lukea\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n (locale = \"fi\", text = \"j\u00e4sen\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n (locale = \"fi\", text = \"voi muokata\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )],\n\n eventTypes = [(\n name = \"addBoardMember\",\n verbPhrase = (defaultText = \"added to board\"),\n ), (\n name = \"createList\",\n verbPhrase = (defaultText = \"created new list\"),\n ), (\n name = \"archivedList\",\n verbPhrase = (defaultText = \"archived list\"),\n ), (\n name = \"restoredList\",\n verbPhrase = (defaultText = \"restored list\"),\n ), (\n name = \"createCard\",\n verbPhrase = (defaultText = \"created new card\"),\n ), (\n name = \"moveCard\",\n verbPhrase = (defaultText = \"moved card\"),\n ), (\n name = \"archivedCard\",\n verbPhrase = (defaultText = \"archived card\"),\n ), (\n name = \"restoredCard\",\n verbPhrase = (defaultText = \"restored card\"),\n ), (\n name = \"addComment\",\n verbPhrase = (defaultText = \"added comment\"),\n ), (\n name = \"addAttachement\",\n verbPhrase = (defaultText = \"added attachment\"),\n ), (\n name = \"joinMember\",\n verbPhrase = (defaultText = \"added to card\"),\n ), (\n name = \"unjoinMember\",\n verbPhrase = (defaultText = \"removed from card\"),\n ), ],\n ),\n apiPath = \"\/\",\n saveIdentityCaps = true,\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"WITH_API\", value = \"true\"),\n (key = \"RICHER_CARD_COMMENT_EDITOR\", value=\"false\"),\n (key = \"SCROLLINERTIA\", value=\"0\"),\n (key = \"SCROLLAMOUNT\", value=\"auto\"),\n (key = \"CARD_OPENED_WEBHOOK_ENABLED\", value=\"false\"),\n (key = \"NOTIFICATION_TRAY_AFTER_READ_DAYS_BEFORE_REMOVE\", value=\"\"),\n (key = \"BIGEVENTS_PATTERN\", value=\"NONE\"),\n (key = \"MATOMO_ADDRESS\", value=\"\"),\n (key = \"MATOMO_SITE_ID\", value=\"\"),\n (key = \"MATOMO_DO_NOT_TRACK\", value=\"true\"),\n (key = \"MATOMO_WITH_USERNAME\", value=\"false\"),\n (key = \"BROWSER_POLICY_ENABLED\", value=\"true\"),\n (key = \"TRUSTED_URL\", value=\"\"),\n (key = \"WEBHOOKS_ATTRIBUTES\", value=\"\"),\n (key = \"OAUTH2_ENABLED\", value=\"\"),\n (key = \"OAUTH2_CLIENT_ID\", value=\"false\"),\n (key = \"OAUTH2_SECRET\", value=\"\"),\n (key = \"OAUTH2_SERVER_URL\", value=\"\"),\n (key = \"OAUTH2_AUTH_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_USERINFO_ENDPOINT\", value=\"\"),\n (key = \"OAUTH2_TOKEN_ENDPOINT\", value=\"\"),\n (key = \"LDAP_ENABLE\", value=\"false\"),\n (key = \"PASSWORD_LOGIN_ENABLED\", value=\"true\"),\n (key = \"SANDSTORM\", value=\"1\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"dcfd09152c718aa4a8f9b6b37fcbb63c9a1a8946","subject":"Add comment.","message":"Add comment.\n","repos":"MarPiRK\/capnproto,mrdomino\/capnproto,mologie\/capnproto,vladon\/capnproto,jparyani\/capnproto-boostpython,bryce-gibson\/capnproto,pjulien\/capnproto,Fraser999\/capnproto,bryce-gibson\/capnproto,mrdomino\/capnproto,zarvox\/capnproto,bsn069\/capnproto,zarvox\/capnproto,pjulien\/capnproto,vladon\/capnproto,kamalmarhubi\/capnproto,hntrmrrs\/capnproto,rcrowder\/capnproto,hntrmrrs\/capnproto,maurer\/capnproto,rcrowder\/capnproto,modulexcite\/capnproto,Fraser999\/capnproto,geofft\/capnproto,ligzy\/capnproto,hntrmrrs\/capnproto,johnkdoe\/capnproto,rcrowder\/capnproto,bryce-gibson\/capnproto,ocdtrekkie\/capnproto,a-richardson\/capnproto,joliss\/capnproto,jparyani\/capnproto-boostpython,johnkdoe\/capnproto,mrdomino\/capnproto,a-richardson\/capnproto,MarPiRK\/capnproto,ligzy\/capnproto,mologie\/capnproto,MarPiRK\/capnproto,maurer\/capnproto,khklau\/capnproto,jparyani\/capnproto-boostpython,mologie\/capnproto,artillery\/capnproto,geofft\/capnproto,jparyani\/capnproto-boostpython,jparyani\/capnproto,pjulien\/capnproto,modulexcite\/capnproto,artillery\/capnproto,ocdtrekkie\/capnproto,jparyani\/capnproto,maurer\/capnproto,a-richardson\/capnproto,bsn069\/capnproto,nagyistoce\/capnproto,artillery\/capnproto,khklau\/capnproto,martindale\/capnproto,vladon\/capnproto,Fraser999\/capnproto,martindale\/capnproto,ocdtrekkie\/capnproto,kamalmarhubi\/capnproto,khklau\/capnproto,johnkdoe\/capnproto,zarvox\/capnproto,joliss\/capnproto,bsn069\/capnproto,jparyani\/capnproto-boostpython,nagyistoce\/capnproto,ligzy\/capnproto,jparyani\/capnproto,kamalmarhubi\/capnproto,modulexcite\/capnproto,martindale\/capnproto,geofft\/capnproto,nagyistoce\/capnproto,joliss\/capnproto","old_file":"c++\/src\/capnproto\/test.capnp","new_file":"c++\/src\/capnproto\/test.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nusing Cxx = import \"c++.capnp\";\n\n$Cxx.namespace(\"capnproto::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = \"bar\";\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x8000000, 0x7ffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestUnion {\n union0 @0 union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1 union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- should go into same space as u1f0s64.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2 union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3 union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = u0f0s16(321), union1 = u1f0s8(123), union2 = u2f0s64(12345678901234567),\n union3 = u3f0s8(55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = u0f1s0(void), union1 = u1f0sp(\"foo\"), union2 = u2f0s1(true),\n union3 = u3f0s32(12345678));\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestInline0 fixed(0 bits) { f @0: Void; }\nstruct TestInline1 fixed(1 bits) { f @0: Bool; }\nstruct TestInline8 fixed(8 bits) { f0 @0: Bool; f1 @1: Bool; f2 @2: Bool; }\nstruct TestInline16 fixed(16 bits) { f0 @0: UInt8; f1 @1: UInt8; }\nstruct TestInline32 fixed(32 bits) { f0 @0: UInt8; f1 @1: UInt16; }\nstruct TestInline64 fixed(64 bits) { f0 @0: UInt8; f1 @1: UInt32; }\nstruct TestInline128 fixed(2 words) { f0 @0: UInt64; f1 @1: UInt64; }\nstruct TestInline192 fixed(3 words) { f0 @0: UInt64; f1 @1: UInt64; f2 @2: UInt64; }\n\nstruct TestInline0p fixed(0 bits, 1 pointers) { f @0 :Inline(TestInline0); p0 @1 :Text; }\nstruct TestInline1p fixed(1 bits, 1 pointers) { f @0 :Inline(TestInline1); p0 @1 :Text; }\nstruct TestInline8p fixed(8 bits, 1 pointers) { f @0 :Inline(TestInline8); p0 @1 :Text; }\nstruct TestInline16p fixed(16 bits, 2 pointers) { f @0 :Inline(TestInline16); p0 @1 :Text; p1 @2 :Text; }\nstruct TestInline32p fixed(32 bits, 2 pointers) { f @0 :Inline(TestInline32); p0 @1 :Text; p1 @2 :Text; }\nstruct TestInline64p fixed(64 bits, 2 pointers) { f @0 :Inline(TestInline64); p0 @1 :Text; p1 @2 :Text; }\nstruct TestInline128p fixed(2 words, 3 pointers) { f @0 :Inline(TestInline128); p0 @1 :Text; p1 @2 :Text; p2 @3 :Text; }\nstruct TestInline192p fixed(3 words, 3 pointers) { f @0 :Inline(TestInline192); p0 @1 :Text; p1 @2 :Text; p2 @3 :Text; }\n\nstruct TestInlineLayout {\n f0 @0 :Inline(TestInline0);\n f1 @1 :Inline(TestInline1);\n f8 @2 :Inline(TestInline8);\n f16 @3 :Inline(TestInline16);\n f32 @4 :Inline(TestInline32);\n f64 @5 :Inline(TestInline64);\n f128 @6 :Inline(TestInline128);\n f192 @7 :Inline(TestInline192);\n\n f0p @8 :Inline(TestInline0p);\n f1p @9 :Inline(TestInline1p);\n f8p @10 :Inline(TestInline8p);\n f16p @11 :Inline(TestInline16p);\n f32p @12 :Inline(TestInline32p);\n f64p @13 :Inline(TestInline64p);\n f128p @14 :Inline(TestInline128p);\n f192p @15 :Inline(TestInline192p);\n\n f1Offset @16 :Inline(TestInline1);\n bit @17 :Bool;\n}\n\nstruct TestInlineUnions {\n union0 @0 union {\n f0 @4 :Inline(TestInline0);\n f1 @5 :Inline(TestInline1);\n f8 @6 :Inline(TestInline8);\n f16 @7 :Inline(TestInline16);\n f32 @8 :Inline(TestInline32);\n f64 @9 :Inline(TestInline64);\n f128 @10 :Inline(TestInline128);\n f192 @11 :Inline(TestInline192);\n\n f0p @12 :Inline(TestInline0p);\n f1p @13 :Inline(TestInline1p);\n f8p @14 :Inline(TestInline8p);\n f16p @15 :Inline(TestInline16p);\n f32p @16 :Inline(TestInline32p);\n f64p @17 :Inline(TestInline64p);\n f128p @18 :Inline(TestInline128p);\n f192p @19 :Inline(TestInline192p);\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @20: Bool;\n\n union1 @1 union {\n f0 @21 :Inline(TestInline0);\n f1 @22 :Inline(TestInline1);\n f8 @23 :Inline(TestInline8);\n f16 @24 :Inline(TestInline16);\n f32 @25 :Inline(TestInline32);\n f64 @26 :Inline(TestInline64);\n f128 @27 :Inline(TestInline128);\n f192 @28 :Inline(TestInline192);\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @29: Bool;\n bit3 @30: Bool;\n bit4 @31: Bool;\n bit5 @32: Bool;\n bit6 @33: Bool;\n bit7 @34: Bool;\n\n # Interleave two unions to be really annoying.\n union2 @2 union {\n f1p @35 :Inline(TestInline1p);\n f8p @37 :Inline(TestInline8p);\n f16p @40 :Inline(TestInline16p);\n f32p @42 :Inline(TestInline32p);\n f64p @44 :Inline(TestInline64p);\n f128p @46 :Inline(TestInline128p);\n f192p @48 :Inline(TestInline192p);\n }\n\n union3 @3 union {\n f1p @36 :Inline(TestInline1p);\n f8p @38 :Inline(TestInline8p);\n f16p @41 :Inline(TestInline16p);\n f32p @43 :Inline(TestInline32p);\n f64p @45 :Inline(TestInline64p);\n f128p @47 :Inline(TestInline128p);\n f192p @49 :Inline(TestInline192p);\n }\n\n byte0 @39: UInt8;\n}\n\nstruct TestInlineLists {\n voidList @ 0 : InlineList(Void, 2);\n boolList @ 1 : InlineList(Bool, 3);\n uInt8List @ 2 : InlineList(UInt8, 4);\n uInt16List @ 3 : InlineList(UInt16, 5);\n uInt32List @ 4 : InlineList(UInt32, 6);\n uInt64List @ 5 : InlineList(UInt64, 7);\n textList @ 6 : InlineList(Text, 8);\n\n structList0 @ 7 : InlineList(TestInline0, 2);\n structList1 @ 8 : InlineList(TestInline1, 3);\n structList8 @ 9 : InlineList(TestInline8, 4);\n structList16 @10 : InlineList(TestInline16, 2);\n structList32 @11 : InlineList(TestInline32, 3);\n structList64 @12 : InlineList(TestInline64, 4);\n structList128 @13 : InlineList(TestInline128, 2);\n structList192 @14 : InlineList(TestInline192, 3);\n\n structList0p @15 : InlineList(TestInline0p, 4);\n structList1p @16 : InlineList(TestInline1p, 2);\n structList8p @17 : InlineList(TestInline8p, 3);\n structList16p @18 : InlineList(TestInline16p, 4);\n structList32p @19 : InlineList(TestInline32p, 2);\n structList64p @20 : InlineList(TestInline64p, 3);\n structList128p @21 : InlineList(TestInline128p, 4);\n structList192p @22 : InlineList(TestInline192p, 2);\n}\n\nstruct TestStructLists {\n # Small structs, when encoded as list, will be encoded as primitive lists rather than struct\n # lists, to save space.\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n}\n\nstruct TestInlineDefaults {\n normal @0 :TestInlineLayout = (\n f0 = (f = void),\n f1 = (f = true),\n f8 = (f0 = true, f1 = false, f2 = true),\n f16 = (f0 = 123, f1 = 45),\n f32 = (f0 = 67, f1 = 8901),\n f64 = (f0 = 234, f1 = 567890123),\n f128 = (f0 = 1234567890123, f1 = 4567890123456),\n f192 = (f0 = 7890123456789, f1 = 2345678901234, f2 = 5678901234567),\n\n f0p = (p0 = \"foo\"),\n f1p = (f = (f = false), p0 = \"bar\"),\n f8p = (f = (f0 = true, f1 = true, f2 = false), p0 = \"baz\"),\n f16p = (f = (f0 = 98, f1 = 76), p0 = \"qux\", p1 = \"quux\"),\n f32p = (f = (f0 = 54, f1 = 32109), p0 = \"corge\", p1 = \"grault\"),\n f64p = (f = (f0 = 87, f1 = 654321098), p0 = \"garply\", p1 = \"waldo\"),\n f128p = (f = (f0 = 7654321098765, f1 = 4321098765432),\n p0 = \"fred\", p1 = \"plugh\", p2 = \"xyzzy\"),\n f192p = (f = (f0 = 1098765432109, f1 = 8765432109876, f2 = 5432109876543),\n p0 = \"thud\", p1 = \"foobar\", p2 = \"barbaz\"));\n\n unions @1 :TestInlineUnions = (\n union0 = f32(f0 = 67, f1 = 8901),\n union1 = f128(f0 = 1234567890123, f1 = 4567890123456),\n union2 = f1p(p0 = \"foo\"),\n union3 = f16p(f = (f0 = 98, f1 = 76), p0 = \"qux\", p1 = \"quux\"));\n\n lists @2 :TestInlineLists = (\n voidList = [void, void],\n boolList = [false, true, false],\n uInt8List = [12, 34, 56, 78],\n uInt16List = [1234, 5678, 9012, 3456, 7890],\n uInt32List = [123456789, 234567890, 345678901, 456789012, 567890123, 678901234],\n uInt64List = [1, 2, 3, 4, 5, 6, 7],\n textList = [\"foo\", \"bar\", \"baz\", \"qux\", \"quux\", \"corge\", \"grault\", \"garply\"],\n\n structList0 = [(f = void), ()],\n structList1 = [(f = true), (f = false), (f = true)],\n structList8 = [(f0 = true, f1 = false, f2 = false),\n (f0 = false, f1 = true, f2 = false),\n (f0 = true, f1 = true, f2 = false),\n (f0 = false, f1 = false, f2 = true)],\n structList16 = [(f0 = 12, f1 = 34), (f0 = 56, f1 = 78)],\n structList32 = [(f0 = 90, f1 = 12345), (f0 = 67, f1 = 8901), (f0 = 23, f1 = 45678)],\n structList64 = [(f0 = 90, f1 = 123456789), (f0 = 12, f1 = 345678901),\n (f0 = 234, f1 = 567890123), (f0 = 45, f1 = 678901234)],\n structList128 = [(f0 = 56789012345678, f1 = 90123456789012),\n (f0 = 34567890123456, f1 = 78901234567890)],\n structList192 = [(f0 = 1234567890123, f1 = 4567890123456, f2 = 7890123456789),\n (f0 = 123456789012, f1 = 3456789012345, f2 = 6789012345678),\n (f0 = 9012345678901, f1 = 2345678901234, f2 = 5678901234567)],\n\n structList0p = [(f = (f = void), p0 = \"foo\"), (p0 = \"bar\"),\n (f = (), p0 = \"baz\"), (p0 = \"qux\")],\n structList1p = [(f = (f = true), p0 = \"quux\"), (p0 = \"corge\")],\n structList8p = [(f = (f0 = true), p0 = \"grault\"), (p0 = \"garply\"), (p0 = \"waldo\")],\n structList16p = [(f = (f0 = 123), p0 = \"fred\", p1 = \"plugh\"),\n (p0 = \"xyzzy\", p1 = \"thud\"),\n (p0 = \"foobar\", p1 = \"barbaz\"),\n (p0 = \"bazqux\", p1 = \"quxquux\")],\n structList32p = [(f = (f1 = 12345), p0 = \"quuxcorge\", p1 = \"corgegrault\"),\n (p0 = \"graultgarply\", p1 = \"garplywaldo\")],\n structList64p = [(f = (f1 = 123456789), p0 = \"waldofred\", p1 = \"fredplugh\"),\n (p0 = \"plughxyzzy\", p1 = \"xyzzythud\"),\n (p0 = \"thudfoo\", p1 = \"foofoo\")],\n structList128p = [(f = (f1 = 123456789012345),\n p0 = \"foobaz\", p1 = \"fooqux\", p2 = \"foocorge\"),\n (p0 = \"barbaz\", p1 = \"barqux\", p2 = \"barcorge\"),\n (p0 = \"bazbaz\", p1 = \"bazqux\", p2 = \"bazcorge\"),\n (p0 = \"quxbaz\", p1 = \"quxqux\", p2 = \"quxcorge\")],\n structList192p = [(f = (f2 = 123456789012345),\n p0 = \"corgebaz\", p1 = \"corgequx\", p2 = \"corgecorge\"),\n (p0 = \"graultbaz\", p1 = \"graultqux\", p2 = \"graultcorge\")]);\n\n structLists @3 :TestStructLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")]);\n}\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nusing Cxx = import \"c++.capnp\";\n\n$Cxx.namespace(\"capnproto::test\");\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = \"bar\";\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x8000000, 0x7ffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestUnion {\n union0 @0 union {\n # Pack union 0 under ideal conditions: there is no unused padding space prior to it.\n u0f0s0 @4: Void;\n u0f0s1 @5: Bool;\n u0f0s8 @6: Int8;\n u0f0s16 @7: Int16;\n u0f0s32 @8: Int32;\n u0f0s64 @9: Int64;\n u0f0sp @10: Text;\n\n # Pack more stuff into union0 -- should go in same space.\n u0f1s0 @11: Void;\n u0f1s1 @12: Bool;\n u0f1s8 @13: Int8;\n u0f1s16 @14: Int16;\n u0f1s32 @15: Int32;\n u0f1s64 @16: Int64;\n u0f1sp @17: Text;\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @18: Bool;\n\n union1 @1 union {\n # Pack pathologically bad case. Each field takes up new space.\n u1f0s0 @19: Void;\n u1f0s1 @20: Bool;\n u1f1s1 @21: Bool;\n u1f0s8 @22: Int8;\n u1f1s8 @23: Int8;\n u1f0s16 @24: Int16;\n u1f1s16 @25: Int16;\n u1f0s32 @26: Int32;\n u1f1s32 @27: Int32;\n u1f0s64 @28: Int64;\n u1f1s64 @29: Int64;\n u1f0sp @30: Text;\n u1f1sp @31: Text;\n\n # Pack more stuff into union1 -- should go into same space as u1f0s64.\n u1f2s0 @32: Void;\n u1f2s1 @33: Bool;\n u1f2s8 @34: Int8;\n u1f2s16 @35: Int16;\n u1f2s32 @36: Int32;\n u1f2s64 @37: Int64;\n u1f2sp @38: Text;\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @39: Bool;\n bit3 @40: Bool;\n bit4 @41: Bool;\n bit5 @42: Bool;\n bit6 @43: Bool;\n bit7 @44: Bool;\n\n # Interleave two unions to be really annoying.\n # Also declare in reverse order to make sure union discriminant values are sorted by field number\n # and not by declaration order.\n union2 @2 union {\n u2f0s64 @54: Int64;\n u2f0s32 @52: Int32;\n u2f0s16 @50: Int16;\n u2f0s8 @47: Int8;\n u2f0s1 @45: Bool;\n }\n\n union3 @3 union {\n u3f0s64 @55: Int64;\n u3f0s32 @53: Int32;\n u3f0s16 @51: Int16;\n u3f0s8 @48: Int8;\n u3f0s1 @46: Bool;\n }\n\n byte0 @49: UInt8;\n}\n\nstruct TestUnionDefaults {\n s16s8s64s8Set @0 :TestUnion =\n (union0 = u0f0s16(321), union1 = u1f0s8(123), union2 = u2f0s64(12345678901234567),\n union3 = u3f0s8(55));\n s0sps1s32Set @1 :TestUnion =\n (union0 = u0f1s0(void), union1 = u1f0sp(\"foo\"), union2 = u2f0s1(true),\n union3 = u3f0s32(12345678));\n}\n\nstruct TestNestedTypes {\n enum NestedEnum {\n foo @0;\n bar @1;\n }\n\n struct NestedStruct {\n enum NestedEnum {\n baz @0;\n qux @1;\n quux @2;\n }\n\n outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;\n innerNestedEnum @1 :NestedEnum = quux;\n }\n\n nestedStruct @0 :NestedStruct;\n\n outerNestedEnum @1 :NestedEnum = bar;\n innerNestedEnum @2 :NestedStruct.NestedEnum = quux;\n}\n\nstruct TestUsing {\n using OuterNestedEnum = TestNestedTypes.NestedEnum;\n using TestNestedTypes.NestedStruct.NestedEnum;\n\n outerNestedEnum @1 :OuterNestedEnum = bar;\n innerNestedEnum @0 :NestedEnum = quux;\n}\n\nstruct TestInline0 fixed(0 bits) { f @0: Void; }\nstruct TestInline1 fixed(1 bits) { f @0: Bool; }\nstruct TestInline8 fixed(8 bits) { f0 @0: Bool; f1 @1: Bool; f2 @2: Bool; }\nstruct TestInline16 fixed(16 bits) { f0 @0: UInt8; f1 @1: UInt8; }\nstruct TestInline32 fixed(32 bits) { f0 @0: UInt8; f1 @1: UInt16; }\nstruct TestInline64 fixed(64 bits) { f0 @0: UInt8; f1 @1: UInt32; }\nstruct TestInline128 fixed(2 words) { f0 @0: UInt64; f1 @1: UInt64; }\nstruct TestInline192 fixed(3 words) { f0 @0: UInt64; f1 @1: UInt64; f2 @2: UInt64; }\n\nstruct TestInline0p fixed(0 bits, 1 pointers) { f @0 :Inline(TestInline0); p0 @1 :Text; }\nstruct TestInline1p fixed(1 bits, 1 pointers) { f @0 :Inline(TestInline1); p0 @1 :Text; }\nstruct TestInline8p fixed(8 bits, 1 pointers) { f @0 :Inline(TestInline8); p0 @1 :Text; }\nstruct TestInline16p fixed(16 bits, 2 pointers) { f @0 :Inline(TestInline16); p0 @1 :Text; p1 @2 :Text; }\nstruct TestInline32p fixed(32 bits, 2 pointers) { f @0 :Inline(TestInline32); p0 @1 :Text; p1 @2 :Text; }\nstruct TestInline64p fixed(64 bits, 2 pointers) { f @0 :Inline(TestInline64); p0 @1 :Text; p1 @2 :Text; }\nstruct TestInline128p fixed(2 words, 3 pointers) { f @0 :Inline(TestInline128); p0 @1 :Text; p1 @2 :Text; p2 @3 :Text; }\nstruct TestInline192p fixed(3 words, 3 pointers) { f @0 :Inline(TestInline192); p0 @1 :Text; p1 @2 :Text; p2 @3 :Text; }\n\nstruct TestInlineLayout {\n f0 @0 :Inline(TestInline0);\n f1 @1 :Inline(TestInline1);\n f8 @2 :Inline(TestInline8);\n f16 @3 :Inline(TestInline16);\n f32 @4 :Inline(TestInline32);\n f64 @5 :Inline(TestInline64);\n f128 @6 :Inline(TestInline128);\n f192 @7 :Inline(TestInline192);\n\n f0p @8 :Inline(TestInline0p);\n f1p @9 :Inline(TestInline1p);\n f8p @10 :Inline(TestInline8p);\n f16p @11 :Inline(TestInline16p);\n f32p @12 :Inline(TestInline32p);\n f64p @13 :Inline(TestInline64p);\n f128p @14 :Inline(TestInline128p);\n f192p @15 :Inline(TestInline192p);\n\n f1Offset @16 :Inline(TestInline1);\n bit @17 :Bool;\n}\n\nstruct TestInlineUnions {\n union0 @0 union {\n f0 @4 :Inline(TestInline0);\n f1 @5 :Inline(TestInline1);\n f8 @6 :Inline(TestInline8);\n f16 @7 :Inline(TestInline16);\n f32 @8 :Inline(TestInline32);\n f64 @9 :Inline(TestInline64);\n f128 @10 :Inline(TestInline128);\n f192 @11 :Inline(TestInline192);\n\n f0p @12 :Inline(TestInline0p);\n f1p @13 :Inline(TestInline1p);\n f8p @14 :Inline(TestInline8p);\n f16p @15 :Inline(TestInline16p);\n f32p @16 :Inline(TestInline32p);\n f64p @17 :Inline(TestInline64p);\n f128p @18 :Inline(TestInline128p);\n f192p @19 :Inline(TestInline192p);\n }\n\n # Pack one bit in order to make pathological situation for union1.\n bit0 @20: Bool;\n\n union1 @1 union {\n f0 @21 :Inline(TestInline0);\n f1 @22 :Inline(TestInline1);\n f8 @23 :Inline(TestInline8);\n f16 @24 :Inline(TestInline16);\n f32 @25 :Inline(TestInline32);\n f64 @26 :Inline(TestInline64);\n f128 @27 :Inline(TestInline128);\n f192 @28 :Inline(TestInline192);\n }\n\n # Fill in the rest of that bitfield from earlier.\n bit2 @29: Bool;\n bit3 @30: Bool;\n bit4 @31: Bool;\n bit5 @32: Bool;\n bit6 @33: Bool;\n bit7 @34: Bool;\n\n # Interleave two unions to be really annoying.\n union2 @2 union {\n f1p @35 :Inline(TestInline1p);\n f8p @37 :Inline(TestInline8p);\n f16p @40 :Inline(TestInline16p);\n f32p @42 :Inline(TestInline32p);\n f64p @44 :Inline(TestInline64p);\n f128p @46 :Inline(TestInline128p);\n f192p @48 :Inline(TestInline192p);\n }\n\n union3 @3 union {\n f1p @36 :Inline(TestInline1p);\n f8p @38 :Inline(TestInline8p);\n f16p @41 :Inline(TestInline16p);\n f32p @43 :Inline(TestInline32p);\n f64p @45 :Inline(TestInline64p);\n f128p @47 :Inline(TestInline128p);\n f192p @49 :Inline(TestInline192p);\n }\n\n byte0 @39: UInt8;\n}\n\nstruct TestInlineLists {\n voidList @ 0 : InlineList(Void, 2);\n boolList @ 1 : InlineList(Bool, 3);\n uInt8List @ 2 : InlineList(UInt8, 4);\n uInt16List @ 3 : InlineList(UInt16, 5);\n uInt32List @ 4 : InlineList(UInt32, 6);\n uInt64List @ 5 : InlineList(UInt64, 7);\n textList @ 6 : InlineList(Text, 8);\n\n structList0 @ 7 : InlineList(TestInline0, 2);\n structList1 @ 8 : InlineList(TestInline1, 3);\n structList8 @ 9 : InlineList(TestInline8, 4);\n structList16 @10 : InlineList(TestInline16, 2);\n structList32 @11 : InlineList(TestInline32, 3);\n structList64 @12 : InlineList(TestInline64, 4);\n structList128 @13 : InlineList(TestInline128, 2);\n structList192 @14 : InlineList(TestInline192, 3);\n\n structList0p @15 : InlineList(TestInline0p, 4);\n structList1p @16 : InlineList(TestInline1p, 2);\n structList8p @17 : InlineList(TestInline8p, 3);\n structList16p @18 : InlineList(TestInline16p, 4);\n structList32p @19 : InlineList(TestInline32p, 2);\n structList64p @20 : InlineList(TestInline64p, 3);\n structList128p @21 : InlineList(TestInline128p, 4);\n structList192p @22 : InlineList(TestInline192p, 2);\n}\n\nstruct TestStructLists {\n struct Struct0 { f @0 :Void; }\n struct Struct1 { f @0 :Bool; }\n struct Struct8 { f @0 :UInt8; }\n struct Struct16 { f @0 :UInt16; }\n struct Struct32 { f @0 :UInt32; }\n struct Struct64 { f @0 :UInt64; }\n struct StructP { f @0 :Text; }\n\n list0 @0 :List(Struct0);\n list1 @1 :List(Struct1);\n list8 @2 :List(Struct8);\n list16 @3 :List(Struct16);\n list32 @4 :List(Struct32);\n list64 @5 :List(Struct64);\n listP @6 :List(StructP);\n}\n\nstruct TestInlineDefaults {\n normal @0 :TestInlineLayout = (\n f0 = (f = void),\n f1 = (f = true),\n f8 = (f0 = true, f1 = false, f2 = true),\n f16 = (f0 = 123, f1 = 45),\n f32 = (f0 = 67, f1 = 8901),\n f64 = (f0 = 234, f1 = 567890123),\n f128 = (f0 = 1234567890123, f1 = 4567890123456),\n f192 = (f0 = 7890123456789, f1 = 2345678901234, f2 = 5678901234567),\n\n f0p = (p0 = \"foo\"),\n f1p = (f = (f = false), p0 = \"bar\"),\n f8p = (f = (f0 = true, f1 = true, f2 = false), p0 = \"baz\"),\n f16p = (f = (f0 = 98, f1 = 76), p0 = \"qux\", p1 = \"quux\"),\n f32p = (f = (f0 = 54, f1 = 32109), p0 = \"corge\", p1 = \"grault\"),\n f64p = (f = (f0 = 87, f1 = 654321098), p0 = \"garply\", p1 = \"waldo\"),\n f128p = (f = (f0 = 7654321098765, f1 = 4321098765432),\n p0 = \"fred\", p1 = \"plugh\", p2 = \"xyzzy\"),\n f192p = (f = (f0 = 1098765432109, f1 = 8765432109876, f2 = 5432109876543),\n p0 = \"thud\", p1 = \"foobar\", p2 = \"barbaz\"));\n\n unions @1 :TestInlineUnions = (\n union0 = f32(f0 = 67, f1 = 8901),\n union1 = f128(f0 = 1234567890123, f1 = 4567890123456),\n union2 = f1p(p0 = \"foo\"),\n union3 = f16p(f = (f0 = 98, f1 = 76), p0 = \"qux\", p1 = \"quux\"));\n\n lists @2 :TestInlineLists = (\n voidList = [void, void],\n boolList = [false, true, false],\n uInt8List = [12, 34, 56, 78],\n uInt16List = [1234, 5678, 9012, 3456, 7890],\n uInt32List = [123456789, 234567890, 345678901, 456789012, 567890123, 678901234],\n uInt64List = [1, 2, 3, 4, 5, 6, 7],\n textList = [\"foo\", \"bar\", \"baz\", \"qux\", \"quux\", \"corge\", \"grault\", \"garply\"],\n\n structList0 = [(f = void), ()],\n structList1 = [(f = true), (f = false), (f = true)],\n structList8 = [(f0 = true, f1 = false, f2 = false),\n (f0 = false, f1 = true, f2 = false),\n (f0 = true, f1 = true, f2 = false),\n (f0 = false, f1 = false, f2 = true)],\n structList16 = [(f0 = 12, f1 = 34), (f0 = 56, f1 = 78)],\n structList32 = [(f0 = 90, f1 = 12345), (f0 = 67, f1 = 8901), (f0 = 23, f1 = 45678)],\n structList64 = [(f0 = 90, f1 = 123456789), (f0 = 12, f1 = 345678901),\n (f0 = 234, f1 = 567890123), (f0 = 45, f1 = 678901234)],\n structList128 = [(f0 = 56789012345678, f1 = 90123456789012),\n (f0 = 34567890123456, f1 = 78901234567890)],\n structList192 = [(f0 = 1234567890123, f1 = 4567890123456, f2 = 7890123456789),\n (f0 = 123456789012, f1 = 3456789012345, f2 = 6789012345678),\n (f0 = 9012345678901, f1 = 2345678901234, f2 = 5678901234567)],\n\n structList0p = [(f = (f = void), p0 = \"foo\"), (p0 = \"bar\"),\n (f = (), p0 = \"baz\"), (p0 = \"qux\")],\n structList1p = [(f = (f = true), p0 = \"quux\"), (p0 = \"corge\")],\n structList8p = [(f = (f0 = true), p0 = \"grault\"), (p0 = \"garply\"), (p0 = \"waldo\")],\n structList16p = [(f = (f0 = 123), p0 = \"fred\", p1 = \"plugh\"),\n (p0 = \"xyzzy\", p1 = \"thud\"),\n (p0 = \"foobar\", p1 = \"barbaz\"),\n (p0 = \"bazqux\", p1 = \"quxquux\")],\n structList32p = [(f = (f1 = 12345), p0 = \"quuxcorge\", p1 = \"corgegrault\"),\n (p0 = \"graultgarply\", p1 = \"garplywaldo\")],\n structList64p = [(f = (f1 = 123456789), p0 = \"waldofred\", p1 = \"fredplugh\"),\n (p0 = \"plughxyzzy\", p1 = \"xyzzythud\"),\n (p0 = \"thudfoo\", p1 = \"foofoo\")],\n structList128p = [(f = (f1 = 123456789012345),\n p0 = \"foobaz\", p1 = \"fooqux\", p2 = \"foocorge\"),\n (p0 = \"barbaz\", p1 = \"barqux\", p2 = \"barcorge\"),\n (p0 = \"bazbaz\", p1 = \"bazqux\", p2 = \"bazcorge\"),\n (p0 = \"quxbaz\", p1 = \"quxqux\", p2 = \"quxcorge\")],\n structList192p = [(f = (f2 = 123456789012345),\n p0 = \"corgebaz\", p1 = \"corgequx\", p2 = \"corgecorge\"),\n (p0 = \"graultbaz\", p1 = \"graultqux\", p2 = \"graultcorge\")]);\n\n structLists @3 :TestStructLists = (\n list0 = [(f = void), (f = void)],\n list1 = [(f = true), (f = false)],\n list8 = [(f = 123), (f = 45)],\n list16 = [(f = 12345), (f = 6789)],\n list32 = [(f = 123456789), (f = 234567890)],\n list64 = [(f = 1234567890123456), (f = 2345678901234567)],\n listP = [(f = \"foo\"), (f = \"bar\")]);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"92dba539f9924fea308cb6703016f7b3e914806a","subject":"modified captain proto to list for entity and child","message":"modified captain proto to list for entity and child\n","repos":"OpenMined\/PySyft,OpenMined\/PySyft,OpenMined\/PySyft,OpenMined\/PySyft","old_file":"packages\/syft\/capnp\/rept.capnp","new_file":"packages\/syft\/capnp\/rept.capnp","new_contents":"@0x8f9c60bd7a9842fc;\n\nstruct REPT {\n child @0 :List(Data);\n minVals @1 :Data;\n maxVals @2 :Data;\n entities @3 :List(Data);\n}\n","old_contents":"@0x8f9c60bd7a9842fc;\n\nstruct REPT {\n child @0 :Data;\n minVals @1 :Data;\n maxVals @2 :Data;\n entities @3 :Data;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9daa8c87afd3060d11d05233033c1862f610a2ad","subject":"Jack <\/3: version bump for 0.4.0","message":"Jack <\/3: version bump for 0.4.0\n","repos":"sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms,sandforms\/sandforms","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 5, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.4.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"@0xc2cc325507512399;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"ztxnreej8a0pqn97ccfhuckswjkrmsaavn85n5sgzk30tv2k4y9h\",\n\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"SandForms\"),\n\n appVersion = 4, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.3.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Form\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n metadata = (\n icons = (\n appGrid = (svg = embed \"..\/graphics\/appGrid.svg\"),\n grain = (svg = embed \"..\/graphics\/grain.svg\"),\n market = (svg = embed \"..\/graphics\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/sandforms\/sandforms\",\n codeUrl = \"https:\/\/github.com\/sandforms\/sandforms\",\n license = (openSource = apache2),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"sandforms@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Form App\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n\n bridgeConfig = (viewInfo = (permissions = [(name = \"owner\")]))\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"62d0d0d4e9d27c0a2cba444b11fd7c1c4bd42e9f","subject":"Clarify that question and export IDs are per-connection and suggest how to allocate them.","message":"Clarify that question and export IDs are per-connection and suggest how to allocate them.\n","repos":"joliss\/capnproto,ocdtrekkie\/capnproto,geofft\/capnproto,johnkdoe\/capnproto,zarvox\/capnproto,maurer\/capnproto,kamalmarhubi\/capnproto,mrdomino\/capnproto,mologie\/capnproto,khklau\/capnproto,hntrmrrs\/capnproto,mrdomino\/capnproto,maurer\/capnproto,Fraser999\/capnproto,ligzy\/capnproto,ocdtrekkie\/capnproto,nagyistoce\/capnproto,martindale\/capnproto,martindale\/capnproto,bsn069\/capnproto,joliss\/capnproto,artillery\/capnproto,artillery\/capnproto,bryce-gibson\/capnproto,geofft\/capnproto,artillery\/capnproto,vladon\/capnproto,hntrmrrs\/capnproto,vladon\/capnproto,johnkdoe\/capnproto,martindale\/capnproto,MarPiRK\/capnproto,maurer\/capnproto,modulexcite\/capnproto,nagyistoce\/capnproto,nagyistoce\/capnproto,Fraser999\/capnproto,a-richardson\/capnproto,pjulien\/capnproto,ligzy\/capnproto,a-richardson\/capnproto,joliss\/capnproto,bryce-gibson\/capnproto,jparyani\/capnproto,jparyani\/capnproto,rcrowder\/capnproto,MarPiRK\/capnproto,pjulien\/capnproto,modulexcite\/capnproto,vladon\/capnproto,zarvox\/capnproto,zarvox\/capnproto,rcrowder\/capnproto,mologie\/capnproto,rcrowder\/capnproto,MarPiRK\/capnproto,Fraser999\/capnproto,ligzy\/capnproto,ocdtrekkie\/capnproto,khklau\/capnproto,jparyani\/capnproto,bsn069\/capnproto,bryce-gibson\/capnproto,mologie\/capnproto,bsn069\/capnproto,johnkdoe\/capnproto,modulexcite\/capnproto,mrdomino\/capnproto,pjulien\/capnproto,geofft\/capnproto,hntrmrrs\/capnproto,kamalmarhubi\/capnproto,khklau\/capnproto,kamalmarhubi\/capnproto,a-richardson\/capnproto","old_file":"c++\/src\/capnp\/rpc.capnp","new_file":"c++\/src\/capnp\/rpc.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could\n# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state\n# tables: questions, answers, imports, and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These\n# numbers are always specific to the connection; a newly-established connection starts with no\n# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like\n# Unix file descriptors -- prefer the lowest-number ID that is currently available.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should\n # reply with a `Return` with `unsupportedPipelineOp` set.\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident.\n\n isPermanent @2 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @3 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","old_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xb312981b2552a250;\n# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that\n# implement interfaces. These references are called \"capabilities\", because they both designate\n# the remote object to use and confer permission to use it.\n#\n# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a\n# capability, the caller can begin calling methods on that capability _before the first call has\n# returned_. The caller essentially sends a message saying \"Hey server, as soon as you finish\n# that previous call, do this with the result!\". Cap'n Proto's RPC protocol makes this possible.\n# As a result, it is more complicated than most.\n#\n# Cap'n Proto RPC is based heavily on CapTP:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/index.html\n#\n# Cap'n Proto RPC takes place between \"vats\". A vat hosts some set of capabilities and talks to\n# other vats through direct bilateral connections. Typically, there is a 1:1 correspondence\n# between vats and processes (in the unix sense of the word), although this is not strictly always\n# true (one process could run multiple vats, or a distributed vat might live across many processes).\n#\n# Cap'n Proto does not distinguish between \"clients\" and \"servers\" -- this is up to the application.\n# Either end of any connection can potentially hold capabilities pointing to the other end, and\n# can call methods on those capabilities. In the doc comments below, we user the words \"sender\"\n# and \"receiver\". These refer to the sender and receiver of an instance of the struct or field\n# being documented. Sometimes we refer to a \"third-party\" which is neither the sender nor the\n# receiver.\n#\n# It is generally up to the vat network implementation to securely verify that connections are made\n# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the\n# `VatNetwork` example interface near the end of this file.\n#\n# Once a connection is formed, nothing interesting can happen until one side sends a Restore\n# message to obtain a persistent capability.\n#\n# Unless otherwise specified, messages must be delivered to the receiving application in the same\n# order in which they were initiated by the sending application, just like in E:\n# http:\/\/erights.org\/elib\/concurrency\/partial-order.html\n#\n# Since the full protocol is complicated, we define multiple levels of support which an\n# implementation may target. For typical applications, level 1 support will be sufficient.\n# Comments in this file indicate which level requires the corresponding feature to be\n# implemented.\n#\n# * **Level 0:** The implementation does not support object references. `Restore` is supported\n# only for looking up singleton objects which exist for the lifetime of the server, and only\n# these singleton objects can receive calls. At this level, the implementation does not support\n# object-oriented protocols and is similar in complexity to JSON-RPC or Protobuf \"generic\n# services\". This level should be considered only a temporary stepping-stone toward level 1 as\n# the lack of object references drastically changes how protocols are designed. Applications\n# _should not_ attempt to design their protocols around the limitations of level 0\n# implementations.\n#\n# * **Level 1:** The implementation supports simple bilateral interaction with object references\n# and promise pipelining, but interactions between three or more parties are supported only via\n# proxying of objects. E.g. if Alice wants to send Bob a capability pointing to Carol, Alice\n# must host a local proxy of Carol and send Bob a reference to that; Bob cannot form a direct\n# connection to Carol. Level 1 implementations do not support \"join\" or \"eq\" across capabilities\n# received from different vats, although they should be supported on capabilities received from\n# the same vat. `Restore` is supported only for looking up singleton objects as in level 0.\n#\n# * **Level 2:** The implementation supports saving, restoring, and deleting persistent\n# capabilities.\n#\n# * **Level 3:** The implementation supports three-way interactions but does not implement \"Join\"\n# operations. The implementation can be used effectively on networks that do not require joins,\n# or to implement objects that never need to be joined.\n#\n# * **Level 4:** The entire protocol is implemented, including joins.\n#\n# Note that an implementation must also support specific networks (transports), as described in\n# the \"Network-specific Parameters\" section below. An implementation might have different levels\n# depending on the network used.\n#\n# New implementations of Cap'n Proto should start out targeting the simplistic \"confined\" network\n# type as defined in `rpc-confined.capnp`. With this network type, level 3 is irrelevant and\n# levels 2 and 4 are much easier than usual to implement. When such an implementation is actually\n# run inside a container, the contained app effectively gets to make full use of the container's\n# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to\n# bother implementing any other vat network protocol -- just use the correct container type and get\n# it for free.\n\nusing Cxx = import \"c++.capnp\";\n$Cxx.namespace(\"capnp::rpc\");\n\n# ========================================================================================\n# The Four Tables\n#\n# As in CapTP, for each open connection, a vat maintains four tables: questions, answers, imports,\n# and exports. See the diagram at:\n# http:\/\/www.erights.org\/elib\/distrib\/captp\/4tables.html\n#\n# The question table corresponds to the other end's answer table, and the imports table corresponds\n# to the other end's exports table.\n#\n# IDs in the questions\/answers tables are chosen by the questioner and generally represent method\n# calls that are in progress.\n#\n# IDs in the imports\/exports tables are chosen by the exporter and generally represent objects on\n# which methods may be called. Exports may be \"settled\", meaning the exported object is an actual\n# object living in the exporter's vat, or they may be \"promises\", meaning the exported object is\n# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other\n# object once that operation completes. Calls made to a promise will be forwarded to the eventual\n# target once it is known. The eventual replacement object does *not* take the same ID as the\n# promise, as it may turn out to be an object that is already exported (so already has an ID) or\n# may even live in a completely different vat (and so won't get an ID on the same export table\n# at all).\n#\n# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since\n# messages using the ID could be traveling in both directions simultaneously, we must define the\n# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been\n# released by both sides.\n#\n# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are\n# canceled and throw exceptions. All imports become broken (all methods throw exceptions). All\n# exports and answers are implicitly released. The only things not lost are persistent\n# capabilities (`SturdyRef`s). The application must plan for this and should respond by\n# establishing a new connection and restoring from these persistent capabilities.\n\nusing QuestionId = UInt32;\n# **(level 0)**\n#\n# Identifies a question in the questions\/answers table. The questioner (caller) chooses an ID\n# when making a call. The ID remains valid in caller -> callee messages until a Finish\n# message is sent, and remains valid in callee -> caller messages until a Return message is sent.\n\nusing ExportId = UInt32;\n# **(level 1)**\n#\n# Identifies an exported capability or promise in the exports\/imports table. The exporter chooses\n# an ID before sending a capability over the wire. If the capability is already in the table, the\n# exporter should reuse the same ID. If the ID is a promise (as opposed to a settled capability),\n# this must be indicated at the time the ID is introduced; in this case, the importer shall expect\n# a later Resolve message which replaces the promise.\n#\n# ExportIds are subject to reference counting. When an `ExportId` is received embedded in an\n# question or answer, the export has an implicit reference until that question or answer is\n# released (questions are released by `Return`, answers are released by `Finish`). Such an\n# export can be retained beyond that point by including it in the `retainedCaps` list at the time\n# the question\/answer is released, thus incrementing its reference count. The reference count is\n# later decremented by a `Release` message. Since the `Release` message can specify an arbitrary\n# number by which to reduce the reference count, the importer should usually batch reference\n# decrements and only send a `Release` when it believes the reference count has hit zero. Of\n# course, it is possible that a new reference to the released object is in-flight at the time\n# that the `Release` message is sent, so it is necessary for the exporter to keep track of the\n# reference count on its end as well to avoid race conditions.\n#\n# When an `ExportId` is received as part of a exporter -> importer message but not embedded in a\n# question or answer, its reference count must be incremented unless otherwise specified.\n#\n# An `ExportId` remains valid in importer -> exporter messages until its reference count reaches\n# zero and a `Release` message has been sent to release it.\n#\n# When a connection is lost, all exports are implicitly released. It is not possible to restore\n# a connection state (or, restoration should be implemented at the transport layer without the RPC\n# layer knowing that anything happened).\n\n# ========================================================================================\n# Messages\n\nstruct Message {\n # An RPC connection is a bi-directional stream of Messages.\n\n union {\n unimplemented @0 :Message;\n # When a peer receives a message of a type it doesn't recognize or doesn't support, it\n # must immediately echo the message back to the sender in `unimplemented`. The sender is\n # then able to examine the message and decide how to deal with it being unimplemented.\n #\n # For example, say `resolve` is received by a level 0 implementation (because a previous call\n # or return happened to contain a promise). The receiver will echo it back as `unimplemented`.\n # The sender can then simply release the cap to which the promise had resolved, thus avoiding\n # a leak.\n #\n # For any message type that introduces a question, if the message comes back unimplemented,\n # the sender may simply treat it as if the question failed with an exception.\n #\n # In cases where there is no sensible way to react to an `unimplemented` message (without\n # resource leaks or other serious problems), the connection may need to be aborted. This is\n # a gray area; different implementations may take different approaches.\n\n abort @1 :Exception;\n # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or\n # because the sender had an internal error (`isCallersFault` is false). The sender will shut\n # down the outgoing half of the connection after `abort` and will completely close the\n # connection shortly thereafter (it's up to the sender how much of a time buffer they want to\n # offer for the client to receive the `abort` before the connection is reset).\n\n # Level 0 features -----------------------------------------------\n\n call @2 :Call; # Begin a method call.\n return @3 :Return; # Complete a method call.\n finish @4 :Finish; # Release a returned answer \/ cancel a call.\n\n # Level 1 features -----------------------------------------------\n\n resolve @5 :Resolve; # Resolve a previously-sent promise.\n release @6 :Release; # Release a capability so that the remote object can be deallocated.\n\n # Level 2 features -----------------------------------------------\n\n save @7 :Save; # Save a capability persistently.\n restore @8 :Restore; # Restore a persistent capability from a previous connection.\n delete @9 :Delete; # Delete a persistent capability.\n\n # Level 3 features -----------------------------------------------\n\n provide @10 :Provide; # Provide a capability to a third party.\n accept @11 :Accept; # Accept a capability provided by a third party.\n\n # Level 4 features -----------------------------------------------\n\n join @12 :Join; # Directly connect to the common root of two or more proxied caps.\n }\n}\n\n# Level 0 message types ----------------------------------------------\n\nstruct Call {\n # **(level 0)**\n #\n # Message type initiating a method call on a capability.\n\n questionId @0 :QuestionId;\n # A number, chosen by the caller, which identifies this call in future messages. This number\n # must be different from all other calls originating from the same end of the connection (but\n # may overlap with question IDs originating from the opposite end). A fine strategy is to use\n # sequential question IDs, but the recipient should not assume this.\n #\n # A question ID can be reused once both:\n # - A matching Return has been received from the callee.\n # - A matching Finish has been sent from the caller.\n\n target :union {\n exportedCap @1 :ExportId;\n # This call is to a capability or promise previously exported by the receiver.\n\n promisedAnswer @2 :PromisedAnswer;\n # This call is to a capability that is expected to be returned by another call that has not\n # yet been completed.\n #\n # At level 0, this is supported only for addressing the result of a previous `Restore`, so that\n # initial startup doesn't require a round trip.\n }\n\n interfaceId @3 :UInt64;\n # The type ID of the interface being called. Each capability may implement multiple interfaces.\n\n methodId @4 :UInt16;\n # The ordinal number of the method to call within the requested interface.\n\n request @5 :Object;\n # The request struct. The fields of this struct correspond to the parameters of the method.\n #\n # The request may contain capabilities. These capabilities are automatically released when the\n # call returns *unless* the Return message explicitly indicates that they are being retained.\n}\n\nstruct Return {\n # **(level 0)**\n #\n # Message type sent from callee to caller indicating that the call has completed.\n\n questionId @0 :QuestionId;\n # Question ID which is being answered, as specified in the corresponding Call.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the request to which the callee continues to hold references. Any\n # other capabilities from the request are implicitly released.\n\n union {\n answer @2 :Object;\n # Result object. If the method returns a struct, this is it. Otherwise, this points to\n # a struct which contains exactly one field, corresponding to the method's return type.\n # (This implies that an method's return type can be upgraded from a non-struct to a struct\n # without breaking wire compatibility.)\n #\n # For a `Return` in response to an `Accept`, `answer` is a capability pointer (and therefore\n # points to a `CapDescriptor`, but is tagged as a capability rather than a struct). A\n # `Finish` is still required in this case, and the capability must still be listed in\n # `retainedCaps` if it is to be retained.\n\n exception @3 :Exception;\n # Indicates that the call failed and explains why.\n\n canceled @4 :Void;\n # Indicates that the call was canceled due to the caller sending a Finish message\n # before the call had completed.\n\n unsupportedPipelineOp @5 :Void;\n # The call was addressed to a `PromisedAnswer` that was not understood by the callee because\n # it used features that the callee's RPC implementation does not support. The caller should\n # wait for the first call to return and then retry the dependent call as a regular,\n # non-pipelined call.\n }\n}\n\nstruct Finish {\n # **(level 0)**\n #\n # Message type sent from the caller to the callee to indicate:\n # 1) The questionId will no longer be used in any messages sent by the callee (no further\n # pipelined requests).\n # 2) Any capabilities in the answer other than the ones listed below should be implicitly\n # released.\n # 3) If the answer has not returned yet, the caller no longer cares about the answer, so the\n # callee may wish to immediately cancel the operation and send back a Return message with\n # \"canceled\" set.\n\n questionId @0 :QuestionId;\n # ID of the question whose answer is to be released.\n\n retainedCaps @1 :List(ExportId);\n # **(level 1)**\n #\n # List of capabilities from the answer to which the callee continues to hold references. Any\n # other capabilities from the answer that need to be released are implicitly released along\n # with the answer itself.\n}\n\n# Level 1 message types ----------------------------------------------\n\nstruct Resolve {\n # **(level 1)**\n #\n # Message type sent to indicate that a previously-sent promise has now been resolved to some other\n # object (possibly another promise) -- or broken, or canceled.\n #\n # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that\n # doesn't implement it. For example, a method call or return might contain a capability in the\n # payload. Normally this is fine even if the receiver is level 0, because they will implicitly\n # release all such capabilities on return \/ finish. But if the cap happens to be a promise, then\n # a follow-up `Resolve` will be sent regardless of this release. The level 0 receiver will reply\n # with an `unimplemented` message. The sender (of the `Resolve`) can respond to this as if the\n # receiver had immediately released any capability to which the promise resolved.\n\n promiseId @0 :ExportId;\n # The ID of the promise to be resolved.\n #\n # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does\n # _not_ increase the reference count of `promiseId`.\n #\n # When a promise ID is first sent over the wire (e.g. in a `CapDescriptor`), the sender (exporter)\n # guarantees that it will follow up at some point with exactly one `Resolve` message. If the\n # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the\n # same ID is reused again later _after_ a `Resolve`, it can only be because the export's\n # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore\n # this later promise does _not_ correspond to the earlier `Resolve`.\n #\n # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`\n # message must still be sent, and the ID cannot be reused in the meantime. Moreover, the object\n # to which the promise resolved itself needs to be released, even if the promise was already\n # released before it resolved. (Although, the exporter may notice that the promise was released\n # and send a `canceled` resolution, in which case nothing new is exported.)\n #\n # RPC implementations should keep in mind when they receive a `Resolve` that the promise ID may\n # have appeared in a previous question or answer which the application has not consumed yet.\n # The RPC implementation usually shouldn't dig through the question\/answer itself looking for\n # capabilities, so it won't be aware of any promise IDs in that message until the application\n # actually goes through and extracts the capabilities it wishes to retain. Therefore, when\n # a `Resolve` is received, the RPC implementation will have to keep track of this resolution\n # at least until all previously-received questions and answers have been consumed and released\n # by the application.\n\n union {\n cap @1 :CapDescriptor;\n # The object to which the promise resolved.\n\n exception @2 :Exception;\n # Indicates that the promise was broken.\n\n canceled @3 :Void;\n # Indicates that this promise won't be resolved because its reference count reached zero before\n # it had completed, so the operation was canceled.\n }\n}\n\nstruct Release {\n # **(level 1)**\n #\n # Message type sent to indicate that the sender is done with the given capability and the receiver\n # can free resources allocated to it.\n\n id @0 :ExportId;\n # What to release.\n\n referenceCount @1 :UInt32;\n # The amount by which to decrement the reference count. The export is only actually released\n # when the reference count reaches zero.\n}\n\n# Level 2 message types ----------------------------------------------\n\nstruct Save {\n # **(level 2)**\n #\n # Message type sent to save a capability persistently so that it can be restored by a future\n # connection. Not all capabilities can be saved -- application interfaces should define which\n # capabilities support this and which do not.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return\n # message whose `answer` is a SturdyRef.\n\n target :union {\n # What is to be saved.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n}\n\nstruct Restore {\n # **(mostly level 2)**\n #\n # Message type sent to restore a persistent capability obtained during a previous connection, or\n # through other means.\n #\n # Level 0\/1 implementations need to implement a limited version of `Restore` only for the purpose\n # of bootstrapping a new connection (otherwise, there would be no objects to which to address\n # methods). These levels may simply implement singleton services that exist for the lifetime of\n # the host process and probably have non-secret names. A level 0 receiver of `Restore` should\n # never actually send a `Return` message, but should simply expect `Call` messages addressed to\n # the `PromisedAnswer` corresponding to the `Restore`. A level 0 sender of `Restore` can ignore\n # the corresponding `Return` and just keep addressing the `PromisedAnswer`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # containing the restored capability.\n\n ref @1 :SturdyRef;\n # Designates the capability to restore.\n}\n\nstruct Delete {\n # **(level 2)**\n #\n # Message type sent to delete a previously-saved persistent capability. In other words, this\n # means \"this ref will no longer be used in the future\", so that the host can potentially\n # garbage collect resources associated with it. Note that if any ExportId still refers to a\n # capability restored from this ref, that export should still remain valid until released.\n #\n # Different applications may define different policies regarding saved capability lifetimes that\n # may or may not rely on `Delete`. For the purpose of implementation freedom, a receiver is\n # allowed to silently ignore a delete request for a reference it doesn't recognize. This way,\n # a persistent capability could be given an expiration time, after which the capability is\n # automatically deleted, and any future `Delete` message is ignored.\n #\n # A client must send no more than one `Delete` message for any given `Save`, so that a host\n # can potentially implement reference counting. However, hosts should be wary of reference\n # counting across multiple clients, as a malicious client could of course send multiple\n # `Delete`s.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this request, which will eventually receive a Return message\n # with an empty answer.\n\n ref @1 :SturdyRef;\n # Designates the capability to delete.\n}\n\n# Level 3 message types ----------------------------------------------\n\nstruct Provide {\n # **(level 3)**\n #\n # Message type sent to indicate that the sender wishes to make a particular capability implemented\n # by the receiver available to a third party for direct access (without the need for the third\n # party to proxy through the sender).\n #\n # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by\n # every vat. In Cap'n Proto, we bake this into the core protocol.)\n\n questionId @0 :QuestionId;\n # Question ID to be held open until the recipient has received the capability. An answer will\n # be returned once the third party has successfully received the capability. The sender must\n # at some point send a `Finish` message as with any other call, and such a message can be\n # used to cancel the whole operation.\n\n target :union {\n # What is to be provided to the third party.\n\n exportedCap @1 :ExportId;\n # An exported capability.\n\n promisedAnswer @2 :PromisedAnswer;\n # A capability expected to be returned in the answer to an outstanding question.\n }\n\n recipient @3 :RecipientId;\n # Identity of the third party which is expected to pick up the capability.\n}\n\nstruct Accept {\n # **(level 3)**\n #\n # Message type sent to pick up a capability hosted by the receiving vat and provided by a third\n # party. The third party previously designated the capability using `Provide`.\n\n questionId @0 :QuestionId;\n # A new question ID identifying this accept message, which will eventually receive a Return\n # message containing the provided capability.\n\n provision @1 :ProvisionId;\n # Identifies the provided object to be picked up.\n}\n\n# Level 4 message types ----------------------------------------------\n\nstruct Join {\n # **(level 4)**\n #\n # Message type sent to implement E.join(), which, given a number of capabilities which are\n # expected to be equivalent, finds the underlying object upon which they all agree and forms a\n # direct connection to it, skipping any proxies which may have been constructed by other vats\n # while transmitting the capability. See:\n # http:\/\/erights.org\/elib\/equality\/index.html\n #\n # Note that this should only serve to bypass fully-transparent proxies -- proxies that were\n # created merely for convenience, without any intention of hiding the underlying object.\n #\n # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both\n # are simply proxies for a capability hosted elsewhere. He then issues a join request, which\n # operates as follows:\n # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece\n # of the JoinKey.\n # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap.\n # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that\n # she doesn't have the other part yet, so she records the request and responds with a\n # JoinAnswer.\n # - Alice relays the JoinAswer back to Bob.\n # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as\n # well.\n # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She\n # combines them in order to form information needed to form a secure connection to Bob. She\n # also responds with another JoinAnswer.\n # - Bob receives the responses from Alice and Carol. He uses the returned JoinAnswers to\n # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now\n # agree on a secret key which neither Alice nor Carol ever saw, this connection can be made\n # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are\n # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because\n # the whole point of the join is to verify that Alice and Carol agree on what capability they\n # are proxying.)\n #\n # If the two capabilities aren't actually proxies of the same object, then the join requests\n # will come back with conflicting `hostId`s and the join will fail before attempting to form any\n # connection.\n\n questionId @0 :QuestionId;\n # Question ID used to respond to this Join. (Note that this ID only identifies one part of the\n # request for one hop; each part has a different ID and relayed copies of the request have\n # (probably) different IDs still.)\n #\n # The receiver will reply with a `Return` whose `answer` is a JoinAnswer. This `JoinAnswer`\n # is relayed from the joined object's host, possibly with transformation applied as needed\n # by the network.\n #\n # Like any answer, the answer must be released using a `Finish`. However, this release\n # should not occur until the joiner has either successfully connected to the joined object.\n # Vats relaying a `Join` message similarly must not release the answer they receive until the\n # answer they relayed back towards the joiner has itself been released. This allows the\n # joined object's host to detect when the Join operation is canceled before completing -- if\n # it receives a `Finish` for one of the join answers before the joiner successfully\n # connects. It can then free any resources it had allocated as part of the join.\n\n capId @1 :ExportId;\n # The capability to join.\n\n keyPart @2 :JoinKeyPart;\n # A part of the join key. These combine to form the complete join key which is used to establish\n # a direct connection.\n}\n\n# ========================================================================================\n# Common structures used in messages\n\nstruct CapDescriptor {\n # **(level 1)**\n #\n # When an application-defined type contains an interface pointer, that pointer's encoding is the\n # same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer\n # actually points to an instance of `CapDescriptor`. The runtime API should not reveal the\n # CapDescriptor directly to the application, but should instead wrap it in some kind of callable\n # object with methods corresponding to the interface that the capability implements.\n #\n # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the\n # description of `ExportId`.\n\n union {\n senderHosted :group {\n # A capability newly exported by the sender.\n\n id @0 :ExportId;\n # The ID of the new capability in the sender's export table (receiver's import table).\n\n interfaces @1 :List(UInt64);\n # Type IDs of interfaces supported by this descriptor. This must include at least the\n # interface type as defined in the schema file, but could include others. The runtime API\n # should allow the interface wrapper to be dynamically cast to these other types (probably\n # not using the language's built-in cast syntax, but something equivalent).\n }\n\n senderPromise @2 :ExportId;\n # A promise which the sender will resolve later. The sender will send exactly one Resolve\n # message at a future point in time to replace this promise.\n\n receiverHosted @3 :ExportId;\n # A capability (or promise) previously exported by the receiver.\n\n receiverAnswer @4 :PromisedAnswer;\n # A capability expected to be returned in the answer for a currently-outstanding question posed\n # by the sender.\n\n thirdPartyHosted @5 :ThirdPartyCapDescriptor;\n # **(level 3)**\n #\n # A capability that lives in neither the sender's nor the receiver's vat. The sender needs\n # to form a direct connection to a third party to pick up the capability.\n }\n}\n\nstruct PromisedAnswer {\n # **(mostly level 1)**\n #\n # Specifies how to derive a promise from an unanswered question, by specifying the path of fields\n # to follow from the root of the eventual answer struct to get to the desired capability. Used\n # to address method calls to a not-yet-returned capability or to pass such a capability as an\n # input to some other method call.\n #\n # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is\n # to a `Restore` message. In this case, `path` is always empty since `Restore` always returns\n # a raw capability.\n\n questionId @0 :QuestionId;\n # ID of the question (in the sender's question table \/ receiver's answer table) whose answer is\n # expected to contain the capability.\n\n transform @1 :List(Op);\n # Operations \/ transformations to apply to the answer in order to get the capability actually\n # being addressed. E.g. if the answer is a struct and you want to call a method on a capability\n # pointed to by a field of the struct, you need a `getPointerField` op.\n\n struct Op {\n # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should\n # reply with a `Return` with `unsupportedPipelineOp` set.\n\n union {\n noop @0 :Void;\n # Does nothing. This member is mostly defined so that we can make `Op` a union even\n # though (as of this writing) only one real operation is defined.\n\n getPointerField @1 :UInt16;\n # Get a pointer field within a struct. The number is an index into the pointer section, NOT\n # a field ordinal, so that the receiver does not need to understand the schema.\n\n # TODO(someday): We could add:\n # - For lists, the ability to address every member of the list, or a slice of the list, the\n # answer to which would be another list. This is useful for implementing the equivalent of\n # a SQL table join (not to be confused with the `Join` message type).\n # - Maybe some ability to test a union.\n # - Probably not a good idea: the ability to specify an arbitrary script to run on the\n # result. We could define a little stack-based language where `PathPart` specifies one\n # \"instruction\" or transformation to apply. Although this is not a good idea\n # (over-engineered), any narrower additions to `PathPart` should be designed as if this\n # were the eventual goal.\n }\n }\n}\n\nstruct ThirdPartyCapDescriptor {\n # **(level 3)**\n #\n # Identifies a capability in a third-party vat which the sender wants the receiver to pick up.\n\n id @0 :ThirdPartyCapId;\n # Identifies the third-party host and the specific capability to accept from it.\n\n vineId @1 :ExportId;\n # Object in the sender's export table which must be Released once the capability has been\n # successfully obtained from the third-party vat. This allows the sender to ensure that the\n # final capability is not released before the receiver manages to accept it. In CapTP\n # terminology this is called a \"vine\", because it is an indirect reference to the third-party\n # object that snakes through the sender vat. The vine does not accept any method calls.\n}\n\nstruct Exception {\n # **(level 0)**\n #\n # Describes an arbitrary error that prevented an operation (e.g. a call) from completing.\n\n reason @0 :Text;\n # Human-readable failure description.\n\n isCallersFault @1 :Bool;\n # In the best estimate of the error source, is it the caller's fault that this error occurred\n # (like HTTP 400), or is it the callee's fault (like HTTP 500)? Or, put another way, if an\n # automated bug report were to be generated for this error, should it be initially filed on the\n # caller's code or the callee's? This is a guess. Generally guesses should err towards blaming\n # the callee -- at the very least, the callee should be on the hook for improving their error\n # handling to be more confident.\n\n isPermanent @2 :Bool;\n # In the best estimate of the error source, is this error likely to repeat if the same call is\n # executed again? Callers might use this to decide when to retry a request.\n\n isOverloaded @3 :Bool;\n # In the best estimate of the error source, is it likely this error was caused by the system\n # being overloaded? If so, the caller probably should not retry the request now, but may\n # consider retrying it later.\n}\n\n# ========================================================================================\n# Network-specific Parameters\n#\n# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks\n# may wish to use different approaches to solving them. For example, on the public internet, you\n# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted\n# infrastructure, you may be happy to authenticate based on network address only, or some other\n# lightweight mechanism.\n#\n# To accommodate this, we specify several \"parameter\" types. Each type is defined here as an\n# alias for `Object`, but a specific network will want to define a specific set of types to use.\n# All vats in a vat network must agree on these parameters in order to be able to communicate.\n# Inter-network communication can be accomplished through \"gateways\" that perform translation\n# between the primitives used on each network; these gateways may need to be deeply stateful,\n# depending on the translations they perform.\n#\n# For interaction over the global internet between parties with no other prior arrangement, a\n# particular set of bindings for these types is defined elsewhere. (TODO(soon): Specify where\n# these common definitions live.)\n#\n# Another common network type is the \"confined\" network, in which a contained vat interacts with\n# the outside world entirely through a container\/supervisor. All objects in the world that aren't\n# hosted by the contained vat appear as if they were hosted by the container. This network type is\n# interesting because from the containee's point of view, there are no three-party interactions at\n# all, and joins are unusually simple to implement, so implementing at level 4 is barely more\n# complicated than implementing at level 1. Moreover, if you pair an app implementing the confined\n# network with a container that implements some other network, the app can then participate on\n# the container's network just as if it implemented that network directly. The types used by the\n# \"confined\" network are defined in `rpc-confined.capnp`.\n#\n# The things which we need to parameterize are:\n# - How to store capabilities long-term without holding a connection open (mostly level 2).\n# - How to authenticate vats in three-party introductions (level 3).\n# - How to implement `Join` (level 4).\n#\n# Persistent references\n# ---------------------\n#\n# **(mostly level 2)**\n#\n# We want to allow some capabilities to be stored long-term, even if a connection is lost and later\n# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't\n# help here. We need a way to specify long-term identifiers, as well as a strategy for\n# reconnecting to a referenced capability later.\n#\n# Three-party interactions\n# ------------------------\n#\n# **(level 3)**\n#\n# In cases where more than two vats are interacting, we have situations where VatA holds a\n# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished\n# by VatA proxying requests on the new capability, but doing so has two big problems:\n# - It's inefficient, requiring an extra network hop.\n# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to\n# detect that the two capabilities are really the same and to implement the E \"join\" operation,\n# which is necessary for certain four-or-more-party interactions, such as the escrow pattern.\n# See: http:\/\/www.erights.org\/elib\/equality\/grant-matcher\/index.html\n#\n# Instead, we want a way for VatC to form a direct, authenticated connection to VatB.\n#\n# Join\n# ----\n#\n# **(level 4)**\n#\n# The `Join` message type and corresponding operation arranges for a direct connection to be formed\n# between the joiner and the host of the joined object, and this connection must be authenticated.\n# Thus, the details are network-dependent.\n\nusing SturdyRef = Object;\n# **(mostly level 2)**\n#\n# Identifies a long-lived capability which can be obtained again in a future connection by sending\n# a `Restore` message. A SturdyRef is a lot like a URL, but possibly with additional\n# considerations e.g. to support authentication without a certificate authority.\n#\n# The base RPC protocol does not specify under what conditions a SturdyRef can\n# be restored. For example:\n# - Do you have to connect to a specific vat to restore the reference?\n# - Is just any vat allowed to restore the SturdyRef, or is it tied to a specific vat requiring\n# some form of authentication?\n#\n# At the very least, a SturdyRef must contain at least enough information to determine where to\n# connect to restore the ref. Ideally, this information is not a physical machine address, but a\n# logical identifier that can be passed to some lookup service to locate an appropriate vat. Using\n# a physical machine address would make the network brittle -- a change in topology could\n# invalidate all SturdyRefs.\n#\n# The ref should also contain some kind of signature or certificate which can be used to\n# authenticate the vat, to protect against a malicious lookup service without the need for a\n# centralized certificate authority.\n#\n# For example, a simple internet-friendly SturdyRef might contain a DNS host name, a public key\n# fingerprint, and a Swiss number (large, unguessable random number;\n# http:\/\/wiki.erights.org\/wiki\/Swiss_number) to identify the specific object within that vat.\n# This construction does have the disadvantage, though, that a compromised private key could\n# invalidate all existing refs that share that key, and a compromise of any one client's storage\n# could require revoking all existing refs to that object. Various more-sophisticated mechanisms\n# can solve these problems but these are beyond the scope of this protocol.\n\nusing ProvisionId = Object;\n# **(level 3)**\n#\n# The information which must be sent in an `Accept` message to identify the object being accepted.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the provider vat along with the questionId used in the `Provide` message sent from\n# that provider.\n\nusing RecipientId = Object;\n# **(level 3)**\n#\n# The information which must be sent in a `Provide` message to identify the recipient of the\n# capability.\n#\n# In a network where each vat has a public\/private key pair, this could simply be the public key\n# fingerprint of the recipient.\n\nusing ThirdPartyCapId = Object;\n# **(level 3)**\n#\n# The information needed to connect to a third party and accept a capability from it.\n#\n# In a network where each vat has a public\/private key pair, this could be a combination of the\n# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP\n# address), and the question ID used in the corresponding `Provide` mesasge sent to that third party\n# (used to identify which capability to pick up).\n\nusing JoinKeyPart = Object;\n# **(level 4)**\n#\n# A piece of a secret key. One piece is sent along each path that is expected to lead to the same\n# place. Once the pieces are combined, a direct connection may be formed between the sender and\n# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type.\n#\n# The motivation for Joins is discussed under \"Supporting Equality\" in the \"Unibus\" protocol\n# sketch: http:\/\/www.erights.org\/elib\/distrib\/captp\/unibus.html\n#\n# In a network where each vat has a public\/private key pair and each vat forms no more than one\n# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never\n# need to be transparently proxied and references to the same object sent over the same connection\n# have the same export ID. Thus, a successful join requires only checking that the two objects\n# come from the same connection and have the same ID, and then completes immediately.\n#\n# However, in networks where two vats may form more than one connection between each other, or\n# where proxying of objects occurs, joins are necessary.\n#\n# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts\n# XOR'd together forms a shared secret which can be used to form an encrypted connection between\n# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of\n# how many parts to expect and a hash of the shared secret (used to match up parts).\n\nusing JoinAnswer = Object;\n# **(level 4)**\n#\n# Information returned in the answer to a `Join` message, needed by the joiner in order to form a\n# direct connection to a joined object. This might simply be the address of the joined object's\n# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared\n# secret to use to authenticate each other.\n#\n# The `JoinAnswer` should also contain information that can be used to detect when the Join\n# requests ended up reaching different objects, so that this situation can be detected easily.\n# This could be a simple matter of including a sequence number -- if the joiner receives two\n# `JoinAnswer`s with sequence number 0, then they must have come from different objects and the\n# whole join is a failure.\n\n# ========================================================================================\n# Network interface sketch\n#\n# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular\n# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in\n# practice you'd probably define these interfaces manually in the target programming language. A\n# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the\n# definitions of the various network-specific parameters defined above.\n\n# interface VatNetwork {\n# # Represents a vat network, with the ability to connect to particular vats and receive\n# # connections from vats.\n# #\n# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the\n# # caller is expected to find and share state with existing users of the connection.\n#\n# # Level 0 features -----------------------------------------------\n#\n# connectToHostOf(ref :SturdyRef) :Connection;\n# # Connect to a host which can restore the given SturdyRef. The transport should return a\n# # promise which does not resolve until authentication has completed, but allows messages to be\n# # pipelined in before that; the transport either queues these messages until authenticated, or\n# # sends them encrypted such that only the authentic vat would be able to decrypt them. The\n# # latter approach avoids a round trip for authentication.\n# #\n# # Once connected, the caller should start by sending a `Restore` message.\n#\n# acceptConnectionAsRefHost() :Connection;\n# # Wait for the next incoming connection and return it. Only connections formed by\n# # connectToHostOf() are returned by this method.\n# #\n# # Once connected, the first received message will usually be a `Restore`.\n#\n# # Level 4 features -----------------------------------------------\n#\n# newJoiner(count :UInt32): NewJoinerResponse;\n# # Prepare a new Join operation, which will eventually lead to forming a new direct connection\n# # to the host of the joined capability. `count` is the number of capabilities to join.\n#\n# struct NewJoinerResponse {\n# joinKeyParts :List(JoinKeyPart);\n# # Key parts to send in Join messages to each capability.\n#\n# joiner :Joiner;\n# # Used to establish the final connection.\n# }\n#\n# interface Joiner {\n# addJoinAnswer(answer :JoinAnswer) :Void;\n# # Add a JoinAnswer received in response to one of the `Join` messages. All `JoinAnswer`s\n# # returned from all paths must be added before trying to connect.\n#\n# connect() :ConnectionAndProvisionId;\n# # Try to form a connection to the joined capability's host, verifying that it has received\n# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept`\n# # message on it with the specified `ProvisionId` in order to receive the final capability.\n# }\n#\n# acceptConnectionFromJoiner(parts: List(JoinKeyPart), paths :List(VatPath))\n# :ConnectionAndProvisionId;\n# # Called on a joined capability's host to receive the connection from the joiner, once all\n# # key parts have arrived. The caller should expect to receive an `Accept` message over the\n# # connection with the given ProvisionId.\n# }\n#\n# interface Connection {\n# # Level 0 features -----------------------------------------------\n#\n# send(message :Message) :Void;\n# # Send the message. Returns successfully when the message (and all preceding messages) has\n# # been acknowledged by the recipient.\n#\n# receive() :Message;\n# # Receive the next message, and acknowledges receipt to the sender. Messages are received in\n# # the order in which they are sent.\n#\n# # Level 3 features -----------------------------------------------\n#\n# introduceTo(recipient :Connection) :IntroductionInfo;\n# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on\n# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`.\n#\n# struct IntroductionInfo {\n# sendToRecipient :ThirdPartyCapId;\n# sendToTarget :RecipientId;\n# }\n#\n# connectToIntroduced(capId: ThirdPartyCapId) :ConnectionAndProvisionId;\n# # Given a ThirdPartyCapId received over this connection, connect to the third party. The\n# # caller should then send an `Accept` message over the new connection.\n#\n# acceptIntroducedConnection(recipientId: RecipientId): Connection\n# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the\n# # recipient to connect, and return the connection formed. Usually, the first message received\n# # on the new connection will be an `Accept` message.\n# }\n#\n# sturct ConnectionAndProvisionId {\n# # **(level 3)**\n#\n# connection :Connection;\n# # Connection on which to issue `Accept` message.\n#\n# provision :ProvisionId;\n# # `ProvisionId` to send in the `Accept` message.\n# }\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"32fbf9442df7c19851553a7c5ccc793dbf648cb1","subject":"Add missing -session_key flag to Sandstorm launcher","message":"Add missing -session_key flag to Sandstorm launcher\n","repos":"zombiezen\/sandpass,zombiezen\/sandpass,zombiezen\/sandpass","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.0.0\"),\n\n actions = [\n ( title = (defaultText = \"New database\"),\n nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \".sandstorm\/notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \".sandstorm\/pgp-signature\",\n ),\n\n pgpKeyring = embed \".sandstorm\/pgp-keyring\",\n\n description = (defaultText = embed \".sandstorm\/description.md\"),\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n (width = 698, height = 704, png = embed \".sandstorm\/screenshot-list.png\"),\n (width = 791, height = 704, png = embed \".sandstorm\/screenshot-edit.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\"),\n obsolete = true, # implied by sharing\n ),\n ( name = \"write\",\n title = (defaultText = \"Make changes to database\"),\n ),\n ( name = \"init\",\n title = (defaultText = \"Create, delete, and rekey the database\"),\n ),\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false, false],\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true, false],\n ),\n ( title = (defaultText = \"manager\"),\n verbPhrase = (defaultText = \"can read, write, and manage\"),\n description = (defaultText = \"A manager can not only edit the database, but also delete it.\"),\n permissions = [true, true, true],\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\n \"\/sandstorm-http-bridge\", \"8080\", \"--\",\n \"\/opt\/app\/sandpass\",\n \"-listen=[::]:8080\",\n \"-db=\/var\/keepass.kdb\",\n \"-session_key=\/var\/session_key.json\",\n \"-static_dir=\/opt\/app\",\n \"-templates_dir=\/opt\/app\/templates\"\n ],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","old_contents":"@0xba54be93d5898b97;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"rq41p170hcs5rzg66axggv8r90fjcssdky8891kq5s7jcpm1813h\",\n manifest = (\n appTitle = (defaultText = \"Sandpass\"),\n appVersion = 4, # Increment this for every release.\n appMarketingVersion = (defaultText = \"1.0.0\"),\n\n actions = [\n ( title = (defaultText = \"New database\"),\n nounPhrase = (defaultText = \"database\"),\n command = .launcher\n )\n ],\n continueCommand = .launcher,\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"icons\/appGrid.svg\"),\n grain = (svg = embed \"icons\/grain.svg\"),\n market = (svg = embed \"icons\/market.svg\"),\n ),\n\n website = \"https:\/\/github.com\/zombiezen\/sandpass\",\n codeUrl = \"https:\/\/github.com\/zombiezen\/sandpass\",\n\n license = (openSource = apache2,\n notices = (defaultText = embed \".sandstorm\/notices.txt\")),\n\n categories = [productivity],\n\n author = (\n contactEmail = \"ross@zombiezen.com\",\n\n pgpSignature = embed \".sandstorm\/pgp-signature\",\n ),\n\n pgpKeyring = embed \".sandstorm\/pgp-keyring\",\n\n description = (defaultText = embed \".sandstorm\/description.md\"),\n shortDescription = (defaultText = \"Password manager\"),\n\n screenshots = [\n (width = 698, height = 704, png = embed \".sandstorm\/screenshot-list.png\"),\n (width = 791, height = 704, png = embed \".sandstorm\/screenshot-edit.png\"),\n ],\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n ),\n\n bridgeConfig = (\n viewInfo = (\n permissions = [\n ( name = \"read\",\n title = (defaultText = \"Read from database\"),\n obsolete = true, # implied by sharing\n ),\n ( name = \"write\",\n title = (defaultText = \"Make changes to database\"),\n ),\n ( name = \"init\",\n title = (defaultText = \"Create, delete, and rekey the database\"),\n ),\n ],\n roles = [\n ( title = (defaultText = \"viewer\"),\n verbPhrase = (defaultText = \"can read\"),\n permissions = [true, false, false],\n ),\n ( title = (defaultText = \"editor\"),\n verbPhrase = (defaultText = \"can read and write\"),\n permissions = [true, true, false],\n ),\n ( title = (defaultText = \"manager\"),\n verbPhrase = (defaultText = \"can read, write, and manage\"),\n description = (defaultText = \"A manager can not only edit the database, but also delete it.\"),\n permissions = [true, true, true],\n )\n ]\n )\n )\n);\n\nconst launcher :Spk.Manifest.Command = (\n argv = [\"\/sandstorm-http-bridge\", \"8080\", \"--\", \"\/opt\/app\/sandpass\", \"-listen=[::]:8080\", \"-db=\/var\/keepass.kdb\", \"-static_dir=\/opt\/app\", \"-templates_dir=\/opt\/app\/templates\"],\n environ = [\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n ]\n);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f7df356b9d4d480f6988e3fc64608c9818a6bd13","subject":"* adding PlayerInit to ClientTransmission * adding in a Finish message that the state transition diagram identified was missing","message":"* adding PlayerInit to ClientTransmission\n* adding in a Finish message that the state transition diagram identified was missing\n","repos":"khklau\/robocup2Dsim,khklau\/robocup2Dsim,khklau\/robocup2Dsim","old_file":"src\/bcprotocol\/protocol.capnp","new_file":"src\/bcprotocol\/protocol.capnp","new_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Command = import \"\/core\/command.capnp\";\nusing Control = import \"control.capnp\";\nusing Error = import \"\/core\/error.capnp\";\nusing Info = import \"info.capnp\";\nusing Sensor = import \"sensor.capnp\";\n\nstruct BotTransmission\n{\n union\n {\n\tcatch @0 :Control.CatchAction;\n\tdash @1 :Control.DashAction;\n\tkick @2 :Control.KickAction;\n\tturnBody @3 :Control.TurnBodyAction;\n\tturnHead @4 :Control.TurnHeadAction;\n\tscoreQuery @5 :Info.ScoreQuery;\n\ttimeQuery @6 :Info.TimeQuery;\n }\n}\n\nstruct ClientTransmission\n{\n union\n {\n\tunknownMsg @0 :Error.UnknownMsgError;\n\tmalformedMsg @1 :Error.MalformedMsgError;\n\tscoreResult @2 :Info.ScoreResult;\n\ttimeResult @3 :Info.TimeResult;\n\tcommunication @4 :Sensor.Communication;\n\tvisual @5 :Sensor.Visual;\n\tinit @6 :Command.PlayerInit;\n\tfinish @7 :Void;\n }\n}\n","old_contents":"@0xca7b62e1bed2bc72;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"robocup2Dsim::bcprotocol\");\n\nusing Control = import \"control.capnp\";\nusing Error = import \"\/core\/error.capnp\";\nusing Info = import \"info.capnp\";\nusing Sensor = import \"sensor.capnp\";\n\nstruct BotTransmission\n{\n union\n {\n\tcatch @0 :Control.CatchAction;\n\tdash @1 :Control.DashAction;\n\tkick @2 :Control.KickAction;\n\tturnBody @3 :Control.TurnBodyAction;\n\tturnHead @4 :Control.TurnHeadAction;\n\tscoreQuery @5 :Info.ScoreQuery;\n\ttimeQuery @6 :Info.TimeQuery;\n }\n}\n\nstruct ClientTransmission\n{\n union\n {\n\tunknownMsg @0 :Error.UnknownMsgError;\n\tmalformedMsg @1 :Error.MalformedMsgError;\n\tscoreResult @2 :Info.ScoreResult;\n\ttimeResult @3 :Info.TimeResult;\n\tcommunication @4 :Sensor.Communication;\n\tvisual @5 :Sensor.Visual;\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"d62bfe10479ab0159fef71b895b9140fc222597a","subject":"Add initial Cap'n Proto schema","message":"Add initial Cap'n Proto schema\n","repos":"extendedmind\/extendedmind,extendedmind\/extendedmind,extendedmind\/extendedmind,extendedmind\/extendedmind,extendedmind\/extendedmind,extendedmind\/extendedmind,extendedmind\/extendedmind","old_file":"schema\/src\/schema.capnp","new_file":"schema\/src\/schema.capnp","new_contents":"@0xc57f2a0601973779;\n\nstruct Data @0x8b5980e82d7915ee {\n items @0 :List(Item);\n tags @1 :List(Tag);\n reminders @2 :List(Reminder);\n\n struct Item @0xa15b6d5e4d8c722e {\n uuid @0 :Data;\n itemType @1 :ItemType = unspecified;\n content @2 :Text;\n\n enum ItemType @0xca3d39e6e2380c85 {\n unspecified @0;\n task @1;\n note @2;\n }\n }\n\n struct Tag @0xc2329ca7e6f7b587 {\n uuid @0 :Data;\n tagType @1 :TagType;\n content @2 :Text;\n\n enum TagType @0xab35690c3d6160b4 {\n keyword @0;\n context @1;\n }\n }\n\n struct Reminder @0xa9fab51c203f9ab8 {\n uuid @0 :Data;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'schema\/src\/schema.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"00b2e86f8376523326d0d8a7dd84643a68ef070c","subject":"bump the version for sandstorm marketplace launch","message":"bump the version for sandstorm marketplace launch\n","repos":"nicolastrres\/hacker-slides,FFrancieli\/hacker-slides,nicolastrres\/hacker-slides,paulproteus\/hacker-slides,paulproteus\/hacker-slides,paulproteus\/hacker-slides,jacksingleton\/hacker-slides,jacksingleton\/hacker-slides,FFrancieli\/hacker-slides,nicolastrres\/hacker-slides,jacksingleton\/hacker-slides,FFrancieli\/hacker-slides,nicolastrres\/hacker-slides,FFrancieli\/hacker-slides,jacksingleton\/hacker-slides,paulproteus\/hacker-slides,jacksingleton\/hacker-slides","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 2, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","old_contents":"@0x87742b8004358e72;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"7qvcjh7gk0rzdx1s3c8gufd288sesf6vvdt297756xcv4q8xxvhh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n\n manifest = (\n appTitle = (defaultText = \"Hacker Slides\"),\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 1, # Increment this for every release.\n appMarketingVersion = (defaultText = \"0.1.0\"),\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Slides\"),\n nounPhrase = (defaultText = \"slides\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"app-graphics\/hackerslides-128.svg\"),\n grain = (svg = embed \"app-graphics\/hackerslides-24.svg\"),\n market = (svg = embed \"app-graphics\/hackerslides-150.svg\"),\n ),\n\n website = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n codeUrl = \"https:\/\/github.com\/jacksingleton\/hacker-slides\",\n license = (openSource = mit),\n categories = [office, productivity],\n\n author = (\n contactEmail = \"hackerslides@jacksingleton.com\",\n pgpSignature = embed \"pgp-signature\",\n ),\n\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Presentation tool\"),\n\n screenshots = [\n (width = 448, height = 343, png = embed \"screenshot.png\")\n ],\n ),\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\", hidePaths = [\".git\", \".vagrant\"] ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\", \"vagrant\", \"*.pyc\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \".\/main.py\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"HOME\", value = \"\/var\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"a644485ddc7aee169f0742e10b4fe6ca06f9e602","subject":"Share descriptor.","message":"Share descriptor.\n","repos":"szmyd\/odi","old_file":"src\/proto\/odi.capnp","new_file":"src\/proto\/odi.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/szmyd\/odi.git\/'\n","license":"isc","lang":"Cap'n Proto"} {"commit":"0da3e7b5d04d16733b6e0faddc4384b39c23bd1f","subject":"add test-message schema","message":"add test-message schema\n","repos":"raffber\/capnqml,raffber\/capnqml,raffber\/capnqml","old_file":"src\/test\/test-message.capnp","new_file":"src\/test\/test-message.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/raffber\/capnqml.git\/'\n","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"311b15ef361806c1bd8de02ffce0e9e5180da249","subject":"fix wrong ordinal number","message":"fix wrong ordinal number\n","repos":"Jumpscale\/ays9,Jumpscale\/ays9,Jumpscale\/ays9,Jumpscale\/ays9","old_file":"templates\/nodes\/node.ovc\/schema.capnp","new_file":"templates\/nodes\/node.ovc\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Jumpscale\/ays9.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"0a755587b0f8dd21a722924642b422fa1dd59c78","subject":"Add schema to TP (and Cells4)","message":"Add schema to TP (and Cells4)\n","repos":"neuroidss\/nupic.core,rhyolight\/nupic.core,akhilaananthram\/nupic.core,scottpurdy\/nupic.core,metaml\/nupic.core,akhilaananthram\/nupic.core,lscheinkman\/nupic.core,rcrowder\/nupic.core,neuroidss\/nupic.core,akhilaananthram\/nupic.core,scottpurdy\/nupic.core,rhyolight\/nupic.core,rhyolight\/nupic.core,rcrowder\/nupic.core,rhyolight\/nupic.core,numenta\/nupic.core,pettitda\/nupic.core,numenta\/nupic.core,sambitgaan\/nupic.core,numenta\/htmresearch-core,subutai\/nupic.core,numenta\/htmresearch-core,scottpurdy\/nupic.core,Bemujo\/https-github.com-numenta-nupic,jaredweiss\/nupic.core,breznak\/nupic.core,utensil\/nupic.core,utensil\/nupic.core,subutai\/nupic.core,rcrowder\/nupic.core,EricSB\/nupic.core,pettitda\/nupic.core,akhilaananthram\/nupic.core,lscheinkman\/nupic.core,ywcui1990\/nupic.core,utensil\/nupic.core,lscheinkman\/nupic.core,pettitda\/nupic.core,utensil\/nupic.core,ywcui1990\/nupic.core,ywcui1990\/nupic.core,sambitgaan\/nupic.core,brev\/nupic.core,subutai\/nupic.core,brev\/nupic.core,neuroidss\/nupic.core,EricSB\/nupic.core,breznak\/nupic.core,subutai\/nupic.core,neuroidss\/nupic.core,sambitgaan\/nupic.core,sambitgaan\/nupic.core,Bemujo\/https-github.com-numenta-nupic,metaml\/nupic.core,Bemujo\/https-github.com-numenta-nupic,numenta\/htmresearch-core,numenta\/nupic.core,breznak\/nupic.core,metaml\/nupic.core,pettitda\/nupic.core,lscheinkman\/nupic.core,numenta\/htmresearch-core,Bemujo\/https-github.com-numenta-nupic,rcrowder\/nupic.core,brev\/nupic.core,numenta\/nupic.core,metaml\/nupic.core,EricSB\/nupic.core,jaredweiss\/nupic.core,scottpurdy\/nupic.core,brev\/nupic.core,jaredweiss\/nupic.core,EricSB\/nupic.core,breznak\/nupic.core,jaredweiss\/nupic.core,ywcui1990\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryV1.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryV1.capnp","new_contents":"@0xa64ad1d724c51d4c;\n\n# TODO: Use absolute path\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: ???\nstruct TemporalMemoryV1Proto {\n version @0 :UInt16;\n verbosity @1 :UInt8;\n random @2 :RandomProto;\n\n numberOfCols @3 :UInt32;\n cellsPerColumn @4 :UInt32;\n maxSegmentsPerCell @5 :UInt32;\n\n activationThreshold @6 :UInt32;\n minThreshold @7 :UInt32;\n segUpdateValidDuration @8 :UInt32;\n newSynapseCount @9 :UInt32;\n maxSynapsesPerSegment @10 :UInt32;\n initSegFreq @11 :Float32;\n\n initialPerm @12 :Float32;\n connectedPerm @13 :Float32;\n permanenceMax @14 :Float32;\n permanenceDec @15 :Float32;\n permanenceInc @16 :Float32;\n checkSynapseConsistency @17 :Bool;\n\n doPooling @18 :Bool;\n globalDecay @19 :Float32;\n maxAge @20 :UInt32;\n maxInfBacktrack @21 :UInt32;\n maxLrnBacktrack @22 :UInt32;\n pamLength @23 :UInt32;\n pamCounter @24 :UInt32;\n learnedSeqLength @25 :UInt32;\n avgLearnedSeqLength @26 :Float32;\n maxSeqLength @27 :UInt32;\n avgInputDensity @28 :Float32;\n outputType @29 : Text;\n burnIn @30 : UInt32;\n collectStats @31 : Bool;\n collectSequenceStats @32 :Bool;\n\n iterationIdx @33 :UInt32;\n lrnIterationIdx @34 :UInt32;\n resetCalled @35 :Bool;\n nextSegIdx @36 :UInt32;\n\n cells @37 :List(Cell);\n segmentUpdates @38 :List(SegmentUpdate);\n\n ownsMemory @39 :Bool;\n lrnActiveStateT1 @40 :List(UInt8);\n lrnActiveStateT @41 :List(UInt8);\n lrnPredictedStateT1 @42 :List(UInt8);\n lrnPredictedStateT @43 :List(UInt8);\n infActiveStateT1 @44 :List(UInt8);\n infActiveStateT @45 :List(UInt8);\n infActiveStateBackup @46 :List(UInt8);\n infActiveStateCandidate @47 :List(UInt8);\n infPredictedStateT1 @48 :List(UInt8);\n infPredictedStateT @49 :List(UInt8);\n cellConfidenceT1 @50 :List(Float32);\n cellConfidenceT @51 :List(Float32);\n colConfidenceT1 @52 :List(Float32);\n colConfidenceT @53 :List(Float32);\n\n prevLrnPatterns @54 :List(List(UInt32));\n prevInfPatterns @55 :List(List(UInt32));\n\n statsNumInfersSinceReset @56 : UInt32;\n statsNumPredictions @57 : UInt32;\n statsCurPredictionScore2 @58 :Float32;\n statsPredictionScoreTotal2 @59 :Float32;\n statsCurFalseNegativeScore @60 :Float32;\n statsFalseNegativeScoreTotal @61 :Float32;\n statsCurFalsePositiveScore @62 :Float32;\n statsFalsePositiveScoreTotal @63 :Float32;\n statsPctExtraTotal @64 :Float32;\n statsPctMissingTotal @65 :Float32;\n statsCurMissing @66 : UInt32;\n statsCurExtra @67 : UInt32;\n statsTotalMissing @68 : UInt32;\n statsTotalExtra @69 : UInt32;\n statsPrevSequenceSignature @70 :List(Float32);\n statsConfHistogram @71 :List(List(Float32));\n\n # Next ID: ???\n struct Cell {\n segments @0 :List(Segment);\n }\n\n # Next ID: ???\n struct Segment {\n segIdx @0 :UInt32;\n sequenceSegment @1 :Bool;\n frequency @2 :Float32;\n numConnectedSynapses @3 :UInt32;\n totalActivations @4 :UInt32;\n positiveActivations @5 :UInt32;\n lastActiveIteration @6 :UInt32;\n lastPosDutyCycle @7 :Float32;\n lastPosDutyCycleIteration @8 :UInt32;\n synapses @9 :List(Synapse);\n }\n\n # Next ID: ???\n struct Synapse {\n srcCellIdx @0 :UInt64;\n permanence @1 :Float32;\n }\n\n # Next ID: ???\n struct SegmentUpdate {\n cellIdx @0 :UInt32;\n segIdx @1 :UInt32;\n sequenceSegment @2 :Bool;\n synapses @3 :List(UInt32);\n newSynapses @4 :List(UInt64);\n lrnIterationIdx @5 :UInt32;\n phase1 @6 :Bool;\n weaklyPredicting @7 :Bool;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/nupic\/proto\/TemporalMemoryV1.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"b7c48f20529707c623c6617ae577757aee2dae44","subject":"Add capnp proto for SDR classifier region","message":"Add capnp proto for SDR classifier region\n","repos":"ywcui1990\/nupic,pulinagrawal\/nupic,breznak\/nupic,rhyolight\/nupic,alfonsokim\/nupic,cogmission\/nupic,badlogicmanpreet\/nupic,neuroidss\/nupic,EricSB\/nupic,blueburningcoder\/nupic,badlogicmanpreet\/nupic,neuroidss\/nupic,scottpurdy\/nupic,rcrowder\/nupic,arhik\/nupic,arhik\/nupic,breznak\/nupic,alfonsokim\/nupic,pulinagrawal\/nupic,pulinagrawal\/nupic,numenta-ci\/nupic,alfonsokim\/nupic,numenta-ci\/nupic,lscheinkman\/nupic,rcrowder\/nupic,numenta\/nupic,rhyolight\/nupic,numenta-ci\/nupic,cogmission\/nupic,lscheinkman\/nupic,subutai\/nupic,vitaly-krugl\/nupic,neuroidss\/nupic,EricSB\/nupic,EricSB\/nupic,vitaly-krugl\/nupic,breznak\/nupic,cogmission\/nupic,blueburningcoder\/nupic,lscheinkman\/nupic,subutai\/nupic,rcrowder\/nupic,ywcui1990\/nupic,marionleborgne\/nupic,marionleborgne\/nupic,marionleborgne\/nupic,blueburningcoder\/nupic,badlogicmanpreet\/nupic,subutai\/nupic,arhik\/nupic,scottpurdy\/nupic,scottpurdy\/nupic,numenta\/nupic,ywcui1990\/nupic,rhyolight\/nupic,vitaly-krugl\/nupic,numenta\/nupic","old_file":"src\/nupic\/regions\/SDRClassifierRegion.capnp","new_file":"src\/nupic\/regions\/SDRClassifierRegion.capnp","new_contents":"@0xa86c32f1ece85ed0;\n\nusing import \"\/nupic\/proto\/SdrClassifier.capnp\".SdrClassifierProto;\n\n# Next ID: 6\nstruct SDRClassifierRegionProto {\n classifierImp @0 :Text;\n claClassifier @1 :SdrClassifierProto;\n steps @2 :Text;\n alpha @3 :Float32;\n verbosity @4 :UInt32;\n maxCategoryCount @5 :UInt32;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/nupic\/regions\/SDRClassifierRegion.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"b3bb2910c1fea8b4ea5615762518815764d02c39","subject":"pkgdef","message":"pkgdef\n","repos":"neynah\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,dwrensha\/groovebasin,neynah\/groovebasin","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0xe6391d0709201983;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"wfg1r0qra2ewyvns05r0rddqttt57qxurz3nz5z95rjnm63et7e0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appVersion = 0, # Increment this for every release.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New GrooveBasin Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"10000\", \"--\", \"npm\", \"start\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sandstorm-pkgdef.capnp' did not match any file(s) known to git\n","license":"mit","lang":"Cap'n Proto"} {"commit":"0f61c8de526054bc5fce24f89434503f9efa06f7","subject":"add missing status to schema of storage_engine (#1133)","message":"add missing status to schema of storage_engine (#1133)\n\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/storage_engine\/schema.capnp","new_file":"templates\/storage_engine\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"c89dba756a04a771c1833d9dfc575450aca49a29","subject":"Fix order of vm schema","message":"Fix order of vm schema\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/vm\/schema.capnp","new_file":"templates\/vm\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"66896f0e898ec0f1ffa6e1e1787f9fa432b401a6","subject":"make format of struct fiedls name consistent","message":"make format of struct fiedls name consistent\n","repos":"Jumpscale\/jumpscale_core8,Jumpscale\/jumpscale_core8","old_file":"lib\/JumpScale\/baselib\/atyourservice\/aysmodel.capnp","new_file":"lib\/JumpScale\/baselib\/atyourservice\/aysmodel.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Jumpscale\/jumpscale_core8.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9aa6b39257b877c3ab592b1b62c807a557da7186","subject":"add test message","message":"add test message\n","repos":"raffber\/capnqml,raffber\/capnqml,raffber\/capnqml","old_file":"src\/schema\/test-message.capnp","new_file":"src\/schema\/test-message.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/raffber\/capnqml.git\/'\n","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"6faa64222da1b0e0a4bdcf3836a56cd08040e3aa","subject":"Add CLAModel proto file","message":"Add CLAModel proto file\n","repos":"EricSB\/nupic,pulinagrawal\/nupic,scottpurdy\/nupic,arhik\/nupic,lscheinkman\/nupic,subutai\/nupic,runt18\/nupic,sambitgaan\/nupic,vitaly-krugl\/nupic,BoltzmannBrain\/nupic,cogmission\/nupic,numenta\/nupic,lscheinkman\/nupic,arhik\/nupic,pulinagrawal\/nupic,go-bears\/nupic,ywcui1990\/nupic,go-bears\/nupic,badlogicmanpreet\/nupic,rcrowder\/nupic,ywcui1990\/nupic,marionleborgne\/nupic,go-bears\/nupic,jcasner\/nupic,subutai\/nupic,arhik\/nupic,cogmission\/nupic,scottpurdy\/nupic,subutai\/nupic,blueburningcoder\/nupic,jcasner\/nupic,blueburningcoder\/nupic,neuroidss\/nupic,numenta\/nupic,vitaly-krugl\/nupic,rhyolight\/nupic,BoltzmannBrain\/nupic,breznak\/nupic,numenta\/nupic,blueburningcoder\/nupic,ywcui1990\/nupic,badlogicmanpreet\/nupic,numenta-ci\/nupic,EricSB\/nupic,runt18\/nupic,alfonsokim\/nupic,alfonsokim\/nupic,runt18\/nupic,breznak\/nupic,rcrowder\/nupic,numenta-ci\/nupic,sambitgaan\/nupic,rhyolight\/nupic,BoltzmannBrain\/nupic,badlogicmanpreet\/nupic,neuroidss\/nupic,neuroidss\/nupic,scottpurdy\/nupic,breznak\/nupic,marionleborgne\/nupic,numenta-ci\/nupic,jcasner\/nupic,EricSB\/nupic,pulinagrawal\/nupic,sambitgaan\/nupic,vitaly-krugl\/nupic,rhyolight\/nupic,rcrowder\/nupic,lscheinkman\/nupic,marionleborgne\/nupic,alfonsokim\/nupic,cogmission\/nupic","old_file":"src\/nupic\/frameworks\/opf\/CLAModelProto.capnp","new_file":"src\/nupic\/frameworks\/opf\/CLAModelProto.capnp","new_contents":"@0xabf2792aa23483be;\n\nusing import \"\/nupic\/proto\/NetworkProto.capnp\".NetworkProto;\n\n# Next ID: 2\nstruct CLAModelProto {\n inferenceType @0 :InferenceType;\n numRunCalls @1 :UInt32;\n network @2 :NetworkProto;\n\n enum InferenceType {\n temporalNextStep @0;\n temporalClassification @1;\n nontemporalClassification @2;\n temporalAnomaly @3;\n nontemporalAnomaly @4;\n temporalMultiStep @5;\n nontemporalMultiStep @6;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/nupic\/frameworks\/opf\/CLAModelProto.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"199c27124dcf2fc3907059ef4fa25fd9ba1251a4","subject":"add gce config","message":"add gce config\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"gce-config.capnp","new_file":"gce-config.capnp","new_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n quotaEnabled = false,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gce-config.capnp' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"93f11400c4d2bed8cf088b4580a048186ca22b82","subject":"Add TileDB Serialization Cap'n Proto schema file","message":"Add TileDB Serialization Cap'n Proto schema file\n\nThis schema file defines the serialization format for TileDB Queries and\nArray schema as used for REST arrays. This file is used to produce the\ntiledb-rest.h and tiledb-rest.c++ files.\n","repos":"TileDB-Inc\/TileDB,TileDB-Inc\/TileDB,TileDB-Inc\/TileDB,TileDB-Inc\/TileDB","old_file":"tiledb\/sm\/serialization\/tiledb-rest.capnp","new_file":"tiledb\/sm\/serialization\/tiledb-rest.capnp","new_contents":"@0xb57d9224b587d87f;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"tiledb::sm::serialization::capnp\");\n\nstruct DomainArray {\n int8 @0 :List(Int8);\n uint8 @1 :List(UInt8);\n int16 @2 :List(Int16);\n uint16 @3 :List(UInt16);\n int32 @4 :List(Int32);\n uint32 @5 :List(UInt32);\n int64 @6 :List(Int64);\n uint64 @7 :List(UInt64);\n float32 @8 :List(Float32);\n float64 @9 :List(Float64);\n}\n\nstruct Array {\n timestamp @0 :UInt64;\n # timestamp array was opened\n\n queryType @1 :Text;\n # Array opened for query type\n\n uri @2 :Text;\n # Array uri\n}\n\nstruct ArraySchema {\n# ArraySchema during creation or retrevial\n arrayType @0 :Text;\n # Type of array\n\n attributes @1 :List(Attribute);\n # Attributes of array\n\n capacity @2 :UInt64;\n # Capacity of array\n\n cellOrder @3 :Text;\n # Order of cells\n\n coordsFilterPipeline @4 :FilterPipeline;\n # Type of compression for coordinates (enum)\n\n domain @5 :Domain;\n # Domain of array\n\n offsetFilterPipeline @6 :FilterPipeline;\n # Compression type of cell variable offsets (enum)\n\n tileOrder @7 :Text;\n # Tile order setting of array\n\n uri @8 :Text;\n # URI of schema\n\n version @9 :List(Int32);\n # file format version\n\n allowsDuplicates @10 :Bool;\n # True if the array allows coordinate duplicates.\n # Applicable only to sparse arrays.\n}\n\nstruct Attribute {\n# Attribute of array\n cellValNum @0 :UInt32;\n # Attribute number of values per cell\n\n name @1 :Text;\n # Attribute name\n\n type @2 :Text;\n # TileDB attribute datatype\n\n filterPipeline @3 :FilterPipeline;\n # TileDB FilterPipeline for Attribute\n}\n\nstruct AttributeBufferHeader {\n# Represents an attribute buffer header information\n\n name @0 :Text;\n # Attribute name\n\n fixedLenBufferSizeInBytes @1 :UInt64;\n # Number of bytes in the fixed-length attribute data buffer\n\n varLenBufferSizeInBytes @2 :UInt64;\n # Number of bytes in the var-length attribute data buffer\n}\n\nstruct Dimension {\n# Dimension of array\n\n name @0 :Text;\n # Dimension name\n\n nullTileExtent @1 :Bool;\n # Is tile extent null\n\n type @2 :Text;\n # Datatype for Dimension\n\n tileExtent :union {\n int8 @3 :Int8;\n uint8 @4 :UInt8;\n int16 @5 :Int16;\n uint16 @6 :UInt16;\n int32 @7 :Int32;\n uint32 @8 :UInt32;\n int64 @9 :Int64;\n uint64 @10 :UInt64;\n float32 @11 :Float32;\n float64 @12 :Float64;\n }\n # Extent of tile\n\n domain @13 :DomainArray;\n # extent of domain\n\n filterPipeline @14 :FilterPipeline;\n # TileDB FilterPipeline for Dimension\n}\n\nstruct Domain {\n# Domain of array\n cellOrder @0 :Text;\n # Tile Order\n\n dimensions @1 :List(Dimension);\n # Array of dimensions\n\n tileOrder @2 :Text;\n # Tile Order\n\n type @3 :Text;\n # Datatype of domain\n}\n\nstruct Error {\n code @0 :Int64;\n message @1 :Text;\n}\n\nstruct Filter {\n type @0 :Text;\n # filter type\n\n data :union {\n text @1 :Text;\n bytes @2 :Data;\n int8 @3 :Int8;\n uint8 @4 :UInt8;\n int16 @5 :Int16;\n uint16 @6 :UInt16;\n int32 @7 :Int32;\n uint32 @8 :UInt32;\n int64 @9 :Int64;\n uint64 @10 :UInt64;\n float32 @11 :Float32;\n float64 @12 :Float64;\n }\n # filter data\n}\n\nstruct FilterPipeline {\n filters @0 :List(Filter);\n}\n\nstruct Map(Key, Value) {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n}\n\nstruct MapUInt32 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :UInt32;\n }\n}\n\nstruct MapInt64 {\n entries @0 :List(Entry);\n struct Entry {\n key @0 :Text;\n value @1 :Int64;\n }\n}\n\nstruct Writer {\n # Write struct\n checkCoordDups @0 :Bool;\n\n checkCoordOOB @1 :Bool;\n\n dedupCoords @2 :Bool;\n\n subarray @3 :DomainArray;\n # Old-style (single-range) subarray for dense writes\n}\n\nstruct SubarrayRanges {\n # A set of 1D ranges for a subarray\n\n type @0 :Text;\n # Datatype of the ranges\n\n hasDefaultRange @1:Bool;\n # True if the range is the default range\n\n buffer @2 :Data;\n # The bytes of the ranges\n\n bufferSizes @3 :List(UInt64);\n # The list of sizes per range\n\n bufferStartSizes @4 :List(UInt64);\n # The list of start sizes per range\n}\n\nstruct Subarray {\n # A Subarray\n\n layout @0 :Text;\n # The layout of the subarray\n\n ranges @1 :List(SubarrayRanges);\n # List of 1D ranges, one per dimension\n}\n\nstruct SubarrayPartitioner {\n # The subarray partitioner\n\n struct PartitionInfo {\n subarray @0 :Subarray;\n start @1 :UInt64;\n end @2 :UInt64;\n splitMultiRange @3 :Bool;\n }\n\n struct State {\n start @0 :UInt64;\n end @1 :UInt64;\n singleRange @2 :List(Subarray);\n multiRange @3 :List(Subarray);\n }\n\n subarray @0 :Subarray;\n # The subarray the partitioner will iterate on to produce partitions.\n\n budget @1 :List(AttributeBufferSize);\n # Result size budget (in bytes) for all attributes.\n\n current @2 :PartitionInfo;\n # The current partition info\n\n state @3 :State;\n # The state information for the remaining partitions to be produced\n\n memoryBudget @4 :UInt64;\n # The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes\n\n memoryBudgetVar @5 :UInt64;\n # The memory budget for the var-sized attributes\n}\n\nstruct ReadState {\n overflowed @0 :Bool;\n # `True` if the query produced results that could not fit in some buffer.\n\n unsplittable @1 :Bool;\n # True if the current subarray partition is unsplittable.\n\n initialized @2 :Bool;\n # True if the reader has been initialized\n\n subarrayPartitioner @3 :SubarrayPartitioner;\n # The subarray partitioner\n}\n\nstruct QueryReader {\n # Read struct (can't be called reader due to class name conflict)\n\n layout @0 :Text;\n # The layout of the cells in the result of the subarray\n\n subarray @1 :Subarray;\n # The query subarray.\n\n readState @2 :ReadState;\n # Read state of reader\n}\n\nstruct Query {\n attributeBufferHeaders @0 :List(AttributeBufferHeader);\n # list of attribute buffer headers\n\n layout @1 :Text;\n # query write layout\n\n status @2 :Text;\n # query status\n\n type @3 :Text;\n # Type of query\n\n writer @4 :Writer;\n # writer contains data needed for continuation of global write order queries\n\n reader @5 :QueryReader;\n # reader contains data needed for continuation of incomplete reads\n\n array @6 :Array;\n # Represents an open array\n\n totalFixedLengthBufferBytes @7: UInt64;\n # Total number of bytes in fixed size attribute buffers\n\n totalVarLenBufferBytes @8: UInt64;\n # Total number of bytes in variable size attribute buffers\n}\n\nstruct NonEmptyDomain {\n # object representing a non-empty domain\n\n nonEmptyDomain @0 :DomainArray;\n # Non-empty domain of array\n\n isEmpty @1 :Bool;\n # Is non-empty domain really empty?\n\n sizes @2 :List(UInt64);\n # Number of elements in DomainArray for var length\n}\n\nstruct NonEmptyDomainList {\n # object representing non-empty domain for heterogeneous or string dimensions\n nonEmptyDomains @0 :List(NonEmptyDomain);\n}\n\nstruct AttributeBufferSize {\n # object representing a buffer size of an attribute\n\n attribute @0: Text;\n # name of attribute\n\n offsetBytes @1: UInt64;\n # size (in bytes) of offset buffer\n\n dataBytes @2: UInt64;\n # size (in bytes) of data buffer\n}\n\nstruct MaxBufferSizes {\n maxBufferSizes @0 :List(AttributeBufferSize);\n # a list of max buffer sizes, one per attribute\n}\n\nstruct ArrayMetadata {\n # object representing array metadata\n\n struct MetadataEntry {\n key @0 :Text;\n type @1 :Text;\n valueNum @2 :UInt32;\n value @3 :Data;\n del @4 :Bool;\n }\n\n entries @0 :List(MetadataEntry);\n # list of metadata values\n}\n\nstruct EstimatedResultSize {\n # object representing estimated\n struct ResultSize {\n # Result size \n sizeFixed @0 :Float64;\n sizeVar @1 :Float64;\n }\n \n struct MemorySize {\n # Memory Size\n sizeFixed @0 :UInt64;\n sizeVar @1 :UInt64;\n }\n\n resultSizes @0 :Map(Text, ResultSize);\n memorySizes @1 :Map(Text, MemorySize);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tiledb\/sm\/serialization\/tiledb-rest.capnp' did not match any file(s) known to git\n","license":"mit","lang":"Cap'n Proto"} {"commit":"82c8a7b0ed7b61fb252e80e795120071f7ed993f","subject":"Change nics to config in container schema","message":"Change nics to config in container schema\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/container\/schema.capnp","new_file":"templates\/container\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f392f4f5b0ae0486eac11aa1d74fb98f60787256","subject":"Accounts_AllowUserProfileChange = false","message":"Accounts_AllowUserProfileChange = false\n","repos":"PavelVanecek\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,mccambridge\/Rocket.Chat,mrinaldhar\/Rocket.Chat,yuyixg\/Rocket.Chat,abhishekshukla0302\/trico,ziedmahdi\/Rocket.Chat,LearnersGuild\/Rocket.Chat,tntobias\/Rocket.Chat,OtkurBiz\/Rocket.Chat,pachox\/Rocket.Chat,amaapp\/ama,litewhatever\/Rocket.Chat,acaronmd\/Rocket.Chat,alexbrazier\/Rocket.Chat,pkgodara\/Rocket.Chat,inoxth\/Rocket.Chat,danielbressan\/Rocket.Chat,ggazzo\/Rocket.Chat,Sing-Li\/Rocket.Chat,abduljanjua\/TheHub,org100h1\/Rocket.Panda,flaviogrossi\/Rocket.Chat,timkinnane\/Rocket.Chat,nishimaki10\/Rocket.Chat,marzieh312\/Rocket.Chat,igorstajic\/Rocket.Chat,Flitterkill\/Rocket.Chat,Flitterkill\/Rocket.Chat,mccambridge\/Rocket.Chat,PavelVanecek\/Rocket.Chat,karlprieb\/Rocket.Chat,xasx\/Rocket.Chat,bt\/Rocket.Chat,JamesHGreen\/Rocket.Chat,danielbressan\/Rocket.Chat,NMandapaty\/Rocket.Chat,xboston\/Rocket.Chat,intelradoux\/Rocket.Chat,haoyixin\/Rocket.Chat,JamesHGreen\/Rocket_API,litewhatever\/Rocket.Chat,mwharrison\/Rocket.Chat,Dianoga\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,k0nsl\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,wicked539\/Rocket.Chat,Dianoga\/Rocket.Chat,pitamar\/Rocket.Chat,OtkurBiz\/Rocket.Chat,abduljanjua\/TheHub,mrsimpson\/Rocket.Chat,timkinnane\/Rocket.Chat,alexbrazier\/Rocket.Chat,VoiSmart\/Rocket.Chat,subesokun\/Rocket.Chat,ggazzo\/Rocket.Chat,galrotem1993\/Rocket.Chat,org100h1\/Rocket.Panda,wtsarchive\/Rocket.Chat,intelradoux\/Rocket.Chat,NMandapaty\/Rocket.Chat,bt\/Rocket.Chat,Flitterkill\/Rocket.Chat,nishimaki10\/Rocket.Chat,AimenJoe\/Rocket.Chat,capensisma\/Rocket.Chat,karlprieb\/Rocket.Chat,galrotem1993\/Rocket.Chat,mrsimpson\/Rocket.Chat,JamesHGreen\/Rocket.Chat,klatys\/Rocket.Chat,wicked539\/Rocket.Chat,flaviogrossi\/Rocket.Chat,LearnersGuild\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,ealbers\/Rocket.Chat,fduraibi\/Rocket.Chat,liuliming2008\/Rocket.Chat,amaapp\/ama,cnash\/Rocket.Chat,galrotem1993\/Rocket.Chat,liuliming2008\/Rocket.Chat,AlecTroemel\/Rocket.Chat,Gyubin\/Rocket.Chat,Movile\/Rocket.Chat,marzieh312\/Rocket.Chat,AimenJoe\/Rocket.Chat,xboston\/Rocket.Chat,wicked539\/Rocket.Chat,igorstajic\/Rocket.Chat,AlecTroemel\/Rocket.Chat,JamesHGreen\/Rocket.Chat,VoiSmart\/Rocket.Chat,LearnersGuild\/echo-chat,Kiran-Rao\/Rocket.Chat,abduljanjua\/TheHub,timkinnane\/Rocket.Chat,Gudii\/Rocket.Chat,linnovate\/hi,mrinaldhar\/Rocket.Chat,mrinaldhar\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,cnash\/Rocket.Chat,xboston\/Rocket.Chat,Gudii\/Rocket.Chat,mccambridge\/Rocket.Chat,jbsavoy18\/rocketchat-1,alexbrazier\/Rocket.Chat,yuyixg\/Rocket.Chat,Sing-Li\/Rocket.Chat,pitamar\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,klatys\/Rocket.Chat,matthewshirley\/Rocket.Chat,fatihwk\/Rocket.Chat,wicked539\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,Movile\/Rocket.Chat,Sing-Li\/Rocket.Chat,cnash\/Rocket.Chat,danielbressan\/Rocket.Chat,steedos\/chat,NMandapaty\/Rocket.Chat,pitamar\/Rocket.Chat,wtsarchive\/Rocket.Chat,AlecTroemel\/Rocket.Chat,marzieh312\/Rocket.Chat,Dianoga\/Rocket.Chat,flaviogrossi\/Rocket.Chat,galrotem1993\/Rocket.Chat,4thParty\/Rocket.Chat,LearnersGuild\/Rocket.Chat,inoio\/Rocket.Chat,jbsavoy18\/rocketchat-1,Achaikos\/Rocket.Chat,Gyubin\/Rocket.Chat,amaapp\/ama,matthewshirley\/Rocket.Chat,acaronmd\/Rocket.Chat,ahmadassaf\/Rocket.Chat,pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat,subesokun\/Rocket.Chat,AimenJoe\/Rocket.Chat,karlprieb\/Rocket.Chat,ealbers\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,nishimaki10\/Rocket.Chat,abhishekshukla0302\/trico,pkgodara\/Rocket.Chat,Gudii\/Rocket.Chat,Achaikos\/Rocket.Chat,pitamar\/Rocket.Chat,inoxth\/Rocket.Chat,subesokun\/Rocket.Chat,ziedmahdi\/Rocket.Chat,BorntraegerMarc\/Rocket.Chat,xboston\/Rocket.Chat,flaviogrossi\/Rocket.Chat,bt\/Rocket.Chat,pachox\/Rocket.Chat,LearnersGuild\/echo-chat,fduraibi\/Rocket.Chat,JamesHGreen\/Rocket.Chat,JamesHGreen\/Rocket_API,klatys\/Rocket.Chat,Dianoga\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,NMandapaty\/Rocket.Chat,k0nsl\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,OtkurBiz\/Rocket.Chat,JamesHGreen\/Rocket_API,abduljanjua\/TheHub,mwharrison\/Rocket.Chat,klatys\/Rocket.Chat,jbsavoy18\/rocketchat-1,BorntraegerMarc\/Rocket.Chat,cnash\/Rocket.Chat,OtkurBiz\/Rocket.Chat,alexbrazier\/Rocket.Chat,fatihwk\/Rocket.Chat,ealbers\/Rocket.Chat,Gyubin\/Rocket.Chat,LearnersGuild\/echo-chat,danielbressan\/Rocket.Chat,Gyubin\/Rocket.Chat,tntobias\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,igorstajic\/Rocket.Chat,pachox\/Rocket.Chat,LearnersGuild\/echo-chat,matthewshirley\/Rocket.Chat,mccambridge\/Rocket.Chat,subesokun\/Rocket.Chat,4thParty\/Rocket.Chat,haoyixin\/Rocket.Chat,steedos\/chat,PavelVanecek\/Rocket.Chat,liuliming2008\/Rocket.Chat,jbsavoy18\/rocketchat-1,amaapp\/ama,ahmadassaf\/Rocket.Chat,litewhatever\/Rocket.Chat,LearnersGuild\/Rocket.Chat,fatihwk\/Rocket.Chat,xasx\/Rocket.Chat,wtsarchive\/Rocket.Chat,Sing-Li\/Rocket.Chat,ahmadassaf\/Rocket.Chat,tntobias\/Rocket.Chat,VoiSmart\/Rocket.Chat,steedos\/chat,capensisma\/Rocket.Chat,inoio\/Rocket.Chat,Achaikos\/Rocket.Chat,Movile\/Rocket.Chat,steedos\/chat,Deepakkothandan\/Rocket.Chat,ggazzo\/Rocket.Chat,capensisma\/Rocket.Chat,AlecTroemel\/Rocket.Chat,ziedmahdi\/Rocket.Chat,yuyixg\/Rocket.Chat,haoyixin\/Rocket.Chat,mrinaldhar\/Rocket.Chat,xasx\/Rocket.Chat,yuyixg\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,mrsimpson\/Rocket.Chat,xasx\/Rocket.Chat,mrsimpson\/Rocket.Chat,ggazzo\/Rocket.Chat,org100h1\/Rocket.Panda,inoio\/Rocket.Chat,tntobias\/Rocket.Chat,inoxth\/Rocket.Chat,nishimaki10\/Rocket.Chat,acaronmd\/Rocket.Chat,litewhatever\/Rocket.Chat,ziedmahdi\/Rocket.Chat,ahmadassaf\/Rocket.Chat,bt\/Rocket.Chat,pkgodara\/Rocket.Chat,PavelVanecek\/Rocket.Chat,fduraibi\/Rocket.Chat,k0nsl\/Rocket.Chat,org100h1\/Rocket.Panda,fatihwk\/Rocket.Chat,abhishekshukla0302\/trico,snaiperskaya96\/Rocket.Chat,mwharrison\/Rocket.Chat,Achaikos\/Rocket.Chat,fduraibi\/Rocket.Chat,Flitterkill\/Rocket.Chat,snaiperskaya96\/Rocket.Chat,haoyixin\/Rocket.Chat,JamesHGreen\/Rocket_API,timkinnane\/Rocket.Chat,linnovate\/hi,igorstajic\/Rocket.Chat,intelradoux\/Rocket.Chat,marzieh312\/Rocket.Chat,karlprieb\/Rocket.Chat,acaronmd\/Rocket.Chat,AimenJoe\/Rocket.Chat,abhishekshukla0302\/trico,ealbers\/Rocket.Chat,k0nsl\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,intelradoux\/Rocket.Chat,Gudii\/Rocket.Chat,Movile\/Rocket.Chat,Deepakkothandan\/Rocket.Chat,4thParty\/Rocket.Chat,liuliming2008\/Rocket.Chat,wtsarchive\/Rocket.Chat,inoxth\/Rocket.Chat,mwharrison\/Rocket.Chat,matthewshirley\/Rocket.Chat,pachox\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 14, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.18.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, developerTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"Statistics_opt_out\", value = \"true\")\n (key = \"Accounts_AllowUserAvatarChange\", value = \"false\")\n (key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n ]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Rocket.Chat\"),\n\n appVersion = 14, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.18.0\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Rocket.Chat\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"rocket.chat-128.svg\"),\n grain = (svg = embed \"rocket.chat-24.svg\"),\n market = (svg = embed \"rocket.chat-150.svg\"),\n ),\n\n website = \"https:\/\/rocket.chat\",\n codeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n license = (openSource = mit),\n categories = [communications, productivity, office, social, developerTools],\n\n author = (\n contactEmail = \"team@rocket.chat\",\n pgpSignature = embed \"pgp-signature\",\n upstreamAuthor = \"Rocket.Chat\",\n ),\n pgpKeyring = embed \"pgp-keyring\",\n\n description = (defaultText = embed \"description.md\"),\n shortDescription = (defaultText = \"Chat app\"),\n\n screenshots = [\n (width = 1203, height = 760, png = embed \"screenshot.png\")\n ],\n\n changeLog = (defaultText = embed \"CHANGELOG.md\"),\n ),\n\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n ( sourcePath = \"\/home\/vagrant\/bundle\" ),\n ( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n ]\n ),\n\n alwaysInclude = [ \".\" ]\n # This says that we always want to include all files from the source map.\n # (An alternative is to automatically detect dependencies by watching what\n # the app opens while running in dev mode. To see what that looks like,\n # run `spk init` without the -A option.)\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"SANDSTORM\", value = \"1\"),\n (key = \"Statistics_opt_out\", value = \"true\")\n (key = \"Accounts_AllowUserAvatarChange\", value = \"false\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"33e57cac7739d3193d45011f0bdb21ced8f78fe3","subject":"add missing status for grid service","message":"add missing status for grid service\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/bridge\/schema.capnp","new_file":"templates\/bridge\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"860c295983f8d9f640e4cec506081f7d0865a98d","subject":"fix match.capnp to match reality with regards to field numbers","message":"fix match.capnp to match reality with regards to field numbers\n","repos":"jamessan\/dcs,lamby\/dcs,jamessan\/dcs,lamby\/dcs,jamessan\/dcs,lamby\/dcs,jamessan\/dcs,lamby\/dcs","old_file":"proto\/match.capnp","new_file":"proto\/match.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/jamessan\/dcs.git\/'\n","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"b64756e1a3bb6357eba9e606aab09866394ff0cc","subject":"Add CLAModel proto file","message":"Add CLAModel proto file\n","repos":"breznak\/nupic,breznak\/nupic,breznak\/nupic","old_file":"src\/nupic\/frameworks\/opf\/CLAModelProto.capnp","new_file":"src\/nupic\/frameworks\/opf\/CLAModelProto.capnp","new_contents":"@0xabf2792aa23483be;\n\nusing import \"\/nupic\/proto\/NetworkProto.capnp\".NetworkProto;\n\n# Next ID: 2\nstruct CLAModelProto {\n inferenceType @0 :InferenceType;\n numRunCalls @1 :UInt32;\n network @2 :NetworkProto;\n\n enum InferenceType {\n temporalNextStep @0;\n temporalClassification @1;\n nontemporalClassification @2;\n temporalAnomaly @3;\n nontemporalAnomaly @4;\n temporalMultiStep @5;\n nontemporalMultiStep @6;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/nupic\/frameworks\/opf\/CLAModelProto.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"063561932c01a42428ce9f2f1f3a46bb487e7345","subject":"Add a missing file","message":"Add a missing file\n","repos":"cloudflare\/lua-capnproto,calio\/lua-capnproto,calio\/lua-capnproto,cloudflare\/lua-capnproto","old_file":"proto\/c++.capnp","new_file":"proto\/c++.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n@0xbdf87d7bb8304e81;\n$namespace(\"capnp::annotations\");\n\nannotation namespace(file): Text;\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proto\/c++.capnp' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"ef4226a5b87497236cf6e93df25b3de87c888d32","subject":"another bug in filesystem","message":"another bug in filesystem\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/filesystem\/schema.capnp","new_file":"templates\/filesystem\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"f0e98f7fba535a659e632711d3ff7b5a334df27b","subject":"Fix sytax error","message":"Fix sytax error\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/dhcp\/schema.capnp","new_file":"templates\/dhcp\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9953064ace539fca4bdb621160924590ba1a15e3","subject":"Add Temporal Memory serialization schema","message":"Add Temporal Memory serialization schema\n","repos":"EricSB\/nupic.core,breznak\/nupic.core,brev\/nupic.core,numenta\/nupic.core,akhilaananthram\/nupic.core,neuroidss\/nupic.core,neuroidss\/nupic.core,jaredweiss\/nupic.core,sambitgaan\/nupic.core,akhilaananthram\/nupic.core,scottpurdy\/nupic.core,rhyolight\/nupic.core,breznak\/nupic.core,utensil\/nupic.core,subutai\/nupic.core,subutai\/nupic.core,utensil\/nupic.core,numenta\/htmresearch-core,rcrowder\/nupic.core,brev\/nupic.core,pettitda\/nupic.core,rhyolight\/nupic.core,rcrowder\/nupic.core,Bemujo\/https-github.com-numenta-nupic,breznak\/nupic.core,Bemujo\/https-github.com-numenta-nupic,pettitda\/nupic.core,rhyolight\/nupic.core,Bemujo\/https-github.com-numenta-nupic,utensil\/nupic.core,pettitda\/nupic.core,neuroidss\/nupic.core,rcrowder\/nupic.core,utensil\/nupic.core,numenta\/nupic.core,lscheinkman\/nupic.core,numenta\/htmresearch-core,sambitgaan\/nupic.core,ywcui1990\/nupic.core,scottpurdy\/nupic.core,ywcui1990\/nupic.core,jaredweiss\/nupic.core,EricSB\/nupic.core,lscheinkman\/nupic.core,sambitgaan\/nupic.core,jaredweiss\/nupic.core,lscheinkman\/nupic.core,scottpurdy\/nupic.core,ywcui1990\/nupic.core,Bemujo\/https-github.com-numenta-nupic,metaml\/nupic.core,pettitda\/nupic.core,numenta\/htmresearch-core,brev\/nupic.core,jaredweiss\/nupic.core,numenta\/nupic.core,metaml\/nupic.core,numenta\/htmresearch-core,akhilaananthram\/nupic.core,ywcui1990\/nupic.core,subutai\/nupic.core,sambitgaan\/nupic.core,metaml\/nupic.core,rcrowder\/nupic.core,EricSB\/nupic.core,subutai\/nupic.core,scottpurdy\/nupic.core,neuroidss\/nupic.core,EricSB\/nupic.core,metaml\/nupic.core,brev\/nupic.core,rhyolight\/nupic.core,numenta\/nupic.core,lscheinkman\/nupic.core,breznak\/nupic.core,akhilaananthram\/nupic.core","old_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_file":"src\/nupic\/proto\/TemporalMemoryProto.capnp","new_contents":"@0xc5bf8243b0c10764;\n\n# TODO: Use absolute path\nusing import \"ConnectionsProto.capnp\".ConnectionsProto;\nusing import \"RandomProto.capnp\".RandomProto;\n\n# Next ID: 16\nstruct TemporalMemoryProto {\n\n columnDimensions @0 :List(UInt32);\n cellsPerColumn @1 :UInt32;\n activationThreshold @2 :UInt32;\n learningRadius @3 :UInt32;\n initialPermanence @4 :Float32;\n connectedPermanence @5 :Float32;\n minThreshold @6 :UInt32;\n maxNewSynapseCount @7 :UInt32;\n permanenceIncrement @8 :Float32;\n permanenceDecrement @9 :Float32;\n\n connections @10 :ConnectionsProto;\n random @11 :RandomProto;\n\n activeCells @12 :List(UInt32);\n predictiveCells @13 :List(UInt32);\n activeSegments @14 :List(UInt32);\n winnerCells @15 :List(UInt32);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/nupic\/proto\/TemporalMemoryProto.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"98f76630cf87331dd8ec6f1844a74222719646b8","subject":"Add simple test schema","message":"Add simple test schema\n","repos":"mattyclarkson\/capnp-es","old_file":"test\/fixtures\/Id.capnp","new_file":"test\/fixtures\/Id.capnp","new_contents":"@0xb44287c014a75e0e;\n\nstruct Id {\n value @0 :UInt64;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/fixtures\/Id.capnp' did not match any file(s) known to git\n","license":"mit","lang":"Cap'n Proto"} {"commit":"49e944ce56cd99dd797757e2c19f6eeed73bdb04","subject":"Update container schema to use nics instead of bridges","message":"Update container schema to use nics instead of bridges\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/container\/schema.capnp","new_file":"templates\/container\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"0f73f5301ddc6279031c75e4ffb42bed599723ea","subject":"Set vm to halted if installation failed","message":"Set vm to halted if installation failed\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/vm\/schema.capnp","new_file":"templates\/vm\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"20ac67dc82bcf32ac1da215535b1be92c50f1e12","subject":"add gce config","message":"add gce config\n","repos":"PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock,PDIS\/blackrock","old_file":"gce-config.capnp","new_file":"gce-config.capnp","new_contents":"@0xa9101b1fec595220;\nusing import \"\/blackrock\/master.capnp\".MasterConfig;\nconst gce :MasterConfig = (\n workerCount = 1,\n frontendCount = 1,\n frontendConfig = (\n baseUrl = \"http:\/\/pdis.rocks\",\n wildcardHost = \"*.pdis.rocks\",\n allowDemoAccounts = true,\n quotaEnabled = false,\n isTesting = true,\n outOfBeta = true,\n allowUninvited = true,\n replicasPerMachine = 2\n ),\n \n gce = (\n project = \"blackrock-mark\", \n zone = \"asia-east1-a\",\n instanceTypes = (\n storage = \"n1-standard-1\",\n worker = \"n1-standard-1\",\n frontend = \"g1-small\",\n mongo = \"g1-small\"\n )\n )\n);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gce-config.capnp' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"b97d88beea586ce9c0fa58a5bff2229b8c436f7a","subject":"add schema for message","message":"add schema for message\n\n","repos":"raffber\/capnqml,raffber\/capnqml,raffber\/capnqml","old_file":"src\/schema\/message.capnp","new_file":"src\/schema\/message.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/raffber\/capnqml.git\/'\n","license":"mpl-2.0","lang":"Cap'n Proto"} {"commit":"12262c1c4e238463aa4a2f827c9132bdf6bd1547","subject":"Add cpp schema","message":"Add cpp schema\n","repos":"lscheinkman\/nupic,rcrowder\/nupic,subutai\/nupic,numenta\/nupic,rcrowder\/nupic,scottpurdy\/nupic,lscheinkman\/nupic,alfonsokim\/nupic,neuroidss\/nupic,vitaly-krugl\/nupic,numenta\/nupic,neuroidss\/nupic,vitaly-krugl\/nupic,numenta\/nupic,ywcui1990\/nupic,rcrowder\/nupic,scottpurdy\/nupic,neuroidss\/nupic,rhyolight\/nupic,subutai\/nupic,ywcui1990\/nupic,ywcui1990\/nupic,alfonsokim\/nupic,rhyolight\/nupic,vitaly-krugl\/nupic,lscheinkman\/nupic,rhyolight\/nupic,alfonsokim\/nupic,subutai\/nupic,scottpurdy\/nupic","old_file":"src\/nupic\/algorithms\/backtracking_tm_cpp.capnp","new_file":"src\/nupic\/algorithms\/backtracking_tm_cpp.capnp","new_contents":"@0x929156e0dfbd37d6;\n\nusing import \"\/nupic\/algorithms\/backtracking_tm.capnp\".BacktrackingTMProto;\nusing import \"\/nupic\/proto\/Cells4.capnp\".Cells4Proto;\n\nstruct BacktrackingTMCppProto {\n baseTM @0 :BacktrackingTMProto;\n cells4 @1 :Cells4Proto;\n makeCells4Ephemeral @2 :Bool;\n seed @3 :Int64;\n checkSynapseConsistency @4 :Bool;\n initArgs @5 :Text;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/nupic\/algorithms\/backtracking_tm_cpp.capnp' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Cap'n Proto"} {"commit":"6ea7995ff29c6db69cca07f589217db0a4ac031f","subject":"change type from text to Nictype enum in container schema","message":"change type from text to Nictype enum in container schema\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/container\/schema.capnp","new_file":"templates\/container\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"80a1f94bc79e512f4707267e67b5b4e25b8fa0c1","subject":"define HOME for sandstorm build.","message":"define HOME for sandstorm build.\n","repos":"pitamar\/Rocket.Chat,pkgodara\/Rocket.Chat,mrinaldhar\/Rocket.Chat,subesokun\/Rocket.Chat,4thParty\/Rocket.Chat,nishimaki10\/Rocket.Chat,pkgodara\/Rocket.Chat,galrotem1993\/Rocket.Chat,subesokun\/Rocket.Chat,Sing-Li\/Rocket.Chat,pitamar\/Rocket.Chat,pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat,inoio\/Rocket.Chat,flaviogrossi\/Rocket.Chat,inoio\/Rocket.Chat,nishimaki10\/Rocket.Chat,galrotem1993\/Rocket.Chat,subesokun\/Rocket.Chat,galrotem1993\/Rocket.Chat,Sing-Li\/Rocket.Chat,pkgodara\/Rocket.Chat,inoio\/Rocket.Chat,mrinaldhar\/Rocket.Chat,flaviogrossi\/Rocket.Chat,pitamar\/Rocket.Chat,nishimaki10\/Rocket.Chat,mrinaldhar\/Rocket.Chat,VoiSmart\/Rocket.Chat,fatihwk\/Rocket.Chat,flaviogrossi\/Rocket.Chat,4thParty\/Rocket.Chat,fatihwk\/Rocket.Chat,nishimaki10\/Rocket.Chat,flaviogrossi\/Rocket.Chat,VoiSmart\/Rocket.Chat,subesokun\/Rocket.Chat,pitamar\/Rocket.Chat,Sing-Li\/Rocket.Chat,4thParty\/Rocket.Chat,mrinaldhar\/Rocket.Chat,fatihwk\/Rocket.Chat,fatihwk\/Rocket.Chat,VoiSmart\/Rocket.Chat,Sing-Li\/Rocket.Chat,galrotem1993\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 62, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.60.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n (key = \"HOME\", value= \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 62, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.60.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"c10c66d3db46dc6c2698de298183b8f5ea41f7f1","subject":"allow to configure max msg size in zerostorserver","message":"allow to configure max msg size in zerostorserver\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/zerostor\/schema.capnp","new_file":"templates\/zerostor\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"609859364341d7e0ccacd03f0190c058c8e09cba","subject":"rpc code","message":"rpc code\n","repos":"cmu-db\/peloton,apavlo\/peloton,malin1993ml\/peloton,cmu-db\/peloton,apavlo\/peloton,yingjunwu\/peloton,cmu-db\/peloton,malin1993ml\/peloton,yingjunwu\/peloton,cmu-db\/peloton,cmu-db\/peloton,apavlo\/peloton,cmu-db\/peloton,malin1993ml\/peloton,malin1993ml\/peloton,apavlo\/peloton,yingjunwu\/peloton,apavlo\/peloton,yingjunwu\/peloton,yingjunwu\/peloton,malin1993ml\/peloton,malin1993ml\/peloton,apavlo\/peloton,yingjunwu\/peloton","old_file":"src\/include\/capnp\/peloton_service.capnp","new_file":"src\/include\/capnp\/peloton_service.capnp","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/include\/capnp\/peloton_service.capnp' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"a7a7d18ea08b35c661e9dd09b00cf0c6bc689641","subject":"Add missing lua.capnp","message":"Add missing lua.capnp\n","repos":"calio\/lua-capnproto,cloudflare\/lua-capnproto,calio\/lua-capnproto,cloudflare\/lua-capnproto","old_file":"proto\/lua.capnp","new_file":"proto\/lua.capnp","new_contents":"@0xb1ce27b8f28b5e4d;\n\nannotation naming(enum) : Text;\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proto\/lua.capnp' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"4b75ac38a47f4d010a9f33e1e355b2832597bd24","subject":"Oops, forgot to check in the schema.","message":"Oops, forgot to check in the schema.\n","repos":"dwrensha\/capnproto-java,dwrensha\/capnproto-java,dwrensha\/capnproto-java","old_file":"compiler\/src\/test\/schema\/test-import.capnp","new_file":"compiler\/src\/test\/schema\/test-import.capnp","new_contents":"@0xd693321951fee8f3;\n\nusing Java = import \"\/capnp\/java.capnp\";\n$Java.package(\"org.capnproto.testimport\");\n$Java.outerClassname(\"TestImport\");\n\n\nusing import \"test.capnp\".TestAllTypes;\n\nstruct Foo {\n importedStruct @0 :TestAllTypes;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'compiler\/src\/test\/schema\/test-import.capnp' did not match any file(s) known to git\n","license":"mit","lang":"Cap'n Proto"} {"commit":"0731fb94f1c8af3db1eac1711670e28b357222f9","subject":"capn proto schema","message":"capn proto schema\n","repos":"rustyrazorblade\/killranswers,rustyrazorblade\/killranswers","old_file":"killranswers.capnp","new_file":"killranswers.capnp","new_contents":"@0xce4c7cd66480f6f2;\n\nstruct Question {\n questionId @0 : Text;\n questionText @1 : Text;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'killranswers.capnp' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"5c25b4ac1b658829276e2c472856b83e3e493985","subject":"Update schema.capnp","message":"Update schema.capnp","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/ardb\/schema.capnp","new_file":"templates\/ardb\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"a889d58a068738a175e4270db8c00e5b0028e1c1","subject":"increase flush-size of vdisk command","message":"increase flush-size of vdisk command\n\nalso add some more logging to help debug\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/zerostor\/schema.capnp","new_file":"templates\/zerostor\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"dd95f0b00256289d53d413ba9030631a8c14d836","subject":"Release 0.11.0-rc2","message":"Release 0.11.0-rc2\n","repos":"johnleeming\/wekan,wekan\/wekan,ddanssaert\/wekan,FSFTN\/Wekan,ahmadassaf\/libreboard,wekan\/wekan,Serubin\/wekan,mario-orlicky\/wekan,libreboard\/libreboard,nztqa\/wekan,pro-to-tip\/wekan,FSFTN\/Wekan,Serubin\/wekan,ahmadassaf\/libreboard,ahmadassaf\/libreboard,jtickle\/wekan,pro-to-tip\/wekan,johnleeming\/wekan,GhassenRjab\/wekan,oliver4u\/WEKAN_runpartner,mario-orlicky\/wekan,ddanssaert\/wekan,libreboard\/libreboard,GhassenRjab\/wekan,GhassenRjab\/wekan,wekan\/wekan,wekan\/wekan,johnleeming\/wekan,oliver4u\/WEKAN_runpartner,johnleeming\/wekan,mario-orlicky\/wekan,jtickle\/wekan,jtickle\/wekan,oliver4u\/sap-wekan,nztqa\/wekan,wekan\/wekan,Serubin\/wekan,oliver4u\/sap-wekan,oliver4u\/WEKAN_runpartner,nztqa\/wekan,ddanssaert\/wekan,oliver4u\/sap-wekan","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 12,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0-rc2\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"mquandalle@wekan.io\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","old_contents":"# Use use the meteor-spk tool to generate a sandstorm package (spk) from this\n# meteor application source code. https:\/\/github.com\/sandstorm-io\/meteor-spk\n@0xa5275bd3ad124e12;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h\",\n # The app ID is actually its public key. The private key was placed in your\n # keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in our app package to tell Sandstorm about our\n # app.\n\n appTitle = (defaultText = \"Wekan\"),\n # The name of the app as it is displayed to the user.\n\n appVersion = 11,\n # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.11.0-rc1\"),\n # Human-readable presentation of the app version.\n\n minUpgradableAppVersion = 0,\n # The minimum version of the app which can be safely replaced by this app\n # package without data loss. This might be non-zero if the app's data store\n # format changed drastically in the past and the app is no longer able to\n # read the old format.\n\n actions = [\n # Define your \"new document\" handlers here.\n (\n title = (defaultText = \"New board\"),\n command = .myCommand,\n # The command to run when starting for the first time. (\".myCommand\" is\n # just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand,\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n\n metadata = (\n icons = (\n appGrid = (svg = embed \"meta\/icons\/wekan-128.svg\"),\n grain = (svg = embed \"meta\/icons\/wekan-24.svg\"),\n market = (svg = embed \"meta\/icons\/wekan-150.svg\"),\n ),\n\n website = \"https:\/\/wekan.io\",\n codeUrl = \"https:\/\/github.com\/wekan\/wekan\",\n license = (openSource = mit),\n categories = [productivity, office],\n\n author = (\n contactEmail = \"mquandalle@wekan.io\",\n pgpSignature = embed \"meta\/mquandalle-pgp-sig\",\n ),\n\n pgpKeyring = embed \"meta\/keyring\",\n\n description = (defaultText = embed \"meta\/description.md\"),\n\n shortDescription = (defaultText = \"Kanban board\"),\n\n screenshots = [\n (\n width = 512,\n height = 330,\n jpeg = embed \"meta\/screenshots\/board-view.jpg\"\n ),\n # XXX The screenshots should have a standard width and height.\n ],\n\n changeLog = (\n defaultText = embed \"CHANGELOG.md\",\n localizations = [\n (locale = \"fr\", text = embed \"meta\/t9n-changelog\/fr.md\"),\n ],\n )\n )\n ),\n\n sourceMap = (\n # The following directories will be copied into your package.\n searchPath = [\n (sourcePath = \".meteor-spk\/deps\"),\n (sourcePath = \".meteor-spk\/bundle\"),\n ]\n ),\n\n alwaysInclude = [ \".\" ],\n # This says that we always want to include all files from the source map. (An\n # alternative is to automatically detect dependencies by watching what the app\n # opens while running in dev mode. To see what that looks like, run `spk init`\n # without the -A option.)\n\n bridgeConfig = (\n viewInfo = (\n permissions = [(\n name = \"participate\",\n title = (\n defaultText = \"participate\",\n localizations = [\n (locale = \"fr\", text = \"participer\"),\n ],\n ),\n description = (\n defaultText = \"allows participating in the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de participer dans le tableau\"),\n ],\n )\n ), (\n name = \"configure\",\n title = (\n defaultText = \"configure\",\n localizations = [\n (locale = \"fr\", text = \"configurer\"),\n ],\n ),\n description = (\n defaultText = \"allows configuring the board\",\n localizations = [\n (locale = \"fr\", text = \"permet de configurer le tableau\"),\n ],\n )\n )],\n\n roles = [(\n title = (\n defaultText = \"observer\",\n localizations = [\n (locale = \"fr\", text = \"observateur\"),\n ],\n ),\n permissions = [false, false],\n verbPhrase = (\n defaultText = \"can read\",\n localizations = [\n (locale = \"fr\", text = \"peut lire\"),\n ],\n )\n ), (\n title = (\n defaultText = \"member\",\n localizations = [\n (locale = \"fr\", text = \"membre\"),\n ],\n ),\n permissions = [true, false],\n verbPhrase = (\n defaultText = \"can edit\",\n localizations = [\n (locale = \"fr\", text = \"peut \u00e9diter\"),\n ],\n ),\n default = true,\n # ), (\n # title = (defaultText = \"administrator\"),\n # permissions = [true, true],\n # verbPhrase = (defaultText = \"can configure\")\n #\n # XXX Administrators configuration options aren\u2019t implemented yet, so this\n # role is currently useless.\n )]\n )\n ),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4000\", \"--\", \"node\", \"start.js\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n (key = \"METEOR_SETTINGS\", value = \"{\\\"public\\\": {\\\"sandstorm\\\": true}}\")\n ]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"180f7622201547f6bfac5e1e04e0c96fab31a548","subject":"add sandstorm package definition","message":"add sandstorm package definition\n","repos":"mnutt\/davros,mnutt\/davros,mnutt\/davros,mnutt\/davros","old_file":"sandstorm-pkgdef.capnp","new_file":"sandstorm-pkgdef.capnp","new_contents":"@0x931fbb8c04377a42;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n # The package definition. Note that the spk tool looks specifically for the\n # \"pkgdef\" constant.\n\n id = \"xartmy74xuhfw2spz61vnpwfcy5mm8ncedu1fk5mt28ku1p8jnyh\",\n # Your app ID is actually its public key. The private key was placed in\n # your keyring. All updates must be signed with the same key.\n\n manifest = (\n # This manifest is included in your app package to tell Sandstorm\n # about your app.\n\n appTitle = (defaultText = \"Davros\"),\n\n appVersion = 0, # Increment this for every release.\n\n appMarketingVersion = (defaultText = \"0.0.1\"),\n # Human-readable representation of appVersion. Should match the way you\n # identify versions of your app in documentation and marketing.\n\n actions = [\n # Define your \"new document\" handlers here.\n ( title = (defaultText = \"New Instance\"),\n command = .myCommand\n # The command to run when starting for the first time. (\".myCommand\"\n # is just a constant defined at the bottom of the file.)\n )\n ],\n\n continueCommand = .myCommand\n # This is the command called to start your app back up after it has been\n # shut down for inactivity. Here we're using the same command as for\n # starting a new instance, but you could use different commands for each\n # case.\n ),\n\n sourceMap = (\n # Here we defined where to look for files to copy into your package. The\n # `spk dev` command actually figures out what files your app needs\n # automatically by running it on a FUSE filesystem. So, the mappings\n # here are only to tell it where to find files that the app wants.\n searchPath = [\n ( sourcePath = \".\" ), # Search this directory first.\n ( sourcePath = \"\/\", # Then search the system root directory.\n hidePaths = [ \"home\", \"proc\", \"sys\",\n \"etc\/passwd\", \"etc\/hosts\", \"etc\/host.conf\",\n \"etc\/nsswitch.conf\", \"etc\/resolv.conf\" ]\n # You probably don't want the app pulling files from these places,\n # so we hide them. Note that \/dev, \/var, and \/tmp are implicitly\n # hidden because Sandstorm itself provides them.\n )\n ]\n ),\n\n fileList = \"sandstorm-files.list\",\n # `spk dev` will write a list of all the files your app uses to this file.\n # You should review it later, before shipping your app.\n\n alwaysInclude = []\n # Fill this list with more names of files or directories that should be\n # included in your package, even if not listed in sandstorm-files.list.\n # Use this to force-include stuff that you know you need but which may\n # not have been detected as a dependency during `spk dev`. If you list\n # a directory here, its entire contents will be included recursively.\n);\n\nconst myCommand :Spk.Manifest.Command = (\n # Here we define the command used to start up your server.\n argv = [\"\/sandstorm-http-bridge\", \"4200\", \"--\", \"npm\", \"start\"],\n environ = [\n # Note that this defines the *entire* environment seen by your app.\n (key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\")\n ]\n);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sandstorm-pkgdef.capnp' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"49e849f4d3fef9215ea4c7a4fcf61505f5c1f949","subject":"Change length to length of Objects, not Bytes.","message":"Change length to length of Objects, not Bytes.\n","repos":"szmyd\/odi","old_file":"src\/proto\/odi.capnp","new_file":"src\/proto\/odi.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/szmyd\/odi.git\/'\n","license":"isc","lang":"Cap'n Proto"} {"commit":"8d2df0373832ec7c8e262277880a8d51ca1eb58e","subject":"Add hwaddr to Nic in Container schema. (#480)","message":"Add hwaddr to Nic in Container schema. (#480)\n\n* Add hwaddr to Nic in Container schema.\r\n\r\n* Generate new schema id\r\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/container\/schema.capnp","new_file":"templates\/container\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"9acec79f7b6872dde93b53cef4b4a73411879634","subject":"use flat schema in grid_config","message":"use flat schema in grid_config\n\nembeded struct is not supported yet\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/grid_config\/schema.capnp","new_file":"templates\/grid_config\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"426b3cf49586ad6c93fe22666a244799b4cb6dd3","subject":"Added begin parameter to prefetch","message":"Added begin parameter to prefetch\n","repos":"szmyd\/odi","old_file":"src\/proto\/odi.capnp","new_file":"src\/proto\/odi.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/szmyd\/odi.git\/'\n","license":"isc","lang":"Cap'n Proto"} {"commit":"38855f23f3cf5ec1f5e4764f599bfefeb9c5e6ae","subject":"Add comments to Cap'n Proto schema file.","message":"Add comments to Cap'n Proto schema file.\n","repos":"XavilPergis\/StrikingDB,XavilPergis\/StrikingDB","old_file":"src\/serial.capnp","new_file":"src\/serial.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/XavilPergis\/StrikingDB.git\/'\n","license":"lgpl-2.1","lang":"Cap'n Proto"} {"commit":"e4290f431b4b2f4172b5d5f5a048a4983ac1521c","subject":"Make Integration scripts work with Sandstorm","message":"Make Integration scripts work with Sandstorm\n\nFixing #6339","repos":"nishimaki10\/Rocket.Chat,Sing-Li\/Rocket.Chat,pachox\/Rocket.Chat,Achaikos\/Rocket.Chat,4thParty\/Rocket.Chat,ggazzo\/Rocket.Chat,mwharrison\/Rocket.Chat,inoxth\/Rocket.Chat,danielbressan\/Rocket.Chat,pachox\/Rocket.Chat,subesokun\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,intelradoux\/Rocket.Chat,k0nsl\/Rocket.Chat,pkgodara\/Rocket.Chat,cnash\/Rocket.Chat,xasx\/Rocket.Chat,Sing-Li\/Rocket.Chat,inoio\/Rocket.Chat,danielbressan\/Rocket.Chat,Achaikos\/Rocket.Chat,pitamar\/Rocket.Chat,mrsimpson\/Rocket.Chat,fatihwk\/Rocket.Chat,Gudii\/Rocket.Chat,flaviogrossi\/Rocket.Chat,pitamar\/Rocket.Chat,mwharrison\/Rocket.Chat,Gudii\/Rocket.Chat,inoxth\/Rocket.Chat,k0nsl\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,VoiSmart\/Rocket.Chat,VoiSmart\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,danielbressan\/Rocket.Chat,k0nsl\/Rocket.Chat,inoio\/Rocket.Chat,nishimaki10\/Rocket.Chat,fatihwk\/Rocket.Chat,subesokun\/Rocket.Chat,Sing-Li\/Rocket.Chat,nishimaki10\/Rocket.Chat,xasx\/Rocket.Chat,Achaikos\/Rocket.Chat,xasx\/Rocket.Chat,fatihwk\/Rocket.Chat,pachox\/Rocket.Chat,inoxth\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,mrsimpson\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,mrinaldhar\/Rocket.Chat,galrotem1993\/Rocket.Chat,galrotem1993\/Rocket.Chat,pitamar\/Rocket.Chat,mrinaldhar\/Rocket.Chat,pkgodara\/Rocket.Chat,flaviogrossi\/Rocket.Chat,mrsimpson\/Rocket.Chat,pitamar\/Rocket.Chat,intelradoux\/Rocket.Chat,k0nsl\/Rocket.Chat,trt15-ssci-organization\/Rocket.Chat,subesokun\/Rocket.Chat,flaviogrossi\/Rocket.Chat,Achaikos\/Rocket.Chat,VoiSmart\/Rocket.Chat,intelradoux\/Rocket.Chat,galrotem1993\/Rocket.Chat,Gudii\/Rocket.Chat,pkgodara\/Rocket.Chat,inoxth\/Rocket.Chat,pachox\/Rocket.Chat,Gudii\/Rocket.Chat,4thParty\/Rocket.Chat,mrsimpson\/Rocket.Chat,nishimaki10\/Rocket.Chat,inoio\/Rocket.Chat,cnash\/Rocket.Chat,cnash\/Rocket.Chat,mwharrison\/Rocket.Chat,danielbressan\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,Kiran-Rao\/Rocket.Chat,subesokun\/Rocket.Chat,mrinaldhar\/Rocket.Chat,pkgodara\/Rocket.Chat,4thParty\/Rocket.Chat,flaviogrossi\/Rocket.Chat,intelradoux\/Rocket.Chat,mwharrison\/Rocket.Chat,xasx\/Rocket.Chat,cnash\/Rocket.Chat,galrotem1993\/Rocket.Chat,ggazzo\/Rocket.Chat,Sing-Li\/Rocket.Chat,4thParty\/Rocket.Chat,fatihwk\/Rocket.Chat,ggazzo\/Rocket.Chat,mrinaldhar\/Rocket.Chat,ggazzo\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 58, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.53.0\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 58, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.53.0\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"2a25c773343873f4d8540801ff6b9dd7e1a8a50b","subject":"Add Map type to capnp file","message":"Add Map type to capnp file\n","repos":"mehulsbhatt\/monk","old_file":"messages\/monk.capnp","new_file":"messages\/monk.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/mehulsbhatt\/monk.git\/'\n","license":"bsd-3-clause","lang":"Cap'n Proto"} {"commit":"3e689c364d5e6a309727bbc0291664706a82e5ab","subject":"Add schema.capnp","message":"Add schema.capnp\n","repos":"cloudflare\/lua-capnproto,calio\/lua-capnproto,cloudflare\/lua-capnproto,calio\/lua-capnproto","old_file":"proto\/schema.capnp","new_file":"proto\/schema.capnp","new_contents":"# Copyright (c) 2013, Kenton Varda \n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation\n# and\/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nusing Cxx = import \"c++.capnp\";\n\n@0xa93fc509624c72d9;\n$Cxx.namespace(\"capnp::schema\");\n\nusing Id = UInt64;\n# The globally-unique ID of a file, type, or annotation.\n\nstruct Node {\n id @0 :Id;\n\n displayName @1 :Text;\n # Name to present to humans to identify this Node. You should not attempt to parse this. Its\n # format could change. It is not guaranteed to be unique.\n #\n # (On Zooko's triangle, this is the node's nickname.)\n\n displayNamePrefixLength @2 :UInt32;\n # If you want a shorter version of `displayName` (just naming this node, without its surrounding\n # scope), chop off this many characters from the beginning of `displayName`.\n\n scopeId @3 :Id;\n # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back\n # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not\n # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is\n # zero if the node has no parent, which is normally only the case with files, but should be\n # allowed for any kind of node (in order to make runtime type generation easier).\n\n nestedNodes @4 :List(NestedNode);\n # List of nodes nested within this node, along with the names under which they were declared.\n\n struct NestedNode {\n name @0 :Text;\n # Unqualified symbol name. Unlike Node.name, this *can* be used programmatically.\n #\n # (On Zooko's triangle, this is the node's petname according to its parent scope.)\n\n id @1 :Id;\n # ID of the nested node. Typically, the target node's scopeId points back to this node, but\n # robust code should avoid relying on this.\n }\n\n annotations @5 :List(Annotation);\n # Annotations applied to this node.\n\n union {\n # Info specific to each kind of node.\n\n file @6 :Void;\n\n struct :group {\n dataWordCount @7 :UInt16;\n # Size of the data section, in words.\n\n pointerCount @8 :UInt16;\n # Size of the pointer section, in pointers (which are one word each).\n\n preferredListEncoding @9 :ElementSize;\n # The preferred element size to use when encoding a list of this struct. If this is anything\n # other than `inlineComposite` then the struct is one word or less in size and is a candidate\n # for list packing optimization.\n\n isGroup @10 :Bool;\n # If true, then this \"struct\" node is actually not an independent node, but merely represents\n # some named union or group within a particular parent struct. This node's scopeId refers\n # to the parent struct, which may itself be a union\/group in yet another struct.\n #\n # All group nodes share the same dataWordCount and pointerCount as the top-level\n # struct, and their fields live in the same ordinal and offset spaces as all other fields in\n # the struct.\n #\n # Note that a named union is considered a special kind of group -- in fact, a named union\n # is exactly equivalent to a group that contains nothing but an unnamed union.\n\n discriminantCount @11 :UInt16;\n # Number of fields in this struct which are members of an anonymous union, and thus may\n # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which\n # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be\n # two or more.\n #\n # Note that the fields of an unnamed union are considered fields of the scope containing the\n # union -- an unnamed union is not its own group. So, a top-level struct may contain a\n # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups\n # containing unnamed unions. So, a named union has its own independent schema node, with\n # `isGroup` = true.\n\n discriminantOffset @12 :UInt32;\n # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in\n # multiples of 16 bits.\n\n fields @13 :List(Field);\n # Fields defined within this scope (either the struct's top-level fields, or the fields of\n # a particular group; see `isGroup`).\n #\n # The fields are sorted by ordinal number, but note that because groups share the same\n # ordinal space, the field's index in this list is not necessarily exactly its ordinal.\n # On the other hand, the field's position in this list does remain the same even as the\n # protocol evolves, since it is not possible to insert or remove an earlier ordinal.\n # Therefore, for most use cases, if you want to identify a field by number, it may make the\n # most sense to use the field's index in this list rather than its ordinal.\n }\n\n enum :group {\n enumerants@14 :List(Enumerant);\n # Enumerants ordered by numeric value (ordinal).\n }\n\n interface :group {\n methods @15 :List(Method);\n # Methods ordered by ordinal.\n }\n\n const :group {\n type @16 :Type;\n value @17 :Value;\n }\n\n annotation :group {\n type @18 :Type;\n\n targetsFile @19 :Bool;\n targetsConst @20 :Bool;\n targetsEnum @21 :Bool;\n targetsEnumerant @22 :Bool;\n targetsStruct @23 :Bool;\n targetsField @24 :Bool;\n targetsUnion @25 :Bool;\n targetsGroup @26 :Bool;\n targetsInterface @27 :Bool;\n targetsMethod @28 :Bool;\n targetsParam @29 :Bool;\n targetsAnnotation @30 :Bool;\n }\n }\n}\n\nstruct Field {\n # Schema for a field of a struct.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Indicates where this member appeared in the code, relative to other members.\n # Code ordering may have semantic relevance -- programmers tend to place related fields\n # together. So, using code ordering makes sense in human-readable formats where ordering is\n # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum\n # value is count(members) - 1. Fields that are members of a union are only ordered relative to\n # the other members of that union, so the maximum value there is count(union.members).\n\n annotations @2 :List(Annotation);\n\n discriminantValue @3 :UInt16 = 0xffff;\n # If the field is in a union, this is the value which the union's discriminant should take when\n # the field is active. If the field is not in a union, this is 0xffff (so hasDiscriminantValue()\n # returns false).\n\n union {\n slot :group {\n # A regular, non-group, non-fixed-list field.\n\n offset @4 :UInt32;\n # Offset, in units of the field's size, from the beginning of the section in which the field\n # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the\n # beginning of the data section.\n\n type @5 :Type;\n defaultValue @6 :Value;\n }\n\n group :group {\n # A group.\n\n typeId @7 :Id;\n # The ID of the group's node.\n }\n }\n\n ordinal :union {\n implicit @8 :Void;\n explicit @9 :UInt16;\n # The original ordinal number given to the field. You probably should NOT use this; if you need\n # a numeric identifier for a field, use its position within the field array for its scope.\n # The ordinal is given here mainly just so that the original schema text can be reproduced given\n # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.\n }\n}\n\nstruct Enumerant {\n # Schema for member of an enum.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the enumerants were declared in the code.\n # Like Struct.Field.codeOrder.\n\n annotations @2 :List(Annotation);\n}\n\nstruct Method {\n # Schema for method of an interface.\n\n name @0 :Text;\n\n codeOrder @1 :UInt16;\n # Specifies order in which the methods were declared in the code.\n # Like Struct.Field.codeOrder.\n\n params @2 :List(Param);\n struct Param {\n name @0 :Text;\n type @1 :Type;\n defaultValue @2 :Value;\n annotations @3 :List(Annotation);\n }\n\n requiredParamCount @3 :UInt16;\n # One plus the index of the last parameter that has no default value. In languages where\n # method calls look like function calls, this is the minimum number of parameters that must\n # always be specified, while subsequent parameters are optional.\n\n returnType @4 :Type;\n\n annotations @5 :List(Annotation);\n}\n\nstruct Type {\n # Represents a type expression.\n\n union {\n # The ordinals intentionally match those of Value.\n\n void @0 :Void;\n bool @1 :Void;\n int8 @2 :Void;\n int16 @3 :Void;\n int32 @4 :Void;\n int64 @5 :Void;\n uint8 @6 :Void;\n uint16 @7 :Void;\n uint32 @8 :Void;\n uint64 @9 :Void;\n float32 @10 :Void;\n float64 @11 :Void;\n text @12 :Void;\n data @13 :Void;\n\n list :group {\n elementType @14 :Type;\n }\n\n enum :group {\n typeId @15 :Id;\n }\n struct :group {\n typeId @16 :Id;\n }\n interface :group {\n typeId @17 :Id;\n }\n\n object @18 :Void;\n }\n}\n\nstruct Value {\n # Represents a value, e.g. a field default value, constant value, or annotation value.\n\n union {\n # The ordinals intentionally match those of Type.\n\n void @0 :Void;\n bool @1 :Bool;\n int8 @2 :Int8;\n int16 @3 :Int16;\n int32 @4 :Int32;\n int64 @5 :Int64;\n uint8 @6 :UInt8;\n uint16 @7 :UInt16;\n uint32 @8 :UInt32;\n uint64 @9 :UInt64;\n float32 @10 :Float32;\n float64 @11 :Float64;\n text @12 :Text;\n data @13 :Data;\n\n list @14 :Object;\n\n enum @15 :UInt16;\n struct @16 :Object;\n\n interface @17 :Void;\n # The only interface value that can be represented statically is \"null\", whose methods always\n # throw exceptions.\n\n object @18 :Object;\n }\n}\n\nstruct Annotation {\n # Describes an annotation applied to a declaration. Note AnnotationNode describes the\n # annotation's declaration, while this describes a use of the annotation.\n\n id @0 :Id;\n # ID of the annotation node.\n\n value @1 :Value;\n}\n\nenum ElementSize {\n # Possible element sizes for encoded lists. These correspond exactly to the possible values of\n # the 3-bit element size component of a list pointer.\n\n empty @0; # aka \"void\", but that's a keyword.\n bit @1;\n byte @2;\n twoBytes @3;\n fourBytes @4;\n eightBytes @5;\n pointer @6;\n inlineComposite @7;\n}\n\nstruct CodeGeneratorRequest {\n nodes @0 :List(Node);\n # All nodes parsed by the compiler, including for the files on the command line and their\n # imports.\n\n requestedFiles @1 :List(RequestedFile);\n # Files which were listed on the command line.\n\n struct RequestedFile {\n id @0 :Id;\n # ID of the file.\n\n filename @1 :Text;\n # Name of the file as it appeared on the command-line (minus the src-prefix). You may use\n # this to decide where to write the output.\n\n imports @2 :List(Import);\n # List of all imported paths seen in this file.\n\n struct Import {\n id @0 :Id;\n # ID of the imported file.\n\n name @1 :Text;\n # Name which *this* file used to refer to the foreign file. This may be a relative name.\n # This information is provided because it might be useful for code generation, e.g. to\n # generate #include directives in C++. We don't put this in Node.file because this\n # information is only meaningful at compile time anyway.\n #\n # (On Zooko's triangle, this is the import's petname according to the importing file.)\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proto\/schema.capnp' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Cap'n Proto"} {"commit":"a5b170cbc5115bf3d5359b3a9150103e788b8bca","subject":"capnp_test schema","message":"capnp_test schema\n","repos":"xygroup\/node-capnp-plugin","old_file":"src\/template\/decode\/test\/schema\/myschema.capnp","new_file":"src\/template\/decode\/test\/schema\/myschema.capnp","new_contents":"# Copyright 2013 Andreas Stenius \n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n@0xa510a585dee47e0b;\n\nusing Cxx = import \"\/capnp\/c++.capnp\";\n$Cxx.namespace(\"capnp_test\");\n\nusing Go = import \"go.capnp\";\n$Go.package(\"capnp_test\");\n$Go.import(\"github.com\/kaos\/capnp_test\");\n\n########################################\n## List with all available tests\n########################################\n\nconst allTests :List(Text) = \n[\n \"simpleTest\",\n \"textListTypeTest\",\n \"uInt8DefaultValueTest\",\n \"constTest\"\n];\n\n\n########################################\n## Define test data\n########################################\n\nconst simpleTestType :Text = \"SimpleTestStruct\";\nconst simpleTest :SimpleTestStruct = (int = 1234567890, msg = \"a short message...\");\n\nconst textListTypeTestType :Text = \"ListTest\";\nconst textListTypeTest :ListTest = (textList = [\"foo\", \"bar\", \"baz\"]);\n\nconst uInt8DefaultValueTestType :Text = \"TestDefaults\";\nconst uInt8DefaultValueTest :TestDefaults = (uInt8Field = 0);\n\nconst constTestType :Text = \"SimpleTestStruct\";\nconst constTestValue :Text = \"A const text test value.\";\nconst constTest :SimpleTestStruct = (msg = .constTestValue);\n\n########################################\n## Types used by tests\n########################################\n\nstruct SimpleTestStruct {\n int @0 :Int32;\n msg @1 :Text;\n}\n\nstruct ListTest {\n# union {\n textList @0 :List(Text);\n# nextList @1 :...;\n# }\n}\n\n\n## Types copied from capnproto\/c++\/src\/test.capnp\n\nenum TestEnum {\n foo @0;\n bar @1;\n baz @2;\n qux @3;\n quux @4;\n corge @5;\n grault @6;\n garply @7;\n}\n\nstruct TestAllTypes {\n voidField @0 : Void;\n boolField @1 : Bool;\n int8Field @2 : Int8;\n int16Field @3 : Int16;\n int32Field @4 : Int32;\n int64Field @5 : Int64;\n uInt8Field @6 : UInt8;\n uInt16Field @7 : UInt16;\n uInt32Field @8 : UInt32;\n uInt64Field @9 : UInt64;\n float32Field @10 : Float32;\n float64Field @11 : Float64;\n textField @12 : Text;\n dataField @13 : Data;\n structField @14 : TestAllTypes;\n enumField @15 : TestEnum;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void);\n boolList @18 : List(Bool);\n int8List @19 : List(Int8);\n int16List @20 : List(Int16);\n int32List @21 : List(Int32);\n int64List @22 : List(Int64);\n uInt8List @23 : List(UInt8);\n uInt16List @24 : List(UInt16);\n uInt32List @25 : List(UInt32);\n uInt64List @26 : List(UInt64);\n float32List @27 : List(Float32);\n float64List @28 : List(Float64);\n textList @29 : List(Text);\n dataList @30 : List(Data);\n structList @31 : List(TestAllTypes);\n enumList @32 : List(TestEnum);\n interfaceList @33 : List(Void); # TODO\n}\n\nstruct TestDefaults {\n voidField @0 : Void = void;\n boolField @1 : Bool = true;\n int8Field @2 : Int8 = -123;\n int16Field @3 : Int16 = -12345;\n int32Field @4 : Int32 = -12345678;\n int64Field @5 : Int64 = -123456789012345;\n uInt8Field @6 : UInt8 = 234;\n uInt16Field @7 : UInt16 = 45678;\n uInt32Field @8 : UInt32 = 3456789012;\n uInt64Field @9 : UInt64 = 12345678901234567890;\n float32Field @10 : Float32 = 1234.5;\n float64Field @11 : Float64 = -123e45;\n textField @12 : Text = \"foo\";\n dataField @13 : Data = \"bar\";\n structField @14 : TestAllTypes = (\n voidField = void,\n boolField = true,\n int8Field = -12,\n int16Field = 3456,\n int32Field = -78901234,\n int64Field = 56789012345678,\n uInt8Field = 90,\n uInt16Field = 1234,\n uInt32Field = 56789012,\n uInt64Field = 345678901234567890,\n float32Field = -1.25e-10,\n float64Field = 345,\n textField = \"baz\",\n dataField = \"qux\",\n structField = (\n textField = \"nested\",\n structField = (textField = \"really nested\")),\n enumField = baz,\n # interfaceField can't have a default\n\n voidList = [void, void, void],\n boolList = [false, true, false, true, true],\n int8List = [12, -34, -0x80, 0x7f],\n int16List = [1234, -5678, -0x8000, 0x7fff],\n int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],\n int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],\n uInt8List = [12, 34, 0, 0xff],\n uInt16List = [1234, 5678, 0, 0xffff],\n uInt32List = [12345678, 90123456, 0, 0xffffffff],\n uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],\n float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],\n float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],\n textList = [\"quux\", \"corge\", \"grault\"],\n dataList = [\"garply\", \"waldo\", \"fred\"],\n structList = [\n (textField = \"x structlist 1\"),\n (textField = \"x structlist 2\"),\n (textField = \"x structlist 3\")],\n enumList = [qux, bar, grault]\n # interfaceList can't have a default\n );\n enumField @15 : TestEnum = corge;\n interfaceField @16 : Void; # TODO\n\n voidList @17 : List(Void) = [void, void, void, void, void, void];\n boolList @18 : List(Bool) = [true, false, false, true];\n int8List @19 : List(Int8) = [111, -111];\n int16List @20 : List(Int16) = [11111, -11111];\n int32List @21 : List(Int32) = [111111111, -111111111];\n int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];\n uInt8List @23 : List(UInt8) = [111, 222] ;\n uInt16List @24 : List(UInt16) = [33333, 44444];\n uInt32List @25 : List(UInt32) = [3333333333];\n uInt64List @26 : List(UInt64) = [11111111111111111111];\n float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];\n float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];\n textList @29 : List(Text) = [\"plugh\", \"xyzzy\", \"thud\"];\n dataList @30 : List(Data) = [\"oops\", \"exhausted\", \"rfc3092\"];\n structList @31 : List(TestAllTypes) = [\n (textField = \"structlist 1\"),\n (textField = \"structlist 2\"),\n (textField = \"structlist 3\")];\n enumList @32 : List(TestEnum) = [foo, garply];\n interfaceList @33 : List(Void); # TODO\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/template\/decode\/test\/schema\/myschema.capnp' did not match any file(s) known to git\n","license":"mit","lang":"Cap'n Proto"} {"commit":"c3f44ef324bf9c1ff1dc8c33e289ec7cdc99ec03","subject":"Add missing semi colon.","message":"Add missing semi colon.\n","repos":"zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator,zero-os\/0-orchestrator","old_file":"templates\/dhcp\/schema.capnp","new_file":"templates\/dhcp\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/zero-os\/0-orchestrator.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"af0443f59bc1f4ddee97dd4efc61b3f96f1b6829","subject":"fix identation in node schema","message":"fix identation in node schema\n","repos":"Jumpscale\/ays9,Jumpscale\/ays9,Jumpscale\/ays9,Jumpscale\/ays9","old_file":"templates\/nodes\/node.ovc\/schema.capnp","new_file":"templates\/nodes\/node.ovc\/schema.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Jumpscale\/ays9.git\/'\n","license":"apache-2.0","lang":"Cap'n Proto"} {"commit":"33e372d3e6921804ff02d663942ee876697a655b","subject":"Bump version to 0.67.0-develop","message":"Bump version to 0.67.0-develop\n","repos":"4thParty\/Rocket.Chat,inoio\/Rocket.Chat,Sing-Li\/Rocket.Chat,subesokun\/Rocket.Chat,flaviogrossi\/Rocket.Chat,flaviogrossi\/Rocket.Chat,VoiSmart\/Rocket.Chat,flaviogrossi\/Rocket.Chat,VoiSmart\/Rocket.Chat,Sing-Li\/Rocket.Chat,4thParty\/Rocket.Chat,pkgodara\/Rocket.Chat,inoio\/Rocket.Chat,Sing-Li\/Rocket.Chat,flaviogrossi\/Rocket.Chat,pkgodara\/Rocket.Chat,subesokun\/Rocket.Chat,4thParty\/Rocket.Chat,4thParty\/Rocket.Chat,subesokun\/Rocket.Chat,pkgodara\/Rocket.Chat,Sing-Li\/Rocket.Chat,inoio\/Rocket.Chat,pkgodara\/Rocket.Chat,subesokun\/Rocket.Chat,VoiSmart\/Rocket.Chat","old_file":".sandstorm\/sandstorm-pkgdef.capnp","new_file":".sandstorm\/sandstorm-pkgdef.capnp","new_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 80, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.67.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"HOME\", value = \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","old_contents":"@0xbbbe049af795122e;\n\nusing Spk = import \"\/sandstorm\/package.capnp\";\n# This imports:\n# $SANDSTORM_HOME\/latest\/usr\/include\/sandstorm\/package.capnp\n# Check out that file to see the full, documented package definition format.\n\nconst pkgdef :Spk.PackageDefinition = (\n\t# The package definition. Note that the spk tool looks specifically for the\n\t# \"pkgdef\" constant.\n\n\tid = \"vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0\",\n\t# Your app ID is actually its public key. The private key was placed in\n\t# your keyring. All updates must be signed with the same key.\n\n\tmanifest = (\n\t\t# This manifest is included in your app package to tell Sandstorm\n\t\t# about your app.\n\n\t\tappTitle = (defaultText = \"Rocket.Chat\"),\n\n\t\tappVersion = 79, # Increment this for every release.\n\n\t\tappMarketingVersion = (defaultText = \"0.67.0-develop\"),\n\t\t# Human-readable representation of appVersion. Should match the way you\n\t\t# identify versions of your app in documentation and marketing.\n\n\t\tactions = [\n\t\t\t# Define your \"new document\" handlers here.\n\t\t\t( title = (defaultText = \"New Rocket.Chat\"),\n\t\t\t\tcommand = .myCommand\n\t\t\t\t# The command to run when starting for the first time. (\".myCommand\"\n\t\t\t\t# is just a constant defined at the bottom of the file.)\n\t\t\t)\n\t\t],\n\n\t\tcontinueCommand = .myCommand,\n\t\t# This is the command called to start your app back up after it has been\n\t\t# shut down for inactivity. Here we're using the same command as for\n\t\t# starting a new instance, but you could use different commands for each\n\t\t# case.\n\n\t\tmetadata = (\n\t\t\ticons = (\n\t\t\t\tappGrid = (svg = embed \"rocket.chat-128.svg\"),\n\t\t\t\tgrain = (svg = embed \"rocket.chat-24.svg\"),\n\t\t\t\tmarket = (svg = embed \"rocket.chat-150.svg\"),\n\t\t\t),\n\n\t\t\twebsite = \"https:\/\/rocket.chat\",\n\t\t\tcodeUrl = \"https:\/\/github.com\/RocketChat\/Rocket.Chat\",\n\t\t\tlicense = (openSource = mit),\n\t\t\tcategories = [communications, productivity, office, social, developerTools],\n\n\t\t\tauthor = (\n\t\t\t\tcontactEmail = \"team@rocket.chat\",\n\t\t\t\tpgpSignature = embed \"pgp-signature\",\n\t\t\t\tupstreamAuthor = \"Rocket.Chat\",\n\t\t\t),\n\t\t\tpgpKeyring = embed \"pgp-keyring\",\n\n\t\t\tdescription = (defaultText = embed \"description.md\"),\n\t\t\tshortDescription = (defaultText = \"Chat app\"),\n\n\t\t\tscreenshots = [\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot1.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot2.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot3.png\"),\n\t\t\t\t(width = 1024, height = 696, png = embed \"screenshot4.png\")\n\t\t\t],\n\n\t\t\tchangeLog = (defaultText = embed \"CHANGELOG.md\"),\n\t\t),\n\n\t),\n\n\tsourceMap = (\n\t\t# The following directories will be copied into your package.\n\t\tsearchPath = [\n\t\t\t( sourcePath = \"\/home\/vagrant\/bundle\" ),\n\t\t\t( sourcePath = \"\/opt\/meteor-spk\/meteor-spk.deps\" )\n\t\t]\n\t),\n\n\talwaysInclude = [ \".\" ],\n\t# This says that we always want to include all files from the source map.\n\t# (An alternative is to automatically detect dependencies by watching what\n\t# the app opens while running in dev mode. To see what that looks like,\n\t# run `spk init` without the -A option.)\n\n\tbridgeConfig = (\n\t\tviewInfo = (\n\t\t\teventTypes = [\n\t\t\t\t(name = \"message\", verbPhrase = (defaultText = \"sent message\")),\n\t\t\t\t(name = \"privateMessage\", verbPhrase = (defaultText = \"sent private message\"), requiredPermission = (explicitList = void)),\n\t\t\t]\n\t\t),\n\t\tsaveIdentityCaps = true,\n\t),\n);\n\nconst myCommand :Spk.Manifest.Command = (\n\t# Here we define the command used to start up your server.\n\targv = [\"\/sandstorm-http-bridge\", \"8000\", \"--\", \"\/opt\/app\/.sandstorm\/launcher.sh\"],\n\tenviron = [\n\t\t# Note that this defines the *entire* environment seen by your app.\n\t\t(key = \"PATH\", value = \"\/usr\/local\/bin:\/usr\/bin:\/bin\"),\n\t\t(key = \"SANDSTORM\", value = \"1\"),\n\t\t(key = \"HOME\", value = \"\/var\"),\n\t\t(key = \"Statistics_reporting\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserAvatarChange\", value = \"false\"),\n\t\t(key = \"Accounts_AllowUserProfileChange\", value = \"false\"),\n\t\t(key = \"BABEL_CACHE_DIR\", value = \"\/var\/babel_cache\")\n\t]\n);\n","returncode":0,"stderr":"","license":"mit","lang":"Cap'n Proto"} {"commit":"e78cd046a23c5138503b026e71a39b4c1996934c","subject":"Add stats to capnp serialization.","message":"Add stats to capnp serialization.\n","repos":"XavilPergis\/StrikingDB,XavilPergis\/StrikingDB","old_file":"src\/serial.capnp","new_file":"src\/serial.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/XavilPergis\/StrikingDB.git\/'\n","license":"lgpl-2.1","lang":"Cap'n Proto"} {"commit":"9044097927df18f6fa2d5bb07c43fa4feaa25513","subject":"Add offset to strand.","message":"Add offset to strand.\n","repos":"XavilPergis\/StrikingDB,XavilPergis\/StrikingDB","old_file":"src\/serial.capnp","new_file":"src\/serial.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/XavilPergis\/StrikingDB.git\/'\n","license":"lgpl-2.1","lang":"Cap'n Proto"} {"commit":"3ccaf2fe4c2c809245b82c65f1f0f18a63a560be","subject":"Added addressbook example","message":"Added addressbook example\n","repos":"niekbouman\/capnconfig","old_file":"addressbook.capnp","new_file":"addressbook.capnp","new_contents":"# addressbook.capnp\n@0x934efea7f017fff0;\n\nconst qux :UInt32 = 123;\n\nstruct Person {\n id @0 :UInt32;\n name @1 :Text;\n email @2 :Text;\n phones @3 :List(PhoneNumber);\n\n struct PhoneNumber {\n number @0 :Text;\n type @1 :Type;\n\n enum Type {\n mobile @0;\n home @1;\n work @2;\n }\n }\n\n employment :union {\n unemployed @4 :Void;\n employer @5 :Text;\n school @6 :Text;\n selfEmployed @7 :Void;\n # We assume that a person is only one of these.\n }\n}\n\nstruct AddressBook {\n people @0 :List(Person);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'addressbook.capnp' did not match any file(s) known to git\n","license":"mit","lang":"Cap'n Proto"} {"commit":"ed7a16e4dcb2784a202babcd5739197da203cb99","subject":"oops, hex data literals aren't supported in capnp 0.4.1","message":"oops, hex data literals aren't supported in capnp 0.4.1\n","repos":"dwrensha\/capnproto-java,jen20\/capnproto-java,nchinmay\/capnproto-java,dwrensha\/capnproto-java,nchinmay\/capnproto-java,jen20\/capnproto-java,nchinmay\/capnproto-java,jen20\/capnproto-java,dwrensha\/capnproto-java","old_file":"compiler\/src\/test\/schema\/test.capnp","new_file":"compiler\/src\/test\/schema\/test.capnp","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/jen20\/capnproto-java.git\/'\n","license":"mit","lang":"Cap'n Proto"}