ask-app-server 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77f123a7ad41bee740dc6678faa847ee174fc688ac09cab76b43c3ea2037da71
4
- data.tar.gz: 1afcf87beb1af260dfc6042305e10d00d06b546c2acb464fe89e757732fccc31
3
+ metadata.gz: 147a968eaddfd9ebce8ef4d0f04cb64c34e76a95e859a676ff79c75b270f6931
4
+ data.tar.gz: ce70ee81dfe2a5a0dcb4d1bd922b97d90f6aae5675c764df11bf99d1a585c7ae
5
5
  SHA512:
6
- metadata.gz: c7179daf83e380074cc04d7584dbaf4043d2c7cfff3df6e49c23a6fdc68bf34fc2b421b49866056a162702eb66d6054ecd437d63365f34dfad5a1cbb0968ce78
7
- data.tar.gz: ad552bb79034f61d6b06a519cb041f711db6eb0f34c67b8e069cfc5c973782dcb47ab21d226f5726f78ee58992b3dbdc65322fbe59e0585cb73346ccda227eb8
6
+ metadata.gz: 68a1c0af900543c31aedc96625c1df396507c44cc584267ad27e8ec9253d31029a79139537f3db0967b48ef6fee6cc33ace6ab1723b4b5741f6b436f40bdea0d
7
+ data.tar.gz: a4e0fa7e7a3004dbe8a7ca935254cb879d6a8125ee4e480520a28d5397653ed71fe40f896eacd3b0b98429bea3e8af88727684da590def6eb7d0d3b313aeb36d
data/README.md CHANGED
@@ -2,16 +2,23 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/ask-app-server.svg)](https://badge.fury.io/rb/ask-app-server)
4
4
 
5
- **JSON-RPC/stdio app-server for ask-rb agents.** Exposes `Ask::Agent::Session` behind the standard app-server protocol, the same protocol spoken by ZCode and Codex app-servers.
5
+ **JSON-RPC/stdio app-server for ask-rb agents.** Exposes `Ask::Agent::Session`
6
+ behind the standard app-server protocol: a vendor-neutral interface for
7
+ driving an agent as a service, with sessions, streamed events, approvals, and
8
+ turn lifecycle. Any client that implements the protocol can drive your agent,
9
+ and the client never needs to know it's talking to Ruby. The same protocol is
10
+ what several coding agents use behind their own app-servers (OpenAI's Codex
11
+ app-server is one well-known implementation); ask-app-server isn't an
12
+ extension of any of them — it simply speaks the standard.
6
13
 
7
14
  ## What is this?
8
15
 
9
16
  `ask-app-server` turns an ask-rb agent into a **programmable service** that speaks JSON-RPC over stdio. Any client that can speak the app-server protocol can drive your agent:
10
17
 
11
- - **Telegram bots**: the `zcode-telegram-bot` connects to ask-app-server instead of ZCode
12
- - **AI SDK providers**: the Vercel AI SDK provider works with ask-app-server unchanged
13
- - **IDE extensions**: VS Code, Cursor, and JetBrains extensions connect over stdio/socket
14
- - **Headless automation**: CI/CD pipelines, batch processing, scriptable agent tasks
18
+ - **IDE extensions and editors** — stream model deltas and tool events into an editor surface over stdio or a socket, the same way agent–editor integrations work today
19
+ - **Custom chat UIs and desktop apps** stream model deltas and tool events into your own interface
20
+ - **Bots and assistants** drive sessions programmatically from any runtime that can spawn a subprocess
21
+ - **Headless automation** CI/CD pipelines, batch processing, scriptable agent tasks
15
22
 
16
23
  ## Installation
17
24
 
@@ -69,11 +76,12 @@ Event payloads are delivered as `session/event` notifications on subscribed sess
69
76
 
70
77
  ## Clients
71
78
 
72
- This server is a drop-in replacement for `zcode app-server`. The following clients work without changes:
73
-
74
- - [ask-coding-providers](https://github.com/ask-rb/ask-coding-providers): ZCode adapter (set `ZCODE_CLI_PATH` to the `ask-app-server` binary)
75
- - [zcode-telegram-bot](https://github.com/ask-rb/zcode-telegram-bot): Python Telegram bot
76
- - [ai-sdk-provider-codex-app-server](https://github.com/pablof7z/ai-sdk-provider-codex-app-server): Vercel AI SDK provider
79
+ Any client that speaks the app-server protocol can connect including
80
+ existing app-server SDKs, such as OpenAI's `openai-codex` (Python) and
81
+ `@openai/codex-sdk` (TypeScript), which spawn an app-server subprocess and
82
+ drive it over stdio. Or write your own client in any language: the protocol
83
+ is documented and the wire format is plain JSON-RPC over newline-delimited
84
+ JSON.
77
85
 
78
86
  ## Configuration
79
87
 
@@ -101,7 +109,7 @@ bundle exec rake test
101
109
 
102
110
  ## Full documentation
103
111
 
104
- The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs. The [Gem reference](https://ask-rb.github.io/ask-docs/reference/gems) (Agent Infrastructure section) covers ask-app-server. API reference: https://ask-rb.github.io/ask-docs/reference/api.
112
+ The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs. The [App Server guide](https://ask-rb.github.io/ask-docs/core/app-server) covers the protocol, events, and configuration; the [Gem reference](https://ask-rb.github.io/ask-docs/reference/gems) (Agent Infrastructure section) lists this gem alongside ask-acp and ask-coding-providers.
105
113
 
106
114
  ## License
107
115
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
+ require "time"
4
5
 
5
6
  module Ask
6
7
  module AppServer
@@ -273,6 +274,39 @@ module Ask
273
274
  { aborted: true, sessionId: session_id }
274
275
  end
275
276
 
277
+ # Artifacts: list the session's tool deliverables
278
+ handler("session/artifacts") do |params, _id|
279
+ session_id = params["sessionId"] || params[:sessionId]
280
+ raise InvalidRequest, "sessionId is required" unless session_id
281
+
282
+ adapter = @session_manager.get(session_id)
283
+ raise Ask::AppServer::SessionNotFound, "Session #{session_id} not found" unless adapter
284
+
285
+ agent = adapter.session
286
+ raise InvalidRequest, "session has no artifact store (artifacts: not enabled)" unless agent.artifact_store
287
+
288
+ { artifacts: agent.artifacts }
289
+ end
290
+
291
+ # Artifact: fetch one (content for inline artifacts, uri for
292
+ # external binaries)
293
+ handler("session/artifact/get") do |params, _id|
294
+ session_id = params["sessionId"] || params[:sessionId]
295
+ artifact_id = params["artifactId"] || params[:artifactId]
296
+ raise InvalidRequest, "sessionId and artifactId are required" unless session_id && artifact_id
297
+
298
+ adapter = @session_manager.get(session_id)
299
+ raise Ask::AppServer::SessionNotFound, "Session #{session_id} not found" unless adapter
300
+
301
+ agent = adapter.session
302
+ raise InvalidRequest, "session has no artifact store (artifacts: not enabled)" unless agent.artifact_store
303
+
304
+ record = agent.fetch_artifact(artifact_id)
305
+ raise InvalidRequest, "Artifact #{artifact_id} not found" unless record
306
+
307
+ { artifact: record }
308
+ end
309
+
276
310
  # Workspace: read state
277
311
  handler("workspace/readState") do |params, _id|
278
312
  @session_manager.read_workspace_state
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
+ require "time"
4
5
 
5
6
  module Ask
6
7
  module AppServer
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module AppServer
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-app-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto