typeclaw 0.3.1 → 0.4.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 (89) hide show
  1. package/README.md +20 -15
  2. package/auth.schema.json +113 -0
  3. package/package.json +1 -1
  4. package/secrets.schema.json +113 -0
  5. package/src/agent/session-meta.ts +1 -1
  6. package/src/agent/session-origin.ts +3 -2
  7. package/src/bundled-plugins/security/index.ts +3 -2
  8. package/src/channels/adapters/github/auth-app.ts +120 -0
  9. package/src/channels/adapters/github/auth-pat.ts +50 -0
  10. package/src/channels/adapters/github/auth.ts +33 -0
  11. package/src/channels/adapters/github/channel-resolver.ts +30 -0
  12. package/src/channels/adapters/github/dedup.ts +26 -0
  13. package/src/channels/adapters/github/event-allowlist.ts +8 -0
  14. package/src/channels/adapters/github/fetch-attachment.ts +5 -0
  15. package/src/channels/adapters/github/history.ts +63 -0
  16. package/src/channels/adapters/github/inbound.ts +286 -0
  17. package/src/channels/adapters/github/index.ts +286 -0
  18. package/src/channels/adapters/github/managed-path.ts +54 -0
  19. package/src/channels/adapters/github/membership.ts +35 -0
  20. package/src/channels/adapters/github/outbound.ts +145 -0
  21. package/src/channels/adapters/github/webhook-register.ts +349 -0
  22. package/src/channels/manager.ts +94 -9
  23. package/src/channels/schema.ts +31 -1
  24. package/src/channels/tunnel-bridge.ts +51 -0
  25. package/src/cli/builtins.ts +28 -0
  26. package/src/cli/channel.ts +511 -25
  27. package/src/cli/container-command-client.ts +244 -0
  28. package/src/cli/cron.ts +173 -0
  29. package/src/cli/host-command-runner.ts +150 -0
  30. package/src/cli/index.ts +42 -1
  31. package/src/cli/init.ts +256 -27
  32. package/src/cli/model.ts +4 -2
  33. package/src/cli/plugin-command-help.ts +49 -0
  34. package/src/cli/plugin-commands-dispatch.ts +112 -0
  35. package/src/cli/plugin-commands.ts +118 -0
  36. package/src/cli/tui.ts +10 -2
  37. package/src/cli/tunnel.ts +533 -0
  38. package/src/cli/ui.ts +8 -3
  39. package/src/config/config.ts +75 -0
  40. package/src/container/start.ts +30 -3
  41. package/src/cron/bridge.ts +136 -0
  42. package/src/cron/consumer.ts +45 -5
  43. package/src/cron/index.ts +19 -2
  44. package/src/cron/list.ts +105 -0
  45. package/src/cron/scheduler.ts +12 -3
  46. package/src/cron/schema.ts +11 -3
  47. package/src/doctor/checks.ts +0 -50
  48. package/src/init/dockerfile.ts +59 -13
  49. package/src/init/ensure-deps.ts +15 -4
  50. package/src/init/github-webhook-install.ts +109 -0
  51. package/src/init/index.ts +505 -9
  52. package/src/init/run-bun-install.ts +17 -3
  53. package/src/init/run-owner-claim.ts +11 -2
  54. package/src/permissions/builtins.ts +6 -1
  55. package/src/permissions/match-rule.ts +24 -2
  56. package/src/permissions/resolve.ts +1 -0
  57. package/src/plugin/define.ts +42 -1
  58. package/src/plugin/index.ts +18 -3
  59. package/src/plugin/manager.ts +2 -0
  60. package/src/plugin/registry.ts +85 -3
  61. package/src/plugin/types.ts +138 -1
  62. package/src/plugin/zod-introspect.ts +100 -0
  63. package/src/role-claim/match-rule.ts +2 -1
  64. package/src/run/index.ts +110 -3
  65. package/src/secrets/index.ts +1 -1
  66. package/src/secrets/schema.ts +21 -0
  67. package/src/server/command-runner.ts +476 -0
  68. package/src/server/index.ts +388 -5
  69. package/src/shared/index.ts +8 -0
  70. package/src/shared/protocol.ts +80 -1
  71. package/src/skills/typeclaw-channel-github/SKILL.md +24 -0
  72. package/src/skills/typeclaw-config/SKILL.md +27 -26
  73. package/src/skills/typeclaw-cron/SKILL.md +234 -3
  74. package/src/skills/typeclaw-monorepo/SKILL.md +2 -2
  75. package/src/skills/typeclaw-permissions/SKILL.md +5 -4
  76. package/src/skills/typeclaw-plugins/SKILL.md +251 -5
  77. package/src/skills/typeclaw-tunnels/SKILL.md +111 -0
  78. package/src/test-helpers/wait-for.ts +50 -0
  79. package/src/tui/index.ts +35 -4
  80. package/src/tunnels/__fixtures__/cloudflared-quick-stderr.txt +11 -0
  81. package/src/tunnels/events.ts +14 -0
  82. package/src/tunnels/index.ts +12 -0
  83. package/src/tunnels/log-ring.ts +54 -0
  84. package/src/tunnels/manager.ts +139 -0
  85. package/src/tunnels/providers/cloudflare-quick.ts +189 -0
  86. package/src/tunnels/providers/external.ts +53 -0
  87. package/src/tunnels/quick-url-parser.ts +5 -0
  88. package/src/tunnels/types.ts +43 -0
  89. package/typeclaw.schema.json +254 -1
@@ -231,6 +231,179 @@
231
231
  }
232
232
  }
233
233
  },
234
+ "github": {
235
+ "type": "object",
236
+ "properties": {
237
+ "engagement": {
238
+ "default": {
239
+ "trigger": [
240
+ "mention",
241
+ "reply",
242
+ "dm"
243
+ ],
244
+ "stickiness": {
245
+ "perReply": {
246
+ "window": 300000
247
+ }
248
+ }
249
+ },
250
+ "type": "object",
251
+ "properties": {
252
+ "trigger": {
253
+ "default": [
254
+ "mention",
255
+ "reply",
256
+ "dm"
257
+ ],
258
+ "type": "array",
259
+ "items": {
260
+ "type": "string",
261
+ "enum": [
262
+ "mention",
263
+ "reply",
264
+ "dm"
265
+ ]
266
+ }
267
+ },
268
+ "stickiness": {
269
+ "default": {
270
+ "perReply": {
271
+ "window": 300000
272
+ }
273
+ },
274
+ "anyOf": [
275
+ {
276
+ "type": "string",
277
+ "const": "off"
278
+ },
279
+ {
280
+ "type": "object",
281
+ "properties": {
282
+ "perReply": {
283
+ "type": "object",
284
+ "properties": {
285
+ "window": {
286
+ "type": "integer",
287
+ "minimum": 1,
288
+ "maximum": 86400000
289
+ }
290
+ },
291
+ "required": [
292
+ "window"
293
+ ]
294
+ }
295
+ },
296
+ "required": [
297
+ "perReply"
298
+ ]
299
+ }
300
+ ]
301
+ }
302
+ }
303
+ },
304
+ "history": {
305
+ "default": {
306
+ "prefetch": {
307
+ "thread": {
308
+ "head": 3,
309
+ "tail": 10
310
+ },
311
+ "channel": {
312
+ "tail": 10
313
+ }
314
+ }
315
+ },
316
+ "type": "object",
317
+ "properties": {
318
+ "prefetch": {
319
+ "default": {
320
+ "thread": {
321
+ "head": 3,
322
+ "tail": 10
323
+ },
324
+ "channel": {
325
+ "tail": 10
326
+ }
327
+ },
328
+ "type": "object",
329
+ "properties": {
330
+ "thread": {
331
+ "default": {
332
+ "head": 3,
333
+ "tail": 10
334
+ },
335
+ "type": "object",
336
+ "properties": {
337
+ "head": {
338
+ "default": 3,
339
+ "type": "integer",
340
+ "minimum": 0,
341
+ "maximum": 200
342
+ },
343
+ "tail": {
344
+ "default": 10,
345
+ "type": "integer",
346
+ "minimum": 0,
347
+ "maximum": 200
348
+ }
349
+ }
350
+ },
351
+ "channel": {
352
+ "default": {
353
+ "tail": 10
354
+ },
355
+ "type": "object",
356
+ "properties": {
357
+ "tail": {
358
+ "default": 10,
359
+ "type": "integer",
360
+ "minimum": 0,
361
+ "maximum": 200
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ },
369
+ "enabled": {
370
+ "default": true,
371
+ "type": "boolean"
372
+ },
373
+ "webhookUrl": {
374
+ "type": "string",
375
+ "format": "uri"
376
+ },
377
+ "webhookPort": {
378
+ "default": 8975,
379
+ "type": "integer",
380
+ "exclusiveMinimum": 0,
381
+ "maximum": 9007199254740991
382
+ },
383
+ "eventAllowlist": {
384
+ "default": [
385
+ "issue_comment.created",
386
+ "pull_request_review_comment.created",
387
+ "discussion_comment.created",
388
+ "issues.opened",
389
+ "pull_request.opened",
390
+ "discussion.created",
391
+ "pull_request_review.submitted"
392
+ ],
393
+ "type": "array",
394
+ "items": {
395
+ "type": "string"
396
+ }
397
+ },
398
+ "repos": {
399
+ "default": [],
400
+ "type": "array",
401
+ "items": {
402
+ "type": "string"
403
+ }
404
+ }
405
+ }
406
+ },
234
407
  "kakaotalk": {
235
408
  "type": "object",
236
409
  "properties": {
@@ -723,6 +896,8 @@
723
896
  "gh": true,
724
897
  "python": true,
725
898
  "tmux": true,
899
+ "cjkFonts": true,
900
+ "cloudflared": true,
726
901
  "append": []
727
902
  }
728
903
  },
@@ -734,6 +909,8 @@
734
909
  "gh": true,
735
910
  "python": true,
736
911
  "tmux": true,
912
+ "cjkFonts": true,
913
+ "cloudflared": true,
737
914
  "append": []
738
915
  },
739
916
  "type": "object",
@@ -778,6 +955,14 @@
778
955
  }
779
956
  ]
780
957
  },
958
+ "cjkFonts": {
959
+ "default": true,
960
+ "type": "boolean"
961
+ },
962
+ "cloudflared": {
963
+ "default": true,
964
+ "type": "boolean"
965
+ },
781
966
  "append": {
782
967
  "default": [],
783
968
  "type": "array",
@@ -826,7 +1011,7 @@
826
1011
  "type": "array",
827
1012
  "items": {
828
1013
  "type": "string",
829
- "pattern": "^(tui|cron|subagent(:[a-z][a-z0-9-]*)?|\\*|(slack|discord|telegram|kakao):[^\\s]+)(\\s+[a-zA-Z][a-zA-Z0-9_]*:[^\\s]+)*$"
1014
+ "pattern": "^(tui|cron|subagent(:[a-z][a-z0-9-]*)?|\\*|(slack|discord|telegram|kakao|github):[^\\s]+)(\\s+[a-zA-Z][a-zA-Z0-9_]*:[^\\s]+)*$"
830
1015
  }
831
1016
  },
832
1017
  "permissions": {
@@ -841,6 +1026,74 @@
841
1026
  "additionalProperties": false
842
1027
  }
843
1028
  },
1029
+ "tunnels": {
1030
+ "default": [],
1031
+ "type": "array",
1032
+ "items": {
1033
+ "type": "object",
1034
+ "properties": {
1035
+ "name": {
1036
+ "type": "string",
1037
+ "minLength": 1,
1038
+ "pattern": "^[a-z0-9][a-z0-9-_]*$"
1039
+ },
1040
+ "provider": {
1041
+ "type": "string",
1042
+ "enum": [
1043
+ "external",
1044
+ "cloudflare-quick"
1045
+ ]
1046
+ },
1047
+ "for": {
1048
+ "oneOf": [
1049
+ {
1050
+ "type": "object",
1051
+ "properties": {
1052
+ "kind": {
1053
+ "type": "string",
1054
+ "const": "channel"
1055
+ },
1056
+ "name": {
1057
+ "type": "string",
1058
+ "minLength": 1
1059
+ }
1060
+ },
1061
+ "required": [
1062
+ "kind",
1063
+ "name"
1064
+ ]
1065
+ },
1066
+ {
1067
+ "type": "object",
1068
+ "properties": {
1069
+ "kind": {
1070
+ "type": "string",
1071
+ "const": "manual"
1072
+ }
1073
+ },
1074
+ "required": [
1075
+ "kind"
1076
+ ]
1077
+ }
1078
+ ]
1079
+ },
1080
+ "externalUrl": {
1081
+ "type": "string",
1082
+ "format": "uri"
1083
+ },
1084
+ "upstreamPort": {
1085
+ "type": "integer",
1086
+ "minimum": 1,
1087
+ "maximum": 65535
1088
+ }
1089
+ },
1090
+ "required": [
1091
+ "name",
1092
+ "provider",
1093
+ "for"
1094
+ ]
1095
+ }
1096
+ },
844
1097
  "tool-result-cap": {
845
1098
  "default": {
846
1099
  "enabled": true,