@kindgi/cli 0.2.0-rc.0 → 0.2.0

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.
Files changed (53) hide show
  1. package/dist/commands/helpers.d.ts +24 -0
  2. package/dist/commands/helpers.d.ts.map +1 -1
  3. package/dist/commands/helpers.js +29 -0
  4. package/dist/commands/helpers.js.map +1 -1
  5. package/dist/commands/index.d.ts.map +1 -1
  6. package/dist/commands/index.js +2 -0
  7. package/dist/commands/index.js.map +1 -1
  8. package/dist/commands/mail-triggers.d.ts +3 -0
  9. package/dist/commands/mail-triggers.d.ts.map +1 -0
  10. package/dist/commands/mail-triggers.js +290 -0
  11. package/dist/commands/mail-triggers.js.map +1 -0
  12. package/dist/commands/schedules.d.ts.map +1 -1
  13. package/dist/commands/schedules.js +12 -11
  14. package/dist/commands/schedules.js.map +1 -1
  15. package/dist/commands/service-accounts.d.ts.map +1 -1
  16. package/dist/commands/service-accounts.js +4 -2
  17. package/dist/commands/service-accounts.js.map +1 -1
  18. package/dist/commands/webhooks.d.ts.map +1 -1
  19. package/dist/commands/webhooks.js +12 -11
  20. package/dist/commands/webhooks.js.map +1 -1
  21. package/dist/dev/runtime-image.d.ts +1 -1
  22. package/dist/dev/runtime-image.d.ts.map +1 -1
  23. package/dist/dev/runtime-image.js +1 -1
  24. package/dist/dev/runtime-image.js.map +1 -1
  25. package/dist/exports/plan.d.ts.map +1 -1
  26. package/dist/exports/plan.js +12 -0
  27. package/dist/exports/plan.js.map +1 -1
  28. package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +1 -1
  29. package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
  30. package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +1 -1
  31. package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +1 -1
  32. package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +11 -1
  33. package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +12 -7
  34. package/dist/sdk-skills/kindgi-fix-corrections/SKILL.md +1 -1
  35. package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +1 -1
  36. package/dist/sdk-skills/kindgi-getting-started/SKILL.md +9 -6
  37. package/dist/sdk-skills/kindgi-java-authoring-agents/SKILL.md +1 -1
  38. package/dist/sdk-skills/kindgi-java-authoring-flows/SKILL.md +1 -1
  39. package/dist/sdk-skills/kindgi-java-authoring-guardrails/SKILL.md +1 -1
  40. package/dist/sdk-skills/kindgi-java-authoring-tools/SKILL.md +13 -5
  41. package/dist/sdk-skills/kindgi-java-getting-started/SKILL.md +9 -6
  42. package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +1 -1
  43. package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +1 -1
  44. package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +1 -1
  45. package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +13 -5
  46. package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +9 -6
  47. package/dist/sdk-skills/kindgi-scala-authoring-agents/SKILL.md +1 -1
  48. package/dist/sdk-skills/kindgi-scala-authoring-flows/SKILL.md +1 -1
  49. package/dist/sdk-skills/kindgi-scala-authoring-guardrails/SKILL.md +1 -1
  50. package/dist/sdk-skills/kindgi-scala-authoring-tools/SKILL.md +13 -5
  51. package/dist/sdk-skills/kindgi-scala-getting-started/SKILL.md +9 -6
  52. package/dist/sdk-skills/kindgi-using/SKILL.md +15 -2
  53. package/package.json +13 -13
@@ -17,7 +17,7 @@ description: >
17
17
  type: core
18
18
  library: "@kindgi/sdk"
19
19
  version: "0.3.16"
20
- sdk_version: "0.2.0-rc.0"
20
+ sdk_version: "0.2.0"
21
21
  pack_languages: [node]
22
22
  ---
23
23
 
@@ -346,12 +346,15 @@ running the older version on it.
346
346
  runtime 0.1.8 or later): the Cloud Run module's `./upgrade.sh`, as of the
347
347
  `@kindgi/sdk@<version>` tag of the release you're upgrading to, since it
348
348
  knows the steps up to its own release. Run `./upgrade.sh --dry-run` first:
349
- it changes nothing, and lists what a real run would change. The module
350
- README's Upgrading section has the rest:
349
+ it changes nothing, and lists what a real run would change. Its plan also
350
+ reads every `*.auto.tfvars.json` in the module's folder (the pack's env),
351
+ and `yes` applies exactly the saved plan it showed. The module README's
352
+ Upgrading section has the rest:
351
353
  https://github.com/kindgi/kindgi-sdk/tree/main/deploy/gcp-cloud-run#upgrading
352
- - **Any other Cloud Run deployment, or one on Azure Container Apps:** the
353
- "Operate it" section of its page,
354
- https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#operate-it or
354
+ - **Any other Cloud Run deployment:** by hand, staging first, as the Cloud
355
+ Run page's "Upgrade by hand" section says:
356
+ https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#upgrade-by-hand
357
+ - **On Azure Container Apps:** the "Operate it" section of its page,
355
358
  https://docs.kindgi.com/v0.2/deploy/self-hosted/azure-container-apps/#operate-it.
356
359
  - **Otherwise:** the operate page's upgrade steps,
357
360
  https://docs.kindgi.com/v0.2/deploy/self-hosted/operate/#upgrade-the-runtime.
@@ -16,7 +16,7 @@ description: >
16
16
  type: core
17
17
  library: "kindgi-pack (Java)"
18
18
  version: "0.1.4"
19
- sdk_version: "0.2.0-rc.0"
19
+ sdk_version: "0.2.0"
20
20
  pack_languages: [java]
21
21
  sources:
22
22
  - sdks/java/kindgi-pack/README.md
@@ -16,7 +16,7 @@ description: >
16
16
  type: core
17
17
  library: "kindgi-pack (Java)"
18
18
  version: "0.1.2"
19
- sdk_version: "0.2.0-rc.0"
19
+ sdk_version: "0.2.0"
20
20
  pack_languages: [java]
21
21
  sources:
22
22
  - sdks/java/kindgi-pack/README.md
@@ -17,7 +17,7 @@ description: >
17
17
  type: core
18
18
  library: "kindgi-pack (Java)"
19
19
  version: "0.1.2"
20
- sdk_version: "0.2.0-rc.0"
20
+ sdk_version: "0.2.0"
21
21
  pack_languages: [java]
22
22
  sources:
23
23
  - sdks/java/kindgi-pack/README.md
@@ -14,8 +14,8 @@ description: >
14
14
  by kindgi-java-getting-started.
15
15
  type: core
16
16
  library: "kindgi-pack (Java)"
17
- version: "0.1.3"
18
- sdk_version: "0.2.0-rc.0"
17
+ version: "0.1.4"
18
+ sdk_version: "0.2.0"
19
19
  pack_languages: [java]
20
20
  sources:
21
21
  - sdks/java/kindgi-pack/README.md
@@ -240,7 +240,7 @@ public static final Tool<Input, Output> TOOL = Tool.define("my-pack.send-mail")
240
240
  - **The token:** `accessToken()` is current for this call only. Never keep, print, log or return it; it never reaches the journal. `account().label()` says whose account it is (`ana@acme.com`).
241
241
  - **A 401 from the app:** `throw new ConnectionRejectedException("mail")`, with the connection's name (a second argument can say what the app answered, never the token), or your own exception with it as the cause. The runtime renews the token once and runs the call again; refused again, the call fails with `connection-rejected`.
242
242
  - **An HTTP tool** sends the token with no code: `.authorization(new HttpAuthSpec.Connection("mail"))`.
243
- - **Unattended runs:** in a run no person started, a tool that uses a `"person"` connection waits for that person's yes, unless it's marked `.mutating(false)` (mark read-only tools so). The agent's own approval settings can't lift it; only a trigger's `toolsAllowedUnattended` can, which a project admin sets, as for `needsApprovalWhenUnattended` (below).
243
+ - **Unattended runs:** in a run no person started, a tool that uses a `"person"` connection waits for that person's yes, reads included: `.mutating(false)` doesn't lift it. The agent's own approval settings can't lift it; only a trigger's `toolsAllowedUnattended` can, which a project admin sets, as for `needsApprovalWhenUnattended` (below). In a run a new mail started, the mail is a stranger's text, so two more calls wait: a call of a tool that isn't `.mutating(false)`, and, when the trigger reads the company's mailbox, a read with the company's connection to that app. The mail trigger's `toolsAllowedUnattended` lifts these too.
244
244
  - **In a unit test:** `ToolContext.forTest(Map.of("mail", new ToolConnection("c-1", "google", "Google", "test", new ConnectionAccount("1", "ana@acme.com"), null)))`; the last argument, when the token expires, can be `null`. `ctx.connections()` is empty when the tool declares none.
245
245
 
246
246
  Docs: https://docs.kindgi.com/v0.2/guides/connections/use-a-connection/
@@ -265,6 +265,10 @@ the tool's approval default: an agent that turns approval gates on
265
265
  (`conversationPolicy.hitl`) asks before any tool that isn't read-only on its
266
266
  first use.
267
267
 
268
+ In a run a new mail started, a call of a tool that isn't read-only waits
269
+ for a person's yes, unless the mail trigger's `toolsAllowedUnattended`
270
+ lists it.
271
+
268
272
  `effect(kind, resource)` declares a side effect, such as
269
273
  `.effect("writes", "db:ledger")`. A dry run also stops at a tool with a
270
274
  `writes`, `deletes`, `spawns-run`, `emits-event` or `external-side-effect`
@@ -326,11 +330,11 @@ the same way, with the same `HttpToolSpec`.
326
330
 
327
331
  ## A person's yes when no one is watching: `needsApprovalWhenUnattended`
328
332
 
329
- `needsApprovalWhenUnattended(true)` declares that a person must say yes to every call of the tool in a run no person started: one a schedule, a webhook, an event or a service account's key started. In such a run:
333
+ `needsApprovalWhenUnattended(true)` declares that a person must say yes to every call of the tool in a run no person started: one a schedule, a webhook, a new mail, an event or a service account's key started. In such a run:
330
334
 
331
335
  - **An agent's call waits** for a person's yes, whatever the agent's `conversationPolicy.hitl.tools` says. The agent's rules can't lift it: agents are reused, and the tool's author knows what it does.
332
336
  - **A flow's tool step that calls it is refused.** Put the tool behind an agent step instead, whose call waits.
333
- - **A trigger can lift both, for its own runs only.** A project admin names the tool in a webhook trigger's or a schedule's `toolsAllowedUnattended` (`--allow-unattended=<tool-id>` on `kindgi webhooks` and `kindgi schedules`). In that trigger's runs, the tool is then as in a run a person started. The tenant's approval rules still apply.
337
+ - **A trigger can lift both, for its own runs only.** A project admin names the tool in a webhook trigger's, a schedule's or a mail trigger's `toolsAllowedUnattended` (`--allow-unattended=<tool-id>` on `kindgi webhooks`, `kindgi schedules` and `kindgi mail-triggers`). In that trigger's runs, the tool is then as in a run a person started. The tenant's approval rules still apply.
334
338
 
335
339
  In a run a person started (signed in, or with their own API key), the agent's rules decide, as for any tool. Left unset, it counts as `false`. Declare it on a tool that moves money or changes something people rely on:
336
340
 
@@ -342,6 +346,10 @@ In a run a person started (signed in, or with their own API key), the agent's ru
342
346
 
343
347
  Docs: https://docs.kindgi.com/v0.2/guides/approvals/ask-before-a-tool-runs/#when-no-person-started-the-run
344
348
 
349
+ ## Results that are text from outside: `resultIsOutsideData`
350
+
351
+ `resultIsOutsideData(true)` says the tool's results are text from outside that nobody checked, such as a mail someone sent or a page a search found. An agent reads each result of the tool as data, not instructions, in that turn and in every later turn's history. It changes what the model is told, not what the tool may do: pair it with approvals for anything an agent could do with what it read. Absent means `false`.
352
+
345
353
  ## Testing
346
354
 
347
355
  `Tool.call(input, ctx)` runs the handler with the input as given (no schema
@@ -18,7 +18,7 @@ description: >
18
18
  type: core
19
19
  library: "kindgi-pack (Java)"
20
20
  version: "0.1.4"
21
- sdk_version: "0.2.0-rc.0"
21
+ sdk_version: "0.2.0"
22
22
  pack_languages: [java]
23
23
  sources:
24
24
  - sdks/java/kindgi-pack/README.md
@@ -267,12 +267,15 @@ running the older version on it.
267
267
  runtime 0.1.8 or later): the Cloud Run module's `./upgrade.sh`, as of the
268
268
  `@kindgi/sdk@<version>` tag of the release you're upgrading to, since it
269
269
  knows the steps up to its own release. Run `./upgrade.sh --dry-run` first:
270
- it changes nothing, and lists what a real run would change. The module
271
- README's Upgrading section has the rest:
270
+ it changes nothing, and lists what a real run would change. Its plan also
271
+ reads every `*.auto.tfvars.json` in the module's folder (the pack's env),
272
+ and `yes` applies exactly the saved plan it showed. The module README's
273
+ Upgrading section has the rest:
272
274
  https://github.com/kindgi/kindgi-sdk/tree/main/deploy/gcp-cloud-run#upgrading
273
- - **Any other Cloud Run deployment, or one on Azure Container Apps:** the
274
- "Operate it" section of its page,
275
- https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#operate-it or
275
+ - **Any other Cloud Run deployment:** by hand, staging first, as the Cloud
276
+ Run page's "Upgrade by hand" section says:
277
+ https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#upgrade-by-hand
278
+ - **On Azure Container Apps:** the "Operate it" section of its page,
276
279
  https://docs.kindgi.com/v0.2/deploy/self-hosted/azure-container-apps/#operate-it.
277
280
  - **Otherwise:** the operate page's upgrade steps,
278
281
  https://docs.kindgi.com/v0.2/deploy/self-hosted/operate/#upgrade-the-runtime.
@@ -16,7 +16,7 @@ description: >
16
16
  type: core
17
17
  library: "kindgi (Python)"
18
18
  version: "0.1.7"
19
- sdk_version: "0.2.0-rc.0"
19
+ sdk_version: "0.2.0"
20
20
  pack_languages: [python]
21
21
  sources:
22
22
  - sdks/python/src/kindgi/pack/define.py
@@ -17,7 +17,7 @@ description: >
17
17
  type: core
18
18
  library: "kindgi (Python)"
19
19
  version: "0.1.2"
20
- sdk_version: "0.2.0-rc.0"
20
+ sdk_version: "0.2.0"
21
21
  pack_languages: [python]
22
22
  sources:
23
23
  - sdks/python/src/kindgi/pack/define.py
@@ -16,7 +16,7 @@ description: >
16
16
  type: core
17
17
  library: "kindgi (Python)"
18
18
  version: "0.1.5"
19
- sdk_version: "0.2.0-rc.0"
19
+ sdk_version: "0.2.0"
20
20
  pack_languages: [python]
21
21
  sources:
22
22
  - sdks/python/src/kindgi/pack/define.py
@@ -14,8 +14,8 @@ description: >
14
14
  kindgi-python-getting-started.
15
15
  type: core
16
16
  library: "kindgi (Python)"
17
- version: "0.1.5"
18
- sdk_version: "0.2.0-rc.0"
17
+ version: "0.1.6"
18
+ sdk_version: "0.2.0"
19
19
  pack_languages: [python]
20
20
  sources:
21
21
  - sdks/python/src/kindgi/pack/define.py
@@ -236,7 +236,7 @@ def send_mail(message: Message, ctx: ToolContext) -> Sent:
236
236
  - **The token:** `access_token` is current for this call only. Never keep, print, log or return it; it never reaches the journal. `account.label` says whose account it is (`ana@acme.com`).
237
237
  - **A 401 from the app:** `raise ConnectionRejected("mail")`, with the connection's name (a second argument can say what the app answered, never the token), or raise your own error `from` it. The runtime renews the token once and runs the call again; refused again, the call fails with `connection-rejected`.
238
238
  - **An HTTP tool** sends the token with no code: `authorization={"kind": "connection", "connection": "mail"}`.
239
- - **Unattended runs:** in a run no person started, a tool that uses a `"person"` connection waits for that person's yes, unless it's marked `mutating=False` (mark read-only tools so). The agent's own approval settings can't lift it; only a trigger's `toolsAllowedUnattended` can, which a project admin sets, as for `needs_approval_when_unattended` (below).
239
+ - **Unattended runs:** in a run no person started, a tool that uses a `"person"` connection waits for that person's yes, reads included: `mutating=False` doesn't lift it. The agent's own approval settings can't lift it; only a trigger's `toolsAllowedUnattended` can, which a project admin sets, as for `needs_approval_when_unattended` (below). In a run a new mail started, the mail is a stranger's text, so two more calls wait: a call of a tool that isn't `mutating=False`, and, when the trigger reads the company's mailbox, a read with the company's connection to that app. The mail trigger's `toolsAllowedUnattended` lifts these too.
240
240
  - **In a unit test:** `ToolContext.for_test(connections={"mail": ToolConnection(connection_id="c-1", app="google", app_name="Google", access_token="test", account=ConnectionAccount(id="1", label="ana@acme.com"))})`, all from `kindgi`. `ctx.connections` is empty when the tool declares none.
241
241
 
242
242
  Docs: https://docs.kindgi.com/v0.2/guides/connections/use-a-connection/
@@ -263,6 +263,10 @@ approval gates on (`conversation_policy={"hitl": {"tools": {...}}}`)
263
263
  and has neither an override for the tool nor a `default` doesn't ask
264
264
  before a read-only tool, and asks before any other on first use.
265
265
 
266
+ In a run a new mail started, a call of a tool that isn't read-only waits
267
+ for a person's yes, unless the mail trigger's `toolsAllowedUnattended`
268
+ lists it.
269
+
266
270
  ```python
267
271
  @tool(id="acme.find-citations", mutating=False)
268
272
  def find_citations(query: CitationQuery) -> Citations:
@@ -278,11 +282,11 @@ policy and review; declare what the tool really does.
278
282
 
279
283
  ## A person's yes when no one is watching: `needs_approval_when_unattended`
280
284
 
281
- `needs_approval_when_unattended=True` declares that a person must say yes to every call of the tool in a run no person started: one a schedule, a webhook, an event or a service account's key started. In such a run:
285
+ `needs_approval_when_unattended=True` declares that a person must say yes to every call of the tool in a run no person started: one a schedule, a webhook, a new mail, an event or a service account's key started. In such a run:
282
286
 
283
287
  - **An agent's call waits** for a person's yes, whatever the agent's `conversation_policy` says in `hitl["tools"]`. The agent's rules can't lift it: agents are reused, and the tool's author knows what it does.
284
288
  - **A flow's tool step that calls it is refused.** Put the tool behind an agent step instead, whose call waits.
285
- - **A trigger can lift both, for its own runs only.** A project admin names the tool in a webhook trigger's or a schedule's `toolsAllowedUnattended` (`--allow-unattended=<tool-id>` on `kindgi webhooks` and `kindgi schedules`). In that trigger's runs, the tool is then as in a run a person started. The tenant's approval rules still apply.
289
+ - **A trigger can lift both, for its own runs only.** A project admin names the tool in a webhook trigger's, a schedule's or a mail trigger's `toolsAllowedUnattended` (`--allow-unattended=<tool-id>` on `kindgi webhooks`, `kindgi schedules` and `kindgi mail-triggers`). In that trigger's runs, the tool is then as in a run a person started. The tenant's approval rules still apply.
286
290
 
287
291
  In a run a person started (signed in, or with their own API key), the agent's rules decide, as for any tool. Left out, it counts as `False`. Declare it on a tool that moves money or changes something people rely on:
288
292
 
@@ -299,6 +303,10 @@ def refund(request: RefundRequest) -> Refunded:
299
303
 
300
304
  Docs: https://docs.kindgi.com/v0.2/guides/approvals/ask-before-a-tool-runs/#when-no-person-started-the-run
301
305
 
306
+ ## Results that are text from outside: `result_is_outside_data`
307
+
308
+ `result_is_outside_data=True` says the tool's results are text from outside that nobody checked, such as a mail someone sent or a page a search found. An agent reads each result of the tool as data, not instructions, in that turn and in every later turn's history. It changes what the model is told, not what the tool may do: pair it with approvals for anything an agent could do with what it read. Absent means `false`.
309
+
302
310
  ## HTTP tools — one request, no code
303
311
 
304
312
  A tool that is a single HTTP request needs no handler. `http_tool(...)`
@@ -17,7 +17,7 @@ description: >
17
17
  type: core
18
18
  library: "kindgi (Python)"
19
19
  version: "0.1.10"
20
- sdk_version: "0.2.0-rc.0"
20
+ sdk_version: "0.2.0"
21
21
  pack_languages: [python]
22
22
  sources:
23
23
  - sdks/python/README.md
@@ -316,12 +316,15 @@ running the older version on it.
316
316
  runtime 0.1.8 or later): the Cloud Run module's `./upgrade.sh`, as of the
317
317
  `@kindgi/sdk@<version>` tag of the release you're upgrading to, since it
318
318
  knows the steps up to its own release. Run `./upgrade.sh --dry-run` first:
319
- it changes nothing, and lists what a real run would change. The module
320
- README's Upgrading section has the rest:
319
+ it changes nothing, and lists what a real run would change. Its plan also
320
+ reads every `*.auto.tfvars.json` in the module's folder (the pack's env),
321
+ and `yes` applies exactly the saved plan it showed. The module README's
322
+ Upgrading section has the rest:
321
323
  https://github.com/kindgi/kindgi-sdk/tree/main/deploy/gcp-cloud-run#upgrading
322
- - **Any other Cloud Run deployment, or one on Azure Container Apps:** the
323
- "Operate it" section of its page,
324
- https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#operate-it or
324
+ - **Any other Cloud Run deployment:** by hand, staging first, as the Cloud
325
+ Run page's "Upgrade by hand" section says:
326
+ https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#upgrade-by-hand
327
+ - **On Azure Container Apps:** the "Operate it" section of its page,
325
328
  https://docs.kindgi.com/v0.2/deploy/self-hosted/azure-container-apps/#operate-it.
326
329
  - **Otherwise:** the operate page's upgrade steps,
327
330
  https://docs.kindgi.com/v0.2/deploy/self-hosted/operate/#upgrade-the-runtime.
@@ -17,7 +17,7 @@ description: >
17
17
  type: core
18
18
  library: "kindgi-pack-scala"
19
19
  version: "0.1.4"
20
- sdk_version: "0.2.0-rc.0"
20
+ sdk_version: "0.2.0"
21
21
  pack_languages: [scala]
22
22
  sources:
23
23
  - sdks/scala/README.md
@@ -17,7 +17,7 @@ description: >
17
17
  type: core
18
18
  library: "kindgi-pack-scala"
19
19
  version: "0.1.2"
20
- sdk_version: "0.2.0-rc.0"
20
+ sdk_version: "0.2.0"
21
21
  pack_languages: [scala]
22
22
  sources:
23
23
  - sdks/scala/README.md
@@ -18,7 +18,7 @@ description: >
18
18
  type: core
19
19
  library: "kindgi-pack-scala"
20
20
  version: "0.1.2"
21
- sdk_version: "0.2.0-rc.0"
21
+ sdk_version: "0.2.0"
22
22
  pack_languages: [scala]
23
23
  sources:
24
24
  - sdks/scala/README.md
@@ -15,8 +15,8 @@ description: >
15
15
  kindgi-scala-getting-started.
16
16
  type: core
17
17
  library: "kindgi-pack-scala"
18
- version: "0.1.3"
19
- sdk_version: "0.2.0-rc.0"
18
+ version: "0.1.4"
19
+ sdk_version: "0.2.0"
20
20
  pack_languages: [scala]
21
21
  sources:
22
22
  - sdks/scala/README.md
@@ -226,7 +226,7 @@ val tool: Tool[Input, Output] = Tool[Input, Output]("my-pack.send-mail")
226
226
  - **The token:** `accessToken` is current for this call only. Never keep, print, log or return it; it never reaches the journal. `account.label` says whose account it is (`ana@acme.com`). `ToolConnection`, `ConnectionAccount` and `ConnectionRejectedException` come with `com.kindgi.pack.scaladsl._`.
227
227
  - **A 401 from the app:** `throw new ConnectionRejectedException("mail")`, with the connection's name (a second argument can say what the app answered, never the token), or your own exception with it as the cause. The runtime renews the token once and runs the call again; refused again, the call fails with `connection-rejected`.
228
228
  - **An HTTP tool** sends the token with no code: `.authorization(new HttpAuthSpec.Connection("mail"))`.
229
- - **Unattended runs:** in a run no person started, a tool that uses a `"person"` connection waits for that person's yes, unless it's marked `.readOnly` (mark read-only tools so). The agent's own approval settings can't lift it; only a trigger's `toolsAllowedUnattended` can, which a project admin sets, as for `needsApprovalWhenUnattended` (below).
229
+ - **Unattended runs:** in a run no person started, a tool that uses a `"person"` connection waits for that person's yes, reads included: `.readOnly` doesn't lift it. The agent's own approval settings can't lift it; only a trigger's `toolsAllowedUnattended` can, which a project admin sets, as for `needsApprovalWhenUnattended` (below). In a run a new mail started, the mail is a stranger's text, so two more calls wait: a call of a tool that isn't `.readOnly`, and, when the trigger reads the company's mailbox, a read with the company's connection to that app. The mail trigger's `toolsAllowedUnattended` lifts these too.
230
230
  - **In a unit test:** `com.kindgi.pack.ToolContext.forTest(java.util.Map.of("mail", new ToolConnection("c-1", "google", "Google", "test", new ConnectionAccount("1", "ana@acme.com"), null)))`; the last argument, when the token expires, can be `null`. `ctx.connections` is empty when the tool declares none.
231
231
 
232
232
  Docs: https://docs.kindgi.com/v0.2/guides/connections/use-a-connection/
@@ -250,6 +250,10 @@ the tool's approval default: an agent that turns approval gates on
250
250
  (`conversationPolicy.hitl`) asks before any tool that isn't read-only on its
251
251
  first use.
252
252
 
253
+ In a run a new mail started, a call of a tool that isn't read-only waits
254
+ for a person's yes, unless the mail trigger's `toolsAllowedUnattended`
255
+ lists it.
256
+
253
257
  `effect(kind, resource)` declares a side effect, such as
254
258
  `.effect("writes", "db:ledger")`. A dry run also stops at a tool with a
255
259
  `writes`, `deletes`, `spawns-run`, `emits-event` or `external-side-effect`
@@ -304,11 +308,11 @@ pages or filters, not one that returns everything.
304
308
 
305
309
  ## A person's yes when no one is watching: `needsApprovalWhenUnattended`
306
310
 
307
- `needsApprovalWhenUnattended(true)` declares that a person must say yes to every call of the tool in a run no person started: one a schedule, a webhook, an event or a service account's key started. In such a run:
311
+ `needsApprovalWhenUnattended(true)` declares that a person must say yes to every call of the tool in a run no person started: one a schedule, a webhook, a new mail, an event or a service account's key started. In such a run:
308
312
 
309
313
  - **An agent's call waits** for a person's yes, whatever the agent's `conversationPolicy.hitl.tools` says. The agent's rules can't lift it: agents are reused, and the tool's author knows what it does.
310
314
  - **A flow's tool step that calls it is refused.** Put the tool behind an agent step instead, whose call waits.
311
- - **A trigger can lift both, for its own runs only.** A project admin names the tool in a webhook trigger's or a schedule's `toolsAllowedUnattended` (`--allow-unattended=<tool-id>` on `kindgi webhooks` and `kindgi schedules`). In that trigger's runs, the tool is then as in a run a person started. The tenant's approval rules still apply.
315
+ - **A trigger can lift both, for its own runs only.** A project admin names the tool in a webhook trigger's, a schedule's or a mail trigger's `toolsAllowedUnattended` (`--allow-unattended=<tool-id>` on `kindgi webhooks`, `kindgi schedules` and `kindgi mail-triggers`). In that trigger's runs, the tool is then as in a run a person started. The tenant's approval rules still apply.
312
316
 
313
317
  In a run a person started (signed in, or with their own API key), the agent's rules decide, as for any tool. Left unset, it counts as `false`. Declare it on a tool that moves money or changes something people rely on:
314
318
 
@@ -320,6 +324,10 @@ In a run a person started (signed in, or with their own API key), the agent's ru
320
324
 
321
325
  Docs: https://docs.kindgi.com/v0.2/guides/approvals/ask-before-a-tool-runs/#when-no-person-started-the-run
322
326
 
327
+ ## Results that are text from outside: `resultIsOutsideData`
328
+
329
+ `resultIsOutsideData(true)` says the tool's results are text from outside that nobody checked, such as a mail someone sent or a page a search found. An agent reads each result of the tool as data, not instructions, in that turn and in every later turn's history. It changes what the model is told, not what the tool may do: pair it with approvals for anything an agent could do with what it read. Absent means `false`.
330
+
323
331
  ## Testing
324
332
 
325
333
  `tool.call(input, ctx)` runs the handler with the input as given (no schema
@@ -18,7 +18,7 @@ description: >
18
18
  type: core
19
19
  library: "kindgi-pack-scala"
20
20
  version: "0.1.4"
21
- sdk_version: "0.2.0-rc.0"
21
+ sdk_version: "0.2.0"
22
22
  pack_languages: [scala]
23
23
  sources:
24
24
  - sdks/scala/README.md
@@ -283,12 +283,15 @@ running the older version on it.
283
283
  runtime 0.1.8 or later): the Cloud Run module's `./upgrade.sh`, as of the
284
284
  `@kindgi/sdk@<version>` tag of the release you're upgrading to, since it
285
285
  knows the steps up to its own release. Run `./upgrade.sh --dry-run` first:
286
- it changes nothing, and lists what a real run would change. The module
287
- README's Upgrading section has the rest:
286
+ it changes nothing, and lists what a real run would change. Its plan also
287
+ reads every `*.auto.tfvars.json` in the module's folder (the pack's env),
288
+ and `yes` applies exactly the saved plan it showed. The module README's
289
+ Upgrading section has the rest:
288
290
  https://github.com/kindgi/kindgi-sdk/tree/main/deploy/gcp-cloud-run#upgrading
289
- - **Any other Cloud Run deployment, or one on Azure Container Apps:** the
290
- "Operate it" section of its page,
291
- https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#operate-it or
291
+ - **Any other Cloud Run deployment:** by hand, staging first, as the Cloud
292
+ Run page's "Upgrade by hand" section says:
293
+ https://docs.kindgi.com/v0.2/deploy/self-hosted/cloud-run/#upgrade-by-hand
294
+ - **On Azure Container Apps:** the "Operate it" section of its page,
292
295
  https://docs.kindgi.com/v0.2/deploy/self-hosted/azure-container-apps/#operate-it.
293
296
  - **Otherwise:** the operate page's upgrade steps,
294
297
  https://docs.kindgi.com/v0.2/deploy/self-hosted/operate/#upgrade-the-runtime.
@@ -15,8 +15,8 @@ description: >
15
15
  with the person.
16
16
  type: core
17
17
  library: "@kindgi/sdk"
18
- version: "0.1.1"
19
- sdk_version: "0.2.0-rc.0"
18
+ version: "0.1.2"
19
+ sdk_version: "0.2.0"
20
20
  pack_languages: [node, python, java, scala]
21
21
  ---
22
22
 
@@ -97,6 +97,7 @@ decided one opens its own page.
97
97
  | Guardrails | `guardrails`, one: `guardrails/<guardrailId>` | each rule's settings, the agents it checks, what it caught |
98
98
  | Flows | `flows`, one: `flows/<flowId>` | the flows and their steps |
99
99
  | Schedules | `schedules`, one: `schedules/<triggerId>` | when each runs next, and its past runs |
100
+ | Mail triggers | `mail-triggers`, one: `mail-triggers/<triggerId>` | the mailbox each watches and what it starts; its latest mails, and the run each started |
100
101
  | Conversations | `conversations`, one: `conversations/<conversationId>` | each conversation's turns |
101
102
  | Cost | `cost` | what the project's model calls cost, by agent, model, flow or kind |
102
103
  | Quality | `quality` | answers waiting to be rated, rating rules, trends |
@@ -224,6 +225,17 @@ say there were none.
224
225
  `status`, and its answer, `output.response.content`.
225
226
  - In the console: `schedules/<triggerId>`, and the run's `runs/<runId>`.
226
227
 
228
+ **"What did the support inbox do with that mail?"**
229
+ - In the CLI: `kindgi mail-triggers list` finds the trigger; `kindgi
230
+ mail-triggers fires <triggerId>` lists each new mail it found, newest
231
+ first, with its `outcome` (`started`, `pending`, `skipped`, `refused` or
232
+ `failed`), a `detail` saying why, and the `runId` it started. A
233
+ `refused` mail never runs: staff handle it in the mailbox.
234
+ - In the console: `mail-triggers/<triggerId>` lists its latest mails, up
235
+ to 50, what happened to each, and the run it started; an older one is
236
+ in the CLI's `fires`. `runs?trigger=<triggerId>` is every run it
237
+ started. The run is `runs/<runId>`.
238
+
227
239
  **"Is Kindgi healthy?"**
228
240
  - In the CLI: `kindgi health` (`"ok": true` when the server answers) and
229
241
  `kindgi doctor` (each part, with a fix for any that fail).
@@ -260,6 +272,7 @@ say there were none.
260
272
  - Connections: https://docs.kindgi.com/v0.2/guides/connections/use-a-connection/
261
273
  - Memory: https://docs.kindgi.com/v0.2/guides/agents/give-an-agent-memory/
262
274
  - Schedules: https://docs.kindgi.com/v0.2/guides/runs/run-on-a-schedule/
275
+ - Mail triggers: https://docs.kindgi.com/v0.2/guides/runs/start-runs-from-new-mail/
263
276
  - People and keys: https://docs.kindgi.com/v0.2/deploy/people-and-keys/
264
277
  - Cost: https://docs.kindgi.com/v0.2/guides/observability/cost-per-run/
265
278
  - Rating answers: https://docs.kindgi.com/v0.2/guides/evals/judge-a-runs-output/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kindgi/cli",
3
- "version": "0.2.0-rc.0",
3
+ "version": "0.2.0",
4
4
  "description": "Command-line interface for Kindgi™. Create a pack, run it on your machine (`kindgi dev`), build, sign and deploy it, and work with a running Kindgi API from the terminal.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,18 +37,18 @@
37
37
  "provenance": true
38
38
  },
39
39
  "dependencies": {
40
- "@kindgi/agents": "0.2.0-rc.0",
41
- "@kindgi/client": "0.2.0-rc.0",
42
- "@kindgi/dotenv-file": "0.2.0-rc.0",
43
- "@kindgi/crypto": "0.2.0-rc.0",
44
- "@kindgi/env-schema": "0.2.0-rc.0",
45
- "@kindgi/flow": "0.2.0-rc.0",
46
- "@kindgi/handler-runtime": "0.2.0-rc.0",
47
- "@kindgi/log": "0.2.0-rc.0",
48
- "@kindgi/secrets-dotenv": "0.2.0-rc.0",
49
- "@kindgi/platform": "0.2.0-rc.0",
50
- "@kindgi/sdk": "0.2.0-rc.0",
51
- "@kindgi/types": "0.2.0-rc.0",
40
+ "@kindgi/agents": "0.2.0",
41
+ "@kindgi/client": "0.2.0",
42
+ "@kindgi/dotenv-file": "0.2.0",
43
+ "@kindgi/crypto": "0.2.0",
44
+ "@kindgi/env-schema": "0.2.0",
45
+ "@kindgi/flow": "0.2.0",
46
+ "@kindgi/handler-runtime": "0.2.0",
47
+ "@kindgi/log": "0.2.0",
48
+ "@kindgi/secrets-dotenv": "0.2.0",
49
+ "@kindgi/platform": "0.2.0",
50
+ "@kindgi/sdk": "0.2.0",
51
+ "@kindgi/types": "0.2.0",
52
52
  "esbuild": "^0.24.0",
53
53
  "semver": "^7.8.5",
54
54
  "smol-toml": "^1.9.0",