hook-harness 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/dist/bin.mjs +90272 -0
- package/dist/relay/index.mjs +75 -0
- package/dist/relay/template.yaml +146 -0
- package/package.json +51 -3
- package/README.md +0 -3
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
AWSTemplateFormatVersion: "2010-09-09"
|
|
2
|
+
Description: hook-harness relay - webhook Lambda function URL backed by a DynamoDB table.
|
|
3
|
+
|
|
4
|
+
Parameters:
|
|
5
|
+
WebhookSecret:
|
|
6
|
+
Type: String
|
|
7
|
+
NoEcho: true
|
|
8
|
+
MinLength: 1
|
|
9
|
+
Description: Secret configured on the webhook sender, used to verify X-Hub-Signature-256.
|
|
10
|
+
PayloadDrop:
|
|
11
|
+
Type: String
|
|
12
|
+
Default: repository,organization
|
|
13
|
+
Description: Comma-separated top-level payload keys not stored (installation is always dropped). Empty keeps them.
|
|
14
|
+
PayloadMaxBytes:
|
|
15
|
+
Type: Number
|
|
16
|
+
Default: 1000000
|
|
17
|
+
MinValue: 0
|
|
18
|
+
Description: Largest pruned payload, in JSON bytes, to store. 0 stores envelopes only.
|
|
19
|
+
BillingMode:
|
|
20
|
+
Type: String
|
|
21
|
+
Default: PROVISIONED
|
|
22
|
+
AllowedValues: [PROVISIONED, PAY_PER_REQUEST]
|
|
23
|
+
ReadCapacity:
|
|
24
|
+
Type: Number
|
|
25
|
+
Default: 25
|
|
26
|
+
MinValue: 1
|
|
27
|
+
WriteCapacity:
|
|
28
|
+
Type: Number
|
|
29
|
+
Default: 25
|
|
30
|
+
MinValue: 1
|
|
31
|
+
|
|
32
|
+
Conditions:
|
|
33
|
+
IsProvisioned: !Equals [!Ref BillingMode, PROVISIONED]
|
|
34
|
+
|
|
35
|
+
Resources:
|
|
36
|
+
Table:
|
|
37
|
+
Type: AWS::DynamoDB::Table
|
|
38
|
+
Properties:
|
|
39
|
+
TableName: !Sub "${AWS::StackName}-events"
|
|
40
|
+
BillingMode: !Ref BillingMode
|
|
41
|
+
ProvisionedThroughput: !If
|
|
42
|
+
- IsProvisioned
|
|
43
|
+
- ReadCapacityUnits: !Ref ReadCapacity
|
|
44
|
+
WriteCapacityUnits: !Ref WriteCapacity
|
|
45
|
+
- !Ref AWS::NoValue
|
|
46
|
+
AttributeDefinitions:
|
|
47
|
+
- AttributeName: PK
|
|
48
|
+
AttributeType: S
|
|
49
|
+
- AttributeName: SK
|
|
50
|
+
AttributeType: S
|
|
51
|
+
KeySchema:
|
|
52
|
+
- AttributeName: PK
|
|
53
|
+
KeyType: HASH
|
|
54
|
+
- AttributeName: SK
|
|
55
|
+
KeyType: RANGE
|
|
56
|
+
TimeToLiveSpecification:
|
|
57
|
+
AttributeName: expiresAt
|
|
58
|
+
Enabled: true
|
|
59
|
+
PointInTimeRecoverySpecification:
|
|
60
|
+
PointInTimeRecoveryEnabled: false
|
|
61
|
+
|
|
62
|
+
FunctionRole:
|
|
63
|
+
Type: AWS::IAM::Role
|
|
64
|
+
Properties:
|
|
65
|
+
AssumeRolePolicyDocument:
|
|
66
|
+
Version: "2012-10-17"
|
|
67
|
+
Statement:
|
|
68
|
+
- Effect: Allow
|
|
69
|
+
Principal:
|
|
70
|
+
Service: lambda.amazonaws.com
|
|
71
|
+
Action: sts:AssumeRole
|
|
72
|
+
ManagedPolicyArns:
|
|
73
|
+
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
|
|
74
|
+
Policies:
|
|
75
|
+
- PolicyName: table-access
|
|
76
|
+
PolicyDocument:
|
|
77
|
+
Version: "2012-10-17"
|
|
78
|
+
Statement:
|
|
79
|
+
- Effect: Allow
|
|
80
|
+
Action:
|
|
81
|
+
- dynamodb:GetItem
|
|
82
|
+
- dynamodb:PutItem
|
|
83
|
+
- dynamodb:Query
|
|
84
|
+
Resource: !GetAtt Table.Arn
|
|
85
|
+
|
|
86
|
+
LogGroup:
|
|
87
|
+
Type: AWS::Logs::LogGroup
|
|
88
|
+
Properties:
|
|
89
|
+
LogGroupName: !Sub "/aws/lambda/${AWS::StackName}-relay"
|
|
90
|
+
RetentionInDays: 1
|
|
91
|
+
|
|
92
|
+
Function:
|
|
93
|
+
Type: AWS::Lambda::Function
|
|
94
|
+
DependsOn: LogGroup
|
|
95
|
+
Properties:
|
|
96
|
+
FunctionName: !Sub "${AWS::StackName}-relay"
|
|
97
|
+
Runtime: nodejs24.x
|
|
98
|
+
Architectures: [arm64]
|
|
99
|
+
MemorySize: 256
|
|
100
|
+
Timeout: 10
|
|
101
|
+
Handler: index.handler
|
|
102
|
+
Role: !GetAtt FunctionRole.Arn
|
|
103
|
+
LoggingConfig:
|
|
104
|
+
LogFormat: JSON
|
|
105
|
+
SystemLogLevel: WARN
|
|
106
|
+
ApplicationLogLevel: INFO
|
|
107
|
+
Environment:
|
|
108
|
+
Variables:
|
|
109
|
+
TABLE_NAME: !Ref Table
|
|
110
|
+
WEBHOOK_SECRET: !Ref WebhookSecret
|
|
111
|
+
PAYLOAD_DROP: !Ref PayloadDrop
|
|
112
|
+
PAYLOAD_MAX_BYTES: !Ref PayloadMaxBytes
|
|
113
|
+
# Placeholder only: the CLI uploads the real bundle with UpdateFunctionCode after every stack update.
|
|
114
|
+
Code:
|
|
115
|
+
ZipFile: |
|
|
116
|
+
exports.handler = async () => ({ statusCode: 503, body: "not deployed" });
|
|
117
|
+
|
|
118
|
+
FunctionUrl:
|
|
119
|
+
Type: AWS::Lambda::Url
|
|
120
|
+
Properties:
|
|
121
|
+
TargetFunctionArn: !GetAtt Function.Arn
|
|
122
|
+
AuthType: NONE
|
|
123
|
+
|
|
124
|
+
UrlInvokePermission:
|
|
125
|
+
Type: AWS::Lambda::Permission
|
|
126
|
+
Properties:
|
|
127
|
+
FunctionName: !Ref Function
|
|
128
|
+
Action: lambda:InvokeFunctionUrl
|
|
129
|
+
Principal: "*"
|
|
130
|
+
FunctionUrlAuthType: NONE
|
|
131
|
+
|
|
132
|
+
InvokePermission:
|
|
133
|
+
Type: AWS::Lambda::Permission
|
|
134
|
+
Properties:
|
|
135
|
+
FunctionName: !Ref Function
|
|
136
|
+
Action: lambda:InvokeFunction
|
|
137
|
+
Principal: "*"
|
|
138
|
+
InvokedViaFunctionUrl: true
|
|
139
|
+
|
|
140
|
+
Outputs:
|
|
141
|
+
FunctionUrl:
|
|
142
|
+
Value: !GetAtt FunctionUrl.FunctionUrl
|
|
143
|
+
FunctionName:
|
|
144
|
+
Value: !Ref Function
|
|
145
|
+
TableName:
|
|
146
|
+
Value: !Ref Table
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hook-harness",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "hook-harness CLI: deploy, update, teardown, status, tokens, and the runner service.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agents",
|
|
7
|
+
"aws",
|
|
8
|
+
"claude-code",
|
|
9
|
+
"cli",
|
|
10
|
+
"codex",
|
|
11
|
+
"github",
|
|
12
|
+
"lambda",
|
|
13
|
+
"webhooks"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/jonathanong/hook-harness#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/jonathanong/hook-harness/issues"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/jonathanong/hook-harness.git",
|
|
23
|
+
"directory": "packages/cli"
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"hook-harness": "./dist/bin.mjs"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"provenance": true
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@aws-sdk/client-cloudformation": "3.1165.0",
|
|
38
|
+
"@aws-sdk/client-dynamodb": "3.1165.0",
|
|
39
|
+
"@aws-sdk/client-lambda": "3.1165.0",
|
|
40
|
+
"@aws-sdk/lib-dynamodb": "3.1165.0",
|
|
41
|
+
"@hook-harness/protocol": "0.0.0",
|
|
42
|
+
"@hook-harness/relay": "0.0.0",
|
|
43
|
+
"@modelcontextprotocol/sdk": "1.32.2",
|
|
44
|
+
"aws-sdk-client-mock": "4.1.0",
|
|
45
|
+
"esbuild": "0.28.2",
|
|
46
|
+
"zod": "4.6.7"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=24"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "node build.mjs"
|
|
53
|
+
}
|
|
6
54
|
}
|
package/README.md
DELETED