omp-superagent 0.1.8 → 0.1.10
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.
- package/DESIGN.md +16 -8
- package/README.ko.md +28 -374
- package/README.md +30 -421
- package/THIRD_PARTY_NOTICES.md +8 -8
- package/config.example.json +7 -0
- package/docs/OPERATIONS.en.md +2223 -0
- package/docs/OPERATIONS.md +164 -23
- package/docs/design/execution.md +164 -18
- package/docs/design/messaging.md +78 -17
- package/docs/kakao-bridge-protocol.md +193 -0
- package/docs/releases/0.1.10.md +17 -0
- package/docs/releases/0.1.9.md +18 -0
- package/gateway/bin/omp-gateway-darwin-arm64 +0 -0
- package/gateway/bin/omp-gateway-darwin-x64 +0 -0
- package/gateway/bin/omp-gateway-linux-arm64 +0 -0
- package/gateway/bin/omp-gateway-linux-x64 +0 -0
- package/host-owner/bin/notices/darwin-arm64/Cargo-LICENSES.txt +2 -0
- package/host-owner/bin/notices/darwin-arm64/Cargo-SOURCES.txt +2 -0
- package/host-owner/bin/notices/darwin-arm64/crates/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/darwin-arm64/crates/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/host-owner/bin/notices/darwin-arm64/crates/rustix-1.1.6/COPYRIGHT +29 -0
- package/host-owner/bin/notices/darwin-arm64/crates/rustix-1.1.6/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/darwin-arm64/crates/rustix-1.1.6/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/host-owner/bin/notices/darwin-arm64/crates/rustix-1.1.6/LICENSE-MIT +23 -0
- package/host-owner/bin/notices/darwin-x64/Cargo-LICENSES.txt +2 -0
- package/host-owner/bin/notices/darwin-x64/Cargo-SOURCES.txt +2 -0
- package/host-owner/bin/notices/darwin-x64/crates/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/darwin-x64/crates/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/host-owner/bin/notices/darwin-x64/crates/rustix-1.1.6/COPYRIGHT +29 -0
- package/host-owner/bin/notices/darwin-x64/crates/rustix-1.1.6/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/darwin-x64/crates/rustix-1.1.6/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/host-owner/bin/notices/darwin-x64/crates/rustix-1.1.6/LICENSE-MIT +23 -0
- package/host-owner/bin/notices/linux-arm64/Cargo-LICENSES.txt +3 -0
- package/host-owner/bin/notices/linux-arm64/Cargo-SOURCES.txt +3 -0
- package/host-owner/bin/notices/linux-arm64/crates/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/linux-arm64/crates/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/host-owner/bin/notices/linux-arm64/crates/linux-raw-sys-0.12.1/COPYRIGHT +29 -0
- package/host-owner/bin/notices/linux-arm64/crates/linux-raw-sys-0.12.1/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/linux-arm64/crates/linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/host-owner/bin/notices/linux-arm64/crates/linux-raw-sys-0.12.1/LICENSE-MIT +23 -0
- package/host-owner/bin/notices/linux-arm64/crates/rustix-1.1.6/COPYRIGHT +29 -0
- package/host-owner/bin/notices/linux-arm64/crates/rustix-1.1.6/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/linux-arm64/crates/rustix-1.1.6/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/host-owner/bin/notices/linux-arm64/crates/rustix-1.1.6/LICENSE-MIT +23 -0
- package/host-owner/bin/notices/linux-x64/Cargo-LICENSES.txt +3 -0
- package/host-owner/bin/notices/linux-x64/Cargo-SOURCES.txt +3 -0
- package/host-owner/bin/notices/linux-x64/crates/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/linux-x64/crates/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/host-owner/bin/notices/linux-x64/crates/linux-raw-sys-0.12.1/COPYRIGHT +29 -0
- package/host-owner/bin/notices/linux-x64/crates/linux-raw-sys-0.12.1/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/linux-x64/crates/linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/host-owner/bin/notices/linux-x64/crates/linux-raw-sys-0.12.1/LICENSE-MIT +23 -0
- package/host-owner/bin/notices/linux-x64/crates/rustix-1.1.6/COPYRIGHT +29 -0
- package/host-owner/bin/notices/linux-x64/crates/rustix-1.1.6/LICENSE-APACHE +201 -0
- package/host-owner/bin/notices/linux-x64/crates/rustix-1.1.6/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/host-owner/bin/notices/linux-x64/crates/rustix-1.1.6/LICENSE-MIT +23 -0
- package/host-owner/bin/omp-host-owner-darwin-arm64 +0 -0
- package/host-owner/bin/omp-host-owner-darwin-x64 +0 -0
- package/host-owner/bin/omp-host-owner-linux-arm64 +0 -0
- package/host-owner/bin/omp-host-owner-linux-x64 +0 -0
- package/package.json +10 -8
- package/skills/head/SKILL.md +28 -14
- package/skills/head/references/routing.md +23 -17
- package/skills/head/references/supervision.md +22 -1
- package/skills/lane/SKILL.md +11 -0
- package/skills/lane/references/workflow.md +17 -8
- package/src/cli.ts +6 -4
- package/src/config.ts +44 -3
- package/src/contracts.ts +101 -8
- package/src/discord-command-registration.ts +34 -186
- package/src/extension.ts +44 -6
- package/src/gateway-client.ts +11 -59
- package/src/gateway-protocol.ts +35 -1
- package/src/head-recovery.ts +226 -17
- package/src/host-extension.ts +132 -17
- package/src/host-protocol.ts +6 -9
- package/src/host-reply-voice.ts +181 -0
- package/src/lane-extension.ts +46 -8
- package/src/lane-models.ts +8 -0
- package/src/lane-report.ts +22 -0
- package/src/managed-ulw-probe.ts +22 -20
- package/src/message-order.ts +2 -1
- package/src/messenger-command-catalog.json +6 -3
- package/src/messenger-commands.ts +9 -2
- package/src/operator.ts +77 -0
- package/src/pr-github-schema.ts +2 -0
- package/src/pr-intake-automation.ts +1 -2
- package/src/pr-intake-comment.ts +1 -2
- package/src/pr-intake-fix.ts +1 -2
- package/src/pr-intake-github.ts +1 -2
- package/src/pr-intake-material.ts +1 -2
- package/src/pr-intake-tree.ts +1 -2
- package/src/pr-review-models.ts +28 -0
- package/src/result-attachment.ts +60 -79
- package/src/runtime.ts +1862 -298
- package/src/setup-profiles.ts +26 -65
- package/src/setup.ts +2 -1
- package/src/slack-command-registration.ts +48 -197
- package/src/soul.ts +214 -0
- package/src/store.ts +643 -55
- package/src/superkit-skills.ts +22 -0
- package/src/telegram-command-languages.json +17 -0
- package/src/telegram-command-registration.ts +32 -134
- package/src/worker-bridge.ts +21 -0
- package/src/worker-enrollment.ts +2 -1
- package/src/worker-host.ts +0 -24
- package/src/worker-serve-prepare.ts +19 -0
- package/src/worker-service.ts +51 -47
- package/scripts/ci.ts +0 -44
- package/scripts/release.ts +0 -112
- package/scripts/test-omp.sh +0 -44
- package/src/discord-commands.ts +0 -29
- package/src/discord-markdown.ts +0 -399
- package/src/slack-commands.ts +0 -18
- package/src/telegram-signal.ts +0 -14
- package/src/worker-stdio.ts +0 -61
package/docs/design/messaging.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Messaging and authority
|
|
2
2
|
|
|
3
|
-
[Architecture](../../DESIGN.md) · [Execution and coordination](execution.md) · [Operations](../OPERATIONS.md)
|
|
3
|
+
[Architecture](../../DESIGN.md) · [Execution and coordination](execution.md) · [Operations](../OPERATIONS.en.md)
|
|
4
4
|
|
|
5
5
|
## Transport and identity
|
|
6
6
|
|
|
@@ -22,6 +22,7 @@ topic is a binding key, not a fabricated conversation or thread ID.
|
|
|
22
22
|
| [Discord](../../gateway/src/discord.rs) | Discord Gateway and REST verify the bot/owner and configured guild and parent-channel allowlists; owner one-to-one DMs are separately allowed. History recovery is for known routes after their saved cursors, not unseen chats or all edits/deletions. |
|
|
23
23
|
| [Telegram](../../gateway/src/telegram.rs) | Bot API `getMe` identifies the bot. Use the configured real owner and allowed chats; anonymous, forwarded, bot-mediated and business identities do not confer authority. Long poll only after startup approval reconciliation; refuse an active webhook without removing it. |
|
|
24
24
|
| [Slack](../../gateway/src/slack.rs) | Socket Mode and the Web API, with bot/workspace and active human owner checks and actual channel membership. No group DMs or public HTTP endpoint. Known-route history is limited by cursors, scopes, membership, retention and rate limits. |
|
|
25
|
+
| [KakaoTalk](../../gateway/src/kakao.rs) | No Kakao login. Polls an operator-run [loopback bridge](../kakao-bridge-protocol.md) with a dedicated token over a proxy-free, redirect-free client. Admits only rows whose sender, chat and numeric log ID match the configured owner one-to-one chat, at most once per log ID. A first contact or inbox generation change saves a baseline instead of replaying history. Replies carry deterministic push IDs; the bridge fixes the destination. Approval cards are cancelled with a notice, never accepted. No threads, attachments or group rooms. |
|
|
25
26
|
|
|
26
27
|
Set `discord.requireAddressing` to `true` to filter ordinary owner messages in
|
|
27
28
|
allowed Discord guild parent channels and threads not created by this bot,
|
|
@@ -37,6 +38,12 @@ The owner, guild and parent-channel checks still apply. Owner DMs, Discord
|
|
|
37
38
|
application commands, approval components and restricted group rooms retain
|
|
38
39
|
their existing policies.
|
|
39
40
|
|
|
41
|
+
Standalone owner preferences, such as the shared reply voice, cannot be set
|
|
42
|
+
through a reply, forward, or attachment. Adapters keep that provenance even
|
|
43
|
+
when a Telegram external reply, Discord forward, or Slack shared attachment
|
|
44
|
+
has no usable in-route snapshot. This marker does not change routing or message
|
|
45
|
+
identity and does not import external reply content.
|
|
46
|
+
|
|
40
47
|
The Gateway records pending owner-message candidates before advancing the
|
|
41
48
|
Discord WebSocket sequence. Until it verifies the sender and route, it keeps
|
|
42
49
|
only lookup coordinates and revision evidence, not message or attachment
|
|
@@ -195,12 +202,33 @@ not spend a saved reset or retry the original input; later inputs keep their
|
|
|
195
202
|
durable order. The quota and credential contracts were checked against the
|
|
196
203
|
[pinned OMP SDK](../../DESIGN.md#stock-omp-and-verification-scope).
|
|
197
204
|
|
|
205
|
+
Any other settled HEAD failure (`prompt_result` status `error`) whose exact
|
|
206
|
+
native run journal contains only its single prompt, failed model replies without
|
|
207
|
+
tool calls, native `provider_refusal` entries and usage records closes as
|
|
208
|
+
cancelled at settlement, with a failure notice and without replay. The same
|
|
209
|
+
receipt identity, run ordinal, session and file binding as the quota rule
|
|
210
|
+
applies. Automatic closure requires that the native session still be idle
|
|
211
|
+
after reading its journal and that every output have a terminal delivery
|
|
212
|
+
state. An outstanding native confirmation retains its original owner route
|
|
213
|
+
and delays settlement until the native dialog is answered or cancelled. An
|
|
214
|
+
input already held after a restart closes the same way during reconciliation;
|
|
215
|
+
after the settled receipt only usage records and native or extension `custom`
|
|
216
|
+
entries (for example `session_exit`) are tolerated, never a later message, run
|
|
217
|
+
or tool start.
|
|
218
|
+
A started tool, a steered follow-up, an unknown journal entry, an unreadable
|
|
219
|
+
journal, or a quota or quota-like refusal (even after a restart `session_exit`,
|
|
220
|
+
model change, or without a quota reader) keeps the input uncertain. That failure
|
|
221
|
+
notice names the exact `/resolve <input-id>`, and the first new owner message
|
|
222
|
+
held behind it atomically persists one hold notice and its marker naming the
|
|
223
|
+
blocking input. Later held messages receive no further notice for the same
|
|
224
|
+
blocker.
|
|
225
|
+
|
|
198
226
|
`/resolve [input-id]` (`!resolve` in Slack) manually closes an uncertain head
|
|
199
227
|
input as cancelled. A stalled lane exposes its exact input ID and queue blocker
|
|
200
228
|
through `/status` or `lane_inspect`. Only the operator in the bound topic can use
|
|
201
229
|
`/resolve --lane <input-id>` to cancel that uncertain input. This is not a native
|
|
202
230
|
interrupt, replay or implicit resume, and it preserves other fences and pauses.
|
|
203
|
-
See the [operations guide](../OPERATIONS.md#4
|
|
231
|
+
See the [operations guide](../OPERATIONS.en.md#4-commands-and-daily-use) for command usage.
|
|
204
232
|
|
|
205
233
|
## Topic routing and controls
|
|
206
234
|
|
|
@@ -295,10 +323,21 @@ See the [operations guide](../OPERATIONS.md#4-명령과-일상-사용) for comma
|
|
|
295
323
|
threads, not edits, quoted text or attachments. DM and other adapters retain
|
|
296
324
|
their existing topic behavior.
|
|
297
325
|
- `/head <request>` explicitly addresses the shared coordination model (Slack:
|
|
298
|
-
`!head` or `/superagent-head`).
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
326
|
+
`!head` or `/superagent-head`). Manager handoffs keep HEAD's review path.
|
|
327
|
+
When HEAD explicitly uses `lane_message` to continue an existing physical
|
|
328
|
+
Discord work thread from its exact authorized guild parent, the controller
|
|
329
|
+
records that thread as the handoff's progress and final report route. It
|
|
330
|
+
does not change the original input or borrow its parent message as a thread
|
|
331
|
+
reply. Replays preserve the recorded destination and do not send a parent
|
|
332
|
+
copy. Native approvals during HEAD's review still use the original parent
|
|
333
|
+
route, not the report's destination. Other routes, logical topics and
|
|
334
|
+
`/resume` retain their existing rules. Bound-topic commentary and final
|
|
335
|
+
answers instead pass through the controller's source-bound outbox without a
|
|
336
|
+
synthesis turn. Approval cards stay with their original native session and
|
|
337
|
+
authorized route.
|
|
338
|
+
- Send an explicit [SOUL reply voice change](execution.md#owner-facing-reply-voice)
|
|
339
|
+
through `/head` from a bound thread. Ordinary lane requests, reports and
|
|
340
|
+
quoted text do not become global settings changes.
|
|
302
341
|
- Thread-first work sends a short kickoff to the selected topic. The durable
|
|
303
342
|
`sent` receipt gates new lane dispatch and steering for that input. A missing
|
|
304
343
|
or uncertain delivery is not a successful kickoff.
|
|
@@ -316,10 +355,12 @@ See the [operations guide](../OPERATIONS.md#4-명령과-일상-사용) for comma
|
|
|
316
355
|
If a follow-up arrives before the native start event, that event rechecks
|
|
317
356
|
pending inputs. An idle destination receives a new prompt.
|
|
318
357
|
Match the full route including account, authority, thread and topic. A bound
|
|
319
|
-
reply can join
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
358
|
+
reply can join a manager run initiated elsewhere only if its verified delivery
|
|
359
|
+
route is this exact thread. When steering another manager handoff into or from
|
|
360
|
+
a parent-origin thread follow-up, both source conversations and report routes
|
|
361
|
+
must match. A manager handoff keeps its HEAD review mode, with the verified
|
|
362
|
+
reply route fixed for the joined run, including logical topics backed by native
|
|
363
|
+
threads. Keep each source and native receipt distinct
|
|
323
364
|
and deliver one result for a jointly handled cohort. History lookup verifies
|
|
324
365
|
a joined reply's topic ownership and its own completed native receipt, not the
|
|
325
366
|
manager's instructions or completion.
|
|
@@ -348,10 +389,25 @@ is not a native mutation receipt. The head requires the recorded sent receipt
|
|
|
348
389
|
for the exact card before changing settings. Unselected cards expire after five
|
|
349
390
|
minutes, on Gateway restart, or when a new menu of the same kind replaces them
|
|
350
391
|
on the same route.
|
|
392
|
+
On Discord, the model card shows two selects: the destination (HEAD or the
|
|
393
|
+
lane bound to the opening conversation) and the provider/model browser. With
|
|
394
|
+
both destinations available the operator must pick one; without a bound lane
|
|
395
|
+
only HEAD is offered. Browsing providers or changing the destination is not a
|
|
396
|
+
model change. The card uses the lane's saved model for its checkmark, omitting
|
|
397
|
+
it when uncertain; browsing does not wait for a lane Host. Remote lanes offer
|
|
398
|
+
only identifiers their worker accepts; manual PR review lanes offer only
|
|
399
|
+
static-review-compatible models. Neither restriction filters the HEAD list.
|
|
400
|
+
The final model selection carries the destination with the saved card and
|
|
401
|
+
option indices. A stale lane selection cannot fall back to HEAD.
|
|
351
402
|
The interaction pattern was compared with [Hermes Agent at 242315ce](https://github.com/NousResearch/hermes-agent/blob/242315ce571cde721e717a544cf8ae6c343315cf/gateway/slash_commands_model.py#L516-L567);
|
|
352
403
|
the catalogue and mutation remain native OMP, and no upstream picker code is used.
|
|
353
404
|
|
|
354
|
-
|
|
405
|
+
The reset picker chooses an exact linked account from the configured OMP profile.
|
|
406
|
+
Discord accepts the argumentless `/usage-reset` command in its picker and in
|
|
407
|
+
authorized messages. `/usage` only reads quotas. The Gateway rejects stale
|
|
408
|
+
`/usage` interactions carrying options; HEAD refuses legacy `/usage reset`
|
|
409
|
+
messages as invalid controls, not model or lane requests. Edits cannot open
|
|
410
|
+
the reset picker. Telegram and Slack keep their existing reset syntax.
|
|
355
411
|
The first click only changes the displayed card revision; Confirm on that
|
|
356
412
|
revision is the only action that admits a reset request. Cancel closes the card
|
|
357
413
|
without admitting any request. The head checks the original sent card and live
|
|
@@ -479,6 +535,9 @@ approval.
|
|
|
479
535
|
API routes and metadata. Do not persist or surface credential URLs or
|
|
480
536
|
follow redirects on private file downloads. Enforce byte limits end to end;
|
|
481
537
|
an unknown size is not zero and a known size must match the bytes received.
|
|
538
|
+
Rust stages the authorized batch under the instance's private attachments
|
|
539
|
+
directory. The head receives file receipts, not a second copy of every
|
|
540
|
+
download over the Gateway socket; it still constructs the native image input.
|
|
482
541
|
The adapters preserve audio metadata; they do not transcribe attachments.
|
|
483
542
|
- An owner can authorize one specific result file with a standalone leading
|
|
484
543
|
`attach: workspace/relative-file.ext` line. `result_attach` stages the exact
|
|
@@ -490,9 +549,11 @@ approval.
|
|
|
490
549
|
hard links, dot paths and managed private state are excluded. Delivery uses
|
|
491
550
|
the original authorized topic and stable outbox identity, with no destination
|
|
492
551
|
override and no replay of uncertain sends. Restricted group rooms cannot
|
|
493
|
-
use this feature.
|
|
494
|
-
|
|
495
|
-
|
|
552
|
+
use this feature. New outbox rows refer to a private snapshot made before
|
|
553
|
+
admission. The Gateway verifies its recorded identity and contents rather
|
|
554
|
+
than reopening the workspace path. Older queued inline attachments retain
|
|
555
|
+
their original delivery identity; moving the bytes does not authorize a
|
|
556
|
+
second upload after an uncertain send.
|
|
496
557
|
- Long outputs use a single bounded text attachment where supported. Discord
|
|
497
558
|
first splits an over-limit reply at paragraph, line, then space boundaries
|
|
498
559
|
into at most five ordered messages of up to 2,000 UTF-16 units, closing and
|
|
@@ -554,9 +615,9 @@ approval.
|
|
|
554
615
|
An Image needs a valid HTTPS URL. A spec that is
|
|
555
616
|
invalid, uses another component, reuses an element or exceeds Discord's embed
|
|
556
617
|
limits stays verbatim as its code block, which is also what Telegram and Slack
|
|
557
|
-
show. The [Rust renderer](../../gateway/src/discord/embeds.rs) and
|
|
558
|
-
[
|
|
559
|
-
[fixture](../../test/fixtures/discord-cards.json).
|
|
618
|
+
show. The [Rust renderer](../../gateway/src/discord/embeds.rs) and the
|
|
619
|
+
[test-only Bun renderer](../../test/oracles/bun-gateway/discord-markdown.ts)
|
|
620
|
+
share one [fixture](../../test/fixtures/discord-cards.json).
|
|
560
621
|
|
|
561
622
|
## Discord voice
|
|
562
623
|
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# KakaoTalk bridge protocol (version 2)
|
|
2
|
+
|
|
3
|
+
[Operations guide (Korean)](OPERATIONS.md#24-kakaotalk-로컬-브리지-주인-11-전용) ·
|
|
4
|
+
[Operations guide (English)](OPERATIONS.en.md#24-kakaotalk-local-bridge-owner-one-to-one-only) ·
|
|
5
|
+
[Reference bridge](../scripts/kakao-reference-bridge.ts) · [Adapter](../gateway/src/kakao.rs)
|
|
6
|
+
|
|
7
|
+
KakaoTalk has no bot API. The Gateway's `kakao` adapter therefore never signs in to
|
|
8
|
+
Kakao, stores no Kakao credentials and never contacts Kakao servers. It talks to a
|
|
9
|
+
**bridge** that the operator runs on the same machine. The bridge owns whatever Kakao
|
|
10
|
+
session or client automation the operator chooses. Superagent does not ship one: the
|
|
11
|
+
repository contains only a [reference bridge](../scripts/kakao-reference-bridge.ts)
|
|
12
|
+
with an in-memory inbox for tests and local demos.
|
|
13
|
+
|
|
14
|
+
> **Terms of service risk.** Automating a personal KakaoTalk account is not an
|
|
15
|
+
> official Kakao integration. It can violate Kakao's terms of service and may lead to
|
|
16
|
+
> account restriction or suspension. Kakao may change its client or protocol at any
|
|
17
|
+
> time. The operator alone chooses, runs and is responsible for the bridge. Use a
|
|
18
|
+
> separate account where possible and do not automate other people's chats.
|
|
19
|
+
|
|
20
|
+
## Roles
|
|
21
|
+
|
|
22
|
+
| Role | Responsibility |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Bridge | Receives Kakao messages, durably records messages that the owner sent in the owner's one-to-one chat with the bridge account, serves them on the inbox endpoint, and delivers replies to that same chat only. |
|
|
25
|
+
| Adapter (Gateway) | Polls the inbox, admits rows that exactly match the configured owner and chat, and posts the head's replies. It cannot choose a destination. |
|
|
26
|
+
|
|
27
|
+
Group chats, open chats and other people's one-to-one chats are out of scope for
|
|
28
|
+
version 2. A bridge MUST NOT place their messages in the Superagent inbox.
|
|
29
|
+
|
|
30
|
+
## Transport and authentication
|
|
31
|
+
|
|
32
|
+
- Plain HTTP on a literal loopback address: `127.0.0.1` or `[::1]`, with an explicit
|
|
33
|
+
port. The adapter rejects host names (including `localhost`), other addresses,
|
|
34
|
+
HTTPS, credentials, query strings and fragments in `bridgeUrl`. It uses a dedicated
|
|
35
|
+
HTTP client with environment/system proxies disabled, no redirects and no retries.
|
|
36
|
+
- A path in `bridgeUrl` is a base: `http://127.0.0.1:8080/kakao` uses
|
|
37
|
+
`/kakao/superagent/inbox`, `/kakao/superagent/v2/destination`, and
|
|
38
|
+
`/kakao/superagent/v2/send`.
|
|
39
|
+
- Every request carries exactly one `X-Superagent-Token` header. The token is a
|
|
40
|
+
dedicated secret for this interface only: at least 24 characters from
|
|
41
|
+
`[A-Za-z0-9_-]`. Do not reuse a token that also authorizes other bridge features.
|
|
42
|
+
The adapter reads it from the environment variable named by `kakao.tokenEnv`.
|
|
43
|
+
|
|
44
|
+
The bridge MUST:
|
|
45
|
+
|
|
46
|
+
1. Listen only on loopback and check that the peer address is loopback.
|
|
47
|
+
2. Reject (`403`) any request carrying a proxy or forwarding header (`Forwarded`,
|
|
48
|
+
`X-Forwarded-For`, `X-Real-IP`, `CF-Connecting-IP`) or a browser header (`Origin`,
|
|
49
|
+
`Referer`, `Sec-Fetch-Site`). This blocks tunnelled requests and browser-based
|
|
50
|
+
cross-site requests to the loopback port.
|
|
51
|
+
3. Reject (`403`) zero or several token headers and compare the token in constant
|
|
52
|
+
time.
|
|
53
|
+
4. Never log the token or message bodies at default verbosity.
|
|
54
|
+
5. Never send replies anywhere but the owner's one-to-one chat. Check the required
|
|
55
|
+
expected destination against the actual authenticated account and fixed chat
|
|
56
|
+
before each write. It is a precondition, not a destination selector. A mismatch
|
|
57
|
+
MUST be refused before any queueing or delivery; ignore fields that try to select
|
|
58
|
+
another destination.
|
|
59
|
+
|
|
60
|
+
## `GET /superagent/inbox`
|
|
61
|
+
|
|
62
|
+
Query parameters:
|
|
63
|
+
|
|
64
|
+
| Name | Meaning |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `after` | Last row ID the adapter has processed (`0` on first contact). |
|
|
67
|
+
| `generation` | Inbox generation the adapter last saw (empty on first contact). |
|
|
68
|
+
| `limit` | Maximum rows to return. The adapter sends `50`. The bridge MUST NOT return more. |
|
|
69
|
+
|
|
70
|
+
Response: `200`, `Content-Type: application/json`.
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"generation": "f1d2c3",
|
|
75
|
+
"latest": 42,
|
|
76
|
+
"messages": [
|
|
77
|
+
{
|
|
78
|
+
"id": 41,
|
|
79
|
+
"logId": "3279618400000000001",
|
|
80
|
+
"chatId": "18400000000000001",
|
|
81
|
+
"senderId": "4000001",
|
|
82
|
+
"text": "status?",
|
|
83
|
+
"receivedAtMs": 1764000000000,
|
|
84
|
+
"stale": false
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- `generation`: non-empty opaque string. It identifies one inbox history. The bridge
|
|
91
|
+
MUST change it whenever row IDs can repeat or go backwards (database recreated or
|
|
92
|
+
restored from backup). The reference rule: if `generation` matches but `after` is
|
|
93
|
+
greater than `latest`, issue a new generation.
|
|
94
|
+
- `latest`: the highest row ID currently stored, `0` when empty.
|
|
95
|
+
- If the requested `generation` differs from the current one, the bridge returns the
|
|
96
|
+
current `generation` and `latest` with **no** messages. The adapter then saves a
|
|
97
|
+
new baseline instead of replaying history: on first contact it starts after `latest`
|
|
98
|
+
(old commands are never executed); after a generation change it starts at `0`.
|
|
99
|
+
- Otherwise, return rows with `id > after` in ascending `id` order, at most `limit`.
|
|
100
|
+
- `id`: positive integer, strictly increasing within a generation.
|
|
101
|
+
- `logId`: Kakao's numeric message log ID, a decimal string without leading zeros (at
|
|
102
|
+
most 20 digits). It is the durable message identity: the adapter admits
|
|
103
|
+
`kakao:<botUserId>:<chatId>:<logId>` at most once, so replaying a row is harmless.
|
|
104
|
+
- `chatId`, `senderId`: decimal strings. The adapter drops rows that are not from the
|
|
105
|
+
configured `ownerId` in the configured `chatId`. Only the row ID is logged.
|
|
106
|
+
- `text`: 1 to 4000 characters after trimming. Longer rows are dropped.
|
|
107
|
+
- `receivedAtMs`: positive Unix milliseconds no greater than 2^53 − 1.
|
|
108
|
+
- `stale` (optional, default `false`): the bridge sets it for a row that is too old to
|
|
109
|
+
act on safely (the reference bridge uses 30 minutes since recording). The adapter
|
|
110
|
+
durably retires the Kakao log ID before attempting one notice, so a rebuilt
|
|
111
|
+
inbox cannot later execute it as fresh or replay an ambiguous notice.
|
|
112
|
+
- The whole response body MUST stay below 4 MiB.
|
|
113
|
+
|
|
114
|
+
A non-JSON `200` (for example an HTML page from an older bridge), a non-`2xx` status,
|
|
115
|
+
invalid JSON, an oversized body, or an invalid page (limit, order, range, or
|
|
116
|
+
generation) produces no admissions and leaves the adapter's cursor unchanged.
|
|
117
|
+
It retries after a short back-off and logs one line per distinct error per minute.
|
|
118
|
+
|
|
119
|
+
## `GET /superagent/v2/destination`
|
|
120
|
+
|
|
121
|
+
Return `200 application/json` with the authenticated bridge account, owner, and
|
|
122
|
+
fixed one-to-one chat: `{"botUserId":"900","ownerId":"42","chatId":"777"}`.
|
|
123
|
+
The adapter compares all three fields with its configuration before sending
|
|
124
|
+
any output. Missing, unverifiable, or different identity stops the send without
|
|
125
|
+
posting any text. Version 1's send endpoint is never used.
|
|
126
|
+
|
|
127
|
+
## `POST /superagent/v2/send`
|
|
128
|
+
|
|
129
|
+
Request body (`Content-Type: application/json`):
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"pushId": "sa-0123456789abcdef01234567-0-2",
|
|
134
|
+
"outputId": "out-17",
|
|
135
|
+
"message": "plain text",
|
|
136
|
+
"expectedDestination": {"botUserId":"900","ownerId":"42","chatId":"777"}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- `pushId`: `sa-` followed by at most 120 characters from `[A-Za-z0-9._:-]`. It is
|
|
141
|
+
derived deterministically from the durable output, chunk index and chunk count.
|
|
142
|
+
The bridge MUST deliver a given `pushId` at most once, including across restarts.
|
|
143
|
+
An identical repeated request returns the same known receipt or unconfirmed
|
|
144
|
+
state, without another send. Conflicting reuse of a push ID is refused.
|
|
145
|
+
- `outputId`: the Superagent output that produced this chunk (informational; useful for
|
|
146
|
+
matching answers to requests). Every chunk of one output shares it.
|
|
147
|
+
- `message`: plain text, 1 to 1500 characters. The adapter strips Markdown and splits
|
|
148
|
+
long replies at line breaks (at most 20 chunks per output).
|
|
149
|
+
- `expectedDestination`: the required fixed tuple. The bridge rechecks it
|
|
150
|
+
against the actual destination immediately before queueing or writing, even
|
|
151
|
+
if the previous read succeeded.
|
|
152
|
+
|
|
153
|
+
Responses:
|
|
154
|
+
|
|
155
|
+
| Status | Body | Adapter behaviour |
|
|
156
|
+
| --- | --- | --- |
|
|
157
|
+
| `200` | `{"ok":true,"state":"delivered","pushId":"…","destination":{"botUserId":"900","ownerId":"42","chatId":"777"},"messageId":"1234"}` | Confirmed only for a matching push ID and destination, with the actual Kakao log ID as a decimal string. |
|
|
158
|
+
| `2xx` | `{"ok":true,"state":"queued"}` | Queue acceptance only. The delivery is uncertain; no automatic resend. |
|
|
159
|
+
| `409` | any | Definitely refused before any effect; the chat is temporarily quiet. |
|
|
160
|
+
| other `4xx` | any | Definitely refused before any effect, including `403` for a wrong destination. |
|
|
161
|
+
| `5xx`, timeout, invalid or oversized (> 64 KiB) receipt | any | Outcome unknown. Superagent does not resend automatically. |
|
|
162
|
+
|
|
163
|
+
Each chunk needs its own confirmed Kakao log ID. A failed later chunk after
|
|
164
|
+
confirmed delivery of an earlier one leaves the output uncertain, never
|
|
165
|
+
definitely rejected or fully sent. Reconcile with the original bridge and
|
|
166
|
+
chat before authorizing any follow-up. The reference bridge simulates log IDs
|
|
167
|
+
from its in-memory delivery list; it cannot verify a live Kakao delivery.
|
|
168
|
+
|
|
169
|
+
## Unsupported features
|
|
170
|
+
|
|
171
|
+
Version 2 carries text only. Threads, attachments, reactions, typing indicators and
|
|
172
|
+
presence are unsupported. Approval cards cannot be shown: the adapter sends a short
|
|
173
|
+
notice and records the approval as **cancelled**. It never accepts one on the owner's
|
|
174
|
+
behalf.
|
|
175
|
+
|
|
176
|
+
## Security model summary
|
|
177
|
+
|
|
178
|
+
| Threat | Mitigation |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| Another local user or web page calls the bridge | Dedicated token, constant-time comparison, browser-header rejection. Loopback is not a sandbox: anyone who can run code as the same OS user can read the token. |
|
|
181
|
+
| Token leaves the machine | Literal loopback URL only, proxies disabled, redirects not followed. |
|
|
182
|
+
| Remote callers through a tunnel | Bridge rejects forwarding headers and non-loopback peers. |
|
|
183
|
+
| Someone else's message reaches the head | Bridge filters to the owner's one-to-one chat; adapter re-checks `ownerId`, `chatId` and `logId` on every row. |
|
|
184
|
+
| Replay after restart or restore | `generation` baseline, `after` cursor, and once-only admission by `logId`. |
|
|
185
|
+
| Duplicate sends after a timeout | Deterministic `pushId` and bridge-side deduplication; unknown outcomes are not resent automatically. |
|
|
186
|
+
| Prompt injection in owner chat | Messages are owner input with the same authority as the owner's other messengers. Anyone who controls the owner's Kakao account controls the head, as with any configured messenger. |
|
|
187
|
+
| Unbounded responses | 10 s request timeout, 2 s connect timeout, page and byte limits. |
|
|
188
|
+
|
|
189
|
+
## Versioning
|
|
190
|
+
|
|
191
|
+
Version 2 retains the inbox endpoint and uses versioned destination and send
|
|
192
|
+
endpoints so an older bridge cannot ignore the new precondition on a write.
|
|
193
|
+
New optional response fields may be added; adapters ignore unknown fields.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# omp-superagent 0.1.10
|
|
2
|
+
|
|
3
|
+
- **Optional KakaoTalk adapter.** Gateway can receive and reply in an owner's one-to-one chat through an operator-run loopback bridge. Superagent does not sign in to Kakao or ship a live Kakao client. See the [bridge protocol and limitations](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.10/docs/kakao-bridge-protocol.md) before enabling it (#56).
|
|
4
|
+
- **Shared reply style for HEAD and lanes.** Tell HEAD how to answer future requests. The saved style applies to new conversational replies and survives restart, but does not change tools, approvals, or workflows. Ordinary messages in a bound work thread still go to its lane (#57, #58).
|
|
5
|
+
- **Safer recovery after interruptions.** HEAD retries interrupted reads of native completion records. The Host owner retries ownership observation if descendants change, and an exited lane Host no longer holds its slot. A fresh `/restart` can retry a failed checkpoint when no stop was sent (#59, #60, #61, #62).
|
|
6
|
+
- **Shorter READMEs and a complete English operations guide.** The [Korean guide](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.10/docs/OPERATIONS.md) remains available.
|
|
7
|
+
|
|
8
|
+
## Install or upgrade
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
bun add --global --trust omp-superagent@0.1.10
|
|
12
|
+
omp-sa --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Alternatively, use `npm install --global omp-superagent@0.1.10` with Bun 1.4.4 or later on `PATH`. Install OMP separately; CI uses stock OMP 19.1.1. Installing does not restart a running Gateway.
|
|
16
|
+
|
|
17
|
+
[Changes since 0.1.9](https://github.com/dbc-hbin/omp-superagent/compare/v0.1.9...v0.1.10) · [Operations guide](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.10/docs/OPERATIONS.en.md)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# omp-superagent 0.1.9
|
|
2
|
+
|
|
3
|
+
- **Change the model for a Discord work thread.** Open `/model` and select HEAD or the lane bound to that thread. A verified lane quota failure pauses that lane's queue and notifies the original conversation without starting a HEAD turn or replaying the failed request. OMP's temporary retry fallback does not overwrite the lane's configured choice (#50).
|
|
4
|
+
- **A tool-free HEAD failure no longer stalls the queue.** When the exact native journal proves the request failed before any tool started, HEAD can close it without replay and move on. Quota failures still require recovery evidence. For uncertain effects, the notice identifies the exact `/resolve <input-id>` to use after checking what happened (#54).
|
|
5
|
+
- **Discord now uses `/usage-reset`.** `/usage` is read-only and takes no options. `/usage-reset` opens the account picker; spending a ticket still requires confirmation. Telegram and Slack command syntax is unchanged. Reopened lane work sends progress and the final answer to the original work thread while keeping the original approval route (#52, #53).
|
|
6
|
+
- **Native Gateway handles more I/O.** Avatar updates, messenger command registration, SSH relay, and attachment staging move to Rust. Inbound attachments are staged in a private directory and checked against Gateway receipts before use. The npm package still includes native binaries for macOS and Linux on arm64 and x64.
|
|
7
|
+
- **Current omp-superkit layouts install cleanly.** Managed setup checks canonical `super` and `super-*` skills and their command pointers while preserving valid legacy revisions.
|
|
8
|
+
|
|
9
|
+
## Install or upgrade
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
bun add --global --trust omp-superagent@0.1.9
|
|
13
|
+
omp-sa --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Alternatively, use `npm install --global omp-superagent@0.1.9` with Bun 1.4.4 or later on `PATH`. OMP is installed separately; CI uses stock OMP 19.1.1. Installing does not restart a running Gateway. Before re-registering Discord commands, update both Gateway and HEAD, then check that Discord `/help` lists `/usage-reset`.
|
|
17
|
+
|
|
18
|
+
[Changes since 0.1.8](https://github.com/dbc-hbin/omp-superagent/compare/v0.1.8...v0.1.9) · [Operations guide](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.9/docs/OPERATIONS.md)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
anyhow-1.0.104: MIT OR Apache-2.0
|
|
2
2
|
base64-0.22.1: MIT OR Apache-2.0
|
|
3
|
+
bitflags-2.13.2: MIT OR Apache-2.0
|
|
3
4
|
bytes-1.12.2: MIT
|
|
4
5
|
cfg-if-1.0.5: MIT OR Apache-2.0
|
|
5
6
|
equivalent-1.0.3: Apache-2.0 OR MIT
|
|
@@ -15,6 +16,7 @@ mio-1.2.5: MIT
|
|
|
15
16
|
pin-project-lite-0.2.18: Apache-2.0 OR MIT
|
|
16
17
|
proc-macro2-1.0.107: MIT OR Apache-2.0
|
|
17
18
|
quote-1.0.47: MIT OR Apache-2.0
|
|
19
|
+
rustix-1.1.6: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
|
|
18
20
|
serde-1.0.229: MIT OR Apache-2.0
|
|
19
21
|
serde_core-1.0.229: MIT OR Apache-2.0
|
|
20
22
|
serde_derive-1.0.229: MIT OR Apache-2.0
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
anyhow-1.0.104: https://static.crates.io/crates/anyhow/anyhow-1.0.104.crate
|
|
2
2
|
base64-0.22.1: https://static.crates.io/crates/base64/base64-0.22.1.crate
|
|
3
|
+
bitflags-2.13.2: https://static.crates.io/crates/bitflags/bitflags-2.13.2.crate
|
|
3
4
|
bytes-1.12.2: https://static.crates.io/crates/bytes/bytes-1.12.2.crate
|
|
4
5
|
cfg-if-1.0.5: https://static.crates.io/crates/cfg-if/cfg-if-1.0.5.crate
|
|
5
6
|
equivalent-1.0.3: https://static.crates.io/crates/equivalent/equivalent-1.0.3.crate
|
|
@@ -15,6 +16,7 @@ mio-1.2.5: https://static.crates.io/crates/mio/mio-1.2.5.crate
|
|
|
15
16
|
pin-project-lite-0.2.18: https://static.crates.io/crates/pin-project-lite/pin-project-lite-0.2.18.crate
|
|
16
17
|
proc-macro2-1.0.107: https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.107.crate
|
|
17
18
|
quote-1.0.47: https://static.crates.io/crates/quote/quote-1.0.47.crate
|
|
19
|
+
rustix-1.1.6: https://static.crates.io/crates/rustix/rustix-1.1.6.crate
|
|
18
20
|
serde-1.0.229: https://static.crates.io/crates/serde/serde-1.0.229.crate
|
|
19
21
|
serde_core-1.0.229: https://static.crates.io/crates/serde_core/serde_core-1.0.229.crate
|
|
20
22
|
serde_derive-1.0.229: https://static.crates.io/crates/serde_derive/serde_derive-1.0.229.crate
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|